[U-Boot] [PATCH v2 01/10] sparc: Add initr function for CMD_AMBAPP command

Francois Retief fgretief at spaceteq.co.za
Wed Nov 5 13:08:14 CET 2014


Add an initr function in the board_r.c file for the AMBA Plug-n-Play
command. Add a Kconfig entry for the ambapp command and remove all
CONFIG_CMD_AMBAPP defines from the board configuration headers.

Also add a Kconfig entry to display the AMBA PnP information on
startup. This option is off by default. Remove relevent define from
board configuration headers.

Signed-off-by: Francois Retief <fgretief at spaceteq.co.za>
---

Changes in v2:
 - Move ambapp command selection to Kconfig

 common/Kconfig                   | 14 ++++++++++++++
 common/board_r.c                 | 21 +++++++++++++++++++++
 include/config_cmd_all.h         |  1 -
 include/configs/gr_cpci_ax2000.h |  4 ----
 include/configs/gr_ep2s60.h      |  4 ----
 include/configs/gr_xc3s_1500.h   |  4 ----
 include/configs/grsim.h          |  4 ----
 7 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index 216a8de..5a72ffe 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1,6 +1,20 @@
 menu "Command line interface"
        depends on !SPL_BUILD

+config CMD_AMBAPP
+       bool "Enable ambapp command"
+       depends on LEON3
+       default y
+       help
+         Lists AMBA Plug-n-Play information.
+
+config SYS_AMBAPP_PRINT_ON_STARTUP
+       bool "Show AMBA PnP info on startup"
+       depends on CMD_AMBAPP
+       default n
+       help
+         Show AMBA Plug-n-Play information on startup.
+
 config CMD_BOOTM
        bool "Enable bootm command"
        default y
diff --git a/common/board_r.c b/common/board_r.c
index 7c33900..6d6c7e8 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -45,6 +45,9 @@
 #include <stdio_dev.h>
 #include <trace.h>
 #include <watchdog.h>
+#ifdef CONFIG_CMD_AMBAPP
+#include <ambapp.h>
+#endif
 #ifdef CONFIG_ADDR_MAP
 #include <asm/mmu.h>
 #endif
@@ -566,6 +569,18 @@ static int initr_status_led(void)
 }
 #endif

+#if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
+extern int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]);
+
+static int initr_ambapp_print(void)
+{
+       puts("AMBA:\n");
+       do_ambapp_print(NULL, 0, 0, NULL);
+
+       return 0;
+}
+#endif
+
 #if defined(CONFIG_CMD_SCSI)
 static int initr_scsi(void)
 {
@@ -857,6 +872,12 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_BOARD_LATE_INIT
        board_late_init,
 #endif
+#if defined(CONFIG_CMD_AMBAPP)
+       ambapp_init_reloc,
+#if defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
+       initr_ambapp_print,
+#endif
+#endif
 #ifdef CONFIG_CMD_SCSI
        INIT_FUNC_WATCHDOG_RESET
        initr_scsi,
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 2c2a05b..0bb5ea7 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -13,7 +13,6 @@
  * Alphabetical list of all possible commands.
  */

-#define CONFIG_CMD_AMBAPP      /* AMBA Plug & Play Bus print utility */
 #define CONFIG_CMD_ASKENV      /* ask for env variable         */
 #define CONFIG_CMD_BDI         /* bdinfo                       */
 #define CONFIG_CMD_BEDBUG      /* Include BedBug Debugger      */
diff --git a/include/configs/gr_cpci_ax2000.h b/include/configs/gr_cpci_ax2000.h
index 854807d..5e9b3f7 100644
--- a/include/configs/gr_cpci_ax2000.h
+++ b/include/configs/gr_cpci_ax2000.h
@@ -62,7 +62,6 @@
 #include <config_cmd_default.h>

 #define CONFIG_CMD_REGINFO
-#define CONFIG_CMD_AMBAPP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_IRQ
@@ -314,9 +313,6 @@

 /***** Gaisler GRLIB IP-Cores Config ********/

-/* AMBA Plug & Play info display on startup */
-/*#define CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP*/
-
 #define CONFIG_SYS_GRLIB_SDRAM    0

 /* See, GRLIB Docs (grip.pdf) on how to set up
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
index ed2dd2a..9e99d07 100644
--- a/include/configs/gr_ep2s60.h
+++ b/include/configs/gr_ep2s60.h
@@ -56,7 +56,6 @@
 #include <config_cmd_default.h>

 #define CONFIG_CMD_REGINFO
-#define CONFIG_CMD_AMBAPP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_IRQ
@@ -299,9 +298,6 @@

 /***** Gaisler GRLIB IP-Cores Config ********/

-/* AMBA Plug & Play info display on startup */
-/*#define CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP*/
-
 #define CONFIG_SYS_GRLIB_SDRAM    0

 /* See, GRLIB Docs (grip.pdf) on how to set up
diff --git a/include/configs/gr_xc3s_1500.h b/include/configs/gr_xc3s_1500.h
index e3cbb6f..8657a56 100644
--- a/include/configs/gr_xc3s_1500.h
+++ b/include/configs/gr_xc3s_1500.h
@@ -43,7 +43,6 @@
 #include <config_cmd_default.h>

 #define CONFIG_CMD_REGINFO
-#define CONFIG_CMD_AMBAPP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_IRQ
@@ -262,9 +261,6 @@

 /***** Gaisler GRLIB IP-Cores Config ********/

-/* AMBA Plug & Play info display on startup */
-/*#define CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP*/
-
 #define CONFIG_SYS_GRLIB_SDRAM    0

 /* See, GRLIB Docs (grip.pdf) on how to set up
diff --git a/include/configs/grsim.h b/include/configs/grsim.h
index 1e089a9..50cafb8 100644
--- a/include/configs/grsim.h
+++ b/include/configs/grsim.h
@@ -47,7 +47,6 @@
 /*
  * Supported commands
  */
-#define CONFIG_CMD_AMBAPP      /* AMBA Plyg&Play information   */
 #define CONFIG_CMD_BDI         /* bdinfo                       */
 #define CONFIG_CMD_CONSOLE     /* coninfo                      */
 #define CONFIG_CMD_DIAG
@@ -279,9 +278,6 @@

 /***** Gaisler GRLIB IP-Cores Config ********/

-/* AMBA Plug & Play info display on startup */
-/*#define CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP*/
-
 #define CONFIG_SYS_GRLIB_SDRAM     0
 #define CONFIG_SYS_GRLIB_MEMCFG1   (0x000000ff | (1<<11))
 #if CONFIG_GRSIM
--
1.9.3


________________________________
Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za <http://www.spaceteq.co.za/home/emaildisclaimer/>


More information about the U-Boot mailing list