[U-Boot] [PATCH 00/14] cm-fx6 updates and a new splash screen feature

This series consists of updates for cm-fx6. Some of these updates (specifically: compulab: splash: use errno values compulab: splash: refactor splash.c compulab: splash: support multiple splash sources compulab: splash: support loading splash from sf) produce an end result which is not really compulab specific and could be useful for other boards as well, so as a last step in the series this code is converted to common code (common: convert compulab splash load code to common code).
The new feature: CONFIG_SPLASH_SOURCE This user option will enable splash_source.c, a module which implements a standard way for boards to define a collection of splash screen locations, as well as routines for loading the splash image into memory.
When invoked using splash_source_load(locations, size), the module will consult the environment variable "splashsource" and compare its value with the splash location names as provided by board code. If there's a match, that splash location is used. If there's no mach, no splash image will be loaded. If splashsource is left undefined, the first splash location is used as default.
Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de
Nikita Kiryanov (14): arm: mx6: cm-fx6: expand boot sequence arm: mx6: cm-fx6: change dtb node for ethaddr compulab: eeprom: allow reading mac address from multiple eeproms arm: mx6: cm-fx6: pass 2nd nic mac addr to Linux arm: mx6: cm-fx6: increase size of malloc area arm: mx6: cm-fx6: add hdmi console support arm: mx6: cm-fx6: display compulab logo arm: mx6: cm-fx6: add support for usb keyboard compulab: splash: use errno values compulab: splash: refactor splash.c compulab: splash: support multiple splash sources compulab: splash: support loading splash from sf arm: mx6: cm-fx6: add splash screen support common: convert compulab splash load code to common code
board/compulab/cm_fx6/cm_fx6.c | 95 ++++++++++++++++++-- board/compulab/cm_t335/cm_t335.c | 2 +- board/compulab/cm_t35/cm_t35.c | 14 ++- board/compulab/cm_t3517/cm_t3517.c | 2 +- board/compulab/cm_t54/cm_t54.c | 2 +- board/compulab/common/Makefile | 1 - board/compulab/common/common.h | 9 -- board/compulab/common/eeprom.c | 20 +++-- board/compulab/common/eeprom.h | 4 +- board/compulab/common/splash.c | 72 --------------- common/Makefile | 1 + common/splash_source.c | 176 +++++++++++++++++++++++++++++++++++++ doc/README.splashprepare | 13 +++ include/configs/cm_fx6.h | 158 +++++++++++++++++++-------------- include/configs/cm_t35.h | 1 + include/splash.h | 11 +++ tools/logos/compulab.bmp | Bin 0 -> 31810 bytes 17 files changed, 409 insertions(+), 172 deletions(-) delete mode 100644 board/compulab/common/splash.c create mode 100644 common/splash_source.c create mode 100644 tools/logos/compulab.bmp

Expand boot sequence to the following order: 1) mmc boot: mmc boot script, then mmc bootm, then mmc bootz. 2) usb boot: usb boot script. 3) sata boot: sata boot script, sata bootm, sata bootz. 4) nand boot: nand bootm, then nand bootz.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- include/configs/cm_fx6.h | 127 +++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 66 deletions(-)
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index f7277eb..d79c83b 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -103,97 +103,92 @@ #define CONFIG_ENV_OFFSET (768 * 1024)
#define CONFIG_EXTRA_ENV_SETTINGS \ - "kernel=uImage-cm-fx6\0" \ "autoload=no\0" \ + "kernel=uImage-cm-fx6\0" \ + "script=boot.scr\0" \ + "dtb=cm-fx6.dtb\0" \ + "bootm_low=18000000\0" \ "loadaddr=0x10800000\0" \ "fdtaddr=0x11000000\0" \ "console=ttymxc3,115200\0" \ "ethprime=FEC0\0" \ - "bootscr=boot.scr\0" \ - "bootm_low=18000000\0" \ "video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32\0" \ "video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \ - "fdtfile=cm-fx6.dtb\0" \ "doboot=bootm ${loadaddr}\0" \ - "loadfdt=false\0" \ + "doloadfdt=false\0" \ "setboottypez=setenv kernel zImage-cm-fx6;" \ "setenv doboot bootz ${loadaddr} - ${fdtaddr};" \ - "setenv loadfdt true;\0" \ + "setenv doloadfdt true;\0" \ "setboottypem=setenv kernel uImage-cm-fx6;" \ "setenv doboot bootm ${loadaddr};" \ - "setenv loadfdt false;\0"\ - "run_eboot=echo Starting EBOOT ...; "\ - "mmc dev ${mmcdev} && " \ - "mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \ - "mmcdev=2\0" \ + "setenv doloadfdt false;\0"\ "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \ - "loadmmcbootscript=load mmc ${mmcdev} ${loadaddr} ${bootscr}\0" \ - "mmcbootscript=echo Running bootscript from mmc ...; "\ - "source ${loadaddr}\0" \ - "mmcargs=setenv bootargs console=${console} " \ - "root=${mmcroot} " \ - "${video}\0" \ - "mmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \ - "mmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \ - "mmcboot=echo Booting from mmc ...; " \ - "run mmcargs; " \ - "run doboot\0" \ - "satadev=0\0" \ "sataroot=/dev/sda2 rw rootwait\0" \ - "sataargs=setenv bootargs console=${console} " \ - "root=${sataroot} " \ - "${video}\0" \ - "loadsatabootscript=load sata ${satadev} ${loadaddr} ${bootscr}\0" \ - "satabootscript=echo Running bootscript from sata ...; " \ - "source ${loadaddr}\0" \ - "sataloadkernel=load sata ${satadev} ${loadaddr} ${kernel}\0" \ - "sataloadfdt=load sata ${satadev} ${fdtaddr} ${fdtfile}\0" \ - "sataboot=echo Booting from sata ...; "\ - "run sataargs; " \ - "run doboot\0" \ "nandroot=/dev/mtdblock4 rw\0" \ "nandrootfstype=ubifs\0" \ + "mmcargs=setenv bootargs console=${console} root=${mmcroot} " \ + "${video}\0" \ + "sataargs=setenv bootargs console=${console} root=${sataroot} " \ + "${video}\0" \ "nandargs=setenv bootargs console=${console} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype} " \ "${video}\0" \ - "nandloadfdt=nand read ${fdtaddr} 780000 80000;\0" \ - "nandboot=echo Booting from nand ...; " \ - "run nandargs; " \ - "nand read ${loadaddr} 0 780000; " \ - "if ${loadfdt}; then " \ + "nandboot=if run nandloadkernel; then " \ "run nandloadfdt;" \ - "fi; " \ - "run doboot\0" \ - "boot=mmc dev ${mmcdev}; " \ - "if mmc rescan; then " \ - "if run loadmmcbootscript; then " \ - "run mmcbootscript;" \ - "else " \ - "if run mmcloadkernel; then " \ - "if ${loadfdt}; then " \ - "run mmcloadfdt;" \ - "fi;" \ - "run mmcboot;" \ - "fi;" \ - "fi;" \ + "run setboottypem;" \ + "run storagebootcmd;" \ + "run setboottypez;" \ + "run storagebootcmd;" \ + "fi;\0" \ + "run_eboot=echo Starting EBOOT ...; "\ + "mmc dev 2 && " \ + "mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \ + "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0"\ + "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0"\ + "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${dtb};\0" \ + "bootscript=echo Running bootscript from ${storagetype} ...;" \ + "source ${loadaddr};\0" \ + "nandloadkernel=nand read ${loadaddr} 0 780000;\0" \ + "nandloadfdt=nand read ${fdtaddr} 780000 80000;\0" \ + "setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \ + "setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \ + "setupnandboot=setenv storagetype nand;\0" \ + "setupusbboot=setenv storagetype usb; setenv storagedev 0;\0" \ + "storagebootcmd=echo Booting from ${storagetype} ...;" \ + "run ${storagetype}args; run doboot;\0" \ + "trybootk=if run loadkernel; then " \ + "if ${doloadfdt}; then " \ + "run loadfdt;" \ "fi;" \ - "if sata init; then " \ - "if run loadsatabootscript; then " \ - "run satabootscript;" \ - "else "\ - "if run sataloadkernel; then " \ - "if ${loadfdt}; then " \ - "run sataloadfdt; " \ - "fi;" \ - "run sataboot;" \ - "fi;" \ - "fi;" \ + "run storagebootcmd;" \ + "fi;\0" \ + "trybootsmz=if run loadscript; then " \ + "run bootscript;" \ "fi;" \ - "run nandboot\0" + "run setboottypem;" \ + "run trybootk;" \ + "run setboottypez;" \ + "run trybootk;\0"
#define CONFIG_BOOTCOMMAND \ - "run setboottypem; run boot" + "run setupmmcboot;" \ + "mmc dev ${storagedev};" \ + "if mmc rescan; then " \ + "run trybootsmz;" \ + "fi;" \ + "run setupusbboot;" \ + "if usb start; then "\ + "if run loadscript; then " \ + "run bootscript;" \ + "fi;" \ + "fi;" \ + "run setupsataboot;" \ + "if sata init; then " \ + "run trybootsmz;" \ + "fi;" \ + "run setupnandboot;" \ + "run nandboot;"
/* SPI */ #define CONFIG_SPI

