[U-Boot] [PATCH 0/5] Refactor BRXRE1 board

Since ee had to do some bugfix introduced by another commit/architecture changes, by the way we bring several other things on this board up-to-date:
- default environment - cosmetic cleanup - drop obsolete defines - drop obsolete features (bootlogo display)
Hannes Schmelzer (5): board/BuR/brxre1: fix MMC boot board/BuR/brxre1: drop bootlogo feature board/BuR/brxre1: drop obsolete CONFIG_LCD_NOSTDOUT from config-header board/BuR/brxre1: cosmetic cleanup of config-header board/BuR/brxre1: refactor default environment
board/BuR/common/common.c | 7 ++++- include/configs/brxre1.h | 65 ++++++++++++++------------------------------ scripts/config_whitelist.txt | 1 - 3 files changed, 27 insertions(+), 46 deletions(-)

since commit
'd5abcf94c7123167725fc22ace342f0d455093c1' - ti: boot: Register the MMC controllers in SPL in the same way as in u-boot
MMC boot on brxre1 board is broken, with this commit we make our board working again.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
---
board/BuR/common/common.c | 7 ++++++- include/configs/brxre1.h | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index b1ae079..e8c6401 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -687,7 +687,12 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { - return omap_mmc_init(1, 0, 0, -1, -1); + int rc = 0; + + rc |= omap_mmc_init(0, 0, 0, -1, -1); + rc |= omap_mmc_init(1, 0, 0, -1, -1); + + return rc; } #endif int overwrite_console(void) diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index 5814d74..a96232d 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -53,21 +53,21 @@ BUR_COMMON_ENV \ "vx_romfsbase=0x800E0000\0" \ "vx_romfssize=0x20000\0" \ "vx_memtop=0x8FBEF000\0" \ -"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \ +"loadromfs=mmc dev 1; mmc read ${vx_romfsbase} 700 100\0" \ "autoload=0\0" \ "loadaddr=0x80100000\0" \ "logoaddr=0x82000000\0" \ "defaultARlen=0x8000\0" \ -"loaddefaultAR=mmc read ${loadaddr} 800 ${defaultARlen}\0" \ +"loaddefaultAR=mmc dev 1; mmc read ${loadaddr} 800 ${defaultARlen}\0" \ "defaultAR=run loadromfs; run loaddefaultAR; bootvx ${loadaddr}\0" \ -"logo0=fatload mmc 0:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ +"logo0=fatload mmc 1:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ "bmp display ${logoaddr} 0 0\0" \ -"logo1=fatload mmc 0:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ +"logo1=fatload mmc 1:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ "bmp display ${logoaddr} 0 0\0" \ "mmcboot=echo booting AR from eMMC-flash ...; "\ "run logo0 || run logo1; " \ "run loadromfs; " \ - "fatload mmc 0:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ + "fatload mmc 1:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ "run defaultAR;\0" \ "netboot=echo booting AR from network ...; " \ "run loadromfs; " \ @@ -113,7 +113,7 @@ BUR_COMMON_ENV \
#undef CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_IS_IN_MMC -#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_SYS_MMC_ENV_DEV 1 #define CONFIG_SYS_MMC_ENV_PART 2 #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)

On Tue, Jun 13, 2017 at 02:11:29PM +0200, Hannes Schmelzer wrote:
since commit
'd5abcf94c7123167725fc22ace342f0d455093c1' - ti: boot: Register the MMC controllers in SPL in the same way as in u-boot
MMC boot on brxre1 board is broken, with this commit we make our board working again.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com

