blob: 14944a20eac5add32d4b102fb0b6450bd3e6cf90 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ian Campbell6efe3692014-05-05 11:52:26 +01002/*
Bernhard Nortmannc9e89612015-09-17 18:52:50 +02003 * (C) Copyright 2007-2011
4 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5 * Tom Cubie <tangliang@allwinnertech.com>
Ian Campbell6efe3692014-05-05 11:52:26 +01006 */
7#ifndef _ASM_ARCH_SPL_H_
Jeroen Hofsteec5d88a52014-06-11 22:01:48 +02008#define _ASM_ARCH_SPL_H_
Ian Campbell6efe3692014-05-05 11:52:26 +01009
Andre Przywara9c889122020-11-17 23:36:05 +000010#include <sunxi_image.h>
Bernhard Nortmannc9e89612015-09-17 18:52:50 +020011
Icenowy Zheng5e6dd272018-07-21 16:20:20 +080012#define SPL_ADDR CONFIG_SUNXI_SRAM_ADDRESS
Bernhard Nortmannead498a2015-09-17 18:52:52 +020013
Siarhei Siamashka08e978b2016-05-14 04:13:26 +030014/* The low 8-bits of the 'boot_media' field in the SPL header */
15#define SUNXI_BOOTED_FROM_MMC0 0
Olliver Schinaglec380a02016-06-13 18:13:07 +020016#define SUNXI_BOOTED_FROM_NAND 1
17#define SUNXI_BOOTED_FROM_MMC2 2
Siarhei Siamashka08e978b2016-05-14 04:13:26 +030018#define SUNXI_BOOTED_FROM_SPI 3
Andre Przywara946e9db2018-12-16 02:04:58 +000019#define SUNXI_BOOTED_FROM_MMC0_HIGH 0x10
20#define SUNXI_BOOTED_FROM_MMC2_HIGH 0x12
Siarhei Siamashka08e978b2016-05-14 04:13:26 +030021
Jesse Taubefb7bd332022-02-11 19:32:33 -050022/*
23 * Values taken from the F1C200s BootROM stack
24 * to determine where we booted from.
25 */
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
30
Maxime Ripard1941be82017-08-23 10:06:30 +020031uint32_t sunxi_get_boot_device(void);
Samuel Holland784fcf62022-03-18 00:00:44 -050032uint32_t sunxi_get_spl_size(void);
Maxime Ripard1941be82017-08-23 10:06:30 +020033
Ian Campbell6efe3692014-05-05 11:52:26 +010034#endif