BananaPi BPI-M4-Zero: update to u-boot-v2024.04

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
This commit is contained in:
Patrick Yavitz
2024-10-01 15:03:20 -04:00
committed by c0rnelius
parent 2ecb25e57f
commit f9921e3058
8 changed files with 242 additions and 236 deletions

View File

@@ -1,171 +0,0 @@
From a4fc93b5b28f8c733fcc54a0bc428481edd583ee Mon Sep 17 00:00:00 2001
From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Date: Tue, 5 Mar 2024 20:30:10 -0500
Subject: [PATCH] sunxi: reorganize mctl_mem_matches_* functions
mctl_mem_matches and mctl_mem_matches_base identical functions. To
avoid code duplication move them to dram_helpers and make
mctl_mem_matches use generic mctl_mem_matches_base.
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
arch/arm/include/asm/arch-sunxi/dram.h | 1 +
arch/arm/mach-sunxi/dram_sunxi_dw.c | 14 --------------
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h
index 682daae6b1..9d21b49241 100644
--- a/arch/arm/include/asm/arch-sunxi/dram.h
+++ b/arch/arm/include/asm/arch-sunxi/dram.h
@@ -40,5 +40,6 @@
unsigned long sunxi_dram_init(void);
void mctl_await_completion(u32 *reg, u32 mask, u32 val);
bool mctl_mem_matches(u32 offset);
+bool mctl_mem_matches_base(u32 offset, ulong base);
#endif /* _SUNXI_DRAM_H */
diff --git a/arch/arm/mach-sunxi/dram_sunxi_dw.c b/arch/arm/mach-sunxi/dram_sunxi_dw.c
index 9382d3d0be..4dc1a19641 100644
--- a/arch/arm/mach-sunxi/dram_sunxi_dw.c
+++ b/arch/arm/mach-sunxi/dram_sunxi_dw.c
@@ -652,20 +652,6 @@ static int mctl_channel_init(uint16_t socid, struct dram_para *para)
return 0;
}
-/*
- * Test if memory at offset offset matches memory at a certain base
- */
-static bool mctl_mem_matches_base(u32 offset, ulong base)
-{
- /* Try to write different values to RAM at two addresses */
- writel(0, base);
- writel(0xaa55aa55, base + offset);
- dsb();
- /* Check if the same value is actually observed when reading back */
- return readl(base) ==
- readl(base + offset);
-}
-
static void mctl_auto_detect_dram_size_rank(uint16_t socid, struct dram_para *para, ulong base, struct rank_para *rank)
{
/* detect row address bits */
--
2.39.2
From 1800c04c0212b87cebc6314cfd88d8b7e3f56970 Mon Sep 17 00:00:00 2001
From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Date: Tue, 5 Mar 2024 20:18:25 -0500
Subject: [PATCH] sunxi: restore modified memory
Current sunxi DRAM initialisation code does several test accesses to the
DRAM array to detect aliasing effects and so determine the correct
row/column configuration. This changes the DRAM content, which breaks
use cases like soft reset and Linux's ramoops mechanism.
Fix this problem by saving and restoring the content of the DRAM cells
that is used for the test writes.
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
arch/arm/mach-sunxi/dram_helpers.c | 35 ++++++++++++++++++++++++------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-sunxi/dram_helpers.c b/arch/arm/mach-sunxi/dram_helpers.c
index cdf2750f1c..83dbe4ca98 100644
--- a/arch/arm/mach-sunxi/dram_helpers.c
+++ b/arch/arm/mach-sunxi/dram_helpers.c
@@ -5,8 +5,9 @@
* (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
*/
-#include <common.h>
+#include <config.h>
#include <time.h>
+#include <vsprintf.h>
#include <asm/barriers.h>
#include <asm/io.h>
#include <asm/arch/dram.h>
@@ -25,19 +26,39 @@ void mctl_await_completion(u32 *reg, u32 mask, u32 val)
}
/*
- * Test if memory at offset offset matches memory at begin of DRAM
+ * Test if memory at offset matches memory at a certain base
*
* Note: dsb() is not available on ARMv5 in Thumb mode
*/
#ifndef CONFIG_MACH_SUNIV
-bool mctl_mem_matches(u32 offset)
+bool mctl_mem_matches_base(u32 offset, ulong base)
{
+ u32 val_base;
+ u32 val_offset;
+ bool ret;
+
+ /* Save original values */
+ val_base = readl(base);
+ val_offset = readl(base + offset);
+
/* Try to write different values to RAM at two addresses */
- writel(0, CFG_SYS_SDRAM_BASE);
- writel(0xaa55aa55, (ulong)CFG_SYS_SDRAM_BASE + offset);
+ writel(0, base);
+ writel(0xaa55aa55, base + offset);
dsb();
/* Check if the same value is actually observed when reading back */
- return readl(CFG_SYS_SDRAM_BASE) ==
- readl((ulong)CFG_SYS_SDRAM_BASE + offset);
+ ret = readl(base) == readl(base + offset);
+
+ /* Restore original values */
+ writel(val_base, base);
+ writel(val_offset, base + offset);
+ return ret;
+}
+
+/*
+ * Test if memory at offset matches memory at begin of DRAM
+ */
+bool mctl_mem_matches(u32 offset)
+{
+ return mctl_mem_matches_base(offset, CFG_SYS_SDRAM_BASE);
}
#endif
--
2.39.2
From 4d6a96ec60255a18cbf0f79985b306de20c0a9c5 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@xxxxx.com>
Date: Tue, 5 Mar 2024 20:38:57 -0500
Subject: [PATCH] mach-sunxi: dram_helpers: add delay to steady dram detection
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
---
arch/arm/mach-sunxi/dram_helpers.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-sunxi/dram_helpers.c b/arch/arm/mach-sunxi/dram_helpers.c
index 83dbe4ca98..df7845502d 100644
--- a/arch/arm/mach-sunxi/dram_helpers.c
+++ b/arch/arm/mach-sunxi/dram_helpers.c
@@ -11,6 +11,7 @@
#include <asm/barriers.h>
#include <asm/io.h>
#include <asm/arch/dram.h>
+#include <linux/delay.h>
/*
* Wait up to 1s for value to be set in given part of reg.
@@ -45,6 +46,7 @@ bool mctl_mem_matches_base(u32 offset, ulong base)
writel(0, base);
writel(0xaa55aa55, base + offset);
dsb();
+ udelay(150);
/* Check if the same value is actually observed when reading back */
ret = readl(base) == readl(base + offset);
--
2.39.2

View File

@@ -1,40 +1,88 @@
From a23c8425ef27dcbf261e9cabbf0e58c6c7a23bac Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@xxxxx.com>
Date: Tue, 5 Mar 2024 07:49:40 -0500
Subject: [PATCH] add board bananapi m4 zero
From 188b1762f16a64dd9751b74e5b8bff31bcaf14c7 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Sat, 28 Sep 2024 23:41:10 -0400
Subject: [PATCH] Add board BananaPi BPI-M4-ZERO
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
sun50i-h618-bananapi-m4-zero.dts
sun50i-h618-bananapi-m4.dtsi
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
arch/arm/dts/Makefile | 3 +-
arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts | 189 ++++++++++++++++++
arch/arm/dts/Makefile | 1 +
arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts | 39 +++
arch/arm/dts/sun50i-h618-bananapi-m4.dtsi | 233 ++++++++++++++++++
configs/bananapi_m4zero_defconfig | 29 +++
3 files changed, 220 insertions(+), 1 deletion(-)
4 files changed, 302 insertions(+)
create mode 100644 arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts
create mode 100644 arch/arm/dts/sun50i-h618-bananapi-m4.dtsi
create mode 100644 configs/bananapi_m4zero_defconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 9d28a485be..5fb6040c5e 100644
index b102ffb5f6..60ea478509 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -836,7 +836,8 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
@@ -838,6 +838,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
sun50i-h6-tanix-tx6.dtb \
sun50i-h6-tanix-tx6-mini.dtb
dtb-$(CONFIG_MACH_SUN50I_H616) += \
+ sun50i-h618-bananapi-m4-zero.dtb \
sun50i-h616-orangepi-zero2.dtb \
sun50i-h618-orangepi-zero2w.dtb \
sun50i-h618-orangepi-zero3.dtb \
- sun50i-h616-x96-mate.dtb
+ sun50i-h616-x96-mate.dtb \
+ sun50i-h618-bananapi-m4-zero.dtb
dtb-$(CONFIG_MACH_SUN50I) += \
sun50i-a64-amarula-relic.dtb \
sun50i-a64-bananapi-m64.dtb \
diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts b/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts
new file mode 100644
index 0000000000..cccd58dc37
index 0000000000..1d234abdb0
--- /dev/null
+++ b/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts
@@ -0,0 +1,189 @@
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Patrick Yavitz <pyavitz@xxxxx.com>
+ * Copyright (c) 2024 Patrick Yavitz <pyavitz@armbian.com>
+ */
+
+/dts-v1/;
+
+#include "sun50i-h618-bananapi-m4.dtsi"
+
+/ {
+ model = "BananaPi BPI-M4-Zero";
+ compatible = "sinovoip,bpi-m4-zero", "allwinner,sun50i-h618";
+};
+
+/* Connected to an on-board RTL8821CU USB WiFi chip. */
+&ehci1 {
+ status = "okay";
+};
+
+&ehci3 {
+ status = "okay";
+};
+
+&emac0 {
+ status = "disabled";
+};
+
+&ohci3 {
+ status = "okay";
+};
+
+&usbotg {
+ status = "okay";
+ dr_mode = "peripheral";
+};
+
+&usbphy {
+ status = "okay";
+};
diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi
new file mode 100644
index 0000000000..7363c5a97a
--- /dev/null
+++ b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi
@@ -0,0 +1,233 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Patrick Yavitz <pyavitz@armbian.com>
+ */
+
+/dts-v1/;
@@ -42,13 +90,11 @@ index 0000000000..cccd58dc37
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "BananaPi M4 Zero";
+ compatible = "sinovoip,bpi-m4-zero", "allwinner,sun50i-h618";
+
+ aliases {
+ ethernet0 = &emac0;
+ serial0 = &uart0;
@@ -58,6 +104,16 @@ index 0000000000..cccd58dc37
+ stdout-path = "serial0:115200n8";
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ key-sw3 {
+ label = "sw3";
+ linux,code = <BTN_0>;
+ gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
@@ -69,8 +125,17 @@ index 0000000000..cccd58dc37
+ };
+ };
+
+ reg_vcc5v: regulator-5v {
+ /* board wide 5V supply directly from the USB-C socket */
+ reg_usb_vbus: regulator-usb-vbus {
+ /* Separate discrete regulator for the USB ports */
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&reg_vcc5v>;
+ };
+
+ reg_vcc5v: regulator-vcc5v {
+ /* Board wide 5V supply directly from the USB-C socket */
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-5v";
+ regulator-min-microvolt = <5000000>;
@@ -78,13 +143,34 @@ index 0000000000..cccd58dc37
+ regulator-always-on;
+ };
+
+ reg_usb_vbus: regulator-usb-vbus {
+ /* separate discrete regulator for the USB ports */
+ reg_vcc3v3: regulator-vcc3v3 {
+ /* SY8089 DC/DC converter */
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&reg_vcc5v>;
+ regulator-name = "vcc-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ vin-supply = <&reg_dldo1>;
+ };
+
+ reg_vcc1v8: regulator-vcc1v8 {
+ /* Always on 1.8V/300mA regulator for WiFi and BT IO */
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ vin-supply = <&reg_aldo1>;
+ };
+
+ wifi_pwrseq: wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rtc CLK_OSC32K_FANOUT>;
+ clock-names = "ext_clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&clk_losc_32k_pin>;
+ post-power-on-delay-ms = <200>;
+ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */
+ };
+};
+
@@ -92,16 +178,8 @@ index 0000000000..cccd58dc37
+ cpu-supply = <&reg_dcdc2>;
+};
+
+/* Connected to an on-board RTL8821CU USB WiFi chip. */
+&ehci1 {
+ status = "okay";
+};
+
+&ehci3 {
+ status = "okay";
+};
+
+&emac0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ext_rgmii_pins>;
+ phy-mode = "rgmii";
@@ -109,11 +187,12 @@ index 0000000000..cccd58dc37
+ phy-supply = <&reg_dldo1>;
+ allwinner,rx-delay-ps = <3100>;
+ allwinner,tx-delay-ps = <700>;
+ status = "disabled";
+};
+
+&ir {
+ status = "okay";
+ status = "disabled";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ir_rx_pin>;
+};
+
+&mdio0 {
@@ -124,25 +203,34 @@ index 0000000000..cccd58dc37
+};
+
+&mmc0 {
+ vmmc-supply = <&reg_dldo1>;
+ status = "okay";
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+ disable-wp;
+ bus-width = <4>;
+ max-frequency = <50000000>;
+ status = "okay";
+ vmmc-supply = <&reg_dldo1>;
+};
+
+&mmc1 {
+ status = "disabled";
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ bus-width = <4>;
+ non-removable;
+ mmc-ddr-1_8v;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ vmmc-supply = <&reg_vcc3v3>;
+ vqmmc-supply = <&reg_vcc1v8>;
+};
+
+&mmc2 {
+ vmmc-supply = <&reg_dldo1>;
+ vqmmc-supply = <&reg_aldo1>;
+ status = "okay";
+ bus-width = <8>;
+ non-removable;
+ cap-mmc-hw-reset;
+ mmc-hs200-1_8v;
+ status = "okay";
+};
+
+&ohci3 {
+ status = "okay";
+ vmmc-supply = <&reg_dldo1>;
+ vqmmc-supply = <&reg_aldo1>;
+};
+
+&pio {
@@ -151,6 +239,13 @@ index 0000000000..cccd58dc37
+ vcc-pg-supply = <&reg_dldo1>;
+ vcc-ph-supply = <&reg_dldo1>;
+ vcc-pi-supply = <&reg_dldo1>;
+
+ clk_losc_32k_pin: clk-losc-32k-pin {
+ pins = "PG10";
+ function = "clock";
+ drive-strength = <20>;
+ bias-pull-up;
+ };
+};
+
+&r_i2c {
@@ -207,23 +302,20 @@ index 0000000000..cccd58dc37
+};
+
+&uart0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_ph_pins>;
+ status = "okay";
+};
+
+&usbotg {
+ dr_mode = "peripheral";
+ status = "okay";
+};
+
+&usbphy {
+ usb1_vbus-supply = <&reg_usb_vbus>;
+&uart1 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ uart-has-rtscts;
+};
diff --git a/configs/bananapi_m4zero_defconfig b/configs/bananapi_m4zero_defconfig
new file mode 100644
index 0000000000..a1bec63df3
index 0000000000..3442bd0c77
--- /dev/null
+++ b/configs/bananapi_m4zero_defconfig
@@ -0,0 +1,29 @@
@@ -257,5 +349,5 @@ index 0000000000..a1bec63df3
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
--
2.39.2
2.39.5