On 13/06/2017 14:11, Hannes Schmelzer wrote:
since commit
'd5abcf94c7123167725fc22ace342f0d455093c1' - ti: boot: Register the MMC controllers in SPL in the same way as in u-boot
MMC boot on brxre1 board is broken, with this commit we make our board working again.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Jean-Jacques Hiblot jjhiblot@ti.com
board/BuR/common/common.c | 7 ++++++- include/configs/brxre1.h | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index b1ae079..e8c6401 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -687,7 +687,12 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) {
- return omap_mmc_init(1, 0, 0, -1, -1);
- int rc = 0;
- rc |= omap_mmc_init(0, 0, 0, -1, -1);
- rc |= omap_mmc_init(1, 0, 0, -1, -1);
- return rc; } #endif int overwrite_console(void)
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index 5814d74..a96232d 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -53,21 +53,21 @@ BUR_COMMON_ENV \ "vx_romfsbase=0x800E0000\0" \ "vx_romfssize=0x20000\0" \ "vx_memtop=0x8FBEF000\0" \ -"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \ +"loadromfs=mmc dev 1; mmc read ${vx_romfsbase} 700 100\0" \ "autoload=0\0" \ "loadaddr=0x80100000\0" \ "logoaddr=0x82000000\0" \ "defaultARlen=0x8000\0" \ -"loaddefaultAR=mmc read ${loadaddr} 800 ${defaultARlen}\0" \ +"loaddefaultAR=mmc dev 1; mmc read ${loadaddr} 800 ${defaultARlen}\0" \ "defaultAR=run loadromfs; run loaddefaultAR; bootvx ${loadaddr}\0" \ -"logo0=fatload mmc 0:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ +"logo0=fatload mmc 1:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ "bmp display ${logoaddr} 0 0\0" \ -"logo1=fatload mmc 0:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ +"logo1=fatload mmc 1:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ "bmp display ${logoaddr} 0 0\0" \ "mmcboot=echo booting AR from eMMC-flash ...; "\ "run logo0 || run logo1; " \ "run loadromfs; " \
- "fatload mmc 0:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \
- "fatload mmc 1:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ "run defaultAR;\0" \ "netboot=echo booting AR from network ...; " \ "run loadromfs; " \
@@ -113,7 +113,7 @@ BUR_COMMON_ENV \
#undef CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_IS_IN_MMC -#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_SYS_MMC_ENV_DEV 1 #define CONFIG_SYS_MMC_ENV_PART 2 #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)

On Tue, Jun 13, 2017 at 02:11:29PM +0200, Hannes Schmelzer wrote:
since commit
'd5abcf94c7123167725fc22ace342f0d455093c1' - ti: boot: Register the MMC controllers in SPL in the same way as in u-boot
MMC boot on brxre1 board is broken, with this commit we make our board working again.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Jean-Jacques Hiblot jjhiblot@ti.com
Applied to u-boot/master, thanks!

the BMP logo loading has become obsolete and is not used any more. So we drop the support for it.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com ---
include/configs/brxre1.h | 11 ----------- 1 file changed, 11 deletions(-)
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index a96232d..eac77fc 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -19,11 +19,6 @@ #define CONFIG_LCD_NOSTDOUT #define LCD_BPP LCD_COLOR32
-#define CONFIG_VIDEO_BMP_GZIP -#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4) -#define CONFIG_BMP_24BPP -#define CONFIG_BMP_32BPP - /* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024)
@@ -56,16 +51,10 @@ BUR_COMMON_ENV \ "loadromfs=mmc dev 1; mmc read ${vx_romfsbase} 700 100\0" \ "autoload=0\0" \ "loadaddr=0x80100000\0" \ -"logoaddr=0x82000000\0" \ "defaultARlen=0x8000\0" \ "loaddefaultAR=mmc dev 1; mmc read ${loadaddr} 800 ${defaultARlen}\0" \ "defaultAR=run loadromfs; run loaddefaultAR; bootvx ${loadaddr}\0" \ -"logo0=fatload mmc 1:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ - "bmp display ${logoaddr} 0 0\0" \ -"logo1=fatload mmc 1:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ - "bmp display ${logoaddr} 0 0\0" \ "mmcboot=echo booting AR from eMMC-flash ...; "\ - "run logo0 || run logo1; " \ "run loadromfs; " \ "fatload mmc 1:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ "run defaultAR;\0" \