On 01/14/15 10:42, Nikita Kiryanov wrote:
Expand boot sequence to the following order:
- mmc boot: mmc boot script, then mmc bootm, then mmc bootz.
- usb boot: usb boot script.
- sata boot: sata boot script, sata bootm, sata bootz.
- nand boot: nand bootm, then nand bootz.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Expand boot sequence to the following order:
- mmc boot: mmc boot script, then mmc bootm, then mmc bootz.
- usb boot: usb boot script.
- sata boot: sata boot script, sata bootm, sata bootz.
- nand boot: nand bootm, then nand bootz.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

When passing eth address to Linux via dtb, the "local-mac-address" property should be set for "/soc/aips-bus@02100000/ethernet@02188000", not "/fec".
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/cm_fx6/cm_fx6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 84e3643..5ddf8c6 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -464,8 +464,9 @@ int ft_board_setup(void *blob, bd_t *bd)
/* MAC addr */ if (eth_getenv_enetaddr("ethaddr", enetaddr)) { - fdt_find_and_setprop(blob, "/fec", "local-mac-address", - enetaddr, 6, 1); + fdt_find_and_setprop(blob, + "/soc/aips-bus@02100000/ethernet@02188000", + "local-mac-address", enetaddr, 6, 1); }
return 0;

On 01/14/15 10:42, Nikita Kiryanov wrote:
When passing eth address to Linux via dtb, the "local-mac-address" property should be set for "/soc/aips-bus@02100000/ethernet@02188000", not "/fec".
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
When passing eth address to Linux via dtb, the "local-mac-address" property should be set for "/soc/aips-bus@02100000/ethernet@02188000", not "/fec".
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Implement the option to select the eeprom i2c bus when reading mac address.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il Cc: Ilya Ledvich ilya@compulab.co.il Cc: Dmitry Lifshitz lifshitz@compulab.co.il --- board/compulab/cm_fx6/cm_fx6.c | 2 +- board/compulab/cm_t335/cm_t335.c | 2 +- board/compulab/cm_t35/cm_t35.c | 2 +- board/compulab/cm_t3517/cm_t3517.c | 2 +- board/compulab/cm_t54/cm_t54.c | 2 +- board/compulab/common/eeprom.c | 20 +++++++++++++------- board/compulab/common/eeprom.h | 4 ++-- 7 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 5ddf8c6..32f4434 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -354,7 +354,7 @@ static int handle_mac_address(void) if (rc) return 0;
- rc = cl_eeprom_read_mac_addr(enetaddr); + rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (rc) return rc;
diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c index 9583149..592ef3d 100644 --- a/board/compulab/cm_t335/cm_t335.c +++ b/board/compulab/cm_t335/cm_t335.c @@ -110,7 +110,7 @@ static int handle_mac_address(void) if (rv) return 0;
- rv = cl_eeprom_read_mac_addr(enetaddr); + rv = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (rv) get_efuse_mac_addr(enetaddr);
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 43463d5..9a3b2ee 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -429,7 +429,7 @@ static int handle_mac_address(void) if (rc) return 0;
- rc = cl_eeprom_read_mac_addr(enetaddr); + rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (rc) return rc;
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c index cac1ad9..624cf4c 100644 --- a/board/compulab/cm_t3517/cm_t3517.c +++ b/board/compulab/cm_t3517/cm_t3517.c @@ -163,7 +163,7 @@ static int cm_t3517_handle_mac_address(void) if (ret) return 0;
- ret = cl_eeprom_read_mac_addr(enetaddr); + ret = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (ret) { ret = am3517_get_efuse_enetaddr(enetaddr); if (ret) diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index 2c2530a..fdea909 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -165,7 +165,7 @@ static int handle_mac_address(void) if (ret) return 0;
- ret = cl_eeprom_read_mac_addr(enetaddr); + ret = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (ret || !is_valid_ether_addr(enetaddr)) generate_mac_addr(enetaddr);
diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index a45e7be..77bcea4 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -31,6 +31,7 @@ #define LAYOUT_INVALID 0 #define LAYOUT_LEGACY 0xff
+static int cl_eeprom_bus; static int cl_eeprom_layout; /* Implicitly LAYOUT_INVALID */
static int cl_eeprom_read(uint offset, uchar *buf, int len) @@ -38,7 +39,7 @@ static int cl_eeprom_read(uint offset, uchar *buf, int len) int res; unsigned int current_i2c_bus = i2c_get_bus_num();
- res = i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS); + res = i2c_set_bus_num(cl_eeprom_bus); if (res < 0) return res;
@@ -50,13 +51,18 @@ static int cl_eeprom_read(uint offset, uchar *buf, int len) return res; }
-static int cl_eeprom_setup_layout(void) +static int cl_eeprom_setup(uint eeprom_bus) { int res;
- if (cl_eeprom_layout != LAYOUT_INVALID) + /* + * We know the setup was already done when the layout is set to a valid + * value and we're using the same bus as before. + */ + if (cl_eeprom_layout != LAYOUT_INVALID && eeprom_bus == cl_eeprom_bus) return 0;
+ cl_eeprom_bus = eeprom_bus; res = cl_eeprom_read(EEPROM_LAYOUT_VER_OFFSET, (uchar *)&cl_eeprom_layout, 1); if (res) { @@ -77,7 +83,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
memset(serialnr, 0, sizeof(*serialnr));
- if (cl_eeprom_setup_layout()) + if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS)) return;
offset = (cl_eeprom_layout != LAYOUT_LEGACY) ? @@ -96,11 +102,11 @@ void get_board_serial(struct tag_serialnr *serialnr) * Routine: cl_eeprom_read_mac_addr * Description: read mac address and store it in buf. */ -int cl_eeprom_read_mac_addr(uchar *buf) +int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus) { uint offset;
- if (cl_eeprom_setup_layout()) + if (cl_eeprom_setup(eeprom_bus)) return 0;
offset = (cl_eeprom_layout != LAYOUT_LEGACY) ? @@ -123,7 +129,7 @@ u32 cl_eeprom_get_board_rev(void) if (board_rev) return board_rev;
- if (cl_eeprom_setup_layout()) + if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS)) return 0;
if (cl_eeprom_layout != LAYOUT_LEGACY) diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/eeprom.h index 85d5bf0..50c6b02 100644 --- a/board/compulab/common/eeprom.h +++ b/board/compulab/common/eeprom.h @@ -11,10 +11,10 @@ #define _EEPROM_
#ifdef CONFIG_SYS_I2C -int cl_eeprom_read_mac_addr(uchar *buf); +int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus); u32 cl_eeprom_get_board_rev(void); #else -static inline int cl_eeprom_read_mac_addr(uchar *buf) +static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus) { return 1; }