View File

@@ -1,9 +1,9 @@
From e9d34fce0765cb2927abeb4bde2225c5aee2925c Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@xxxxx.com>
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Wed, 28 Feb 2024 11:55:04 -0500
Subject: [PATCH] drivers: mmc: sunxi_mmc: bpi-m4-zero emmc boot support
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
drivers/mmc/sunxi_mmc.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

View File

@@ -1,5 +1,7 @@
From 8df52c4a9b6f7590031b3fcd2c2b98552597986b Mon Sep 17 00:00:00 2001
From: Da Xue <da@libre.computer>
Date: Thu, 21 Jul 2022 18:08:21 -0400
Date: Mon, 13 May 2024 17:46:44 -0400
Subject: [PATCH] sunxi mmc: increase stabilization delay from 1ms to 20ms
Some users experienced problems booting u-boot from SPL hanging here:
@@ -35,10 +37,10 @@ Signed-off-by: Da Xue <da@libre.computer>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 1bb7b6d0e9..f7942b69ce 100644
index 714706d241..61aa330c7d 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -297,7 +297,7 @@ static int sunxi_mmc_core_init(struct mmc *mmc)
@@ -492,7 +492,7 @@ static int sunxi_mmc_core_init(struct mmc *mmc)
/* Reset controller */
writel(SUNXI_MMC_GCTRL_RESET, &priv->reg->gctrl);
@@ -47,3 +49,6 @@ index 1bb7b6d0e9..f7942b69ce 100644
return 0;
}
--
2.39.2

