blob: 7b99c1aa12de449fd148fd59d8ab9247713fb56d [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
Siarhei Siamashka6b0cd012017-04-26 01:32:49 +010022
Bernhard Nortmannead498a2015-09-17 18:52:52 +020023#define is_boot0_magic(addr) (memcmp((void *)addr, BOOT0_MAGIC, 8) == 0)
24
Maxime Ripard1941be82017-08-23 10:06:30 +020025uint32_t sunxi_get_boot_device(void);
26
Ian Campbell6efe3692014-05-05 11:52:26 +010027#endif