Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2012 |
| 3 | * Texas Instruments, <www.ti.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _SPL_H_ |
| 8 | #define _SPL_H_ |
| 9 | |
| 10 | /* Platform-specific defines */ |
Tom Rini | 6507f13 | 2012-08-22 15:31:05 -0700 | [diff] [blame] | 11 | #include <linux/compiler.h> |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 12 | #include <asm/spl.h> |
| 13 | |
Dan Murphy | 773b594 | 2014-01-16 11:23:29 -0600 | [diff] [blame] | 14 | |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 15 | /* Boot type */ |
| 16 | #define MMCSD_MODE_UNDEFINED 0 |
| 17 | #define MMCSD_MODE_RAW 1 |
| 18 | #define MMCSD_MODE_FAT 2 |
| 19 | |
| 20 | struct spl_image_info { |
| 21 | const char *name; |
| 22 | u8 os; |
| 23 | u32 load_addr; |
| 24 | u32 entry_point; |
| 25 | u32 size; |
Stefan Roese | 022b497 | 2012-08-27 12:50:58 +0200 | [diff] [blame] | 26 | u32 flags; |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 27 | }; |
| 28 | |
Stefan Roese | 022b497 | 2012-08-27 12:50:58 +0200 | [diff] [blame] | 29 | #define SPL_COPY_PAYLOAD_ONLY 1 |
| 30 | |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 31 | extern struct spl_image_info spl_image; |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 32 | |
| 33 | /* SPL common functions */ |
| 34 | void preloader_console_init(void); |
| 35 | u32 spl_boot_device(void); |
| 36 | u32 spl_boot_mode(void); |
| 37 | void spl_parse_image_header(const struct image_header *header); |
| 38 | void spl_board_prepare_for_linux(void); |
Tom Rini | 6507f13 | 2012-08-22 15:31:05 -0700 | [diff] [blame] | 39 | void __noreturn jump_to_image_linux(void *arg); |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 40 | int spl_start_uboot(void); |
| 41 | void spl_display_print(void); |
| 42 | |
| 43 | /* NAND SPL functions */ |
| 44 | void spl_nand_load_image(void); |
| 45 | |
Enric Balletbo i Serra | 6000992 | 2013-02-07 23:14:48 +0000 | [diff] [blame] | 46 | /* OneNAND SPL functions */ |
| 47 | void spl_onenand_load_image(void); |
| 48 | |
Stefan Roese | 33d3464 | 2012-08-27 12:50:59 +0200 | [diff] [blame] | 49 | /* NOR SPL functions */ |
| 50 | void spl_nor_load_image(void); |
| 51 | |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 52 | /* MMC SPL functions */ |
| 53 | void spl_mmc_load_image(void); |
| 54 | |
| 55 | /* YMODEM SPL functions */ |
| 56 | void spl_ymodem_load_image(void); |
| 57 | |
| 58 | /* SPI SPL functions */ |
Tom Rini | a4cc1c4 | 2012-08-14 14:34:10 -0700 | [diff] [blame] | 59 | void spl_spi_load_image(void); |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 60 | |
Ilya Yanok | 7ac2fe2 | 2012-09-18 00:22:50 +0000 | [diff] [blame] | 61 | /* Ethernet SPL functions */ |
| 62 | void spl_net_load_image(const char *device); |
| 63 | |
Dan Murphy | 8cffe5b | 2014-01-16 11:23:30 -0600 | [diff] [blame] | 64 | /* USB SPL functions */ |
| 65 | void spl_usb_load_image(void); |
| 66 | |
Dan Murphy | 773b594 | 2014-01-16 11:23:29 -0600 | [diff] [blame] | 67 | /* SPL FAT image functions */ |
| 68 | int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename); |
| 69 | int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition); |
| 70 | |
Tom Rini | 47f7bca | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 71 | #ifdef CONFIG_SPL_BOARD_INIT |
| 72 | void spl_board_init(void); |
| 73 | #endif |
| 74 | #endif |