Skip to contentSkip to conversation

board: mediatek: fix mmc_get_boot_dev() for platforms without external SD

PATCH New David Woodhouse 2 participants 7 messages Jul 12, 2020 – Jul 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 board: mediatek: fix mmc_get_boot_dev() for platforms without external SD

On the UniElec U7623 board there is no external SD slot and the preloader doesn't fill in the magic field at 0x81dffff0 to indicate that it was booted from eMMC.

---
 board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++
 1 file changed, 7 insertions(+)
board/mediatek/mt7623/mt7623_rfb.c +7 -0
index 4ec2764976..984e75ccaf 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <mmc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -15,10 +16,15 @@ int board_init(void)
 	return 0;
 }
 
+#ifdef CONFIG_MMC
 int mmc_get_boot_dev(void)
 {
 	int g_mmc_devid = -1;
 	char *uflag = (char *)0x81DFFFF0;
+
+	if (!find_mmc_device(1))
+		return 0;
+
 	if (strncmp(uflag,"eMMC",4)==0) {
 		g_mmc_devid = 0;
 		printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid);
@@ -33,3 +39,4 @@ int mmc_get_env_dev(void)
 {
 	return mmc_get_boot_dev();
 }
+#endif
Signature · 1 line
2.26.2
#1 lore raw

PATCH 2/3 board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment

Rather than hard-coding it to the Banana Pi R2.

---
 configs/mt7623n_bpir2_defconfig | 2 +-
 include/configs/mt7623.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/mt7623n_bpir2_defconfig +1 -1
index 6b9fbd7e22..918c52d608 100644
@@ -12,7 +12,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
-CONFIG_DEFAULT_FDT_FILE="mt7623n-bananapi-bpi-r2"
+CONFIG_DEFAULT_FDT_FILE="mt7623n-bananapi-bpi-r2.dtb"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTMENU=y
include/configs/mt7623.h +1 -1
index fe436cca38..33e07ed646 100644
@@ -51,7 +51,7 @@
 	"fdt_high=" FDT_HIGH "\0"			\
 	"kernel_addr_r=0x84000000\0"			\
 	"fdt_addr_r=" FDT_HIGH "\0"			\
-	"fdtfile=mt7623n-bananapi-bpi-r2.dtb" "\0"
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"
 
 /* Ethernet */
 #define CONFIG_IPADDR			192.168.1.1
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/3 board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment

Quoted 3 lines · David Woodhouse

Rather than hard-coding it to the Banana Pi R2.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/fee36ec3/attachment.sig>
#3 lore raw

PATCH 3/3 board: mediatek: Add support for UniElec U7623 board

In reply to David Woodhouse

This is an MT7623A-based board, very similar to the Banana Pi R2.

http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN

---
 arch/arm/dts/Makefile                         |   1 +
 .../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++
 configs/mt7623a_unielec_u7623_02_defconfig    |  54 +++++
 3 files changed, 266 insertions(+)
 create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
 create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig
arch/arm/dts/Makefile +1 -0
index 89fa448818..a140b1c8d4 100644
@@ -938,6 +938,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
 
 dtb-$(CONFIG_ARCH_MEDIATEK) += \
 	mt7622-rfb.dtb \
+	mt7623a-unielec-u7623-02-emmc.dtb \
 	mt7623n-bananapi-bpi-r2.dtb \
 	mt7629-rfb.dtb \
 	mt8512-bm1-emmc.dtb \
arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts new file +211 -0

211 lines not on this page · raw message

configs/mt7623a_unielec_u7623_02_defconfig new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.26.2
#4 lore raw

PATCH 3/3 board: mediatek: Add support for UniElec U7623 board

Quoted 3 lines · David Woodhouse

This is an MT7623A-based board, very similar to the Banana Pi R2.

http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN

Ping?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5174 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200724/8a1f7dd8/attachment.bin>

#5 lore raw

PATCH 3/3 board: mediatek: Add support for UniElec U7623 board

In reply to David Woodhouse
Quoted 5 lines · David Woodhouse

This is an MT7623A-based board, very similar to the Banana Pi R2.

http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/a1ea40ec/attachment.sig>
#6 lore raw

PATCH 1/3 board: mediatek: fix mmc_get_boot_dev() for platforms without external SD

In reply to David Woodhouse
Quoted 5 lines · David Woodhouse

On the UniElec U7623 board there is no external SD slot and the preloader doesn't fill in the magic field at 0x81dffff0 to indicate that it was booted from eMMC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/dbafa0e0/attachment.sig>