On 01/14/15 10:42, Nikita Kiryanov wrote:
Implement the option to select the eeprom i2c bus when reading mac address.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il Cc: Ilya Ledvich ilya@compulab.co.il Cc: Dmitry Lifshitz lifshitz@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Implement the option to select the eeprom i2c bus when reading mac address.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il Cc: Ilya Ledvich ilya@compulab.co.il Cc: Dmitry Lifshitz lifshitz@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Obtain 2nd NIC MAC address from baseboard EEPROM and pass it to Linux.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/cm_fx6/cm_fx6.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 32f4434..eb18dfc 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -345,32 +345,36 @@ static iomux_v3_cfg_t const enet_pads[] = { MUX_PAD_CTRL(ENET_PAD_CTRL)), };
-static int handle_mac_address(void) +static int handle_mac_address(char *env_var, uint eeprom_bus) { unsigned char enetaddr[6]; int rc;
- rc = eth_getenv_enetaddr("ethaddr", enetaddr); + rc = eth_getenv_enetaddr(env_var, enetaddr); if (rc) return 0;
- rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); + rc = cl_eeprom_read_mac_addr(enetaddr, eeprom_bus); if (rc) return rc;
if (!is_valid_ether_addr(enetaddr)) return -1;
- return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_setenv_enetaddr(env_var, enetaddr); }
+#define SB_FX6_I2C_EEPROM_BUS 0 +#define NO_MAC_ADDR "No MAC address found for %s\n" int board_eth_init(bd_t *bis) { int err;
- err = handle_mac_address(); - if (err) - puts("No MAC address found\n"); + if (handle_mac_address("ethaddr", CONFIG_SYS_I2C_EEPROM_BUS)) + printf(NO_MAC_ADDR, "primary NIC"); + + if (handle_mac_address("eth1addr", SB_FX6_I2C_EEPROM_BUS)) + printf(NO_MAC_ADDR, "secondary NIC");
SETUP_IOMUX_PADS(enet_pads); /* phy reset */ @@ -469,6 +473,11 @@ int ft_board_setup(void *blob, bd_t *bd) "local-mac-address", enetaddr, 6, 1); }
+ if (eth_getenv_enetaddr("eth1addr", enetaddr)) { + fdt_find_and_setprop(blob, "/eth@pcie", "local-mac-address", + enetaddr, 6, 1); + } + return 0; } #endif

On 01/14/15 10:42, Nikita Kiryanov wrote:
Obtain 2nd NIC MAC address from baseboard EEPROM and pass it to Linux.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Obtain 2nd NIC MAC address from baseboard EEPROM and pass it to Linux.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Increase size of malloc area to make room for framebuffer and other such big allocations.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- include/configs/cm_fx6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index d79c83b..a2e42c4 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -276,7 +276,7 @@ /* misc */ #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_STACKSIZE (128 * 1024) -#define CONFIG_SYS_MALLOC_LEN (2 * 1024 * 1024) +#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ #define CONFIG_OF_BOARD_SETUP

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Increase size of malloc area to make room for framebuffer and other such big allocations.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Add support for hdmi console.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/cm_fx6/cm_fx6.c | 51 ++++++++++++++++++++++++++++++++++++++++++ include/configs/cm_fx6.h | 15 +++++++++++++ 2 files changed, 66 insertions(+)
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index eb18dfc..b31e1f5 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -18,8 +18,10 @@ #include <asm/arch/crm_regs.h> #include <asm/arch/sys_proto.h> #include <asm/arch/iomux.h> +#include <asm/arch/mxc_hdmi.h> #include <asm/imx-common/mxc_i2c.h> #include <asm/imx-common/sata.h> +#include <asm/imx-common/video.h> #include <asm/io.h> #include <asm/gpio.h> #include <dm/platform_data/serial_mxc.h> @@ -28,6 +30,53 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_IMX_HDMI +static void cm_fx6_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} + +struct display_info_t const displays[] = { + { + .bus = -1, + .addr = 0, + .pixfmt = IPU_PIX_FMT_RGB24, + .detect = detect_hdmi, + .enable = cm_fx6_enable_hdmi, + .mode = { + .name = "HDMI", + .refresh = 60, + .xres = 1024, + .yres = 768, + .pixclock = 40385, + .left_margin = 220, + .right_margin = 40, + .upper_margin = 21, + .lower_margin = 7, + .hsync_len = 60, + .vsync_len = 10, + .sync = FB_SYNC_EXT, + .vmode = FB_VMODE_NONINTERLACED, + } + }, +}; +size_t display_count = ARRAY_SIZE(displays); + +static void cm_fx6_setup_display(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + int reg; + + enable_ipu_clock(); + imx_setup_hdmi(); + reg = __raw_readl(&mxc_ccm->CCGR3); + reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK; + writel(reg, &mxc_ccm->CCGR3); +} +#else +static inline void cm_fx6_setup_display(void) {} +#endif /* CONFIG_VIDEO_IPUV3 */ + #ifdef CONFIG_DWC_AHSATA static int cm_fx6_issd_gpios[] = { /* The order of the GPIOs in the array is important! */ @@ -516,6 +565,8 @@ int board_init(void) if (ret) printf("Warning: I2C setup failed: %d\n", ret);
+ cm_fx6_setup_display(); + return 0; }
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index a2e42c4..a9f33a9 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -103,6 +103,9 @@ #define CONFIG_ENV_OFFSET (768 * 1024)
#define CONFIG_EXTRA_ENV_SETTINGS \ + "stdout=serial,vga\0" \ + "stderr=serial,vga\0" \ + "panel=HDMI\0" \ "autoload=no\0" \ "kernel=uImage-cm-fx6\0" \ "script=boot.scr\0" \ @@ -291,4 +294,16 @@ #define CONFIG_SYS_SPI_U_BOOT_OFFS (64 * 1024) #define CONFIG_SPL_SPI_LOAD
+/* Display */ +#define CONFIG_VIDEO +#define CONFIG_VIDEO_IPUV3 +#define CONFIG_IPUV3_CLK 260000000 +#define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP +#define CONFIG_CFB_CONSOLE +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_CONSOLE_MUX +#define CONFIG_VIDEO_SW_CURSOR + #endif /* __CONFIG_CM_FX6_H */

Add support for hdmi console.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
board/compulab/cm_fx6/cm_fx6.c | 51
++++++++++++++++++++++++++++++++++++++++++
include/configs/cm_fx6.h | 15 +++++++++++++ 2 files changed, 66 insertions(+)
[...]
+struct display_info_t const displays[] = {
- {
.bus = -1,
.addr = 0,
.pixfmt = IPU_PIX_FMT_RGB24,
.detect = detect_hdmi,
.enable = cm_fx6_enable_hdmi,
.mode = {
.name = "HDMI",
.refresh = 60,
.xres = 1024,
.yres = 768,
.pixclock = 40385,
.left_margin = 220,
.right_margin = 40,
.upper_margin = 21,
.lower_margin = 7,
.hsync_len = 60,
.vsync_len = 10,
.sync = FB_SYNC_EXT,
.vmode = FB_VMODE_NONINTERLACED,
}
- },
+};
This is not VESA compliant.
+static void cm_fx6_setup_display(void) +{
- struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *) CCM_BASE_ADDR;
- int reg;
- enable_ipu_clock();
- imx_setup_hdmi();
- reg = __raw_readl(&mxc_ccm->CCGR3);
- reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
- writel(reg, &mxc_ccm->CCGR3);
+}
This will not give the correct pixel clock for a framerate of 60 frames per second (as probably expected).
Just as a warning: Due to the non-standard video timing most hdmi monitors will not work. For more compatible settings please have a look into the tbs2910 board code.
Soeren

Hi Soeren,
On 01/14/2015 01:34 PM, Soeren Moch wrote:
Add support for hdmi console.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
board/compulab/cm_fx6/cm_fx6.c | 51
++++++++++++++++++++++++++++++++++++++++++
include/configs/cm_fx6.h | 15 +++++++++++++ 2 files changed, 66 insertions(+)
[...]
+struct display_info_t const displays[] = {
- {
.bus = -1,
.addr = 0,
.pixfmt = IPU_PIX_FMT_RGB24,
.detect = detect_hdmi,
.enable = cm_fx6_enable_hdmi,
.mode = {
.name = "HDMI",
.refresh = 60,
.xres = 1024,
.yres = 768,
.pixclock = 40385,
.left_margin = 220,
.right_margin = 40,
.upper_margin = 21,
.lower_margin = 7,
.hsync_len = 60,
.vsync_len = 10,
.sync = FB_SYNC_EXT,
.vmode = FB_VMODE_NONINTERLACED,
}
- },
+};
This is not VESA compliant.
+static void cm_fx6_setup_display(void) +{
- struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *) CCM_BASE_ADDR;
- int reg;
- enable_ipu_clock();
- imx_setup_hdmi();
- reg = __raw_readl(&mxc_ccm->CCGR3);
- reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
- writel(reg, &mxc_ccm->CCGR3);
+}
This will not give the correct pixel clock for a framerate of 60 frames per second (as probably expected).
Just as a warning: Due to the non-standard video timing most hdmi monitors will not work. For more compatible settings please have a look into the tbs2910 board code.
Thanks for the pointer. I'll take a look at the tbs2910 code when I expand the set of supported display presets. For now this is a preliminary support.

