blob: 5e248561f13791ade05d69dea96f5315410cb20c [file] [log] [blame]
Tom Rini47f7bca2012-08-13 12:03:19 -07001/*
2 * (C) Copyright 2012
3 * Texas Instruments, <www.ti.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Tom Rini47f7bca2012-08-13 12:03:19 -07006 */
7#ifndef _SPL_H_
8#define _SPL_H_
9
10/* Platform-specific defines */
Tom Rini6507f132012-08-22 15:31:05 -070011#include <linux/compiler.h>
Tom Rini47f7bca2012-08-13 12:03:19 -070012#include <asm/spl.h>
13
Dan Murphy773b5942014-01-16 11:23:29 -060014
Tom Rini47f7bca2012-08-13 12:03:19 -070015/* Boot type */
16#define MMCSD_MODE_UNDEFINED 0
17#define MMCSD_MODE_RAW 1
18#define MMCSD_MODE_FAT 2
19
20struct spl_image_info {
21 const char *name;
22 u8 os;
23 u32 load_addr;
24 u32 entry_point;
25 u32 size;
Stefan Roese022b4972012-08-27 12:50:58 +020026 u32 flags;
Tom Rini47f7bca2012-08-13 12:03:19 -070027};
28
Stefan Roese022b4972012-08-27 12:50:58 +020029#define SPL_COPY_PAYLOAD_ONLY 1
30
Tom Rini47f7bca2012-08-13 12:03:19 -070031extern struct spl_image_info spl_image;
Tom Rini47f7bca2012-08-13 12:03:19 -070032
33/* SPL common functions */
34void preloader_console_init(void);
35u32 spl_boot_device(void);
36u32 spl_boot_mode(void);
37void spl_parse_image_header(const struct image_header *header);
38void spl_board_prepare_for_linux(void);
Tom Rini6507f132012-08-22 15:31:05 -070039void __noreturn jump_to_image_linux(void *arg);
Tom Rini47f7bca2012-08-13 12:03:19 -070040int spl_start_uboot(void);
41void spl_display_print(void);
42
43/* NAND SPL functions */
44void spl_nand_load_image(void);
45
Enric Balletbo i Serra60009922013-02-07 23:14:48 +000046/* OneNAND SPL functions */
47void spl_onenand_load_image(void);
48
Stefan Roese33d34642012-08-27 12:50:59 +020049/* NOR SPL functions */
50void spl_nor_load_image(void);
51
Tom Rini47f7bca2012-08-13 12:03:19 -070052/* MMC SPL functions */
53void spl_mmc_load_image(void);
54
55/* YMODEM SPL functions */
56void spl_ymodem_load_image(void);
57
58/* SPI SPL functions */
Tom Rinia4cc1c42012-08-14 14:34:10 -070059void spl_spi_load_image(void);
Tom Rini47f7bca2012-08-13 12:03:19 -070060
Ilya Yanok7ac2fe22012-09-18 00:22:50 +000061/* Ethernet SPL functions */
62void spl_net_load_image(const char *device);
63
Dan Murphy8cffe5b2014-01-16 11:23:30 -060064/* USB SPL functions */
65void spl_usb_load_image(void);
66
Dan Murphy773b5942014-01-16 11:23:29 -060067/* SPL FAT image functions */
68int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
69int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
70
Tom Rini47f7bca2012-08-13 12:03:19 -070071#ifdef CONFIG_SPL_BOARD_INIT
72void spl_board_init(void);
73#endif
74#endif