2016-11-26 03:16:01 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2020-10-22 02:12:12 +00:00
|
|
|
#ifdef CONFIG_MACH_SUN50I_H6
|
|
|
|
#define BL31_ADDR 0x104000
|
2020-10-22 02:12:16 +00:00
|
|
|
#define SCP_ADDR 0x114000
|
2021-01-11 20:11:46 +00:00
|
|
|
#elif defined(CONFIG_MACH_SUN50I_H616)
|
2021-03-25 16:20:13 +00:00
|
|
|
#define BL31_ADDR 0x40000000
|
2020-10-22 02:12:12 +00:00
|
|
|
#else
|
|
|
|
#define BL31_ADDR 0x44000
|
2020-10-22 02:12:16 +00:00
|
|
|
#define SCP_ADDR 0x50000
|
2020-10-22 02:12:12 +00:00
|
|
|
#endif
|
|
|
|
|
2016-11-26 03:16:01 +00:00
|
|
|
/ {
|
arm: dts: sunxi: Alter mmc2 auto-numbering to mmc1
Environment and fastboot mmc devices are configured based on the number
of mmc slots defined on particular board configs, MMC_SUNXI_SLOT_EXTRA.
If MMC_SUNXI_SLOT_EXTRA is more than 1, the default env and fastboot
mmc devices is mmc1 by assuming mmc0 is SD and mmc1 is emmc device.
But with DM_MMC the mmc devices are numbered as per the dts node
enablement. If there is a chance of having enabling all mmc nodes
in dts say mmc0, mmc1, mmc2 then the default env and fastboot devices
will failed to assign proper emmc device since mmc2 is emmc in most
of the Allwinner platforms.
So, we need to alter the auto-numbering by aliasing mmc2 to mmc1 since
aliases take precedence over auto-numbering.
If the dts enables mmc0, mmc1, mmc2, then all the nodes will probe
sequentially and auto-numbered as it is. but when aliases mmc1 with mmc2
the resulting number should be that mmc0 is till mmc0, mmc2 become mmc1
and mmc2 become mmc1
Without aliases of mmc1 = &mmc2;
-------------------------------
MMC: mmc@1c0f000: 0, mmc@1c10000: 1, mmc@1c11000: 2
With aliases of mmc1 = &mmc2;
----------------------------
MMC: Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... OK
Some platforms like A20 has mmc0...mmc3, but there is no usecases now
for enabling all mmc controllers in any of A20 board dts files.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-01-21 10:31:15 +00:00
|
|
|
aliases {
|
2021-04-16 10:52:27 +00:00
|
|
|
mmc0 = &mmc0;
|
2021-11-30 23:18:54 +00:00
|
|
|
#if CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
|
arm: dts: sunxi: Alter mmc2 auto-numbering to mmc1
Environment and fastboot mmc devices are configured based on the number
of mmc slots defined on particular board configs, MMC_SUNXI_SLOT_EXTRA.
If MMC_SUNXI_SLOT_EXTRA is more than 1, the default env and fastboot
mmc devices is mmc1 by assuming mmc0 is SD and mmc1 is emmc device.
But with DM_MMC the mmc devices are numbered as per the dts node
enablement. If there is a chance of having enabling all mmc nodes
in dts say mmc0, mmc1, mmc2 then the default env and fastboot devices
will failed to assign proper emmc device since mmc2 is emmc in most
of the Allwinner platforms.
So, we need to alter the auto-numbering by aliasing mmc2 to mmc1 since
aliases take precedence over auto-numbering.
If the dts enables mmc0, mmc1, mmc2, then all the nodes will probe
sequentially and auto-numbered as it is. but when aliases mmc1 with mmc2
the resulting number should be that mmc0 is till mmc0, mmc2 become mmc1
and mmc2 become mmc1
Without aliases of mmc1 = &mmc2;
-------------------------------
MMC: mmc@1c0f000: 0, mmc@1c10000: 1, mmc@1c11000: 2
With aliases of mmc1 = &mmc2;
----------------------------
MMC: Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... OK
Some platforms like A20 has mmc0...mmc3, but there is no usecases now
for enabling all mmc controllers in any of A20 board dts files.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-01-21 10:31:15 +00:00
|
|
|
mmc1 = &mmc2;
|
2021-07-22 06:30:04 +00:00
|
|
|
#endif
|
arm: dts: sunxi: Alter mmc2 auto-numbering to mmc1
Environment and fastboot mmc devices are configured based on the number
of mmc slots defined on particular board configs, MMC_SUNXI_SLOT_EXTRA.
If MMC_SUNXI_SLOT_EXTRA is more than 1, the default env and fastboot
mmc devices is mmc1 by assuming mmc0 is SD and mmc1 is emmc device.
But with DM_MMC the mmc devices are numbered as per the dts node
enablement. If there is a chance of having enabling all mmc nodes
in dts say mmc0, mmc1, mmc2 then the default env and fastboot devices
will failed to assign proper emmc device since mmc2 is emmc in most
of the Allwinner platforms.
So, we need to alter the auto-numbering by aliasing mmc2 to mmc1 since
aliases take precedence over auto-numbering.
If the dts enables mmc0, mmc1, mmc2, then all the nodes will probe
sequentially and auto-numbered as it is. but when aliases mmc1 with mmc2
the resulting number should be that mmc0 is till mmc0, mmc2 become mmc1
and mmc2 become mmc1
Without aliases of mmc1 = &mmc2;
-------------------------------
MMC: mmc@1c0f000: 0, mmc@1c10000: 1, mmc@1c11000: 2
With aliases of mmc1 = &mmc2;
----------------------------
MMC: Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... OK
Some platforms like A20 has mmc0...mmc3, but there is no usecases now
for enabling all mmc controllers in any of A20 board dts files.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-01-21 10:31:15 +00:00
|
|
|
};
|
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
binman: binman {
|
|
|
|
multiple-images;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-06 14:59:57 +00:00
|
|
|
/* Let U-Boot be the firmware layer that controls the watchdog. */
|
|
|
|
#ifdef CONFIG_MACH_SUN8I_R528
|
|
|
|
&wdt {
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
&binman {
|
|
|
|
u-boot-sunxi-with-spl {
|
2016-11-26 03:16:01 +00:00
|
|
|
filename = "u-boot-sunxi-with-spl.bin";
|
|
|
|
pad-byte = <0xff>;
|
2020-10-22 02:12:10 +00:00
|
|
|
|
2016-11-26 03:16:01 +00:00
|
|
|
blob {
|
sunxi: binman: Fix U-Boot offset when SPL is not 32 KiB
On sunxi boards, SPL looks for U-Boot at a 32 KiB offset, unless SPL is
larger than 32 KiB, in which case U-Boot immediately follows SPL. See
the logic in spl_mmc_get_uboot_raw_sector() and spl_spi_load_image().
In two cases, the existing binman description mismatches the SPL code.
For 64-bit boards, binman would place U-Boot immediately following SPL,
even if SPL is smaller than 32 KiB. This can happen when SPL MMC support
is disabled (i.e. when booting from SPI flash).
In contrast, for 32-bit boards, binman would place U-Boot at 32 KiB,
even if SPL is larger than that. This happens because the 'offset'
property does not consider the size of previous entries.
Fix both issues by setting a minimum size for the SPL entry, which
exactly matches the logic in the SPL code. Unfortunately, this size must
be provided as a magic number, since none of the relevant config symbols
(SPL_PAD_TO, SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, and SYS_SPI_U_BOOT_OFFS)
are guaranteed to be defined in all cases.
Fixes: cfa3db602caf ("sunxi: Convert 64-bit boards to use binman")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-01-21 23:25:17 +00:00
|
|
|
/*
|
|
|
|
* This value matches SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
|
|
|
|
* and SYS_SPI_U_BOOT_OFFS if those are defined.
|
|
|
|
*/
|
|
|
|
min-size = <0x8000>;
|
2016-11-26 03:16:01 +00:00
|
|
|
filename = "spl/sunxi-spl.bin";
|
|
|
|
};
|
2020-10-22 02:12:10 +00:00
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
#ifdef CONFIG_ARM64
|
|
|
|
fit {
|
|
|
|
description = "Configuration to load ATF before U-Boot";
|
|
|
|
#address-cells = <1>;
|
|
|
|
fit,fdt-list = "of-list";
|
|
|
|
|
|
|
|
images {
|
|
|
|
uboot {
|
|
|
|
description = "U-Boot (64-bit)";
|
|
|
|
type = "standalone";
|
2020-10-22 02:12:14 +00:00
|
|
|
os = "u-boot";
|
2020-09-01 11:14:01 +00:00
|
|
|
arch = "arm64";
|
|
|
|
compression = "none";
|
2022-10-21 00:22:39 +00:00
|
|
|
load = <CONFIG_TEXT_BASE>;
|
2020-09-01 11:14:01 +00:00
|
|
|
|
|
|
|
u-boot-nodtb {
|
|
|
|
};
|
|
|
|
};
|
2020-10-22 02:12:10 +00:00
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
atf {
|
|
|
|
description = "ARM Trusted Firmware";
|
|
|
|
type = "firmware";
|
2020-10-22 02:12:14 +00:00
|
|
|
os = "arm-trusted-firmware";
|
2020-09-01 11:14:01 +00:00
|
|
|
arch = "arm64";
|
|
|
|
compression = "none";
|
2020-10-22 02:12:12 +00:00
|
|
|
load = <BL31_ADDR>;
|
|
|
|
entry = <BL31_ADDR>;
|
2020-10-22 02:12:10 +00:00
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
atf-bl31 {
|
2020-10-22 02:12:11 +00:00
|
|
|
filename = "bl31.bin";
|
2020-09-06 16:39:10 +00:00
|
|
|
missing-msg = "atf-bl31-sunxi";
|
2020-09-01 11:14:01 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-07-22 06:30:03 +00:00
|
|
|
#ifdef SCP_ADDR
|
2020-10-22 02:12:16 +00:00
|
|
|
scp {
|
|
|
|
description = "SCP firmware";
|
|
|
|
type = "firmware";
|
|
|
|
arch = "or1k";
|
|
|
|
compression = "none";
|
|
|
|
load = <SCP_ADDR>;
|
|
|
|
|
|
|
|
scp {
|
|
|
|
filename = "scp.bin";
|
|
|
|
missing-msg = "scp-sunxi";
|
|
|
|
};
|
|
|
|
};
|
2021-01-11 20:11:46 +00:00
|
|
|
#endif
|
2020-10-22 02:12:16 +00:00
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
@fdt-SEQ {
|
|
|
|
description = "NAME";
|
|
|
|
type = "flat_dt";
|
|
|
|
compression = "none";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
configurations {
|
2021-02-08 06:03:16 +00:00
|
|
|
default = "@config-DEFAULT-SEQ";
|
2020-10-22 02:12:10 +00:00
|
|
|
|
2020-09-01 11:14:01 +00:00
|
|
|
@config-SEQ {
|
|
|
|
description = "NAME";
|
2020-10-22 02:12:14 +00:00
|
|
|
firmware = "atf";
|
2021-07-22 06:30:03 +00:00
|
|
|
#ifndef SCP_ADDR
|
2021-01-11 20:11:46 +00:00
|
|
|
loadables = "uboot";
|
|
|
|
#else
|
2020-10-22 02:12:16 +00:00
|
|
|
loadables = "scp", "uboot";
|
2021-01-11 20:11:46 +00:00
|
|
|
#endif
|
2020-09-01 11:14:01 +00:00
|
|
|
fdt = "fdt-SEQ";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#else
|
2016-11-26 03:16:01 +00:00
|
|
|
u-boot-img {
|
|
|
|
};
|
2020-09-01 11:14:01 +00:00
|
|
|
#endif
|
2016-11-26 03:16:01 +00:00
|
|
|
};
|
|
|
|
};
|