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 | |
Siarhei Siamashka | 6b0cd01 | 2017-04-26 01:32:49 +0100 | [diff] [blame] | 22 | |
Bernhard Nortmann | ead498a | 2015-09-17 18:52:52 +0200 | [diff] [blame] | 23 | #define is_boot0_magic(addr) (memcmp((void *)addr, BOOT0_MAGIC, 8) == 0) |
| 24 | |
Maxime Ripard | 1941be8 | 2017-08-23 10:06:30 +0200 | [diff] [blame] | 25 | uint32_t sunxi_get_boot_device(void); |
| 26 | |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 27 | #endif |