View File

@@ -0,0 +1,33 @@
From 110909494f8eeae7470321399978c25d9e3af554 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Mon, 13 May 2024 17:45:57 -0400
Subject: [PATCH] mach-sunxi: dram_helpers: add delay to steady dram detection
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
arch/arm/mach-sunxi/dram_helpers.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-sunxi/dram_helpers.c b/arch/arm/mach-sunxi/dram_helpers.c
index 83dbe4ca98..df7845502d 100644
--- a/arch/arm/mach-sunxi/dram_helpers.c
+++ b/arch/arm/mach-sunxi/dram_helpers.c
@@ -11,6 +11,7 @@
#include <asm/barriers.h>
#include <asm/io.h>
#include <asm/arch/dram.h>
+#include <linux/delay.h>
/*
* Wait up to 1s for value to be set in given part of reg.
@@ -45,6 +46,7 @@ bool mctl_mem_matches_base(u32 offset, ulong base)
writel(0, base);
writel(0xaa55aa55, base + offset);
dsb();
+ udelay(150);
/* Check if the same value is actually observed when reading back */
ret = readl(base) == readl(base + offset);
--
2.39.2

View File

@@ -0,0 +1,47 @@
From 8df52c4a9b6f7590031b3fcd2c2b98552597986b Mon Sep 17 00:00:00 2001
From: Andre Przywara <andre.przywara@arm.com>
To: Jagan Teki <jagan@amarulasolutions.com>
Subject: [PATCH] sunxi: spl: h616: fix booting from high MMC offset
Date: Fri, 10 May 2024 00:13:16 +0100
The BootROM in the Allwinner H616 tries to load the initial boot code
from sector 16 (8KB) of an SD card or eMMC device, but also looks at
sector 512 (256KB). This helps with GPT formatted cards.
A "high" boot offset is also used on previous SoCs, but it's sector 256
(128KB) there instead.
Extend the existing offset calculation code to consider the different
sector offset when running on an H616 SoC. This allows to load U-Boot
on any H616 device when the SPL is not located at 8KB.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
arch/arm/mach-sunxi/board.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 0140b07d32a..046e9fbfc67 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -333,7 +333,8 @@ uint32_t sunxi_get_spl_size(void)
* The eGON SPL image can be located at 8KB or at 128KB into an SD card or
* an eMMC device. The boot source has bit 4 set in the latter case.
* By adding 120KB to the normal offset when booting from a "high" location
- * we can support both cases.
+ * we can support both cases. The H616 has the alternative location
+ * moved up to 256 KB instead of 128KB, so cater for that, too.
* Also U-Boot proper is located at least 32KB after the SPL, but will
* immediately follow the SPL if that is bigger than that.
*/
@@ -349,6 +350,8 @@ unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
case SUNXI_BOOTED_FROM_MMC0_HIGH:
case SUNXI_BOOTED_FROM_MMC2_HIGH:
sector += (128 - 8) * 2;
+ if (IS_ENABLED(CONFIG_MACH_SUN50I_H616))
+ sector += 128 * 2;
break;
}
--
2.35.8