On 01/14/15 10:42, Nikita Kiryanov wrote:
Add support for hdmi console.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add support for hdmi console.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Add compulab logo and display it on boot.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- include/configs/cm_fx6.h | 3 +++ tools/logos/compulab.bmp | Bin 0 -> 31810 bytes 2 files changed, 3 insertions(+) create mode 100644 tools/logos/compulab.bmp
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index a9f33a9..5d0d303 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -306,4 +306,7 @@ #define CONFIG_CONSOLE_MUX #define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO + #endif /* __CONFIG_CM_FX6_H */ diff --git a/tools/logos/compulab.bmp b/tools/logos/compulab.bmp new file mode 100644 index 0000000000000000000000000000000000000000..df5435cb596ee93496557b78fbbb0c2b97299b4b GIT binary patch literal 31810 zcmeI33v8R$b;l1WO0p=)dQuYgj3tXw^suOhtrsoQqNw-Ndd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irh%9SVj75PAf|zs24WhBX&|P7 Vm<D1Rh-o0EftUtj8hC#i_<uuVowxu1
literal 0 HcmV?d00001

On 01/14/15 10:42, Nikita Kiryanov wrote:
Add compulab logo and display it on boot.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

Hi Nikita,
On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add compulab logo and display it on boot.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
include/configs/cm_fx6.h | 3 +++ tools/logos/compulab.bmp | Bin 0 -> 31810 bytes 2 files changed, 3 insertions(+) create mode 100644 tools/logos/compulab.bmp
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index a9f33a9..5d0d303 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -306,4 +306,7 @@ #define CONFIG_CONSOLE_MUX #define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO
This is a general question, not strictly related to the patch. You add with the series a way to get splash screen from multiple sources. I have often (I know we are talking about different things..) used splash screen as a way to add a logo, without the necessity to link the image to the code. I think also that the way with logo does not scale well, and we cannot merge in mainline tons of images - they have nothing to do with u-boot sources.
Why is not enough for you to use the splash screen functionality ? IMHO it is much more flexible as using the logo, and there is no need to link it against the code.
Best regards, Stefano Babic

Hi Stefano,
On 01/22/2015 11:58 AM, Stefano Babic wrote:
Hi Nikita,
On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add compulab logo and display it on boot.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
include/configs/cm_fx6.h | 3 +++ tools/logos/compulab.bmp | Bin 0 -> 31810 bytes 2 files changed, 3 insertions(+) create mode 100644 tools/logos/compulab.bmp
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index a9f33a9..5d0d303 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -306,4 +306,7 @@ #define CONFIG_CONSOLE_MUX #define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO
This is a general question, not strictly related to the patch. You add with the series a way to get splash screen from multiple sources. I have often (I know we are talking about different things..) used splash screen as a way to add a logo, without the necessity to link the image to the code. I think also that the way with logo does not scale well,
Why not?
and we cannot merge in mainline tons of images - they have nothing to do with u-boot sources.
Storing graphics that are part of a program in the program's repository is a common practice, why should U-Boot be different?
Why is not enough for you to use the splash screen functionality ? IMHO it is much more flexible as using the logo, and there is no need to link it against the code.
We are interested in the behavior that VIDEO_LOGO provides: that the logo remains visible on screen and coexists with the frame buffer console, and that no manual installation is required.
Best regards, Stefano Babic

Hi Nikita,
On 22/01/2015 18:33, Nikita Kiryanov wrote:
This is a general question, not strictly related to the patch. You add with the series a way to get splash screen from multiple sources. I have often (I know we are talking about different things..) used splash screen as a way to add a logo, without the necessity to link the image to the code. I think also that the way with logo does not scale well,
Why not?
Well, it happens if for each maintained board there is a corresponding logo and all logos should be maintain in U-Boot repository - that is quite a mess.
Logos has nothing to do with U-Boot development - they are blob data. The fact that they are linked together with U-Boot looks easy, but I do not think it is elegant.
Splash images are loaded on demand by u-boot code from a storage - this is IMHO a better solution.
and we cannot merge in mainline tons of images - they have nothing to do with u-boot sources.
Storing graphics that are part of a program in the program's repository is a common practice, why should U-Boot be different?
Maybe due to the number of boards, and if each board wants to have its own logo. If all boards share the same logo I would not see any problem at all.
Why is not enough for you to use the splash screen functionality ? IMHO it is much more flexible as using the logo, and there is no need to link it against the code.
We are interested in the behavior that VIDEO_LOGO provides: that the logo remains visible on screen and coexists with the frame buffer console, and that no manual installation is required.
ok, you like really the logo feature, I see ;-).
Added Anatolji to CC - we could let the question in background for the future. Maybe could we have a logo_load_image() near splash_load_from_*() ?
Besst regards, Stefano Babic

On 01/23/15 11:47, Stefano Babic wrote:
Hi Nikita,
On 22/01/2015 18:33, Nikita Kiryanov wrote:
This is a general question, not strictly related to the patch. You add with the series a way to get splash screen from multiple sources. I have often (I know we are talking about different things..) used splash screen as a way to add a logo, without the necessity to link the image to the code. I think also that the way with logo does not scale well,
Why not?
Well, it happens if for each maintained board there is a corresponding logo and all logos should be maintain in U-Boot repository - that is quite a mess.
Right. I must agree it is a mess. Also, please understand correctly, this is not our intent...
Logos has nothing to do with U-Boot development - they are blob data. The fact that they are linked together with U-Boot looks easy, but I do not think it is elegant.
Splash images are loaded on demand by u-boot code from a storage - this is IMHO a better solution.
Yes, indeed, and also the only one that permits a board to have multiple customizable splash images - which is the case for many SoMs.
and we cannot merge in mainline tons of images - they have nothing to do with u-boot sources.
Storing graphics that are part of a program in the program's repository is a common practice, why should U-Boot be different?
Maybe due to the number of boards, and if each board wants to have its own logo. If all boards share the same logo I would not see any problem at all.
And yes, this is our intent. We would like to have a single logo for all our boards (and we have some already - more to come). It is vendor oriented, not board oriented.
Why is not enough for you to use the splash screen functionality ? IMHO it is much more flexible as using the logo, and there is no need to link it against the code.
We are interested in the behavior that VIDEO_LOGO provides: that the logo remains visible on screen and coexists with the frame buffer console, and that no manual installation is required.
ok, you like really the logo feature, I see ;-).
Yes, currently, it is used on Utilite computer (which is build around cm-fx6 SoM). So, it looks really good, for the Utilite users to have the HDMI with USB console and the vendor logo.
Added Anatolji to CC - we could let the question in background for the future. Maybe could we have a logo_load_image() near splash_load_from_*() ?
That would be perfect, I think, and also have it user customizable. Although, I would like to have an option to return to default one...

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add compulab logo and display it on boot.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Add support for usb keyboard for cm_fx6.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- include/configs/cm_fx6.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index 5d0d303..49b1b00 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -103,6 +103,7 @@ #define CONFIG_ENV_OFFSET (768 * 1024)
#define CONFIG_EXTRA_ENV_SETTINGS \ + "stdin=serial,usbkbd\0" \ "stdout=serial,vga\0" \ "stderr=serial,vga\0" \ "panel=HDMI\0" \ @@ -193,6 +194,8 @@ "run setupnandboot;" \ "run nandboot;"
+#define CONFIG_PREBOOT "usb start" + /* SPI */ #define CONFIG_SPI #define CONFIG_MXC_SPI @@ -241,6 +244,9 @@ #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ +#define CONFIG_USB_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP +#define CONFIG_SYS_STDIO_DEREGISTER
/* I2C */ #define CONFIG_CMD_I2C

On 01/14/15 10:42, Nikita Kiryanov wrote:
Add support for usb keyboard for cm_fx6.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add support for usb keyboard for cm_fx6.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Use errno values to improve return reporting.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/common/splash.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c index 49ed49b..33b2f9f 100644 --- a/board/compulab/common/splash.c +++ b/board/compulab/common/splash.c @@ -8,6 +8,7 @@
#include <common.h> #include <nand.h> +#include <errno.h> #include <bmp_layout.h>
DECLARE_GLOBAL_DATA_PTR; @@ -44,12 +45,12 @@ splash_address_too_high: printf("Error: splashimage address too high. Data overwrites U-Boot " "and/or placed beyond DRAM boundaries.\n");
- return -1; + return -EFAULT; } #else static inline int splash_load_from_nand(u32 bmp_load_addr, int nand_offset) { - return -1; + return -ENOSYS; } #endif /* CONFIG_CMD_NAND */
@@ -60,12 +61,12 @@ int cl_splash_screen_prepare(int nand_offset)
env_splashimage_value = getenv("splashimage"); if (env_splashimage_value == NULL) - return -1; + return -ENOENT;
bmp_load_addr = simple_strtoul(env_splashimage_value, 0, 16); if (bmp_load_addr == 0) { printf("Error: bad splashimage address specified\n"); - return -1; + return -EFAULT; }
return splash_load_from_nand(bmp_load_addr, nand_offset);

