Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 2 | /* |
Bernhard Nortmann | c9e8961 | 2015-09-17 18:52:50 +0200 | [diff] [blame] | 3 | * (C) Copyright 2007-2011 |
| 4 | * Allwinner Technology Co., Ltd. <www.allwinnertech.com> |
| 5 | * Tom Cubie <tangliang@allwinnertech.com> |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _ASM_ARCH_SPL_H_ |
Jeroen Hofstee | c5d88a5 | 2014-06-11 22:01:48 +0200 | [diff] [blame] | 8 | #define _ASM_ARCH_SPL_H_ |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 9 | |
Andre Przywara | 9c88912 | 2020-11-17 23:36:05 +0000 | [diff] [blame] | 10 | #include <sunxi_image.h> |
Bernhard Nortmann | c9e8961 | 2015-09-17 18:52:50 +0200 | [diff] [blame] | 11 | |
Icenowy Zheng | 5e6dd27 | 2018-07-21 16:20:20 +0800 | [diff] [blame] | 12 | #define SPL_ADDR CONFIG_SUNXI_SRAM_ADDRESS |
Bernhard Nortmann | ead498a | 2015-09-17 18:52:52 +0200 | [diff] [blame] | 13 | |
Siarhei Siamashka | 08e978b | 2016-05-14 04:13:26 +0300 | [diff] [blame] | 14 | /* The low 8-bits of the 'boot_media' field in the SPL header */ |
| 15 | #define SUNXI_BOOTED_FROM_MMC0 0 |
Olliver Schinagl | ec380a0 | 2016-06-13 18:13:07 +0200 | [diff] [blame] | 16 | #define SUNXI_BOOTED_FROM_NAND 1 |
| 17 | #define SUNXI_BOOTED_FROM_MMC2 2 |
Siarhei Siamashka | 08e978b | 2016-05-14 04:13:26 +0300 | [diff] [blame] | 18 | #define SUNXI_BOOTED_FROM_SPI 3 |
Andre Przywara | 946e9db | 2018-12-16 02:04:58 +0000 | [diff] [blame] | 19 | #define SUNXI_BOOTED_FROM_MMC0_HIGH 0x10 |
| 20 | #define SUNXI_BOOTED_FROM_MMC2_HIGH 0x12 |
Siarhei Siamashka | 08e978b | 2016-05-14 04:13:26 +0300 | [diff] [blame] | 21 | |
Jesse Taube | fb7bd33 | 2022-02-11 19:32:33 -0500 | [diff] [blame] | 22 | /* |
| 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 Ripard | 1941be8 | 2017-08-23 10:06:30 +0200 | [diff] [blame] | 31 | uint32_t sunxi_get_boot_device(void); |
Samuel Holland | 784fcf6 | 2022-03-18 00:00:44 -0500 | [diff] [blame] | 32 | uint32_t sunxi_get_spl_size(void); |
Maxime Ripard | 1941be8 | 2017-08-23 10:06:30 +0200 | [diff] [blame] | 33 | |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 34 | #endif |