On Tue, Jun 13, 2017 at 02:11:30PM +0200, Hannes Schmelzer wrote:
the BMP logo loading has become obsolete and is not used any more. So we drop the support for it.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 13, 2017 at 02:11:30PM +0200, Hannes Schmelzer wrote:
the BMP logo loading has become obsolete and is not used any more. So we drop the support for it.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

This define isn't used anymore in the u-boot source tree, so we drop it from the config header.
We drop it also from the 'config_whitelist.txt'
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com ---
include/configs/brxre1.h | 1 - scripts/config_whitelist.txt | 1 - 2 files changed, 2 deletions(-)
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index eac77fc..640f3db 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -16,7 +16,6 @@ #include <configs/bur_am335x_common.h> /* ------------------------------------------------------------------------- */ #define CONFIG_AM335X_LCD -#define CONFIG_LCD_NOSTDOUT #define LCD_BPP LCD_COLOR32
/* memory */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 2d9a9fe..f729e2b 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1480,7 +1480,6 @@ CONFIG_LCD_IN_PSRAM CONFIG_LCD_LOGO CONFIG_LCD_MENU CONFIG_LCD_MENU_BOARD -CONFIG_LCD_NOSTDOUT CONFIG_LCD_ROTATION CONFIG_LD9040 CONFIG_LEGACY

On Tue, Jun 13, 2017 at 02:11:31PM +0200, Hannes Schmelzer wrote:
This define isn't used anymore in the u-boot source tree, so we drop it from the config header.
We drop it also from the 'config_whitelist.txt'
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 13, 2017 at 02:11:31PM +0200, Hannes Schmelzer wrote:
This define isn't used anymore in the u-boot source tree, so we drop it from the config header.
We drop it also from the 'config_whitelist.txt'
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com ---
include/configs/brxre1.h | 2 -- 1 file changed, 2 deletions(-)
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index 640f3db..63f6ebc 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -31,8 +31,6 @@ /* I2C IP block */ #define CONFIG_SYS_OMAP24_I2C_SPEED_PSOC 20000
-/* GPIO */ - /* MMC/SD IP block */ #define CONFIG_SUPPORT_EMMC_BOOT

On Tue, Jun 13, 2017 at 02:11:32PM +0200, Hannes Schmelzer wrote:
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 13, 2017 at 02:11:32PM +0200, Hannes Schmelzer wrote:
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

