From patchwork Tue Aug 4 09:31:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 1340755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=iHAz16ez; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=XUowiDTu; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BLV160Gxxz9sRR for ; Tue, 4 Aug 2020 19:33:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CS5wcK8w/jYXShDb8gRf8JFIJqh4uQEeYg/2UkFZDjs=; b=iHAz16ezWHwTYe2EIgjX4o+ZHm FQbiOAkAoZXcXt/KSgZKO2nnpHd6Cb5xWz1abU7ojYdOv5f6libB/h00WVH1SYhWUDYMgkinT8691 O+x20BTcg1V2/iG/tV8A0eA8D3iyVxTIN7X+ZHqWC1xAk4bB+dEXLsmx5JKbsDUkRWuvNrIQ7ZJZx BNF6XVZor4PZabg5BFMF9XmWeMfE385KwnfhO+tOY8nga9B49RTSHMAXDNsC3Hi7nqnzOpyR84oMW 2gGGQ77b5zUnXFiXrvLyA0azPdTGoR61q0HE9B2bvYKzbqtRM9zJP/iVaqHqUEuNxf5wppFX/O/Qd dS/2LVDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2tHw-0000TF-Dx; Tue, 04 Aug 2020 09:31:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2tHt-0000Sr-8e for openwrt-devel@merlin.infradead.org; Tue, 04 Aug 2020 09:31:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=Sm6A14+tbCi99RpAoBiYUiPzQe8mSsR1XkgE9iu/PQU=; b=XUowiDTuyZyZggya0B5nIwUaaI QaKea0322tGXNmjJQW4bs8SNYr+Qu5xUdKkMB6Ta3l/EZObTWCvtKVMFXIseMcEN3TLui0GCkCBeL +eO7sF+4RnYGzJxFz+jLYybNXkOIcqmpmOgxggyXxiHmbG6BzRwRGgCfmIIiYVm34H5QehnPBeG9J gT6S9VRj/Ve7DYnEHawYojtYDJGQ4La2jwDJrAuEeovpCPjwsy11R9MvWx3p6z37wX0A0s2KBQOt1 mENpivCdgWFzI3DG87qJqG8CSY7mwJj3Y4vTVhommrk3IVe3EPklXILfkg22hnN0KrRXi2IoFt2VH 9Kyj4FnQ==; Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2tHr-0003iK-Lo; Tue, 04 Aug 2020 09:31:12 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.93 #3 (Red Hat Linux)) id 1k2tHr-0099j7-8E; Tue, 04 Aug 2020 10:31:11 +0100 From: David Woodhouse To: openwrt-devel@lists.openwrt.org, john@phrozen.org Subject: [PATCH 2/2] uboot-mediatek: resync patches with upstream Date: Tue, 4 Aug 2020 10:31:11 +0100 Message-Id: <20200804093111.2182295-2-dwmw2@infradead.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200804093111.2182295-1-dwmw2@infradead.org> References: <20200804093111.2182295-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- .../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(-) diff --git a/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch b/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch index c5a0cb9c6d..2e50717b72 100644 --- a/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch +++ b/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch @@ -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 -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 +Tested-by: Frank Wunderlich --- 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[] = { diff --git a/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch b/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch index 20b6620d71..a0236785d0 100644 --- a/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch +++ b/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch @@ -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 -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 +[trini: Add #if/#else/#endif logic around CONFIG_SYS_MMC_ENV_DEV usage, + whitespace changes] +Signed-off-by: Tom Rini --- 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, diff --git a/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch index e32114a880..f57beed094 100644 --- a/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch +++ b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch @@ -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 -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 diff --git a/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch index 32bef358f4..e4cf8e56ad 100644 --- a/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch +++ b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch @@ -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 -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 --- 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 ++M: David Woodhouse ++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