@@ -1,6 +1,6 @@
-From eca387ea507bde160558a0e5301bf2e0f1985b3b Mon Sep 17 00:00:00 2001
+From e05fdd93645dab2217bb5bfabcc04845415cf7ed Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
-Date: Fri, 19 Jun 2020 11:34:32 +0100
+Date: Fri, 19 Jun 2020 12:40:20 +0100
Subject: [PATCH] pinctrl: mediatek: add PUPD/R0/R1 support for MT7623
The pins for the MMC controller weren't being set up correctly because the
@@ -8,6 +8,7 @@ pinctrl driver only sets the GPIO pullup/pulldown config and doesn't
handle the special cases with PUPD/R0/R1 control.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
+Tested-by: Frank Wunderlich <frank-w@public-files.de>
---
drivers/pinctrl/mediatek/pinctrl-mt7623.c | 129 ++++++++++++++++++
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 19 ++-
@@ -162,7 +163,7 @@ index d58d840e08..0f5dcb2c63 100644
static const struct mtk_pin_desc mt7623_pins[] = {
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
-index 5fdc150295..f5199fc574 100644
+index e8187a3780..6553dde45c 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -296,7 +296,7 @@ static const struct pinconf_param mtk_conf_params[] = {
@@ -1,22 +1,28 @@
-From fb2810b2c7209d4ed690e48e5bffa52d1af2eda3 Mon Sep 17 00:00:00 2001
+From 6731bef6966ea2b26cdcfe0109ff5a950003fd03 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
-Date: Fri, 19 Jun 2020 22:57:04 +0100
+Date: Fri, 19 Jun 2020 23:07:17 +0100
Subject: [PATCH] env/fat.c: allow loading from a FAT partition on the MMC boot
device
I don't want to have to specify the device; only the partition.
+This allows me to use the same image on internal eMMC or SD card for
+Banana Pi R2, and it finds its own environment either way.
+
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
+[trini: Add #if/#else/#endif logic around CONFIG_SYS_MMC_ENV_DEV usage,
+ whitespace changes]
+Signed-off-by: Tom Rini <trini@konsulko.com>
---
env/Kconfig | 4 ++++
- env/fat.c | 31 +++++++++++++++++++++++++++++--
- 2 files changed, 33 insertions(+), 2 deletions(-)
+ env/fat.c | 32 ++++++++++++++++++++++++++++++--
+ 2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/env/Kconfig b/env/Kconfig
-index 0d6f559b39..a2020a8661 100644
+index 38e7fadbb9..5784136674 100644
--- a/env/Kconfig
+++ b/env/Kconfig
-@@ -432,6 +432,10 @@ config ENV_FAT_DEVICE_AND_PART
+@@ -434,6 +434,10 @@ config ENV_FAT_DEVICE_AND_PART
If none, first valid partition in device D. If no
partition table then means device D.
@@ -28,17 +34,21 @@ index 0d6f559b39..a2020a8661 100644
string "Name of the FAT file to use for the environment"
depends on ENV_IS_IN_FAT
diff --git a/env/fat.c b/env/fat.c
-index 1836556f36..1c32d17bd5 100644
+index 35a1955e63..63aced9317 100644
--- a/env/fat.c
+++ b/env/fat.c
-@@ -31,6 +31,33 @@
+@@ -29,6 +29,36 @@
# endif
#endif
+#if defined(CMD_SAVEENV) || defined(CMD_LOADENV)
+__weak int mmc_get_env_dev(void)
+{
-+ return CONFIG_SYS_MMC_ENV_DEV;
++#ifdef CONFIG_SYS_MMC_ENV_DEV
++ return CONFIG_SYS_MMC_ENV_DEV;
++#else
++ return 0;
++#endif
+}
+
+static char *env_fat_device_and_part(void)
@@ -48,8 +58,7 @@ index 1836556f36..1c32d17bd5 100644
+
+ if (!part_str) {
+ part_str = CONFIG_ENV_FAT_DEVICE_AND_PART;
-+ if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc")
-+ && part_str[0] == ':') {
++ if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc") && part_str[0] == ':') {
+ part_str = "0" CONFIG_ENV_FAT_DEVICE_AND_PART;
+ part_str[0] += mmc_get_env_dev();
+ }
@@ -65,7 +74,7 @@ index 1836556f36..1c32d17bd5 100644
#ifdef CMD_SAVEENV
static int env_fat_save(void)
{
-@@ -46,7 +73,7 @@ static int env_fat_save(void)
+@@ -43,7 +71,7 @@ static int env_fat_save(void)
return err;
part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
@@ -74,7 +83,7 @@ index 1836556f36..1c32d17bd5 100644
&dev_desc, &info, 1);
if (part < 0)
return 1;
-@@ -93,7 +120,7 @@ static int env_fat_load(void)
+@@ -89,7 +117,7 @@ static int env_fat_load(void)
#endif
part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
@@ -1,6 +1,6 @@
-From b0d1b85fb25a28a9532eaa9dda064b40a0e25f25 Mon Sep 17 00:00:00 2001
+From e3cc511eef5d99491e0c51324be499b688dde8de Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
-Date: Sun, 12 Jul 2020 23:19:09 +0100
+Date: Sun, 12 Jul 2020 23:33:01 +0100
Subject: [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms
without external SD
@@ -1,6 +1,6 @@
-From d13abe5b2c5b85228bdd34584fcbd642f1883668 Mon Sep 17 00:00:00 2001
+From 3fad1ca28d4c87346d18b89438bf2084fb2c3896 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
-Date: Sun, 12 Jul 2020 23:23:05 +0100
+Date: Sun, 12 Jul 2020 23:33:03 +0100
Subject: [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
This is an MT7623A-based board, very similar to the Banana Pi R2.
@@ -11,16 +11,17 @@ Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
arch/arm/dts/Makefile | 1 +
.../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++
+ board/mediatek/mt7623/MAINTAINERS | 7 +
configs/mt7623a_unielec_u7623_02_defconfig | 54 +++++
- 3 files changed, 266 insertions(+)
+ 4 files changed, 273 insertions(+)
create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
-index 89fa448818..a140b1c8d4 100644
+index a3a1e3fbe4..caa7756c5d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -938,6 +938,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
+@@ -949,6 +949,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
@@ -245,6 +246,21 @@ index 0000000000..fdeec75b05
+ pinctrl-0 = <&uart2_pins_b>;
+ status = "okay";
+};
+diff --git a/board/mediatek/mt7623/MAINTAINERS b/board/mediatek/mt7623/MAINTAINERS
+index eeb0375d70..1a8d796bd3 100644
+--- a/board/mediatek/mt7623/MAINTAINERS
++++ b/board/mediatek/mt7623/MAINTAINERS
+@@ -5,3 +5,10 @@ S: Maintained
+ F: board/mediatek/mt7623
+ F: include/configs/mt7623.h
+ F: configs/mt7623n_bpir2_defconfig
++
++UNIELEC U7623
++M: Ryder Lee <ryder.lee@mediatek.com>
++M: David Woodhouse <dwmw2@infradead.org>
++S: Maintained
++F: arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
++F: configs/mt7623a_unielec_u7623_02_defconfig
diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig
new file mode 100644
index 0000000000..72b5f31092
Now that my patches have been merged into upstream U-Boot, resync the cosmetic changes and the commit IDs from the final commits. Signed-off-by: David Woodhouse <dwmw2@infradead.org> --- .../patches/006-mt7623-pinctrl-fix.patch | 7 ++-- .../patches/007-env-fat-use-bootdevice.patch | 35 ++++++++++++------- ...ix-mmc_get_boot_dev-for-platforms-wi.patch | 4 +-- ...-Add-support-for-UniElec-U7623-board.patch | 26 +++++++++++--- 4 files changed, 49 insertions(+), 23 deletions(-)