From ebc4ef61d76fc182773fe225151adc9b913c62eb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 30 Nov 2016 15:30:50 -0700 Subject: spl: Add a name to the SPL load-image methods It 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()). Signed-off-by: Simon Glass --- 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 +- 11 files changed, 18 insertions(+), 16 deletions(-) (limited to 'common') diff --git a/common/spl/spl.c b/common/spl/spl.c index 9bcbd09ff38..30b4c50251c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -221,10 +221,10 @@ static int spl_ram_load_image(struct spl_image_info *spl_image, return 0; } #if defined(CONFIG_SPL_RAM_DEVICE) -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); #endif #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 diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 32d7c2a84b4..85e3de8f230 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -355,6 +355,6 @@ 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); diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index d1abda6e4ce..cd39f9be9d3 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -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); diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index f4b4bc48339..0fba0172ea4 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -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 diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c index 6bfa399bace..d07ca843824 100644 --- a/common/spl/spl_nor.c +++ b/common/spl/spl_nor.c @@ -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); diff --git a/common/spl/spl_onenand.c b/common/spl/spl_onenand.c index f076e2c7c88..fc98e9cbe58 100644 --- a/common/spl/spl_onenand.c +++ b/common/spl/spl_onenand.c @@ -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); diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index a3c07cd9cee..5476206131d 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -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); diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 78b8cd16bb8..cd1d6b285ef 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -125,4 +125,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); diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c index c03910bb408..24633f4766e 100644 --- a/common/spl/spl_ubi.c +++ b/common/spl/spl_ubi.c @@ -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); diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c index e37966ed6ce..567a4505056 100644 --- a/common/spl/spl_usb.c +++ b/common/spl/spl_usb.c @@ -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); diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c index 957894dccbf..ff8085b795e 100644 --- a/common/spl/spl_ymodem.c +++ b/common/spl/spl_ymodem.c @@ -132,4 +132,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); -- cgit v1.2.3