For better readability and setup-handling we refactor the default environment.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com ---
include/configs/brxre1.h | 51 ++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 30 deletions(-)
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index 63f6ebc..f7d7369 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -38,45 +38,36 @@ #define CONFIG_ENV_SIZE (64 << 10)
#ifndef CONFIG_SPL_BUILD -#define CONFIG_EXTRA_ENV_SETTINGS \ + +/* Default environment */ +#define CONFIG_EXTRA_ENV_SETTINGS \ BUR_COMMON_ENV \ +"autoload=0\0" \ +"scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "bootaddr=0x80001100\0" \ "bootdev=cpsw(0,0)\0" \ "vx_romfsbase=0x800E0000\0" \ "vx_romfssize=0x20000\0" \ "vx_memtop=0x8FBEF000\0" \ -"loadromfs=mmc dev 1; mmc read ${vx_romfsbase} 700 100\0" \ -"autoload=0\0" \ +"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \ "loadaddr=0x80100000\0" \ -"defaultARlen=0x8000\0" \ -"loaddefaultAR=mmc dev 1; mmc read ${loadaddr} 800 ${defaultARlen}\0" \ -"defaultAR=run loadromfs; run loaddefaultAR; bootvx ${loadaddr}\0" \ -"mmcboot=echo booting AR from eMMC-flash ...; "\ - "run loadromfs; " \ - "fatload mmc 1:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ - "run defaultAR;\0" \ -"netboot=echo booting AR from network ...; " \ - "run loadromfs; " \ - "tftp ${loadaddr} arimg && bootvx ${loadaddr}; " \ - "puts 'networkboot failed!';\0" \ -"netscript=echo running script from network (tftp) ...; " \ - "tftp 0x80000000 netscript.img && source; " \ - "puts 'netscript load failed!'\0" \ -"netupdate=tftp ${loadddr} MLO && mmc write ${loadaddr} 100 100; " \ - "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 300\0" \ -"netupdatedefaultAR=echo updating defaultAR from network (tftp) ...; " \ - "if tftp 0x80100000 arimg.bin; " \ - "then mmc write 0x80100000 800 ${defaultARlen}; " \ - "else setcurs 1 8; puts 'defAR update failed (tftp)!'; fi;\0" \ -"netupdateROMFS=echo updating romfs from network (tftp) ...; " \ - "if tftp 0x80100000 romfs.bin; " \ - "then mmc write 0x80100000 700 100; " \ - "else setcurs 1 8; puts 'romfs update failed (tftp)!'; fi;\0" - +"startvx=run loadromfs; bootvx ${loadaddr}\0" \ +"b_break=0\0" \ +"b_tgts_std=mmc def net usb0\0" \ +"b_tgts_rcy=def net usb0\0" \ +"b_tgts_pme=net usb0 mmc\0" \ +"b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ +" elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ +" else setenv b_tgts ${b_tgts_std}; fi\0" \ +"b_mmc=load mmc 1 ${loadaddr} arimg && run startvx\0" \ +"b_def=mmc read ${loadaddr} 800 8000; run startvx\0" \ +"b_net=tftp ${scradr} netscript.img && source ${scradr}\0" \ +"b_usb0=usb start && load usb 0 ${scradr} usbscript.img && source ${scradr}\0" \ +"b_default=run b_deftgts; for target in ${b_tgts};"\ +" do run b_${target}; if test ${b_break} = 1; then; exit; fi; done\0" #endif /* !CONFIG_SPL_BUILD*/
-#define CONFIG_BOOTCOMMAND \ - "run usbscript;" +#define CONFIG_BOOTCOMMAND "mmc dev 1; run b_default"
/* undefine command which we not need here */ #undef CONFIG_BOOTM_NETBSD

On Tue, Jun 13, 2017 at 02:11:33PM +0200, Hannes Schmelzer wrote:
For better readability and setup-handling we refactor the default environment.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com
That said, in a future patch, can you please move the various environment parts to include/environment/bur/ similar to how we have it for include/environment/ti/ ? Thanks!

Tom Rini trini@konsulko.com schrieb am 13.06.2017 15:24:57:
Von: Tom Rini trini@konsulko.com An: Hannes Schmelzer hannes.schmelzer@br-automation.com, Kopie: U-Boot@lists.denx.de Datum: 13.06.2017 15:24 Betreff: Re: [PATCH 5/5] board/BuR/brxre1: refactor default environment
On Tue, Jun 13, 2017 at 02:11:33PM +0200, Hannes Schmelzer wrote:
For better readability and setup-handling we refactor the default environment.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
Reviewed-by: Tom Rini trini@konsulko.com
That said, in a future patch, can you please move the various environment parts to include/environment/bur/ similar to how we have it for include/environment/ti/ ? Thanks!
Hi Tom,
thanks for this hint. I will have a look to all my b&r boards how to come on this way. There are several boards in the pipeline which aren't mainlined yet.
cheers, Hannes

On Tue, Jun 13, 2017 at 02:11:33PM +0200, Hannes Schmelzer wrote:
For better readability and setup-handling we refactor the default environment.
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (4)
-
Hannes Schmelzer
-
Hannes Schmelzer
-
Jean-Jacques Hiblot
-
Tom Rini