U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup
@ 2025-04-07 16:59 Stephan Gerhold
  2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The DB410c U-Boot port has not been updated much lately. This series
includes various fixes and cleanup to bring it back into better shape. I've
also added myself as new maintainer (and Sam as reviewer), since Ramon has
not been active on the U-Boot mailing list for over a year now.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
Stephan Gerhold (13):
      mach-snapdragon: Fix EL2 boot on DragonBoard 410c
      board: dragonboard410c: Fix RAM size
      board: dragonboard410c: Fix BD address
      board: dragonboard410c: Drop UNSTUFF_BITS() macro
      board: dragonboard410c: Drop reflash functionality
      board: dragonboard410c: Drop unused linux_image
      board: dragonboard410c: Use dynamically allocated load addresses
      board: dragonboard410c: Fix counter frequency
      board: dragonboard410c: Enable RTL8152 ethernet
      board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS
      board: dragonboard410c: Enable support for Android boot images
      board: dragonboard410c: Use button_cmd instead of custom code
      board: dragonboard410c: Update maintainers

 arch/arm/Kconfig                                   |  2 +-
 arch/arm/dts/apq8016-sbc-u-boot.dtsi               |  2 +-
 board/qualcomm/dragonboard410c/MAINTAINERS         |  3 +-
 board/qualcomm/dragonboard410c/dragonboard410c.c   | 67 +++++++---------------
 board/qualcomm/dragonboard410c/dragonboard410c.env | 38 ++----------
 configs/dragonboard410c_defconfig                  | 10 ++--
 include/configs/dragonboard410c.h                  | 11 ----
 7 files changed, 35 insertions(+), 98 deletions(-)
---
base-commit: 4b2895adb0ab94fdaabd6c19cef4d72986483461
change-id: 20250407-db410c-fixes-85c6a6de2716

Best regards,
-- 
Stephan Gerhold <stephan.gerhold@linaro.org>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:12   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 02/13] board: dragonboard410c: Fix RAM size Stephan Gerhold
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The workaround for the "PSCI bug" on DragonBoard 410c implemented in
arch/arm/mach-snapdragon/include/mach/boot0.h clobbers the x0 register
by storing the CurrentEL in there. When running in EL1, the mode switch
sequence implemented there later clears the register again, but this is
skipped when U-Boot is booted in EL2.

This causes crashes in the mach-snapdragon board_fdt_blob_setup() later,
because the invalid address stored in x0 gets dereferenced to check if it
points to a valid DTB.

We can't rely on having a valid values in the CPU registers for the first
stage bootloader configuration on DB410c, and nothing would place a DTB
there anyway. Skip selecting the SAVE_PREV_BL_FDT_ADDR option for the boot0
hook case to avoid crashing with the clobbered register value.

Fixes: 059d526af312 ("mach-snapdragon: generalise board support")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 63aefeda9575fec8fc57194358df0819397d088e..af3d39196ee4fb201d4aad20a882bbbb39263396 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1115,7 +1115,7 @@ config ARCH_SNAPDRAGON
 	select SPMI
 	select BOARD_LATE_INIT
 	select OF_BOARD
-	select SAVE_PREV_BL_FDT_ADDR
+	select SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK
 	select LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK
 	select SYSRESET
 	select SYSRESET_PSCI

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/13] board: dragonboard410c: Fix RAM size
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
  2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:06   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 03/13] board: dragonboard410c: Fix BD address Stephan Gerhold
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

DB410c has exactly 1 GiB of RAM. Some of it is reserved, but this is
described separately in the DT.

This was fixed before in commit 1d667227ea51 ("board: dragonboard410c: Fix
PHYS_SDRAM_1_SIZE"), but was reintroduced when DB410c was converted to use
the upstream device tree.

Note that there are variants of apq8016-sbc with 2 GiB RAM (e.g. the
Geniatech DB4). They need the WIP SMEM memory map parsing [1] to use the
full amount of RAM.

[1]: https://lore.kernel.org/u-boot/20241124-b4-modernise-smem-v1-0-b7852c11b67c@linaro.org/T/

Fixes: ed8fbd2889fc ("dts: msm8916: replace with upstream DTS")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 arch/arm/dts/apq8016-sbc-u-boot.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/apq8016-sbc-u-boot.dtsi b/arch/arm/dts/apq8016-sbc-u-boot.dtsi
index 585d54d29623823145e6b43eda89c05f31fc4403..c8a46ed14483f6939e7a666b2b279c803476ac63 100644
--- a/arch/arm/dts/apq8016-sbc-u-boot.dtsi
+++ b/arch/arm/dts/apq8016-sbc-u-boot.dtsi
@@ -6,7 +6,7 @@
 / {
 	/* When running as a first-stage bootloader this isn't filled in automatically */
 	memory@80000000 {
-		reg = <0 0x80000000 0 0x3da00000>;
+		reg = <0 0x80000000 0 0x40000000>;
 	};
 };
 

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/13] board: dragonboard410c: Fix BD address
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
  2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
  2025-04-07 16:59 ` [PATCH 02/13] board: dragonboard410c: Fix RAM size Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:11   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro Stephan Gerhold
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

local-bd-address in the device tree needs to be formatted with the least
significant byte first (i.e. little endian). We're not doing this when
adding it to the DT, which means the MAC address ends up being reversed in
Linux. Fix this by reversing the array before setting it in the DT.

We're also flipping the wrong bit when generating the BD address. Before
reversing the array, the least significant bit is in the last byte.

Fixes: ff06dc240325 ("db410: alter WLAN/BT MAC address fixup")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.c | 27 ++++++++++++++++++------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index fcbf2c3fe60f21bae1c6d64b542a4d9867c33826..c33529d31869b17c7a30ec83af1199d01db472f5 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -97,9 +97,9 @@ int qcom_late_init(void)
 	return 0;
 }
 
-/* Fixup of DTB for Linux Kernel
- * 1. Fixup installed DRAM.
- * 2. Fixup WLAN/BT Mac address:
+/*
+ * Fixup of DTB for Linux Kernel
+ * 1. Fixup WLAN/BT Mac address:
  *	First, check if MAC addresses for WLAN/BT exists as environemnt
  *	variables wlanaddr,btaddr. if not, generate a unique address.
  */
@@ -107,6 +107,7 @@ int qcom_late_init(void)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
 	u8 mac[ARP_HLEN];
+	int i;
 
 	if (!eth_env_get_enetaddr("wlanaddr", mac)) {
 		msm_generate_mac_addr(mac);
@@ -118,12 +119,24 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	if (!eth_env_get_enetaddr("btaddr", mac)) {
 		msm_generate_mac_addr(mac);
 
-/* The BD address is same as WLAN MAC address but with
- * least significant bit flipped.
- */
-		mac[0] ^= 0x01;
+		/*
+		 * The BD address is same as WLAN MAC address but with
+		 * least significant bit flipped.
+		 */
+		mac[ARP_HLEN - 1] ^= 0x01;
 	};
 
+	/*
+	 * Reverse array since local-bd-address is formatted with least
+	 * significant byte first (little endian).
+	 */
+	for (i = 0; i < ARP_HLEN / 2; ++i) {
+		u8 tmp = mac[i];
+
+		mac[i] = mac[ARP_HLEN - 1 - i];
+		mac[ARP_HLEN - 1 - i] = tmp;
+	}
+
 	do_fixup_by_compat(blob, "qcom,wcnss-bt",
 			   "local-bd-address", mac, ARP_HLEN, 1);
 	return 0;

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (2 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 03/13] board: dragonboard410c: Fix BD address Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:07   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 05/13] board: dragonboard410c: Drop reflash functionality Stephan Gerhold
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

This was originally taken from Linux, but at this point it's an inline
function upstream and no longer a macro. Given that we just want to extract
the serial number from the MMC CID, let's just inline that specifically.
This is also the style used in the MMC core code within U-Boot.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index c33529d31869b17c7a30ec83af1199d01db472f5..61d68e7f0c6bed16861e6ceaefd2c7dc94807d65 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -22,21 +22,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* UNSTUFF_BITS macro taken from Linux Kernel: drivers/mmc/core/sd.c */
-#define UNSTUFF_BITS(resp, start, size) \
-	({ \
-		const int __size = size; \
-		const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1;	\
-		const int __off = 3 - ((start) / 32); \
-		const int __shft = (start) & 31; \
-		u32 __res; \
-					\
-		__res = resp[__off] >> __shft; \
-		if (__size + __shft > 32) \
-			__res |= resp[__off - 1] << ((32 - __shft) % 32); \
-		__res & __mask;	\
-	})
-
 static u32 msm_board_serial(void)
 {
 	struct mmc *mmc_dev;
@@ -48,7 +33,8 @@ static u32 msm_board_serial(void)
 	if (mmc_init(mmc_dev))
 		return 0;
 
-	return UNSTUFF_BITS(mmc_dev->cid, 16, 32);
+	/* MMC serial number */
+	return mmc_dev->cid[2] << 16 | mmc_dev->cid[3] >> 16;
 }
 
 static void msm_generate_mac_addr(u8 *mac)

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/13] board: dragonboard410c: Drop reflash functionality
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (3 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:12   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 06/13] board: dragonboard410c: Drop unused linux_image Stephan Gerhold
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

This is broken ever since we switched to using U-Boot as first stage
bootloader. Since no one seems to test this actively, let's just drop this
entirely. There are other tools available for re-flashing the DB410c.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.env | 26 ----------------------
 1 file changed, 26 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index 9d9a575a0c3f7a4739e4fb77a980d742e10510f5..57a30031f743f43d4a6389286b426b404d2f371b 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -1,30 +1,4 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
-
-/* Does what recovery does */
-#define REFLASH(file, partnum) \
-part start mmc 0 partnum start && \
-part size mmc 0 partnum size && \
-tftp $loadaddr file &&  \
-mmc write $loadaddr $start $size &&
-
-reflash=
-mmc dev 0 &&
-usb start &&
-dhcp &&
-tftp $loadaddr dragonboard/rescue/gpt_both0.bin &&
-mmc write $loadaddr 0 43 &&
-mmc rescan &&
-REFLASH(dragonboard/rescue/NON-HLOS.bin, 1)
-REFLASH(dragonboard/rescue/sbl1.mbn, 2)
-REFLASH(dragonboard/rescue/rpm.mbn, 3)
-REFLASH(dragonboard/rescue/tz.mbn, 4)
-REFLASH(dragonboard/rescue/hyp.mbn, 5)
-REFLASH(dragonboard/rescue/sec.dat, 6)
-REFLASH(dragonboard/rescue/emmc_appsboot.mbn, 7)
-REFLASH(dragonboard/u-boot.img, 8)
-usb stop &&
-echo Reflash completed
-
 loadaddr=0x81000000
 initrd_high=0xffffffffffffffff
 linux_image=Image

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/13] board: dragonboard410c: Drop unused linux_image
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (4 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 05/13] board: dragonboard410c: Drop reflash functionality Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:08   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses Stephan Gerhold
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

This does not seem to be used anywhere.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.env | 1 -
 1 file changed, 1 deletion(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index 57a30031f743f43d4a6389286b426b404d2f371b..eb42c0abcf11fedf7ab86d1340531b4ff5b52bf5 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 loadaddr=0x81000000
 initrd_high=0xffffffffffffffff
-linux_image=Image
 kernel_addr_r=0x81000000
 fdtfile=qcom/apq8016-sbc.dtb
 fdt_addr_r=0x83000000

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (5 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 06/13] board: dragonboard410c: Drop unused linux_image Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:08   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 08/13] board: dragonboard410c: Fix counter frequency Stephan Gerhold
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The generic Qualcomm board code allocates addresses for loading the kernel,
ramdisk, DT, fastboot etc. This also happens on the DB410c and already
overrides these definitions defined in the default env. So let's just drop
the static ones, since the dynamic ones work just fine.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.c   | 2 +-
 board/qualcomm/dragonboard410c/dragonboard410c.env | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index 61d68e7f0c6bed16861e6ceaefd2c7dc94807d65..697e3c9b08b5c874912eb66ff4f0b3d32deaae01 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -66,7 +66,7 @@ int misc_init_r(void)
 
 	state = button_get_state(btn);
 	if (state == BUTTON_ON) {
-		env_set("preboot", "setenv preboot; fastboot 0");
+		env_set("preboot", "setenv preboot; run fastboot");
 		printf("vol_down pressed - Starting fastboot.\n");
 	}
 
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index eb42c0abcf11fedf7ab86d1340531b4ff5b52bf5..0032dc3592a1021e4bb422357867cc26b4b30551 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -1,9 +1,3 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
-loadaddr=0x81000000
 initrd_high=0xffffffffffffffff
-kernel_addr_r=0x81000000
-fdtfile=qcom/apq8016-sbc.dtb
-fdt_addr_r=0x83000000
-ramdisk_addr_r=0x84000000
-scriptaddr=0x90000000
-pxefile_addr_r=0x90100000
+fastboot=fastboot -l $fastboot_addr_r usb 0

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/13] board: dragonboard410c: Fix counter frequency
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (6 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:08   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet Stephan Gerhold
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The actual counter frequency is 19.2 MHz, not 19.0 MHz. This isn't really
used so far though, since probably no one (except me) ever tried using
U-Boot in EL3 where we need to program the counter frequency.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 configs/dragonboard410c_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 5870aae83b4fc8d6897eb0f18cc4eb153d299c11..b7f284b4fa2812c60804126362b61164135adeeb 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -1,6 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SYS_BOARD="dragonboard410c"
-CONFIG_COUNTER_FREQUENCY=19000000
+CONFIG_COUNTER_FREQUENCY=19200000
 CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y
 CONFIG_ARCH_SNAPDRAGON=y
 CONFIG_TEXT_BASE=0x8f600000

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (7 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 08/13] board: dragonboard410c: Fix counter frequency Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:09   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS Stephan Gerhold
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The Geniatech DB4 V3 [1] has a RTL8152 onboard for Ethernet. I don't have
one to test if that works, but the other USB Ethernet drivers work pretty
much as-is, so just enable it with the assumption it will work out fine.

[1]: https://www.96boards.org/product/db4/

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 configs/dragonboard410c_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index b7f284b4fa2812c60804126362b61164135adeeb..da1ec4bfc60cdf4a2a9077efb081383b5b39301a 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -69,6 +69,7 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
 CONFIG_USB_ETHER_MCS7830=y
+CONFIG_USB_ETHER_RTL8152=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_VENDOR_NUM=0x18d1

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (8 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:09   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images Stephan Gerhold
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

Reduce the environment size by using standard boot instead of distro boot.
It uses faster bootdevs first by default (eMMC -> SD -> USB -> Network), so
set "boot_targets" to keep the current ordering (USB -> SD -> eMMC ->
Network). Perhaps this should be changed for consistency, but for now this
keeps the behavior similar to before.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.env |  1 +
 configs/dragonboard410c_defconfig                  |  3 ++-
 include/configs/dragonboard410c.h                  | 11 -----------
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index 0032dc3592a1021e4bb422357867cc26b4b30551..71f929b646cc305cf5223cd3462fe2350bc8093e 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -1,3 +1,4 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 initrd_high=0xffffffffffffffff
 fastboot=fastboot -l $fastboot_addr_r usb 0
+boot_targets=usb mmc1 mmc0 pxe
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index da1ec4bfc60cdf4a2a9077efb081383b5b39301a..62fc42c9460d075fd27c3e2823eb8eea2a559772 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -16,7 +16,7 @@ CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
 CONFIG_REMAKE_ELF=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTSTD_FULL=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CBSIZE=512
@@ -35,6 +35,7 @@ CONFIG_CMD_USB=y
 CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_SYSBOOT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=2
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 00102cd5c4f54236366e4b6380a9c9537f9b4614..c31c6c57c1a4bebde740bc3fe535ca9610af043e 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -18,15 +18,4 @@
 #define PHYS_SDRAM_1_SIZE		SZ_1G
 #define CFG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 
-/* Environment */
-#define BOOT_TARGET_DEVICES(func) \
-	func(USB, usb, 0) \
-	func(MMC, mmc, 1) \
-	func(MMC, mmc, 0) \
-	func(DHCP, dhcp, na)
-
-#include <config_distro_bootcmd.h>
-
-#define CFG_EXTRA_ENV_SETTINGS BOOTENV
-
 #endif

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (9 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:10   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code Stephan Gerhold
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

The U-Boot port for DB410c still has plenty of extra space available at
this point, so avoid disabling features that would be normally enabled by
default. In particular, this incldues support for Android boot images,
which is quite likely to be used together with the USB Fastboot interface.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 configs/dragonboard410c_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 62fc42c9460d075fd27c3e2823eb8eea2a559772..414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -14,7 +14,6 @@ CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SYS_LOAD_ADDR=0x80080000
 CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
 CONFIG_REMAKE_ELF=y
-# CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
 CONFIG_BOOTSTD_FULL=y
 CONFIG_OF_BOARD_SETUP=y
@@ -25,7 +24,6 @@ CONFIG_SYS_PBSIZE=548
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_MISC_INIT_R=y
 CONFIG_SYS_PROMPT="dragonboard410c => "
-# CONFIG_CMD_IMI is not set
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_GPIO=y

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (10 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:10   ` Neil Armstrong
  2025-04-07 16:59 ` [PATCH 13/13] board: dragonboard410c: Update maintainers Stephan Gerhold
  2025-04-09 15:23 ` [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Caleb Connolly
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

Simplify the board code by using the new BUTTON_CMD functionality, instead
of implementing this separately using C code. This allows disabling or
customizing this functionality if wanted.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 board/qualcomm/dragonboard410c/dragonboard410c.c   | 22 ----------------------
 board/qualcomm/dragonboard410c/dragonboard410c.env |  2 ++
 configs/dragonboard410c_defconfig                  |  2 +-
 3 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index 697e3c9b08b5c874912eb66ff4f0b3d32deaae01..4698b9d5e3e47a9b0389d9f6bafab9dd6db56a41 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -51,28 +51,6 @@ static void msm_generate_mac_addr(u8 *mac)
 	put_unaligned_be32(msm_board_serial(), &mac[2]);
 }
 
