All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD
@ 2020-07-12 22:33 David Woodhouse
  2020-07-12 22:33 ` [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Woodhouse @ 2020-07-12 22:33 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
 board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c
index 4ec2764976..984e75ccaf 100644
--- a/board/mediatek/mt7623/mt7623_rfb.c
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -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
-- 
2.26.2

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

* [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment
  2020-07-12 22:33 [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD David Woodhouse
@ 2020-07-12 22:33 ` David Woodhouse
  2020-07-29 13:45   ` Tom Rini
  2020-07-12 22:33 ` [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board David Woodhouse
  2020-07-29 13:45 ` [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2020-07-12 22:33 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
 configs/mt7623n_bpir2_defconfig | 2 +-
 include/configs/mt7623.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
index 6b9fbd7e22..918c52d608 100644
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
@@ -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
diff --git a/include/configs/mt7623.h b/include/configs/mt7623.h
index fe436cca38..33e07ed646 100644
--- a/include/configs/mt7623.h
+++ b/include/configs/mt7623.h
@@ -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
-- 
2.26.2

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

* [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
  2020-07-12 22:33 [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD David Woodhouse
  2020-07-12 22:33 ` [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment David Woodhouse
@ 2020-07-12 22:33 ` David Woodhouse
  2020-07-23 23:17   ` David Woodhouse
  2020-07-29 13:45   ` Tom Rini
  2020-07-29 13:45 ` [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD Tom Rini
  2 siblings, 2 replies; 7+ messages in thread
From: David Woodhouse @ 2020-07-12 22:33 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
 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

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 89fa448818..a140b1c8d4 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 \
 
 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 \
diff --git a/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
new file mode 100644
index 0000000000..fdeec75b05
--- /dev/null
+++ b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.
+ * Author: Ryder Lee <ryder.lee@mediatek.com>
+ *
+ * SPDX-License-Identifier: (GPL-2.0 OR MIT)
+ */
+
+/dts-v1/;
+#include "mt7623.dtsi"
+#include "mt7623-u-boot.dtsi"
+
+/ {
+	model = "UniElec U7623-02 eMMC";
+	compatible = "unielec,u7623-02-emmc", "mediatek,mt7623";
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x20000000>;
+	};
+
+	chosen {
+		stdout-path = &uart2;
+		tick-timer = &timer0;
+	};
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led3 {
+			label = "u7623-01:green:led3";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led4 {
+			label = "u7623-01:green:led4";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+};
+
+&eth {
+	status = "okay";
+	mediatek,gmac-id = <0>;
+	phy-mode = "rgmii";
+	mediatek,switch = "mt7530";
+	mediatek,mcm;
+
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_default>;
+	status = "okay";
+	bus-width = <8>;
+	max-frequency = <50000000>;
+	cap-mmc-highspeed;
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	non-removable;
+};
+
+&pinctrl {
+	ephy_default: ephy_default {
+		mux {
+			function = "eth";
+			groups = "mdc_mdio", "ephy";
+		};
+
+		conf {
+			pins = "G2_TXEN", "G2_TXD0", "G2_TXD1", "G2_TXD2",
+			       "G2_TXD3", "G2_TXC", "G2_RXC", "G2_RXD0",
+			       "G2_RXD1", "G2_RXD2", "G2_RXD3", "G2_RXDV",
+			       "MDC", "MDIO";
+			drive-strength = <12>;
+			mediatek,tdsel = <5>;
+		};
+	};
+
+	mmc0_pins_default: mmc0default {
+		mux {
+			function = "msdc";
+			groups =  "msdc0";
+		};
+
+		conf-cmd-data {
+			pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1",
+			       "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4",
+			       "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7";
+			input-enable;
+			bias-pull-up;
+		};
+
+		conf-clk {
+			pins = "MSDC0_CLK";
+			bias-pull-down;
+		};
+
+		conf-rst {
+			pins = "MSDC0_RSTB";
+			bias-pull-up;
+		};
+	};
+
+	pcie_default: pcie-default {
+		mux {
+			function = "pcie";
+			groups =  "pcie0_0_perst", "pcie1_0_perst";
+		};
+	};
+
+	uart0_pins_a: uart0-default {
+		mux {
+			function = "uart";
+			groups =  "uart0_0_txd_rxd";
+		};
+	};
+
+	uart1_pins_a: uart1-default {
+		mux {
+			function = "uart";
+			groups =  "uart1_0_txd_rxd";
+		};
+	};
+
+	uart2_pins_a: uart2-default {
+		mux {
+			function = "uart";
+			groups =  "uart2_0_txd_rxd";
+		};
+	};
+
+	uart2_pins_b: uart2-alt {
+		mux {
+			function = "uart";
+			groups =  "uart2_1_txd_rxd";
+		};
+	};
+};
+
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie_default>;
+	status = "okay";
+
+	pcie at 0,0 {
+		status = "okay";
+	};
+
+	pcie at 1,0 {
+		status = "okay";
+	};
+};
+
+&pcie0_phy {
+	status = "okay";
+};
+
+&pcie1_phy {
+	status = "okay";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins_a>;
+	status = "okay";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins_b>;
+	status = "okay";
+};
diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig
new file mode 100644
index 0000000000..72b5f31092
--- /dev/null
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -0,0 +1,54 @@
+CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SYS_TEXT_BASE=0x81e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x100000
+CONFIG_TARGET_MT7623=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=3
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb"
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+CONFIG_CMD_BOOTMENU=y
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_READ=y
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_DM_MMC=y
+# CONFIG_MMC_QUIRKS is not set
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_MMC_MTK=y
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7623=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_TIMER=y
+CONFIG_MTK_TIMER=y
+CONFIG_WDT_MTK=y
+CONFIG_LZMA=y
-- 
2.26.2

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

* [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
  2020-07-12 22:33 ` [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board David Woodhouse
@ 2020-07-23 23:17   ` David Woodhouse
  2020-07-29 13:45   ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2020-07-23 23:17 UTC (permalink / raw)
  To: u-boot

On Sun, 2020-07-12 at 23:33 +0100, David Woodhouse wrote:
> 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>

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

* [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD
  2020-07-12 22:33 [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD David Woodhouse
  2020-07-12 22:33 ` [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment David Woodhouse
  2020-07-12 22:33 ` [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board David Woodhouse
@ 2020-07-29 13:45 ` Tom Rini
  2 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2020-07-29 13:45 UTC (permalink / raw)
  To: u-boot

On Sun, Jul 12, 2020 at 11:33:01PM +0100, David Woodhouse wrote:

> 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.
> 
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Applied to u-boot/master, thanks!

-- 
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>

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

* [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment
  2020-07-12 22:33 ` [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment David Woodhouse
@ 2020-07-29 13:45   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2020-07-29 13:45 UTC (permalink / raw)
  To: u-boot

On Sun, Jul 12, 2020 at 11:33:02PM +0100, David Woodhouse wrote:

> Rather than hard-coding it to the Banana Pi R2.
> 
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Applied to u-boot/master, thanks!

-- 
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>

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

* [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
  2020-07-12 22:33 ` [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board David Woodhouse
  2020-07-23 23:17   ` David Woodhouse
@ 2020-07-29 13:45   ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2020-07-29 13:45 UTC (permalink / raw)
  To: u-boot

On Sun, Jul 12, 2020 at 11:33:03PM +0100, David Woodhouse wrote:

> 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
> 
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Applied to u-boot/master, thanks!

-- 
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>

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

end of thread, other threads:[~2020-07-29 13:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 22:33 [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD David Woodhouse
2020-07-12 22:33 ` [PATCH 2/3] board: mediatek: Use CONFIG_DEFAULT_FDT_FILE for default environment David Woodhouse
2020-07-29 13:45   ` Tom Rini
2020-07-12 22:33 ` [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board David Woodhouse
2020-07-23 23:17   ` David Woodhouse
2020-07-29 13:45   ` Tom Rini
2020-07-29 13:45 ` [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms without external SD Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.