1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2007-2011
4 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
7 #ifndef _ASM_ARCH_SPL_H_
8 #define _ASM_ARCH_SPL_H_
10 #include <sunxi_image.h>
12 #define SPL_ADDR CONFIG_SUNXI_SRAM_ADDRESS
14 /* The low 8-bits of the 'boot_media' field in the SPL header */
15 #define SUNXI_BOOTED_FROM_MMC0 0
16 #define SUNXI_BOOTED_FROM_NAND 1
17 #define SUNXI_BOOTED_FROM_MMC2 2
18 #define SUNXI_BOOTED_FROM_SPI 3
19 #define SUNXI_BOOTED_FROM_MMC0_HIGH 0x10
20 #define SUNXI_BOOTED_FROM_MMC2_HIGH 0x12
23 * Values taken from the F1C200s BootROM stack
24 * to determine where we booted from.
26 #define SUNIV_BOOTED_FROM_MMC0 0xffff40f8
27 #define SUNIV_BOOTED_FROM_NAND 0xffff4114
28 #define SUNIV_BOOTED_FROM_SPI 0xffff4130
29 #define SUNIV_BOOTED_FROM_MMC1 0xffff4150
31 #define is_boot0_magic(addr) (memcmp((void *)(addr), BOOT0_MAGIC, 8) == 0)
33 uint32_t sunxi_get_boot_device(void);