summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-09-24 18:19:57 -0600
committerTom Rini <trini@konsulko.com>2016-10-06 14:53:36 -0400
commitecdfd69a4be55363589e8185ff151b02e6c36cfa (patch)
treeb625ae78bfe96236f62320061a1a667f4d8e446d /include
parenta807ab33035fe2e9b63aac2e7475525ca8d90adc (diff)
downloadu-boot-imx-ecdfd69a4be55363589e8185ff151b02e6c36cfa.zip
u-boot-imx-ecdfd69a4be55363589e8185ff151b02e6c36cfa.tar.gz
u-boot-imx-ecdfd69a4be55363589e8185ff151b02e6c36cfa.tar.bz2
spl: Convert boot_device into a struct
At present some spl_xxx_load_image() functions take a parameter and some don't. Of those that do, most take an integer but one takes a string. Convert this parameter into a struct so that we can pass all functions the same thing. This will allow us to use a common function signature. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/spl.h40
1 files changed, 29 insertions, 11 deletions
diff --git a/include/spl.h b/include/spl.h
index f700955..4435089 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -131,35 +131,53 @@ int spl_start_uboot(void);
*/
void spl_display_print(void);
+/**
+ * struct spl_boot_device - Describes a boot device used by SPL
+ *
+ * @boot_device: A number indicating the BOOT_DEVICE type. There are various
+ * BOOT_DEVICE... #defines and enums in U-Boot and they are not consistently
+ * numbered.
+ * @boot_device_name: Named boot device, or NULL if none.
+ *
+ * Note: Additional fields can be added here, bearing in mind that SPL is
+ * size-sensitive and common fields will be present on all boards. This
+ * struct can also be used to return additional information about the load
+ * process if that becomes useful.
+ */
+struct spl_boot_device {
+ uint boot_device;
+ const char *boot_device_name;
+};
+
/* NAND SPL functions */
-int spl_nand_load_image(void);
+int spl_nand_load_image(struct spl_boot_device *bootdev);
/* OneNAND SPL functions */
-int spl_onenand_load_image(void);
+int spl_onenand_load_image(struct spl_boot_device *bootdev);
/* NOR SPL functions */
-int spl_nor_load_image(void);
+int spl_nor_load_image(struct spl_boot_device *bootdev);
/* UBI SPL functions */
-int spl_ubi_load_image(u32 boot_device);
+int spl_ubi_load_image(struct spl_boot_device *bootdev);
/* MMC SPL functions */
-int spl_mmc_load_image(u32 boot_device);
+int spl_mmc_load_image(struct spl_boot_device *bootdev);
/* YMODEM SPL functions */
-int spl_ymodem_load_image(void);
+int spl_ymodem_load_image(struct spl_boot_device *bootdev);
/* SPI SPL functions */
-int spl_spi_load_image(void);
+int spl_spi_load_image(struct spl_boot_device *bootdev);
/* Ethernet SPL functions */
-int spl_net_load_image(const char *device);
+int spl_net_load_image(struct spl_boot_device *bootdev);
/* USB SPL functions */
-int spl_usb_load_image(void);
+int spl_usb_load_image(struct spl_boot_device *bootdev);
/* SATA SPL functions */
-int spl_sata_load_image(void);
+int spl_sata_load_image(struct spl_boot_device *bootdev);
/* SPL FAT image functions */
int spl_load_image_fat(struct blk_desc *block_dev, int partition,
@@ -214,6 +232,6 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr);
*
* @return 0 on success, negative errno value on failure.
*/
-int spl_board_load_image(void);
+int spl_board_load_image(struct spl_boot_device *bootdev);
#endif