Re: [U-Boot] [PATCH V2 06/14] ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
On Sun, Nov 24, 2013 at 11:48 PM, Lokesh Vutla wrote: > On Friday 22 November 2013 01:58 AM, Vaibhav Bedia wrote: >> On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla wrote: >> [...] >>> +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG >>> + char safe_string[HDR_NAME_LEN + 1]; >>> + struct am43xx_board_id header; >>> + >>> + if (read_eeprom(&header) < 0) >>> + puts("Could not get board ID.\n"); >> >> Hmm... didn't the previous patch read the EEPROM? > This is as per suggested by Tom. If I populate a common structure it ll bread > NOR boot. > I hope you understand what happens in NOR boot. > Care to explain how this particular snippet relates to NOR boot? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 06/14] ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
On Friday 22 November 2013 01:58 AM, Vaibhav Bedia wrote: > On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla wrote: > [...] >> +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG >> + char safe_string[HDR_NAME_LEN + 1]; >> + struct am43xx_board_id header; >> + >> + if (read_eeprom(&header) < 0) >> + puts("Could not get board ID.\n"); > > Hmm... didn't the previous patch read the EEPROM? This is as per suggested by Tom. If I populate a common structure it ll bread NOR boot. I hope you understand what happens in NOR boot. Thanks Lokesh > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 06/14] ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla wrote: [...] > +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG > + char safe_string[HDR_NAME_LEN + 1]; > + struct am43xx_board_id header; > + > + if (read_eeprom(&header) < 0) > + puts("Could not get board ID.\n"); Hmm... didn't the previous patch read the EEPROM? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 06/14] ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
From: Sekhar Nori CONFIG_ENV_VARS_UBOOT_CONFIG, CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG and CONFIG_BOARD_LATE_INIT is already set. Adding support to detect the board. These variables are used by findfdt. Signed-off-by: Sekhar Nori Signed-off-by: Lokesh Vutla --- board/ti/am43xx/board.c | 16 1 file changed, 16 insertions(+) diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 4fc1a40..723d0ca 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -98,6 +98,22 @@ int board_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + char safe_string[HDR_NAME_LEN + 1]; + struct am43xx_board_id header; + + if (read_eeprom(&header) < 0) + puts("Could not get board ID.\n"); + + /* Now set variables based on the header. */ + strncpy(safe_string, (char *)header.name, sizeof(header.name)); + safe_string[sizeof(header.name)] = 0; + setenv("board_name", safe_string); + + strncpy(safe_string, (char *)header.version, sizeof(header.version)); + safe_string[sizeof(header.version)] = 0; + setenv("board_rev", safe_string); +#endif return 0; } #endif -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot