blob: 2bd6e16a0e10f2cf1cb9c90f6bc11cbb9cd45133 [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
14/* Boot type */
15#define MMCSD_MODE_UNDEFINED 0
16#define MMCSD_MODE_RAW 1
17#define MMCSD_MODE_FAT 2
18
19struct spl_image_info {
20 const char *name;
21 u8 os;
22 u32 load_addr;
23 u32 entry_point;
24 u32 size;
Stefan Roese022b4972012-08-27 12:50:58 +020025 u32 flags;
Tom Rini47f7bca2012-08-13 12:03:19 -070026};
27
Stefan Roese022b4972012-08-27 12:50:58 +020028#define SPL_COPY_PAYLOAD_ONLY 1
29
Tom Rini47f7bca2012-08-13 12:03:19 -070030extern struct spl_image_info spl_image;
Tom Rini47f7bca2012-08-13 12:03:19 -070031
32/* SPL common functions */
33void preloader_console_init(void);
34u32 spl_boot_device(void);
35u32 spl_boot_mode(void);
36void spl_parse_image_header(const struct image_header *header);
37void spl_board_prepare_for_linux(void);
Tom Rini6507f132012-08-22 15:31:05 -070038void __noreturn jump_to_image_linux(void *arg);
Tom Rini47f7bca2012-08-13 12:03:19 -070039int spl_start_uboot(void);
40void spl_display_print(void);
41
42/* NAND SPL functions */
43void spl_nand_load_image(void);
44
Enric Balletbo i Serra60009922013-02-07 23:14:48 +000045/* OneNAND SPL functions */
46void spl_onenand_load_image(void);
47
Stefan Roese33d34642012-08-27 12:50:59 +020048/* NOR SPL functions */
49void spl_nor_load_image(void);
50
Tom Rini47f7bca2012-08-13 12:03:19 -070051/* MMC SPL functions */
52void spl_mmc_load_image(void);
53
54/* YMODEM SPL functions */
55void spl_ymodem_load_image(void);
56
57/* SPI SPL functions */
Tom Rinia4cc1c42012-08-14 14:34:10 -070058void spl_spi_load_image(void);
Tom Rini47f7bca2012-08-13 12:03:19 -070059
Ilya Yanok7ac2fe22012-09-18 00:22:50 +000060/* Ethernet SPL functions */
61void spl_net_load_image(const char *device);
62
Tom Rini47f7bca2012-08-13 12:03:19 -070063#ifdef CONFIG_SPL_BOARD_INIT
64void spl_board_init(void);
65#endif
66#endif