[U-Boot] [PATCH resend 2/2] arm/boards: Define a new config option CONFIG_BOOT_PARAMS_P
Vipin Kumar
vipin.kumar at st.com
Thu Dec 6 10:29:37 CET 2012
A lot of ARM boards are using board_init routine just to initialize boot_params
variable in the global data structure.
This patch lets the board config files to define a CONFIG_BOOT_PARAMS_P option
which is assigned to gd->bd->bi_boot_params automatically
Consequently, many board_init routines would not be required in the respective
board directories and a weak definition becomes necessary before their removal
from the code.
Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
---
README | 6 ++++++
arch/arm/lib/board.c | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git a/README b/README
index 037513a..2077c3b 100644
--- a/README
+++ b/README
@@ -550,6 +550,12 @@ The following options need to be configured:
in a single configuration file and the machine type is
runtime discoverable, do not have to use this setting.
+ CONFIG_BOOT_PARAMS_P [relevant for ARM only]
+
+ This config option can provide a way to initialize
+ bi_boot_params from the u-boot infrastructure itself. The
+ board still has the option to override it in board_init routine
+
- vxWorks boot parameters:
bootvx constructs a valid bootline using the following
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 92cad9a..fa161b8 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -399,6 +399,11 @@ void board_init_f(ulong bootflag)
gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
#endif
+#ifdef CONFIG_BOOT_PARAMS_P
+ /* Boot params passed to Linux */
+ gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_P;
+#endif
+
addr_sp -= sizeof (gd_t);
id = (gd_t *) addr_sp;
debug("Reserving %zu Bytes for Global Data at: %08lx\n",
@@ -468,6 +473,13 @@ void board_init_f(ulong bootflag)
static char *failed = "*** failed ***\n";
#endif
+static int __def_board_init(bd_t *bis)
+{
+ return -1;
+}
+
+int board_init(void) __attribute__((weak, alias("__def_board_init")));
+
/*
************************************************************************
*
--
1.8.0
More information about the U-Boot
mailing list