123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- #ifndef _SPL_H_
- #define _SPL_H_
- #include <linux/compiler.h>
- #include <asm/spl.h>
- #define UBOOT_NOT_LOADED_FROM_SPL 0x13578642
- #define MMCSD_MODE_UNDEFINED 0
- #define MMCSD_MODE_RAW 1
- #define MMCSD_MODE_FS 2
- #define MMCSD_MODE_EMMCBOOT 3
- struct spl_image_info {
- const char *name;
- u8 os;
- u32 load_addr;
- u32 entry_point;
- u32 size;
- u32 flags;
- };
- struct spl_load_info {
- void *dev;
- void *priv;
- int bl_len;
- const char *filename;
- ulong (*read)(struct spl_load_info *load, ulong sector, ulong count,
- void *buf);
- };
- int spl_load_simple_fit(struct spl_image_info *spl_image,
- struct spl_load_info *info, ulong sector, void *fdt);
- #define SPL_COPY_PAYLOAD_ONLY 1
- void preloader_console_init(void);
- u32 spl_boot_device(void);
- u32 spl_boot_mode(const u32 boot_device);
- void spl_set_header_raw_uboot(struct spl_image_info *spl_image);
- int spl_parse_image_header(struct spl_image_info *spl_image,
- const struct image_header *header);
- void spl_board_prepare_for_linux(void);
- void spl_board_prepare_for_boot(void);
- int spl_board_ubi_load_image(u32 boot_device);
- void __noreturn jump_to_image_linux(struct spl_image_info *spl_image,
- void *arg);
- int spl_start_uboot(void);
- void spl_display_print(void);
- struct spl_boot_device {
- uint boot_device;
- const char *boot_device_name;
- };
- struct spl_image_loader {
- #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- const char *name;
- #endif
- uint boot_device;
-
- int (*load_image)(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev);
- };
- #define SPL_LOAD_IMAGE(__name) \
- ll_entry_declare(struct spl_image_loader, __name, spl_image_loader)
- #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
- int spl_load_image_fat(struct spl_image_info *spl_image,
- struct blk_desc *block_dev, int partition,
- const char *filename);
- int spl_load_image_fat_os(struct spl_image_info *spl_image,
- struct blk_desc *block_dev, int partition);
- void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
- int spl_load_image_ext(struct spl_image_info *spl_image,
- struct blk_desc *block_dev, int partition,
- const char *filename);
- int spl_load_image_ext_os(struct spl_image_info *spl_image,
- struct blk_desc *block_dev, int partition);
- int spl_early_init(void);
- int spl_init(void);
- #ifdef CONFIG_SPL_BOARD_INIT
- void spl_board_init(void);
- #endif
- bool spl_was_boot_source(void);
- int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr);
- int spl_mmc_load_image(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev);
- #endif
|