-/* Check for vol- button - if pressed - stop autoboot */
-int misc_init_r(void)
-{
-	struct udevice *btn;
-	int ret;
-	enum button_state_t state;
-
-	ret = button_get_by_label("vol_down", &btn);
-	if (ret < 0) {
-		printf("Couldn't find power button!\n");
-		return ret;
-	}
-
-	state = button_get_state(btn);
-	if (state == BUTTON_ON) {
-		env_set("preboot", "setenv preboot; run fastboot");
-		printf("vol_down pressed - Starting fastboot.\n");
-	}
-
-	return 0;
-}
-
 int qcom_late_init(void)
 {
 	char serial[16];
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index 71f929b646cc305cf5223cd3462fe2350bc8093e..38399d65c640ee18261529ee3101b268700fa004 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -2,3 +2,5 @@
 initrd_high=0xffffffffffffffff
 fastboot=fastboot -l $fastboot_addr_r usb 0
 boot_targets=usb mmc1 mmc0 pxe
+button_cmd_0_name=vol_down
+button_cmd_0=run fastboot
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa..449d48a3c004117b832ad620d49beb681a9bda68 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -14,6 +14,7 @@ CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SYS_LOAD_ADDR=0x80080000
 CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
 CONFIG_REMAKE_ELF=y
+CONFIG_BUTTON_CMD=y
 CONFIG_FIT=y
 CONFIG_BOOTSTD_FULL=y
 CONFIG_OF_BOARD_SETUP=y
@@ -22,7 +23,6 @@ CONFIG_SYS_CBSIZE=512
 CONFIG_SYS_PBSIZE=548
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_MISC_INIT_R=y
 CONFIG_SYS_PROMPT="dragonboard410c => "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 13/13] board: dragonboard410c: Update maintainers
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (11 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code Stephan Gerhold
@ 2025-04-07 16:59 ` Stephan Gerhold
  2025-04-07 18:11   ` Neil Armstrong
  2025-04-09 15:23 ` [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Caleb Connolly
  13 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-07 16:59 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

Ramon has been inactive on the U-Boot mailing list for over a year now and
the DB410c port has not been updated much lately. I've been doing most of
the DB410c-specific fixes/rework lately and try to test it every now and
then, so add myself as new maintainer. Also add Sam as reviewer, since he's
been doing lots of testing and reviews for MSM8916 recently.

Cc: Sam Day <me@samcday.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
@Ramon: If you want to stay co-maintainer please let me know, I'm also
happy to just add myself and Sam additionally.
---
 board/qualcomm/dragonboard410c/MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/qualcomm/dragonboard410c/MAINTAINERS b/board/qualcomm/dragonboard410c/MAINTAINERS
index e78f5b2d6421c7e41436cfbb3292f06b10324c6d..9c10fa3053b042ef0b5b44a2c3c4a2f2956cfb60 100644
--- a/board/qualcomm/dragonboard410c/MAINTAINERS
+++ b/board/qualcomm/dragonboard410c/MAINTAINERS
@@ -1,5 +1,6 @@
 DRAGONBOARD410C BOARD
-M:	Ramon Fried <rfried.dev@gmail.com>
+M:	Stephan Gerhold <stephan@gerhold.net>
+R:	Sam Day <me@samcday.com>
 S:	Maintained
 F:	board/qualcomm/dragonboard410c/
 F:	include/configs/dragonboard410c.h

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 02/13] board: dragonboard410c: Fix RAM size
  2025-04-07 16:59 ` [PATCH 02/13] board: dragonboard410c: Fix RAM size Stephan Gerhold
@ 2025-04-07 18:06   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:06 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> DB410c has exactly 1 GiB of RAM. Some of it is reserved, but this is
> described separately in the DT.
> 
> This was fixed before in commit 1d667227ea51 ("board: dragonboard410c: Fix
> PHYS_SDRAM_1_SIZE"), but was reintroduced when DB410c was converted to use
> the upstream device tree.
> 
> Note that there are variants of apq8016-sbc with 2 GiB RAM (e.g. the
> Geniatech DB4). They need the WIP SMEM memory map parsing [1] to use the
> full amount of RAM.
> 
> [1]: https://lore.kernel.org/u-boot/20241124-b4-modernise-smem-v1-0-b7852c11b67c@linaro.org/T/
> 
> Fixes: ed8fbd2889fc ("dts: msm8916: replace with upstream DTS")
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   arch/arm/dts/apq8016-sbc-u-boot.dtsi | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/apq8016-sbc-u-boot.dtsi b/arch/arm/dts/apq8016-sbc-u-boot.dtsi
> index 585d54d29623823145e6b43eda89c05f31fc4403..c8a46ed14483f6939e7a666b2b279c803476ac63 100644
> --- a/arch/arm/dts/apq8016-sbc-u-boot.dtsi
> +++ b/arch/arm/dts/apq8016-sbc-u-boot.dtsi
> @@ -6,7 +6,7 @@
>   / {
>   	/* When running as a first-stage bootloader this isn't filled in automatically */
>   	memory@80000000 {
> -		reg = <0 0x80000000 0 0x3da00000>;
> +		reg = <0 0x80000000 0 0x40000000>;
>   	};
>   };
>   
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro
  2025-04-07 16:59 ` [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro Stephan Gerhold
@ 2025-04-07 18:07   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:07 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> This was originally taken from Linux, but at this point it's an inline
> function upstream and no longer a macro. Given that we just want to extract
> the serial number from the MMC CID, let's just inline that specifically.
> This is also the style used in the MMC core code within U-Boot.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.c | 18 ++----------------
>   1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
> index c33529d31869b17c7a30ec83af1199d01db472f5..61d68e7f0c6bed16861e6ceaefd2c7dc94807d65 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.c
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
> @@ -22,21 +22,6 @@
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> -/* UNSTUFF_BITS macro taken from Linux Kernel: drivers/mmc/core/sd.c */
> -#define UNSTUFF_BITS(resp, start, size) \
> -	({ \
> -		const int __size = size; \
> -		const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1;	\
> -		const int __off = 3 - ((start) / 32); \
> -		const int __shft = (start) & 31; \
> -		u32 __res; \
> -					\
> -		__res = resp[__off] >> __shft; \
> -		if (__size + __shft > 32) \
> -			__res |= resp[__off - 1] << ((32 - __shft) % 32); \
> -		__res & __mask;	\
> -	})
> -
>   static u32 msm_board_serial(void)
>   {
>   	struct mmc *mmc_dev;
> @@ -48,7 +33,8 @@ static u32 msm_board_serial(void)
>   	if (mmc_init(mmc_dev))
>   		return 0;
>   
> -	return UNSTUFF_BITS(mmc_dev->cid, 16, 32);
> +	/* MMC serial number */
> +	return mmc_dev->cid[2] << 16 | mmc_dev->cid[3] >> 16;
>   }
>   
>   static void msm_generate_mac_addr(u8 *mac)
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/13] board: dragonboard410c: Drop unused linux_image
  2025-04-07 16:59 ` [PATCH 06/13] board: dragonboard410c: Drop unused linux_image Stephan Gerhold
@ 2025-04-07 18:08   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:08 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> This does not seem to be used anywhere.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.env | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
> index 57a30031f743f43d4a6389286b426b404d2f371b..eb42c0abcf11fedf7ab86d1340531b4ff5b52bf5 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.env
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
> @@ -1,7 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0+ */
>   loadaddr=0x81000000
>   initrd_high=0xffffffffffffffff
> -linux_image=Image
>   kernel_addr_r=0x81000000
>   fdtfile=qcom/apq8016-sbc.dtb
>   fdt_addr_r=0x83000000
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses
  2025-04-07 16:59 ` [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses Stephan Gerhold
@ 2025-04-07 18:08   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:08 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> The generic Qualcomm board code allocates addresses for loading the kernel,
> ramdisk, DT, fastboot etc. This also happens on the DB410c and already
> overrides these definitions defined in the default env. So let's just drop
> the static ones, since the dynamic ones work just fine.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.c   | 2 +-
>   board/qualcomm/dragonboard410c/dragonboard410c.env | 8 +-------
>   2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
> index 61d68e7f0c6bed16861e6ceaefd2c7dc94807d65..697e3c9b08b5c874912eb66ff4f0b3d32deaae01 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.c
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
> @@ -66,7 +66,7 @@ int misc_init_r(void)
>   
>   	state = button_get_state(btn);
>   	if (state == BUTTON_ON) {
> -		env_set("preboot", "setenv preboot; fastboot 0");
> +		env_set("preboot", "setenv preboot; run fastboot");
>   		printf("vol_down pressed - Starting fastboot.\n");
>   	}
>   
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
> index eb42c0abcf11fedf7ab86d1340531b4ff5b52bf5..0032dc3592a1021e4bb422357867cc26b4b30551 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.env
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
> @@ -1,9 +1,3 @@
>   /* SPDX-License-Identifier: GPL-2.0+ */
> -loadaddr=0x81000000
>   initrd_high=0xffffffffffffffff
> -kernel_addr_r=0x81000000
> -fdtfile=qcom/apq8016-sbc.dtb
> -fdt_addr_r=0x83000000
> -ramdisk_addr_r=0x84000000
> -scriptaddr=0x90000000
> -pxefile_addr_r=0x90100000
> +fastboot=fastboot -l $fastboot_addr_r usb 0
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 08/13] board: dragonboard410c: Fix counter frequency
  2025-04-07 16:59 ` [PATCH 08/13] board: dragonboard410c: Fix counter frequency Stephan Gerhold
@ 2025-04-07 18:08   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:08 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> The actual counter frequency is 19.2 MHz, not 19.0 MHz. This isn't really
> used so far though, since probably no one (except me) ever tried using
> U-Boot in EL3 where we need to program the counter frequency.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   configs/dragonboard410c_defconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> index 5870aae83b4fc8d6897eb0f18cc4eb153d299c11..b7f284b4fa2812c60804126362b61164135adeeb 100644
> --- a/configs/dragonboard410c_defconfig
> +++ b/configs/dragonboard410c_defconfig
> @@ -1,6 +1,6 @@
>   CONFIG_ARM=y
>   CONFIG_SYS_BOARD="dragonboard410c"
> -CONFIG_COUNTER_FREQUENCY=19000000
> +CONFIG_COUNTER_FREQUENCY=19200000
>   CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y
>   CONFIG_ARCH_SNAPDRAGON=y
>   CONFIG_TEXT_BASE=0x8f600000
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet
  2025-04-07 16:59 ` [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet Stephan Gerhold
@ 2025-04-07 18:09   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:09 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> The Geniatech DB4 V3 [1] has a RTL8152 onboard for Ethernet. I don't have
> one to test if that works, but the other USB Ethernet drivers work pretty
> much as-is, so just enable it with the assumption it will work out fine.
> 
> [1]: https://www.96boards.org/product/db4/
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   configs/dragonboard410c_defconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> index b7f284b4fa2812c60804126362b61164135adeeb..da1ec4bfc60cdf4a2a9077efb081383b5b39301a 100644
> --- a/configs/dragonboard410c_defconfig
> +++ b/configs/dragonboard410c_defconfig
> @@ -69,6 +69,7 @@ CONFIG_USB_HOST_ETHER=y
>   CONFIG_USB_ETHER_ASIX=y
>   CONFIG_USB_ETHER_ASIX88179=y
>   CONFIG_USB_ETHER_MCS7830=y
> +CONFIG_USB_ETHER_RTL8152=y
>   CONFIG_USB_ETHER_SMSC95XX=y
>   CONFIG_USB_GADGET=y
>   CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS
  2025-04-07 16:59 ` [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS Stephan Gerhold
@ 2025-04-07 18:09   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:09 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> Reduce the environment size by using standard boot instead of distro boot.
> It uses faster bootdevs first by default (eMMC -> SD -> USB -> Network), so
> set "boot_targets" to keep the current ordering (USB -> SD -> eMMC ->
> Network). Perhaps this should be changed for consistency, but for now this
> keeps the behavior similar to before.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.env |  1 +
>   configs/dragonboard410c_defconfig                  |  3 ++-
>   include/configs/dragonboard410c.h                  | 11 -----------
>   3 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
> index 0032dc3592a1021e4bb422357867cc26b4b30551..71f929b646cc305cf5223cd3462fe2350bc8093e 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.env
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
> @@ -1,3 +1,4 @@
>   /* SPDX-License-Identifier: GPL-2.0+ */
>   initrd_high=0xffffffffffffffff
>   fastboot=fastboot -l $fastboot_addr_r usb 0
> +boot_targets=usb mmc1 mmc0 pxe
> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> index da1ec4bfc60cdf4a2a9077efb081383b5b39301a..62fc42c9460d075fd27c3e2823eb8eea2a559772 100644
> --- a/configs/dragonboard410c_defconfig
> +++ b/configs/dragonboard410c_defconfig
> @@ -16,7 +16,7 @@ CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
>   CONFIG_REMAKE_ELF=y
>   # CONFIG_ANDROID_BOOT_IMAGE is not set
>   CONFIG_FIT=y
> -CONFIG_DISTRO_DEFAULTS=y
> +CONFIG_BOOTSTD_FULL=y
>   CONFIG_OF_BOARD_SETUP=y
>   CONFIG_USE_PREBOOT=y
>   CONFIG_SYS_CBSIZE=512
> @@ -35,6 +35,7 @@ CONFIG_CMD_USB=y
>   CONFIG_BOOTP_BOOTFILESIZE=y
>   CONFIG_CMD_CACHE=y
>   CONFIG_CMD_TIMER=y
> +CONFIG_CMD_SYSBOOT=y
>   CONFIG_ENV_IS_IN_MMC=y
>   CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>   CONFIG_SYS_MMC_ENV_PART=2
> diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
> index 00102cd5c4f54236366e4b6380a9c9537f9b4614..c31c6c57c1a4bebde740bc3fe535ca9610af043e 100644
> --- a/include/configs/dragonboard410c.h
> +++ b/include/configs/dragonboard410c.h
> @@ -18,15 +18,4 @@
>   #define PHYS_SDRAM_1_SIZE		SZ_1G
>   #define CFG_SYS_SDRAM_BASE		PHYS_SDRAM_1
>   
> -/* Environment */
> -#define BOOT_TARGET_DEVICES(func) \
> -	func(USB, usb, 0) \
> -	func(MMC, mmc, 1) \
> -	func(MMC, mmc, 0) \
> -	func(DHCP, dhcp, na)
> -
> -#include <config_distro_bootcmd.h>
> -
> -#define CFG_EXTRA_ENV_SETTINGS BOOTENV
> -
>   #endif
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images
  2025-04-07 16:59 ` [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images Stephan Gerhold
@ 2025-04-07 18:10   ` Neil Armstrong
  2025-04-08  7:01     ` Stephan Gerhold
  0 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:10 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> The U-Boot port for DB410c still has plenty of extra space available at
> this point, so avoid disabling features that would be normally enabled by
> default. In particular, this incldues support for Android boot images,
> which is quite likely to be used together with the USB Fastboot interface.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   configs/dragonboard410c_defconfig | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> index 62fc42c9460d075fd27c3e2823eb8eea2a559772..414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa 100644
> --- a/configs/dragonboard410c_defconfig
> +++ b/configs/dragonboard410c_defconfig
> @@ -14,7 +14,6 @@ CONFIG_OF_LIBFDT_OVERLAY=y
>   CONFIG_SYS_LOAD_ADDR=0x80080000
>   CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
>   CONFIG_REMAKE_ELF=y
> -# CONFIG_ANDROID_BOOT_IMAGE is not set
>   CONFIG_FIT=y
>   CONFIG_BOOTSTD_FULL=y
>   CONFIG_OF_BOARD_SETUP=y
> @@ -25,7 +24,6 @@ CONFIG_SYS_PBSIZE=548
>   # CONFIG_DISPLAY_BOARDINFO is not set
>   CONFIG_MISC_INIT_R=y
>   CONFIG_SYS_PROMPT="dragonboard410c => "
> -# CONFIG_CMD_IMI is not set


What is IMI ?

>   CONFIG_CMD_MD5SUM=y
>   CONFIG_CMD_MEMINFO=y
>   CONFIG_CMD_GPIO=y
> 


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code
  2025-04-07 16:59 ` [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code Stephan Gerhold
@ 2025-04-07 18:10   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:10 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> Simplify the board code by using the new BUTTON_CMD functionality, instead
> of implementing this separately using C code. This allows disabling or
> customizing this functionality if wanted.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.c   | 22 ----------------------
>   board/qualcomm/dragonboard410c/dragonboard410c.env |  2 ++
>   configs/dragonboard410c_defconfig                  |  2 +-
>   3 files changed, 3 insertions(+), 23 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
> index 697e3c9b08b5c874912eb66ff4f0b3d32deaae01..4698b9d5e3e47a9b0389d9f6bafab9dd6db56a41 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.c
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
> @@ -51,28 +51,6 @@ static void msm_generate_mac_addr(u8 *mac)
>   	put_unaligned_be32(msm_board_serial(), &mac[2]);
>   }
>   
> -/* Check for vol- button - if pressed - stop autoboot */
> -int misc_init_r(void)
> -{
> -	struct udevice *btn;
> -	int ret;
> -	enum button_state_t state;
> -
> -	ret = button_get_by_label("vol_down", &btn);
> -	if (ret < 0) {
> -		printf("Couldn't find power button!\n");
> -		return ret;
> -	}
> -
> -	state = button_get_state(btn);
> -	if (state == BUTTON_ON) {
> -		env_set("preboot", "setenv preboot; run fastboot");
> -		printf("vol_down pressed - Starting fastboot.\n");
> -	}
> -
> -	return 0;
> -}
> -
>   int qcom_late_init(void)
>   {
>   	char serial[16];
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
> index 71f929b646cc305cf5223cd3462fe2350bc8093e..38399d65c640ee18261529ee3101b268700fa004 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.env
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
> @@ -2,3 +2,5 @@
>   initrd_high=0xffffffffffffffff
>   fastboot=fastboot -l $fastboot_addr_r usb 0
>   boot_targets=usb mmc1 mmc0 pxe
> +button_cmd_0_name=vol_down
> +button_cmd_0=run fastboot
> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> index 414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa..449d48a3c004117b832ad620d49beb681a9bda68 100644
> --- a/configs/dragonboard410c_defconfig
> +++ b/configs/dragonboard410c_defconfig
> @@ -14,6 +14,7 @@ CONFIG_OF_LIBFDT_OVERLAY=y
>   CONFIG_SYS_LOAD_ADDR=0x80080000
>   CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
>   CONFIG_REMAKE_ELF=y
> +CONFIG_BUTTON_CMD=y
>   CONFIG_FIT=y
>   CONFIG_BOOTSTD_FULL=y
>   CONFIG_OF_BOARD_SETUP=y
> @@ -22,7 +23,6 @@ CONFIG_SYS_CBSIZE=512
>   CONFIG_SYS_PBSIZE=548
>   # CONFIG_DISPLAY_CPUINFO is not set
>   # CONFIG_DISPLAY_BOARDINFO is not set
> -CONFIG_MISC_INIT_R=y
>   CONFIG_SYS_PROMPT="dragonboard410c => "
>   CONFIG_CMD_MD5SUM=y
>   CONFIG_CMD_MEMINFO=y
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 13/13] board: dragonboard410c: Update maintainers
  2025-04-07 16:59 ` [PATCH 13/13] board: dragonboard410c: Update maintainers Stephan Gerhold
@ 2025-04-07 18:11   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:11 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> Ramon has been inactive on the U-Boot mailing list for over a year now and
> the DB410c port has not been updated much lately. I've been doing most of
> the DB410c-specific fixes/rework lately and try to test it every now and
> then, so add myself as new maintainer. Also add Sam as reviewer, since he's
> been doing lots of testing and reviews for MSM8916 recently.
> 
> Cc: Sam Day <me@samcday.com>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
> @Ramon: If you want to stay co-maintainer please let me know, I'm also
> happy to just add myself and Sam additionally.
> ---
>   board/qualcomm/dragonboard410c/MAINTAINERS | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/MAINTAINERS b/board/qualcomm/dragonboard410c/MAINTAINERS
> index e78f5b2d6421c7e41436cfbb3292f06b10324c6d..9c10fa3053b042ef0b5b44a2c3c4a2f2956cfb60 100644
> --- a/board/qualcomm/dragonboard410c/MAINTAINERS
> +++ b/board/qualcomm/dragonboard410c/MAINTAINERS
> @@ -1,5 +1,6 @@
>   DRAGONBOARD410C BOARD
> -M:	Ramon Fried <rfried.dev@gmail.com>
> +M:	Stephan Gerhold <stephan@gerhold.net>
> +R:	Sam Day <me@samcday.com>
>   S:	Maintained
>   F:	board/qualcomm/dragonboard410c/
>   F:	include/configs/dragonboard410c.h
> 

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 03/13] board: dragonboard410c: Fix BD address
  2025-04-07 16:59 ` [PATCH 03/13] board: dragonboard410c: Fix BD address Stephan Gerhold
@ 2025-04-07 18:11   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:11 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> local-bd-address in the device tree needs to be formatted with the least
> significant byte first (i.e. little endian). We're not doing this when
> adding it to the DT, which means the MAC address ends up being reversed in
> Linux. Fix this by reversing the array before setting it in the DT.
> 
> We're also flipping the wrong bit when generating the BD address. Before
> reversing the array, the least significant bit is in the last byte.
> 
> Fixes: ff06dc240325 ("db410: alter WLAN/BT MAC address fixup")
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.c | 27 ++++++++++++++++++------
>   1 file changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
> index fcbf2c3fe60f21bae1c6d64b542a4d9867c33826..c33529d31869b17c7a30ec83af1199d01db472f5 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.c
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
> @@ -97,9 +97,9 @@ int qcom_late_init(void)
>   	return 0;
>   }
>   
> -/* Fixup of DTB for Linux Kernel
> - * 1. Fixup installed DRAM.
> - * 2. Fixup WLAN/BT Mac address:
> +/*
> + * Fixup of DTB for Linux Kernel
> + * 1. Fixup WLAN/BT Mac address:
>    *	First, check if MAC addresses for WLAN/BT exists as environemnt
>    *	variables wlanaddr,btaddr. if not, generate a unique address.
>    */
> @@ -107,6 +107,7 @@ int qcom_late_init(void)
>   int ft_board_setup(void *blob, struct bd_info *bd)
>   {
>   	u8 mac[ARP_HLEN];
> +	int i;
>   
>   	if (!eth_env_get_enetaddr("wlanaddr", mac)) {
>   		msm_generate_mac_addr(mac);
> @@ -118,12 +119,24 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>   	if (!eth_env_get_enetaddr("btaddr", mac)) {
>   		msm_generate_mac_addr(mac);
>   
> -/* The BD address is same as WLAN MAC address but with
> - * least significant bit flipped.
> - */
> -		mac[0] ^= 0x01;
> +		/*
> +		 * The BD address is same as WLAN MAC address but with
> +		 * least significant bit flipped.
> +		 */
> +		mac[ARP_HLEN - 1] ^= 0x01;
>   	};
>   
> +	/*
> +	 * Reverse array since local-bd-address is formatted with least
> +	 * significant byte first (little endian).
> +	 */
> +	for (i = 0; i < ARP_HLEN / 2; ++i) {
> +		u8 tmp = mac[i];
> +
> +		mac[i] = mac[ARP_HLEN - 1 - i];
> +		mac[ARP_HLEN - 1 - i] = tmp;
> +	}
> +
>   	do_fixup_by_compat(blob, "qcom,wcnss-bt",
>   			   "local-bd-address", mac, ARP_HLEN, 1);
>   	return 0;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c
  2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
@ 2025-04-07 18:12   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:12 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> The workaround for the "PSCI bug" on DragonBoard 410c implemented in
> arch/arm/mach-snapdragon/include/mach/boot0.h clobbers the x0 register
> by storing the CurrentEL in there. When running in EL1, the mode switch
> sequence implemented there later clears the register again, but this is
> skipped when U-Boot is booted in EL2.
> 
> This causes crashes in the mach-snapdragon board_fdt_blob_setup() later,
> because the invalid address stored in x0 gets dereferenced to check if it
> points to a valid DTB.
> 
> We can't rely on having a valid values in the CPU registers for the first
> stage bootloader configuration on DB410c, and nothing would place a DTB
> there anyway. Skip selecting the SAVE_PREV_BL_FDT_ADDR option for the boot0
> hook case to avoid crashing with the clobbered register value.
> 
> Fixes: 059d526af312 ("mach-snapdragon: generalise board support")
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   arch/arm/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 63aefeda9575fec8fc57194358df0819397d088e..af3d39196ee4fb201d4aad20a882bbbb39263396 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1115,7 +1115,7 @@ config ARCH_SNAPDRAGON
>   	select SPMI
>   	select BOARD_LATE_INIT
>   	select OF_BOARD
> -	select SAVE_PREV_BL_FDT_ADDR
> +	select SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK
>   	select LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK
>   	select SYSRESET
>   	select SYSRESET_PSCI
> 

Good catch

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 05/13] board: dragonboard410c: Drop reflash functionality
  2025-04-07 16:59 ` [PATCH 05/13] board: dragonboard410c: Drop reflash functionality Stephan Gerhold
@ 2025-04-07 18:12   ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-07 18:12 UTC (permalink / raw)
  To: Stephan Gerhold, Caleb Connolly
  Cc: Tom Rini, Ramon Fried, Sumit Garg, u-boot, u-boot-qcom, Sam Day

On 07/04/2025 18:59, Stephan Gerhold wrote:
> This is broken ever since we switched to using U-Boot as first stage
> bootloader. Since no one seems to test this actively, let's just drop this
> entirely. There are other tools available for re-flashing the DB410c.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
>   board/qualcomm/dragonboard410c/dragonboard410c.env | 26 ----------------------
>   1 file changed, 26 deletions(-)
> 
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
> index 9d9a575a0c3f7a4739e4fb77a980d742e10510f5..57a30031f743f43d4a6389286b426b404d2f371b 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.env
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
> @@ -1,30 +1,4 @@
>   /* SPDX-License-Identifier: GPL-2.0+ */
> -
> -/* Does what recovery does */
> -#define REFLASH(file, partnum) \
> -part start mmc 0 partnum start && \
> -part size mmc 0 partnum size && \
> -tftp $loadaddr file &&  \
> -mmc write $loadaddr $start $size &&
> -
> -reflash=
> -mmc dev 0 &&
> -usb start &&
> -dhcp &&
> -tftp $loadaddr dragonboard/rescue/gpt_both0.bin &&
> -mmc write $loadaddr 0 43 &&
> -mmc rescan &&
> -REFLASH(dragonboard/rescue/NON-HLOS.bin, 1)
> -REFLASH(dragonboard/rescue/sbl1.mbn, 2)
> -REFLASH(dragonboard/rescue/rpm.mbn, 3)
> -REFLASH(dragonboard/rescue/tz.mbn, 4)
> -REFLASH(dragonboard/rescue/hyp.mbn, 5)
> -REFLASH(dragonboard/rescue/sec.dat, 6)
> -REFLASH(dragonboard/rescue/emmc_appsboot.mbn, 7)
> -REFLASH(dragonboard/u-boot.img, 8)
> -usb stop &&
> -echo Reflash completed
> -
>   loadaddr=0x81000000
>   initrd_high=0xffffffffffffffff
>   linux_image=Image
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images
  2025-04-07 18:10   ` Neil Armstrong
@ 2025-04-08  7:01     ` Stephan Gerhold
  2025-04-08  7:18       ` Neil Armstrong
  0 siblings, 1 reply; 30+ messages in thread
From: Stephan Gerhold @ 2025-04-08  7:01 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Caleb Connolly, Tom Rini, Ramon Fried, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

On Mon, Apr 07, 2025 at 08:10:24PM +0200, Neil Armstrong wrote:
> On 07/04/2025 18:59, Stephan Gerhold wrote:
> > The U-Boot port for DB410c still has plenty of extra space available at
> > this point, so avoid disabling features that would be normally enabled by
> > default. In particular, this incldues support for Android boot images,
> > which is quite likely to be used together with the USB Fastboot interface.
> > 
> > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> > ---
> >   configs/dragonboard410c_defconfig | 2 --
> >   1 file changed, 2 deletions(-)
> > 
> > diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
> > index 62fc42c9460d075fd27c3e2823eb8eea2a559772..414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa 100644
> > --- a/configs/dragonboard410c_defconfig
> > +++ b/configs/dragonboard410c_defconfig
> > @@ -14,7 +14,6 @@ CONFIG_OF_LIBFDT_OVERLAY=y
> >   CONFIG_SYS_LOAD_ADDR=0x80080000
> >   CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
> >   CONFIG_REMAKE_ELF=y
> > -# CONFIG_ANDROID_BOOT_IMAGE is not set
> >   CONFIG_FIT=y
> >   CONFIG_BOOTSTD_FULL=y
> >   CONFIG_OF_BOARD_SETUP=y
> > @@ -25,7 +24,6 @@ CONFIG_SYS_PBSIZE=548
> >   # CONFIG_DISPLAY_BOARDINFO is not set
> >   CONFIG_MISC_INIT_R=y
> >   CONFIG_SYS_PROMPT="dragonboard410c => "
> > -# CONFIG_CMD_IMI is not set
> 
> 
> What is IMI ?
> 

The "iminfo" command. "print header information for application image".
I don't know why we need to disable that. I just dropped all weird
exclusions in the defconfig here.

Thanks,
Stephan

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images
  2025-04-08  7:01     ` Stephan Gerhold
@ 2025-04-08  7:18       ` Neil Armstrong
  0 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2025-04-08  7:18 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Caleb Connolly, Tom Rini, Ramon Fried, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day

On 08/04/2025 09:01, Stephan Gerhold wrote:
> On Mon, Apr 07, 2025 at 08:10:24PM +0200, Neil Armstrong wrote:
>> On 07/04/2025 18:59, Stephan Gerhold wrote:
>>> The U-Boot port for DB410c still has plenty of extra space available at
>>> this point, so avoid disabling features that would be normally enabled by
>>> default. In particular, this incldues support for Android boot images,
>>> which is quite likely to be used together with the USB Fastboot interface.
>>>
>>> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
>>> ---
>>>    configs/dragonboard410c_defconfig | 2 --
>>>    1 file changed, 2 deletions(-)
>>>
>>> diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
>>> index 62fc42c9460d075fd27c3e2823eb8eea2a559772..414dda6778c95eb3fdcd6ef522d8c7d0ef9219fa 100644
>>> --- a/configs/dragonboard410c_defconfig
>>> +++ b/configs/dragonboard410c_defconfig
>>> @@ -14,7 +14,6 @@ CONFIG_OF_LIBFDT_OVERLAY=y
>>>    CONFIG_SYS_LOAD_ADDR=0x80080000
>>>    CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
>>>    CONFIG_REMAKE_ELF=y
>>> -# CONFIG_ANDROID_BOOT_IMAGE is not set
>>>    CONFIG_FIT=y
>>>    CONFIG_BOOTSTD_FULL=y
>>>    CONFIG_OF_BOARD_SETUP=y
>>> @@ -25,7 +24,6 @@ CONFIG_SYS_PBSIZE=548
>>>    # CONFIG_DISPLAY_BOARDINFO is not set
>>>    CONFIG_MISC_INIT_R=y
>>>    CONFIG_SYS_PROMPT="dragonboard410c => "
>>> -# CONFIG_CMD_IMI is not set
>>
>>
>> What is IMI ?
>>
> 
> The "iminfo" command. "print header information for application image".
> I don't know why we need to disable that. I just dropped all weird
> exclusions in the defconfig here.

Indeed, weird


Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

> 
> Thanks,
> Stephan


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup
  2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
                   ` (12 preceding siblings ...)
  2025-04-07 16:59 ` [PATCH 13/13] board: dragonboard410c: Update maintainers Stephan Gerhold
@ 2025-04-09 15:23 ` Caleb Connolly
  13 siblings, 0 replies; 30+ messages in thread
From: Caleb Connolly @ 2025-04-09 15:23 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Tom Rini, Ramon Fried, Neil Armstrong, Sumit Garg, u-boot,
	u-boot-qcom, Sam Day



On 4/7/25 18:59, Stephan Gerhold wrote:
> The DB410c U-Boot port has not been updated much lately. This series
> includes various fixes and cleanup to bring it back into better shape. I've
> also added myself as new maintainer (and Sam as reviewer), since Ramon has
> not been active on the U-Boot mailing list for over a year now.
> 
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>

Thanks for this! Awesome cleanup. Really no other words, this is art :D

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>> ---
> Stephan Gerhold (13):
>        mach-snapdragon: Fix EL2 boot on DragonBoard 410c
>        board: dragonboard410c: Fix RAM size
>        board: dragonboard410c: Fix BD address
>        board: dragonboard410c: Drop UNSTUFF_BITS() macro
>        board: dragonboard410c: Drop reflash functionality
>        board: dragonboard410c: Drop unused linux_image
>        board: dragonboard410c: Use dynamically allocated load addresses
>        board: dragonboard410c: Fix counter frequency
>        board: dragonboard410c: Enable RTL8152 ethernet
>        board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS
>        board: dragonboard410c: Enable support for Android boot images
>        board: dragonboard410c: Use button_cmd instead of custom code
>        board: dragonboard410c: Update maintainers
> 
>   arch/arm/Kconfig                                   |  2 +-
>   arch/arm/dts/apq8016-sbc-u-boot.dtsi               |  2 +-
>   board/qualcomm/dragonboard410c/MAINTAINERS         |  3 +-
>   board/qualcomm/dragonboard410c/dragonboard410c.c   | 67 +++++++---------------
>   board/qualcomm/dragonboard410c/dragonboard410c.env | 38 ++----------
>   configs/dragonboard410c_defconfig                  | 10 ++--
>   include/configs/dragonboard410c.h                  | 11 ----
>   7 files changed, 35 insertions(+), 98 deletions(-)
> ---
> base-commit: 4b2895adb0ab94fdaabd6c19cef4d72986483461
> change-id: 20250407-db410c-fixes-85c6a6de2716
> 
> Best regards,
-- 
Caleb (they/them)


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2025-04-09 15:23 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
2025-04-07 18:12   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 02/13] board: dragonboard410c: Fix RAM size Stephan Gerhold
2025-04-07 18:06   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 03/13] board: dragonboard410c: Fix BD address Stephan Gerhold
2025-04-07 18:11   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro Stephan Gerhold
2025-04-07 18:07   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 05/13] board: dragonboard410c: Drop reflash functionality Stephan Gerhold
2025-04-07 18:12   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 06/13] board: dragonboard410c: Drop unused linux_image Stephan Gerhold
2025-04-07 18:08   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses Stephan Gerhold
2025-04-07 18:08   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 08/13] board: dragonboard410c: Fix counter frequency Stephan Gerhold
2025-04-07 18:08   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet Stephan Gerhold
2025-04-07 18:09   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS Stephan Gerhold
2025-04-07 18:09   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images Stephan Gerhold
2025-04-07 18:10   ` Neil Armstrong
2025-04-08  7:01     ` Stephan Gerhold
2025-04-08  7:18       ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code Stephan Gerhold
2025-04-07 18:10   ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 13/13] board: dragonboard410c: Update maintainers Stephan Gerhold
2025-04-07 18:11   ` Neil Armstrong
2025-04-09 15:23 ` [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Caleb Connolly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox