spl: Move image loader names into the linker list
Subsystems (5)
cover spl: Move image loader names into the linker list
At present we have a linker list for all the image-loader methods but announce_boot_device() uses its own switch() statement with the names of each method. We may as well combine the name into the linker list.
The names are only needed if libcommon support is enabled, since printf() is used to display then.
This series performs this adjustment, by adding the names and then converting the generic SPL code over to use them. This allows the board-specific spl_board_announce_boot_device() functions to be dropped as well.
Simon Glass (8):
spl: Use a single underscore in the SPL_LOAD_IMAGE_METHOD() macro
spl: Add a name to the SPL load-image methods
spl: Move the loading code into its own function
spl: Pass the loader into spl_load_image()
spl: Drop announce_boot_device()
spl: sunxi: Drop spl_board_announce_boot_device()
spl: uniphier: Drop spl_board_announce_boot_device()
spl: sandbox: Drop spl_board_announce_boot_device()
arch/arm/mach-sunxi/board.c | 11 +-- arch/arm/mach-uniphier/boot-mode/spl_board.c | 7 +- arch/sandbox/cpu/spl.c | 19 +--- common/spl/spl.c | 125 ++++++--------------------- common/spl/spl_mmc.c | 6 +- common/spl/spl_nand.c | 2 +- common/spl/spl_net.c | 5 +- common/spl/spl_nor.c | 2 +- common/spl/spl_onenand.c | 3 +- common/spl/spl_sata.c | 2 +- common/spl/spl_spi.c | 2 +- common/spl/spl_ubi.c | 4 +- common/spl/spl_usb.c | 2 +- common/spl/spl_ymodem.c | 2 +- drivers/mtd/spi/sunxi_spi_spl.c | 2 +- include/spl.h | 27 ++++-- 16 files changed, 70 insertions(+), 151 deletions(-)
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 1/8 spl: Use a single underscore in the SPL_LOAD_IMAGE_METHOD() macro
A double underscore is normally reserved for compiler predefines. Use a single underscore instead.
---
include/spl.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
include/spl.h +7 -7
@@ -172,15 +172,15 @@ struct spl_image_loader { ll_entry_declare(struct spl_image_loader, __name, spl_image_loader)/* -* __priority is the priority of this method, 0 meaning it will be the top +* _priority is the priority of this method, 0 meaning it will be the top * choice for this device, 9 meaning it is the bottom choice. -* __boot_device is the BOOT_DEVICE_... value -* __method is the load_image function to call +* _boot_device is the BOOT_DEVICE_... value +* _method is the load_image function to call */ -#define SPL_LOAD_IMAGE_METHOD (__priority, __boot_device, __method) \ - SPL_LOAD_IMAGE(__method ## __priority ## __boot_device) = { \ - .boot_device = __boot_device, \ - .load_image = __method, \ +#define SPL_LOAD_IMAGE_METHOD (_priority, _boot_device, _method) \ + SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \ + .boot_device = _boot_device, \ + .load_image = _method, \ }/* SPL FAT image functions */
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 2/8 spl: Add a name to the SPL load-image methods
In reply to Simon GlassIt is useful to name each method so that we can print out this name when using the method. Currently this happens using a separate function. In preparation for unifying this, add a name to each method.
The name is only available if we have libcommon support (i.e can use printf()).
---
arch/arm/mach-sunxi/board.c | 2 +- arch/arm/mach-uniphier/boot-mode/spl_board.c | 2 +- arch/sandbox/cpu/spl.c | 2 +- common/spl/spl.c | 4 ++-- common/spl/spl_mmc.c | 6 +++--- common/spl/spl_nand.c | 2 +- common/spl/spl_net.c | 5 +++-- common/spl/spl_nor.c | 2 +- common/spl/spl_onenand.c | 3 ++- common/spl/spl_sata.c | 2 +- common/spl/spl_spi.c | 2 +- common/spl/spl_ubi.c | 4 ++-- common/spl/spl_usb.c | 2 +- common/spl/spl_ymodem.c | 2 +- drivers/mtd/spi/sunxi_spi_spl.c | 2 +- include/spl.h | 15 ++++++++++++++- 16 files changed, 36 insertions(+), 21 deletions(-)
arch/arm/mach-sunxi/board.c +1 -1
@@ -142,7 +142,7 @@ static int spl_board_load_image(struct spl_image_info *spl_image, return 0; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_BOARD , spl_board_load_image); +SPL_LOAD_IMAGE_METHOD ("FEL" ,0 ,BOOT_DEVICE_BOARD , spl_board_load_image);#endif void s_init (void )
arch/arm/mach-uniphier/boot-mode/spl_board.c +1 -1
@@ -127,4 +127,4 @@ static int spl_board_load_image(struct spl_image_info *spl_image,return 0 ; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_BOARD , spl_board_load_image); +SPL_LOAD_IMAGE_METHOD ("eMMC" ,0 ,BOOT_DEVICE_BOARD , spl_board_load_image);
arch/sandbox/cpu/spl.c +1 -1
@@ -51,7 +51,7 @@ static int spl_board_load_image(struct spl_image_info *spl_image,/* Hopefully this will not return */ return os_spl_to_uboot (fname); } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_BOARD , spl_board_load_image); +SPL_LOAD_IMAGE_METHOD ("sandbox" ,0 ,BOOT_DEVICE_BOARD , spl_board_load_image);void spl_board_init (void ) {
common/spl/spl.c +2 -2
@@ -220,9 +220,9 @@ static int spl_ram_load_image(struct spl_image_info *spl_image, return 0; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_RAM , spl_ram_load_image); +SPL_LOAD_IMAGE_METHOD ("RAM" ,0 ,BOOT_DEVICE_RAM , spl_ram_load_image);#if defined(CONFIG_SPL_DFU_SUPPORT ) -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_DFU , spl_ram_load_image); +SPL_LOAD_IMAGE_METHOD ("USB DFU" ,0 ,BOOT_DEVICE_DFU , spl_ram_load_image);#endif #endif
common/spl/spl_mmc.c +3 -3
@@ -352,6 +352,6 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,return err; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_MMC1 , spl_mmc_load_image); -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_MMC2 , spl_mmc_load_image); -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_MMC2_2 , spl_mmc_load_image); +SPL_LOAD_IMAGE_METHOD ("MMC1" ,0 ,BOOT_DEVICE_MMC1 , spl_mmc_load_image); +SPL_LOAD_IMAGE_METHOD ("MMC2" ,0 ,BOOT_DEVICE_MMC2 , spl_mmc_load_image); +SPL_LOAD_IMAGE_METHOD ("MMC2_2" ,0 ,BOOT_DEVICE_MMC2_2 , spl_mmc_load_image);
common/spl/spl_nand.c +1 -1
@@ -151,4 +151,4 @@ static int spl_nand_load_image(struct spl_image_info *spl_image, }#endif /* Use priorty 1 so that Ubi can override this */ -SPL_LOAD_IMAGE_METHOD (1 ,BOOT_DEVICE_NAND , spl_nand_load_image); +SPL_LOAD_IMAGE_METHOD ("NAND" ,1 ,BOOT_DEVICE_NAND , spl_nand_load_image);
common/spl/spl_net.c +3 -2
@@ -51,7 +51,8 @@ int spl_net_load_image_cpgmac(struct spl_image_info *spl_image, return spl_net_load_image(spl_image, bootdev); } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_CPGMAC , spl_net_load_image_cpgmac); +SPL_LOAD_IMAGE_METHOD ("eth device" ,0 ,BOOT_DEVICE_CPGMAC , + spl_net_load_image_cpgmac);#endif #ifdef CONFIG_SPL_USBETH_SUPPORT
@@ -62,5 +63,5 @@ int spl_net_load_image_usb(struct spl_image_info *spl_image, return spl_net_load_image(spl_image, bootdev); } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_USBETH , spl_net_load_image_usb); +SPL_LOAD_IMAGE_METHOD ("USB eth" ,0 ,BOOT_DEVICE_USBETH , spl_net_load_image_usb);#endif
common/spl/spl_nor.c +1 -1
@@ -71,4 +71,4 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,return 0 ; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_NOR , spl_nor_load_image); +SPL_LOAD_IMAGE_METHOD ("NOR" ,0 ,BOOT_DEVICE_NOR , spl_nor_load_image);
common/spl/spl_onenand.c +2 -1
@@ -36,4 +36,5 @@ static int spl_onenand_load_image(struct spl_image_info *spl_image,return 0 ; }/* Use priorty 1 so that Ubi can override this */ -SPL_LOAD_IMAGE_METHOD (1 ,BOOT_DEVICE_ONENAND , spl_onenand_load_image); +SPL_LOAD_IMAGE_METHOD ("OneNAND" ,1 ,BOOT_DEVICE_ONENAND , + spl_onenand_load_image);
common/spl/spl_sata.c +1 -1
@@ -57,4 +57,4 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,return 0 ; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_SATA , spl_sata_load_image); +SPL_LOAD_IMAGE_METHOD ("SATA" ,0 ,BOOT_DEVICE_SATA , spl_sata_load_image);
common/spl/spl_spi.c +1 -1
@@ -124,4 +124,4 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,return err; }/* Use priorty 1 so that boards can override this */ -SPL_LOAD_IMAGE_METHOD (1 ,BOOT_DEVICE_SPI , spl_spi_load_image); +SPL_LOAD_IMAGE_METHOD ("SPI" ,1 ,BOOT_DEVICE_SPI , spl_spi_load_image);
common/spl/spl_ubi.c +2 -2
@@ -78,5 +78,5 @@ out:return ret; }/* Use priorty 0 so that Ubi will override NAND and ONENAND methods */ -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_NAND , spl_ubi_load_image); -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_ONENAND , spl_ubi_load_image); +SPL_LOAD_IMAGE_METHOD ("NAND" ,0 ,BOOT_DEVICE_NAND , spl_ubi_load_image); +SPL_LOAD_IMAGE_METHOD ("OneNAND" ,0 ,BOOT_DEVICE_ONENAND , spl_ubi_load_image);
common/spl/spl_usb.c +1 -1
@@ -65,4 +65,4 @@ static int spl_usb_load_image(struct spl_image_info *spl_image,return 0 ; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_USB , spl_usb_load_image); +SPL_LOAD_IMAGE_METHOD ("USB" ,0 ,BOOT_DEVICE_USB , spl_usb_load_image);
common/spl/spl_ymodem.c +1 -1
@@ -133,4 +133,4 @@ end_stream:printf ("Loaded %d bytes\n" , size);return 0 ; } -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_UART , spl_ymodem_load_image); +SPL_LOAD_IMAGE_METHOD ("UART" ,0 ,BOOT_DEVICE_UART , spl_ymodem_load_image);
drivers/mtd/spi/sunxi_spi_spl.c +1 -1
@@ -283,4 +283,4 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,return 0 ; }/* Use priorty 0 to override the default if it happens to be linked in */ -SPL_LOAD_IMAGE_METHOD (0 ,BOOT_DEVICE_SPI , spl_spi_load_image); +SPL_LOAD_IMAGE_METHOD("sunxi SPI" 0, BOOT_DEVICE_SPI, spl_spi_load_image);
include/spl.h +14 -1
@@ -152,10 +152,14 @@ struct spl_boot_device {/** * Holds information about a way of loading an SPL image * +* @name: User-friendly name for this method (e.g. "MMC") * @boot_device: Boot device that this loader supports * @load_image: Function to call to load image */ struct spl_image_loader { +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT +const char *name; +#endif uint boot_device;/** * load_image() - Load an SPL image
@@ -177,11 +181,20 @@ struct spl_image_loader {* _boot_device is the BOOT_DEVICE_... value * _method is the load_image function to call */ -#define SPL_LOAD_IMAGE_METHOD (_priority, _boot_device, _method) \ +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT +#define SPL_LOAD_IMAGE_METHOD (_name, _priority, _boot_device, _method) \ SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \ + .name = _name, \ .boot_device = _boot_device, \ .load_image = _method, \ } +#else +#define SPL_LOAD_IMAGE_METHOD (_name, _priority, _boot_device, _method) \ + SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \ + .boot_device = _boot_device, \ + .load_image = _method, \ + } +#endif /* SPL FAT image functions */ int spl_load_image_fat(struct spl_image_info *spl_image,
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 3/8 spl: Move the loading code into its own function
In reply to Simon GlassCreate a boot_from_devices() function to handle trying each device. This helps to reduce the size of the already-large board_init_r() function.
---
common/spl/spl.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-)
common/spl/spl.c +21 -12
@@ -372,12 +372,29 @@ static int spl_load_image(struct spl_image_info *spl_image, u32 boot_device) bootdev.boot_device = boot_device; bootdev.boot_device_name =NULL ; -if (loader) -return loader->load_image (spl_image, &bootdev); +return loader->load_image (spl_image, &bootdev); +} + +static int boot_from_devices (struct spl_image_info *spl_image, +u32 spl_boot_list[]) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (spl_boot_list) && + spl_boot_list[i] !=BOOT_DEVICE_NONE ; i++) { +struct spl_image_loader *loader; + +announce_boot_device (spl_boot_list[i]); + loader =spl_ll_find_loader (spl_boot_list[i]);#if defined(CONFIG_SPL_SERIAL_SUPPORT ) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT ) -puts ("SPL: Unsupported Boot Device!\n" ); +if (!loader) +puts ("SPL: Unsupported Boot Device!\n" );#endif +if (loader && !spl_load_image (spl_image, spl_boot_list[i])) +return 0 ; + } +return -ENODEV ; }
@@ -391,7 +408,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2) BOOT_DEVICE_NONE, };struct spl_image_info spl_image; -int i;debug (">>spl:board_init_r()\n" );
@@ -418,15 +434,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)memset (&spl_image,'\0' ,sizeof (spl_image));board_boot_order (spl_boot_list); -for (i =0 ; i <ARRAY_SIZE (spl_boot_list) && - spl_boot_list[i] !=BOOT_DEVICE_NONE ; i++) { -announce_boot_device (spl_boot_list[i]); -if (!spl_load_image (&spl_image, spl_boot_list[i])) -break ; - } -if (i ==ARRAY_SIZE (spl_boot_list) || - spl_boot_list[i] ==BOOT_DEVICE_NONE ) { +if (boot_from_devices (&spl_image, spl_boot_list)) {puts ("SPL: failed to boot from all boot devices\n" );hang (); }
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 3/8 spl: Move the loading code into its own function
Hi Simon,
2016-11-18 2:29 GMT+09:00 Simon Glass <[email protected]>:
Quoted 24 lines
Create a
boot_from_devices()function to handle trying each device. This helps to reduce the size of the already-largeboard_init_r()function.Signed-off-by Simon Glass <[email protected]>---
common/spl/spl.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-)common/spl/spl.c +4
-2@@ -372,12 +372,29 @@ static int spl_load_image(struct spl_image_info *spl_image, u32 boot_device) bootdev.boot_device = boot_device; bootdev.boot_device_name =NULL ; -if (loader) -return loader->load_image (spl_image, &bootdev); +return loader->load_image (spl_image, &bootdev); +} + +static int boot_from_devices(struct spl_image_info *spl_image,
common/spl/spl.c static int spl_load_image(struct spl_image_info *spl_image, u32 boot_device) · line 389
Quoted 10 lines
common/spl/spl.c +10
-0+ u32 spl_boot_list[]) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (spl_boot_list) && + spl_boot_list[i] !=BOOT_DEVICE_NONE ; i++) { +struct spl_image_loader *loader; + +announce_boot_device (spl_boot_list[i]); + loader =spl_ll_find_loader (spl_boot_list[i]);
I do not believe ARRAY_SIZE(spl_boot_list) would work in this context.
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH 3/8 spl: Move the loading code into its own function
In reply to Simon GlassQuoted 4 lines · Simon Glass
Create a
boot_from_devices()function to handle trying each device. This helps to reduce the size of the already-largeboard_init_r()function.Signed-off-by Simon Glass <[email protected]>
So with gcc-5.x and later:
+In file included from include/common.h:27:0, + from common/spl/spl.c:9: + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+ ^+common/spl/spl.c:384:18: note: in expansion of macro 'ARRAY_SIZE'
+ for (i = 0; i < ARRAY_SIZE(spl_boot_list) &&
+ ^+common/spl/spl.c:380:13: note: declared here
+ u32 spl_boot_list[])
+ ^w+common/spl/spl.c: In function 'boot_from_devices':w+include/linux/kernel.h:45:30: warning: 'sizeof' on array function parameter 'spl_boot_list' will return size of 'u32 * {aka unsigned int *}' [-Wsizeof-array-argument]
Which I think is what Masahiro was pointing out :) So the rest of the series needs some re-work following that too, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161128/f1a529a8/attachment.sig>
PATCH 3/8 spl: Move the loading code into its own function
Hi Tom,
Quoted 19 lines · Tom Rini
Quoted 4 lines · Simon Glass
Create a
boot_from_devices()function to handle trying each device. This helps to reduce the size of the already-largeboard_init_r()function.Signed-off-by Simon Glass <[email protected]>So with gcc-5.x and later:
(quoted diff) +8
-0+In file included from include/common.h:27:0, + from common/spl/spl.c:9: + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + ^ +common/spl/spl.c:384:18: note: in expansion of macro 'ARRAY_SIZE' + for (i = 0; i < ARRAY_SIZE(spl_boot_list) && + ^ +common/spl/spl.c:380:13: note: declared here + u32 spl_boot_list[]) + ^
w+common/spl/spl.c: In function 'boot_from_devices':w+include/linux/kernel.h:45:30: warning: 'sizeof' on array function parameter 'spl_boot_list' will return size of 'u32 * {aka unsigned int *}' [-Wsizeof-array-argument]
Quoted 2 lines
Which I think is what Masahiro was pointing out :) So the rest of the series needs some re-work following that too, thanks!
Yes indeed, will get to it this week...need to test it properly with a board with multiple loaders.
- Simon
PATCH 4/8 spl: Pass the loader into spl_load_image()
In reply to Simon GlassRather than have this function figure out the correct loader again, pass it in as a parameter.
---
common/spl/spl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
common/spl/spl.c +4 -4
@@ -365,12 +365,12 @@ static struct spl_image_loader *spl_ll_find_loader(uint boot_device)return NULL ; } -static int spl_load_image (struct spl_image_info *spl_image,u32 boot_device) +static int spl_load_image (struct spl_image_info *spl_image, +struct spl_image_loader *loader) {struct spl_boot_device bootdev; -struct spl_image_loader *loader =spl_ll_find_loader (boot_device); - bootdev.boot_device = boot_device; + bootdev.boot_device = loader->boot_device; bootdev.boot_device_name =NULL ;return loader->load_image (spl_image, &bootdev);
@@ -391,7 +391,7 @@ static int boot_from_devices(struct spl_image_info *spl_image,if (!loader)puts ("SPL: Unsupported Boot Device!\n" );#endif -if (loader && !spl_load_image (spl_image, spl_boot_list[i])) +if (loader && !spl_load_image (spl_image, loader))return 0 ; }
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 5/8 spl: Drop announce_boot_device()
In reply to Simon GlassThis task can be handled by inline code now. Drop this function.
---
common/spl/spl.c | 86 ++------------------------------------------------------ 1 file changed, 3 insertions(+), 83 deletions(-)
common/spl/spl.c +3 -83
@@ -267,87 +267,6 @@ __weak void board_boot_order(u32 *spl_boot_list) spl_boot_list[0 ] =spl_boot_device (); } -#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE -__weak void spl_board_announce_boot_device (void ) { } -#endif - -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT -struct boot_device_name { - u32 boot_dev; - const char *name; -}; - -struct boot_device_name boot_name_table[] = { -#ifdef CONFIG_SPL_RAM_DEVICE - { BOOT_DEVICE_RAM, "RAM" }, -#endif -#ifdef CONFIG_SPL_MMC_SUPPORT - { BOOT_DEVICE_MMC1, "MMC1" }, - { BOOT_DEVICE_MMC2, "MMC2" }, - { BOOT_DEVICE_MMC2_2, "MMC2_2" }, -#endif -#ifdef CONFIG_SPL_NAND_SUPPORT - { BOOT_DEVICE_NAND, "NAND" }, -#endif -#ifdef CONFIG_SPL_ONENAND_SUPPORT - { BOOT_DEVICE_ONENAND, "OneNAND" }, -#endif -#ifdef CONFIG_SPL_NOR_SUPPORT - { BOOT_DEVICE_NOR, "NOR" }, -#endif -#ifdef CONFIG_SPL_YMODEM_SUPPORT - { BOOT_DEVICE_UART, "UART" }, -#endif -#if defined(CONFIG_SPL_SPI_SUPPORT) || defined(CONFIG_SPL_SPI_FLASH_SUPPORT) - { BOOT_DEVICE_SPI, "SPI" }, -#endif -#ifdef CONFIG_SPL_ETH_SUPPORT -#ifdef CONFIG_SPL_ETH_DEVICE - { BOOT_DEVICE_CPGMAC, "eth device" }, -#else - { BOOT_DEVICE_CPGMAC, "net" }, -#endif -#endif -#ifdef CONFIG_SPL_USBETH_SUPPORT - { BOOT_DEVICE_USBETH, "USB eth" }, -#endif -#ifdef CONFIG_SPL_USB_SUPPORT - { BOOT_DEVICE_USB, "USB" }, -#endif -#ifdef CONFIG_SPL_DFU_SUPPORT - { BOOT_DEVICE_DFU, "USB DFU" }, -#endif -#ifdef CONFIG_SPL_SATA_SUPPORT - { BOOT_DEVICE_SATA, "SATA" }, -#endif - /* Keep this entry last */ - { BOOT_DEVICE_NONE, "unknown boot device" }, -}; - -static void announce_boot_device(u32 boot_device) -{ - int i; - - puts("Trying to boot from "); - -#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE - if (boot_device == BOOT_DEVICE_BOARD) { - spl_board_announce_boot_device(); - puts("\n"); - return; - } -#endif - for (i = 0; i < ARRAY_SIZE(boot_name_table) - 1; i++) { - if (boot_name_table[i].boot_dev == boot_device) - break; - } - - printf("%s\n", boot_name_table[i].name); -} -#else -static inline void announce_boot_device(u32 boot_device) { } -#endif -static struct spl_image_loader *spl_ll_find_loader (uint boot_device) { struct spl_image_loader *drv =
@@ -385,10 +304,11 @@ static int boot_from_devices(struct spl_image_info *spl_image, spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {struct spl_image_loader *loader; -announce_boot_device (spl_boot_list[i]); loader =spl_ll_find_loader (spl_boot_list[i]);#if defined(CONFIG_SPL_SERIAL_SUPPORT ) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT ) -if (!loader) +if (loader) +printf ("Trying to boot from %s" , loader->name); +else puts ("SPL: Unsupported Boot Device!\n" );#endif if (loader && !spl_load_image (spl_image, loader))
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 6/8 spl: sunxi: Drop spl_board_announce_boot_device()
In reply to Simon GlassThis function is not used anymore. Drop it.
---
arch/arm/mach-sunxi/board.c | 9 --------- 1 file changed, 9 deletions(-)
arch/arm/mach-sunxi/board.c +0 -9
@@ -247,15 +247,6 @@ u32 spl_boot_device(void)return -1 ;/* Never reached */ } -/* -* Properly announce BOOT_DEVICE_BOARD as "FEL". -* Overrides weak function from common/spl/spl.c -*/ -void spl_board_announce_boot_device (void ) -{ -printf ("FEL" ); -} -/* No confirmation data available in SPL yet. Hardcode bootmode */ u32 spl_boot_mode (const u32 boot_device) {
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 7/8 spl: uniphier: Drop spl_board_announce_boot_device()
In reply to Simon GlassThis function is not used anymore. Drop it.
---
arch/arm/mach-uniphier/boot-mode/spl_board.c | 5 ----- 1 file changed, 5 deletions(-)
arch/arm/mach-uniphier/boot-mode/spl_board.c +0 -5
@@ -12,11 +12,6 @@#include "../soc-info.h" -void spl_board_announce_boot_device (void ) -{ -printf ("eMMC" ); -} -struct uniphier_romfunc_table {void *mmc_send_cmd;void *mmc_card_blockaddr;
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH 8/8 spl: sandbox: Drop spl_board_announce_boot_device()
In reply to Simon GlassThis function is not used anymore. Drop it.
---
arch/sandbox/cpu/spl.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
arch/sandbox/cpu/spl.c +3 -14
@@ -25,19 +25,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_BOARD ; } -void spl_board_announce_boot_device (void ) -{ -char fname[256 ]; -int ret; - - ret =os_find_u_boot (fname,sizeof (fname)); -if (ret) { -printf ("(%s not found, error %d)\n" , fname, ret); -return ; - } -printf ("%s\n" , fname); -} -static int spl_board_load_image (struct spl_image_info *spl_image,struct spl_boot_device *bootdev) {
@@ -45,8 +32,10 @@ static int spl_board_load_image(struct spl_image_info *spl_image,int ret; ret =os_find_u_boot (fname,sizeof (fname)); -if (ret) +if (ret) { +printf ("(%s not found, error %d)\n" , fname, ret);return ret; + }/* Hopefully this will not return */ return os_spl_to_uboot (fname);
Signature · 1 line
2.8.0.rc3.226.g39d4020