On 01/14/15 10:42, Nikita Kiryanov wrote:
Use errno values to improve return reporting.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Use errno values to improve return reporting.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Move storage device specific code into its own function instead of calling it directly from an otherwise storage device independent function (cl_splash_screen_prepare).
This is a preparation for supporting multiple splash locations.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/common/common.h | 4 ++-- board/compulab/common/splash.c | 43 +++++++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index 68ffb11..80753b4 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -25,9 +25,9 @@ static inline void cl_usb_hub_deinit(int gpio) {} #endif /* CONFIG_CMD_USB */
#ifdef CONFIG_SPLASH_SCREEN -int cl_splash_screen_prepare(int nand_offset); +int cl_splash_screen_prepare(int offset); #else /* !CONFIG_SPLASH_SCREEN */ -static inline int cl_splash_screen_prepare(int nand_offset) +static inline int cl_splash_screen_prepare(int offset) { return -ENOSYS; } diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c index 33b2f9f..09a0755 100644 --- a/board/compulab/common/splash.c +++ b/board/compulab/common/splash.c @@ -10,11 +10,32 @@ #include <nand.h> #include <errno.h> #include <bmp_layout.h> +#include "common.h"
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_CMD_NAND -static int splash_load_from_nand(u32 bmp_load_addr, int nand_offset) +static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + return nand_read_skip_bad(&nand_info[nand_curr_device], offset, + &read_size, NULL, + nand_info[nand_curr_device].size, + (u_char *)bmp_load_addr); +} +#else +static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + debug("%s: nand support not available\n", __func__); + return -ENOSYS; +} +#endif + +static int splash_storage_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + return splash_nand_read(bmp_load_addr, offset, read_size); +} + +static int splash_load_raw(u32 bmp_load_addr, int offset) { struct bmp_header *bmp_hdr; int res; @@ -23,10 +44,7 @@ static int splash_load_from_nand(u32 bmp_load_addr, int nand_offset) if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp) goto splash_address_too_high;
- res = nand_read_skip_bad(&nand_info[nand_curr_device], - nand_offset, &bmp_header_size, - NULL, nand_info[nand_curr_device].size, - (u_char *)bmp_load_addr); + res = splash_storage_read(bmp_load_addr, offset, bmp_header_size); if (res < 0) return res;
@@ -36,10 +54,7 @@ static int splash_load_from_nand(u32 bmp_load_addr, int nand_offset) if (bmp_load_addr + bmp_size >= gd->start_addr_sp) goto splash_address_too_high;
- return nand_read_skip_bad(&nand_info[nand_curr_device], - nand_offset, &bmp_size, - NULL, nand_info[nand_curr_device].size, - (u_char *)bmp_load_addr); + return splash_storage_read(bmp_load_addr, offset, bmp_size);
splash_address_too_high: printf("Error: splashimage address too high. Data overwrites U-Boot " @@ -47,14 +62,8 @@ splash_address_too_high:
return -EFAULT; } -#else -static inline int splash_load_from_nand(u32 bmp_load_addr, int nand_offset) -{ - return -ENOSYS; -} -#endif /* CONFIG_CMD_NAND */
-int cl_splash_screen_prepare(int nand_offset) +int cl_splash_screen_prepare(int offset) { char *env_splashimage_value; u32 bmp_load_addr; @@ -69,5 +78,5 @@ int cl_splash_screen_prepare(int nand_offset) return -EFAULT; }
- return splash_load_from_nand(bmp_load_addr, nand_offset); + return splash_load_raw(bmp_load_addr, offset); }

On 01/14/15 10:42, Nikita Kiryanov wrote:
Move storage device specific code into its own function instead of calling it directly from an otherwise storage device independent function (cl_splash_screen_prepare).
This is a preparation for supporting multiple splash locations.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Move storage device specific code into its own function instead of calling it directly from an otherwise storage device independent function (cl_splash_screen_prepare).
This is a preparation for supporting multiple splash locations.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Define a generic way for boards to define splash image locations: - introduce struct splash_location - introduce enum splash_storage - update cl_splash_screen_prepare() to take an array of above struct and select the appropriate one based on the splashsource environment variable (if it is not defined- use the first splash location as default).
cm-t35 is updated to work with the new interface.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/cm_t35/cm_t35.c | 11 +++++-- board/compulab/common/common.h | 15 +++++++-- board/compulab/common/splash.c | 70 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 85 insertions(+), 11 deletions(-)
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 9a3b2ee..8143c05 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -59,11 +59,18 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) } #endif
-#define CM_T35_SPLASH_NAND_OFFSET 0x100000 +struct splash_location splash_locations[] = { + { + .name = "nand", + .storage = SPLASH_STORAGE_NAND, + .offset = 0x100000, + }, +};
int splash_screen_prepare(void) { - return cl_splash_screen_prepare(CM_T35_SPLASH_NAND_OFFSET); + return cl_splash_screen_prepare(splash_locations, + ARRAY_SIZE(splash_locations)); }
/* diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index 80753b4..09b4de6 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -24,10 +24,21 @@ static inline int cl_usb_hub_init(int gpio, const char *label) static inline void cl_usb_hub_deinit(int gpio) {} #endif /* CONFIG_CMD_USB */
+enum splash_storage { + SPLASH_STORAGE_NAND, +}; + +struct splash_location { + char *name; + enum splash_storage storage; + u32 offset; /* offset from start of storage */ +}; + #ifdef CONFIG_SPLASH_SCREEN -int cl_splash_screen_prepare(int offset); +int cl_splash_screen_prepare(struct splash_location *locations, uint size); #else /* !CONFIG_SPLASH_SCREEN */ -static inline int cl_splash_screen_prepare(int offset) +static inline int cl_splash_screen_prepare(struct splash_location *locations, + uint size) { return -ENOSYS; } diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c index 09a0755..f230d6d 100644 --- a/board/compulab/common/splash.c +++ b/board/compulab/common/splash.c @@ -30,12 +30,26 @@ static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) } #endif
-static int splash_storage_read(u32 bmp_load_addr, int offset, size_t read_size) +static int splash_storage_read(struct splash_location *location, + u32 bmp_load_addr, size_t read_size) { - return splash_nand_read(bmp_load_addr, offset, read_size); + u32 offset; + + if (!location) + return -EINVAL; + + offset = location->offset; + switch (location->storage) { + case SPLASH_STORAGE_NAND: + return splash_nand_read(bmp_load_addr, offset, read_size); + default: + printf("Unknown splash location\n"); + } + + return -EINVAL; }
-static int splash_load_raw(u32 bmp_load_addr, int offset) +static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr) { struct bmp_header *bmp_hdr; int res; @@ -44,7 +58,7 @@ static int splash_load_raw(u32 bmp_load_addr, int offset) if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp) goto splash_address_too_high;
- res = splash_storage_read(bmp_load_addr, offset, bmp_header_size); + res = splash_storage_read(location, bmp_load_addr, bmp_header_size); if (res < 0) return res;
@@ -54,7 +68,7 @@ static int splash_load_raw(u32 bmp_load_addr, int offset) if (bmp_load_addr + bmp_size >= gd->start_addr_sp) goto splash_address_too_high;
- return splash_storage_read(bmp_load_addr, offset, bmp_size); + return splash_storage_read(location, bmp_load_addr, bmp_size);
splash_address_too_high: printf("Error: splashimage address too high. Data overwrites U-Boot " @@ -63,8 +77,46 @@ splash_address_too_high: return -EFAULT; }
-int cl_splash_screen_prepare(int offset) +/** + * select_splash_location - return the splash location based on board support + * and env variable "splashsource". + * + * @locations: An array of supported splash locations. + * @size: Size of splash_locations array. + * + * @return: If a null set of splash locations is given, or + * splashsource env variable is set to unsupported value + * return NULL. + * If splashsource env variable is not defined + * return the first entry in splash_locations as default. + * If splashsource env variable contains a supported value + * return the location selected by splashsource. + */ +static struct splash_location *select_splash_location( + struct splash_location *locations, uint size) +{ + int i; + char *env_splashsource; + + if (!locations || size == 0) + return NULL; + + env_splashsource = getenv("splashsource"); + if (env_splashsource == NULL) + return &locations[0]; + + for (i = 0; i < size; i++) { + if (!strcmp(locations[i].name, env_splashsource)) + return &locations[i]; + } + + printf("splashsource env variable set to unsupported value\n"); + return NULL; +} + +int cl_splash_screen_prepare(struct splash_location *locations, uint size) { + struct splash_location *splash_location; char *env_splashimage_value; u32 bmp_load_addr;
@@ -78,5 +130,9 @@ int cl_splash_screen_prepare(int offset) return -EFAULT; }
- return splash_load_raw(bmp_load_addr, offset); + splash_location = select_splash_location(locations, size); + if (!splash_location) + return -EINVAL; + + return splash_load_raw(splash_location, bmp_load_addr); }

On 01/14/15 10:42, Nikita Kiryanov wrote:
Define a generic way for boards to define splash image locations:
- introduce struct splash_location
- introduce enum splash_storage
- update cl_splash_screen_prepare() to take an array of above struct and select the appropriate one based on the splashsource environment variable (if it is not defined- use the first splash location as default).
cm-t35 is updated to work with the new interface.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Define a generic way for boards to define splash image locations:
- introduce struct splash_location
- introduce enum splash_storage
- update cl_splash_screen_prepare() to take an array of above struct and select the appropriate one based on the splashsource environment variable (if it is not defined- use the first splash location as default).
cm-t35 is updated to work with the new interface.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Add support for loading splash from sf.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il [grinberg@compulab.co.il: staticize the sf global variable] Signed-off-by: Igor Grinberg grinberg@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/common/common.h | 1 + board/compulab/common/splash.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index 09b4de6..b992965 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -26,6 +26,7 @@ static inline void cl_usb_hub_deinit(int gpio) {}
enum splash_storage { SPLASH_STORAGE_NAND, + SPLASH_STORAGE_SF, };
struct splash_location { diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c index f230d6d..16c315c 100644 --- a/board/compulab/common/splash.c +++ b/board/compulab/common/splash.c @@ -9,11 +9,36 @@ #include <common.h> #include <nand.h> #include <errno.h> +#include <spi_flash.h> +#include <spi.h> #include <bmp_layout.h> #include "common.h"
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_SPI_FLASH +static struct spi_flash *sf; +static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + if (!sf) { + sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, + CONFIG_SF_DEFAULT_CS, + CONFIG_SF_DEFAULT_SPEED, + CONFIG_SF_DEFAULT_MODE); + if (!sf) + return -ENODEV; + } + + return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr); +} +#else +static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + debug("%s: sf support not available\n", __func__); + return -ENOSYS; +} +#endif + #ifdef CONFIG_CMD_NAND static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) { @@ -42,6 +67,8 @@ static int splash_storage_read(struct splash_location *location, switch (location->storage) { case SPLASH_STORAGE_NAND: return splash_nand_read(bmp_load_addr, offset, read_size); + case SPLASH_STORAGE_SF: + return splash_sf_read(bmp_load_addr, offset, read_size); default: printf("Unknown splash location\n"); }

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add support for loading splash from sf.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il [grinberg@compulab.co.il: staticize the sf global variable] Signed-off-by: Igor Grinberg grinberg@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Add support for splash screen. The splash screen is loaded from the SPI flash and is displayed on the HDMI display.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il [grinberg@compulab.co.il: minor code and commit message updates] Signed-off-by: Igor Grinberg grinberg@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il --- board/compulab/cm_fx6/cm_fx6.c | 17 +++++++++++++++++ include/configs/cm_fx6.h | 4 ++++ 2 files changed, 21 insertions(+)
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index b31e1f5..b5c3ea1 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -27,9 +27,26 @@ #include <dm/platform_data/serial_mxc.h> #include "common.h" #include "../common/eeprom.h" +#include "../common/common.h"
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_SPLASH_SCREEN +static struct splash_location cm_fx6_splash_locations[] = { + { + .name = "sf", + .storage = SPLASH_STORAGE_SF, + .offset = 0x100000, + }, +}; + +int splash_screen_prepare(void) +{ + return cl_splash_screen_prepare(cm_fx6_splash_locations, + ARRAY_SIZE(cm_fx6_splash_locations)); +} +#endif + #ifdef CONFIG_IMX_HDMI static void cm_fx6_enable_hdmi(struct display_info_t const *dev) { diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index 49b1b00..b92ba97 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -312,6 +312,10 @@ #define CONFIG_CONSOLE_MUX #define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_SPLASH_SCREEN +#define CONFIG_CMD_BMP +#define CONFIG_VIDEO_BMP_RLE8 + #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Add support for splash screen. The splash screen is loaded from the SPI flash and is displayed on the HDMI display.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il [grinberg@compulab.co.il: minor code and commit message updates] Signed-off-by: Igor Grinberg grinberg@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Move board/compulab/common/splash.c code to common/splash_source.c to make it available for everybody. This move renames cl_splash_screen_prepare() to splash_source_load(), and the compilation of this code is conditional on CONFIG_SPLASH_SOURCE.
splash_source features: * Provide a standardized way for declaring board specific splash screen locations * Provide existing routines for auto loading the splash image from the locations as declared by the board * Introduce the "splashsource" environment variable, which makes it possible to select the splash image source.
cm-t35 and cm-fx6 are updated to use the modified version.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Tom Rini trini@ti.com Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de --- board/compulab/cm_fx6/cm_fx6.c | 5 +- board/compulab/cm_t35/cm_t35.c | 5 +- board/compulab/common/Makefile | 1 - board/compulab/common/common.h | 21 ----- board/compulab/common/splash.c | 165 -------------------------------------- common/Makefile | 1 + common/splash_source.c | 176 +++++++++++++++++++++++++++++++++++++++++ doc/README.splashprepare | 13 +++ include/configs/cm_fx6.h | 1 + include/configs/cm_t35.h | 1 + include/splash.h | 11 +++ 11 files changed, 209 insertions(+), 191 deletions(-) delete mode 100644 board/compulab/common/splash.c create mode 100644 common/splash_source.c
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index b5c3ea1..ae6945b 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -15,6 +15,7 @@ #include <netdev.h> #include <fdt_support.h> #include <sata.h> +#include <splash.h> #include <asm/arch/crm_regs.h> #include <asm/arch/sys_proto.h> #include <asm/arch/iomux.h> @@ -42,8 +43,8 @@ static struct splash_location cm_fx6_splash_locations[] = {
int splash_screen_prepare(void) { - return cl_splash_screen_prepare(cm_fx6_splash_locations, - ARRAY_SIZE(cm_fx6_splash_locations)); + return splash_source_load(cm_fx6_splash_locations, + ARRAY_SIZE(cm_fx6_splash_locations)); } #endif
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 8143c05..c4ea8ea 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -19,6 +19,7 @@ #include <i2c.h> #include <usb.h> #include <mmc.h> +#include <splash.h> #include <twl4030.h> #include <linux/compiler.h>
@@ -69,8 +70,8 @@ struct splash_location splash_locations[] = {
int splash_screen_prepare(void) { - return cl_splash_screen_prepare(splash_locations, - ARRAY_SIZE(splash_locations)); + return splash_source_load(splash_locations, + ARRAY_SIZE(splash_locations)); }
/* diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile index dbf0009..286f327 100644 --- a/board/compulab/common/Makefile +++ b/board/compulab/common/Makefile @@ -9,5 +9,4 @@ obj-y += common.o obj-$(CONFIG_SYS_I2C) += eeprom.o obj-$(CONFIG_LCD) += omap3_display.o -obj-$(CONFIG_SPLASH_SCREEN) += splash.o obj-$(CONFIG_SMC911X) += omap3_smc911x.o diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index b992965..8f38b79 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -24,27 +24,6 @@ static inline int cl_usb_hub_init(int gpio, const char *label) static inline void cl_usb_hub_deinit(int gpio) {} #endif /* CONFIG_CMD_USB */
-enum splash_storage { - SPLASH_STORAGE_NAND, - SPLASH_STORAGE_SF, -}; - -struct splash_location { - char *name; - enum splash_storage storage; - u32 offset; /* offset from start of storage */ -}; - -#ifdef CONFIG_SPLASH_SCREEN -int cl_splash_screen_prepare(struct splash_location *locations, uint size); -#else /* !CONFIG_SPLASH_SCREEN */ -static inline int cl_splash_screen_prepare(struct splash_location *locations, - uint size) -{ - return -ENOSYS; -} -#endif /* CONFIG_SPLASH_SCREEN */ - #ifdef CONFIG_SMC911X int cl_omap3_smc911x_init(int id, int cs, u32 base_addr, int (*reset)(int), int rst_gpio); diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c deleted file mode 100644 index 16c315c..0000000 --- a/board/compulab/common/splash.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il> - * - * Authors: Igor Grinberg grinberg@compulab.co.il - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <common.h> -#include <nand.h> -#include <errno.h> -#include <spi_flash.h> -#include <spi.h> -#include <bmp_layout.h> -#include "common.h" - -DECLARE_GLOBAL_DATA_PTR; - -#ifdef CONFIG_SPI_FLASH -static struct spi_flash *sf; -static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) -{ - if (!sf) { - sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, - CONFIG_SF_DEFAULT_CS, - CONFIG_SF_DEFAULT_SPEED, - CONFIG_SF_DEFAULT_MODE); - if (!sf) - return -ENODEV; - } - - return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr); -} -#else -static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) -{ - debug("%s: sf support not available\n", __func__); - return -ENOSYS; -} -#endif - -#ifdef CONFIG_CMD_NAND -static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) -{ - return nand_read_skip_bad(&nand_info[nand_curr_device], offset, - &read_size, NULL, - nand_info[nand_curr_device].size, - (u_char *)bmp_load_addr); -} -#else -static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) -{ - debug("%s: nand support not available\n", __func__); - return -ENOSYS; -} -#endif - -static int splash_storage_read(struct splash_location *location, - u32 bmp_load_addr, size_t read_size) -{ - u32 offset; - - if (!location) - return -EINVAL; - - offset = location->offset; - switch (location->storage) { - case SPLASH_STORAGE_NAND: - return splash_nand_read(bmp_load_addr, offset, read_size); - case SPLASH_STORAGE_SF: - return splash_sf_read(bmp_load_addr, offset, read_size); - default: - printf("Unknown splash location\n"); - } - - return -EINVAL; -} - -static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr) -{ - struct bmp_header *bmp_hdr; - int res; - size_t bmp_size, bmp_header_size = sizeof(struct bmp_header); - - if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp) - goto splash_address_too_high; - - res = splash_storage_read(location, bmp_load_addr, bmp_header_size); - if (res < 0) - return res; - - bmp_hdr = (struct bmp_header *)bmp_load_addr; - bmp_size = le32_to_cpu(bmp_hdr->file_size); - - if (bmp_load_addr + bmp_size >= gd->start_addr_sp) - goto splash_address_too_high; - - return splash_storage_read(location, bmp_load_addr, bmp_size); - -splash_address_too_high: - printf("Error: splashimage address too high. Data overwrites U-Boot " - "and/or placed beyond DRAM boundaries.\n"); - - return -EFAULT; -} - -/** - * select_splash_location - return the splash location based on board support - * and env variable "splashsource". - * - * @locations: An array of supported splash locations. - * @size: Size of splash_locations array. - * - * @return: If a null set of splash locations is given, or - * splashsource env variable is set to unsupported value - * return NULL. - * If splashsource env variable is not defined - * return the first entry in splash_locations as default. - * If splashsource env variable contains a supported value - * return the location selected by splashsource. - */ -static struct splash_location *select_splash_location( - struct splash_location *locations, uint size) -{ - int i; - char *env_splashsource; - - if (!locations || size == 0) - return NULL; - - env_splashsource = getenv("splashsource"); - if (env_splashsource == NULL) - return &locations[0]; - - for (i = 0; i < size; i++) { - if (!strcmp(locations[i].name, env_splashsource)) - return &locations[i]; - } - - printf("splashsource env variable set to unsupported value\n"); - return NULL; -} - -int cl_splash_screen_prepare(struct splash_location *locations, uint size) -{ - struct splash_location *splash_location; - char *env_splashimage_value; - u32 bmp_load_addr; - - env_splashimage_value = getenv("splashimage"); - if (env_splashimage_value == NULL) - return -ENOENT; - - bmp_load_addr = simple_strtoul(env_splashimage_value, 0, 16); - if (bmp_load_addr == 0) { - printf("Error: bad splashimage address specified\n"); - return -EFAULT; - } - - splash_location = select_splash_location(locations, size); - if (!splash_location) - return -EINVAL; - - return splash_load_raw(splash_location, bmp_load_addr); -} diff --git a/common/Makefile b/common/Makefile index c668a2f..e162847 100644 --- a/common/Makefile +++ b/common/Makefile @@ -196,6 +196,7 @@ obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o obj-$(CONFIG_I2C_EDID) += edid.o obj-$(CONFIG_KALLSYMS) += kallsyms.o obj-y += splash.o +obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o obj-$(CONFIG_LCD) += lcd.o obj-$(CONFIG_LYNXKDI) += lynxkdi.o obj-$(CONFIG_MENU) += menu.o diff --git a/common/splash_source.c b/common/splash_source.c new file mode 100644 index 0000000..d1bb5a4 --- /dev/null +++ b/common/splash_source.c @@ -0,0 +1,176 @@ +/* + * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il> + * + * Authors: Igor Grinberg grinberg@compulab.co.il + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <nand.h> +#include <errno.h> +#include <splash.h> +#include <spi_flash.h> +#include <spi.h> +#include <bmp_layout.h> + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_SPI_FLASH +static struct spi_flash *sf; +static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + if (!sf) { + sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, + CONFIG_SF_DEFAULT_CS, + CONFIG_SF_DEFAULT_SPEED, + CONFIG_SF_DEFAULT_MODE); + if (!sf) + return -ENODEV; + } + + return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr); +} +#else +static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + debug("%s: sf support not available\n", __func__); + return -ENOSYS; +} +#endif + +#ifdef CONFIG_CMD_NAND +static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + return nand_read_skip_bad(&nand_info[nand_curr_device], offset, + &read_size, NULL, + nand_info[nand_curr_device].size, + (u_char *)bmp_load_addr); +} +#else +static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size) +{ + debug("%s: nand support not available\n", __func__); + return -ENOSYS; +} +#endif + +static int splash_storage_read(struct splash_location *location, + u32 bmp_load_addr, size_t read_size) +{ + u32 offset; + + if (!location) + return -EINVAL; + + offset = location->offset; + switch (location->storage) { + case SPLASH_STORAGE_NAND: + return splash_nand_read(bmp_load_addr, offset, read_size); + case SPLASH_STORAGE_SF: + return splash_sf_read(bmp_load_addr, offset, read_size); + default: + printf("Unknown splash location\n"); + } + + return -EINVAL; +} + +static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr) +{ + struct bmp_header *bmp_hdr; + int res; + size_t bmp_size, bmp_header_size = sizeof(struct bmp_header); + + if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp) + goto splash_address_too_high; + + res = splash_storage_read(location, bmp_load_addr, bmp_header_size); + if (res < 0) + return res; + + bmp_hdr = (struct bmp_header *)bmp_load_addr; + bmp_size = le32_to_cpu(bmp_hdr->file_size); + + if (bmp_load_addr + bmp_size >= gd->start_addr_sp) + goto splash_address_too_high; + + return splash_storage_read(location, bmp_load_addr, bmp_size); + +splash_address_too_high: + printf("Error: splashimage address too high. Data overwrites U-Boot and/or placed beyond DRAM boundaries.\n"); + + return -EFAULT; +} + +/** + * select_splash_location - return the splash location based on board support + * and env variable "splashsource". + * + * @locations: An array of supported splash locations. + * @size: Size of splash_locations array. + * + * @return: If a null set of splash locations is given, or + * splashsource env variable is set to unsupported value + * return NULL. + * If splashsource env variable is not defined + * return the first entry in splash_locations as default. + * If splashsource env variable contains a supported value + * return the location selected by splashsource. + */ +static struct splash_location *select_splash_location( + struct splash_location *locations, uint size) +{ + int i; + char *env_splashsource; + + if (!locations || size == 0) + return NULL; + + env_splashsource = getenv("splashsource"); + if (env_splashsource == NULL) + return &locations[0]; + + for (i = 0; i < size; i++) { + if (!strcmp(locations[i].name, env_splashsource)) + return &locations[i]; + } + + printf("splashsource env variable set to unsupported value\n"); + return NULL; +} + +/** + * splash_source_load - load splash image from a supported location. + * + * Select a splash image location based on the value of splashsource environment + * variable and the board supported splash source locations, and load a + * splashimage to the address pointed to by splashimage environment variable. + * + * @locations: An array of supported splash locations. + * @size: Size of splash_locations array. + * + * @return: 0 on success, negative value on failure. + */ +int splash_source_load(struct splash_location *locations, uint size) +{ + struct splash_location *splash_location; + char *env_splashimage_value; + u32 bmp_load_addr; + + env_splashimage_value = getenv("splashimage"); + if (env_splashimage_value == NULL) + return -ENOENT; + + bmp_load_addr = simple_strtoul(env_splashimage_value, 0, 16); + if (bmp_load_addr == 0) { + printf("Error: bad splashimage address specified\n"); + return -EFAULT; + } + + splash_location = select_splash_location(locations, size); + if (!splash_location) + return -EINVAL; + + return splash_load_raw(splash_location, bmp_load_addr); +} diff --git a/doc/README.splashprepare b/doc/README.splashprepare index 61b4ec5..a0f0f3c 100644 --- a/doc/README.splashprepare +++ b/doc/README.splashprepare @@ -6,3 +6,16 @@ common/splash.c. It is called as part of the splash screen display sequence. It gives the board an opportunity to prepare the splash image data before it is processed and sent to the frame buffer by U-Boot. Define your own version to use this feature. + +CONFIG_SPLASH_SOURCE + +Use the splash_source.c library. This library provides facilities to declare +board specific splash image locations, routines for loading splash image from +supported locations, and a way of controlling the selected splash location +using the "splashsource" environment variable. + +splashsource works as follows: +- If splashsource is set to a supported location name as defined by board code, + use that splash location. +- If splashsource is undefined, use the first splash location as default. +- If splashsource is set to an unsupported value, do not load a splash screen. diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index b92ba97..1f64495 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -313,6 +313,7 @@ #define CONFIG_VIDEO_SW_CURSOR
#define CONFIG_SPLASH_SCREEN +#define CONFIG_SPLASH_SOURCE #define CONFIG_CMD_BMP #define CONFIG_VIDEO_BMP_RLE8
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h index 9767512..b2a9f35 100644 --- a/include/configs/cm_t35.h +++ b/include/configs/cm_t35.h @@ -310,6 +310,7 @@
#define CONFIG_LCD #define CONFIG_SPLASH_SCREEN +#define CONFIG_SPLASH_SOURCE #define CONFIG_CMD_BMP #define CONFIG_BMP_16BPP #define CONFIG_SCF0403_LCD diff --git a/include/splash.h b/include/splash.h index 89ee7b2..a60e895 100644 --- a/include/splash.h +++ b/include/splash.h @@ -22,7 +22,18 @@ #ifndef _SPLASH_H_ #define _SPLASH_H_
+enum splash_storage { + SPLASH_STORAGE_NAND, + SPLASH_STORAGE_SF, +};
+struct splash_location { + char *name; + enum splash_storage storage; + u32 offset; /* offset from start of storage */ +}; + +int splash_source_load(struct splash_location *locations, uint size); int splash_screen_prepare(void);
#ifdef CONFIG_SPLASH_SCREEN_ALIGN

On Wed, Jan 14, 2015 at 10:42:54AM +0200, Nikita Kiryanov wrote:
Move board/compulab/common/splash.c code to common/splash_source.c to make it available for everybody. This move renames cl_splash_screen_prepare() to splash_source_load(), and the compilation of this code is conditional on CONFIG_SPLASH_SOURCE.
splash_source features:
- Provide a standardized way for declaring board specific splash screen locations
- Provide existing routines for auto loading the splash image from the locations as declared by the board
- Introduce the "splashsource" environment variable, which makes it possible to select the splash image source.
cm-t35 and cm-fx6 are updated to use the modified version.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Tom Rini trini@ti.com Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de
Reviewed-by: Tom Rini trini@ti.com

On 01/14/15 10:42, Nikita Kiryanov wrote:
Move board/compulab/common/splash.c code to common/splash_source.c to make it available for everybody. This move renames cl_splash_screen_prepare() to splash_source_load(), and the compilation of this code is conditional on CONFIG_SPLASH_SOURCE.
splash_source features:
- Provide a standardized way for declaring board specific splash screen locations
- Provide existing routines for auto loading the splash image from the locations as declared by the board
- Introduce the "splashsource" environment variable, which makes it possible to select the splash image source.
cm-t35 and cm-fx6 are updated to use the modified version.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Tom Rini trini@ti.com Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de
Acked-by: Igor Grinberg grinberg@compulab.co.il

On 14/01/2015 09:42, Nikita Kiryanov wrote:
Move board/compulab/common/splash.c code to common/splash_source.c to make it available for everybody. This move renames cl_splash_screen_prepare() to splash_source_load(), and the compilation of this code is conditional on CONFIG_SPLASH_SOURCE.
splash_source features:
- Provide a standardized way for declaring board specific splash screen locations
- Provide existing routines for auto loading the splash image from the locations as declared by the board
- Introduce the "splashsource" environment variable, which makes it possible to select the splash image source.
cm-t35 and cm-fx6 are updated to use the modified version.
Signed-off-by: Nikita Kiryanov nikita@compulab.co.il Cc: Stefano Babic sbabic@denx.de Cc: Tom Rini trini@ti.com Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

On Wed, Jan 14, 2015 at 10:42:40AM +0200, Nikita Kiryanov wrote:
This series consists of updates for cm-fx6. Some of these updates (specifically: compulab: splash: use errno values compulab: splash: refactor splash.c compulab: splash: support multiple splash sources compulab: splash: support loading splash from sf) produce an end result which is not really compulab specific and could be useful for other boards as well, so as a last step in the series this code is converted to common code (common: convert compulab splash load code to common code).
The new feature: CONFIG_SPLASH_SOURCE This user option will enable splash_source.c, a module which implements a standard way for boards to define a collection of splash screen locations, as well as routines for loading the splash image into memory.
When invoked using splash_source_load(locations, size), the module will consult the environment variable "splashsource" and compare its value with the splash location names as provided by board code. If there's a match, that splash location is used. If there's no mach, no splash image will be loaded. If splashsource is left undefined, the first splash location is used as default.
Cc: Stefano Babic sbabic@denx.de Cc: Igor Grinberg grinberg@compulab.co.il Cc: Anatolij Gustschin agust@denx.de
FWIW, I'm fine with this coming either via the imx tree or the video tree, whichever you agree to, Stefano and Anatolij, assuming you're both fine with the code of course.

Hi Nikita,
On 14 January 2015 at 01:42, Nikita Kiryanov nikita@compulab.co.il wrote:
This series consists of updates for cm-fx6. Some of these updates (specifically: compulab: splash: use errno values compulab: splash: refactor splash.c compulab: splash: support multiple splash sources compulab: splash: support loading splash from sf) produce an end result which is not really compulab specific and could be useful for other boards as well, so as a last step in the series this code is converted to common code (common: convert compulab splash load code to common code).
The new feature: CONFIG_SPLASH_SOURCE This user option will enable splash_source.c, a module which implements a standard way for boards to define a collection of splash screen locations, as well as routines for loading the splash image into memory.
When invoked using splash_source_load(locations, size), the module will consult the environment variable "splashsource" and compare its value with the splash location names as provided by board code. If there's a match, that splash location is used. If there's no mach, no splash image will be loaded. If splashsource is left undefined, the first splash location is used as default.
Are you planning to work on joining up video and lcd beyond this series?
Regards, Simon

Hi Simon,
On 01/15/2015 12:48 AM, Simon Glass wrote:
Hi Nikita,
On 14 January 2015 at 01:42, Nikita Kiryanov nikita@compulab.co.il wrote:
This series consists of updates for cm-fx6. Some of these updates (specifically: compulab: splash: use errno values compulab: splash: refactor splash.c compulab: splash: support multiple splash sources compulab: splash: support loading splash from sf) produce an end result which is not really compulab specific and could be useful for other boards as well, so as a last step in the series this code is converted to common code (common: convert compulab splash load code to common code).
The new feature: CONFIG_SPLASH_SOURCE This user option will enable splash_source.c, a module which implements a standard way for boards to define a collection of splash screen locations, as well as routines for loading the splash image into memory.
When invoked using splash_source_load(locations, size), the module will consult the environment variable "splashsource" and compare its value with the splash location names as provided by board code. If there's a match, that splash location is used. If there's no mach, no splash image will be loaded. If splashsource is left undefined, the first splash location is used as default.
Are you planning to work on joining up video and lcd beyond this series?
Yes. I already started working on the next step.
Regards, Simon
participants (6)
-
Igor Grinberg
-
Nikita Kiryanov
-
Simon Glass
-
Soeren Moch
-
Stefano Babic
-
Tom Rini