public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper
@ 2019-07-30  7:12 Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic Lukasz Majewski
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This patch series converts imx6q based tpc70 board to use driver model and
device tree description in SPL and u-boot proper.

All the non-DM parts of the code has been removed.
This patch series also uses the Common Clock Framework [CCF] as a base for
clock management on imx6q board.

Travis-CI: https://travis-ci.org/lmajewski/u-boot-dfu/builds/565198753

Those patches are applied on top of -master:
SHA1: 75551c8bfc9545e31ec2ce238cac3857904007b8



Lukasz Majewski (11):
  imx: tpc70: config: Add script commands to update u-boot and OE's wic
  imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL
    update
  imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD
    boot
  imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB
    compilation
  imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock
  imx: tpc70: led: Enable LED default state
  imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  imx: dts: Add u-boot specific set of device tree properties for tpc70
  imx: tpc70: Convert TPC70 (imx6q) board to use DM/DTS in SPL and
    u-boot
  imx: spl: tpc70: Do not remove clock related properties from DTS
  imx: config: Update KP's TPC70 config to support SWUpdate

 arch/arm/dts/Makefile                     |   1 +
 arch/arm/dts/imx6q-kp-u-boot.dtsi         |  59 ++++++++
 arch/arm/dts/imx6q-kp.dts                 | 219 ++++++++++++++++++++++++++++++
 arch/arm/mach-imx/mx6/Kconfig             |  10 ++
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c     | 172 ++---------------------
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 137 ++-----------------
 configs/kp_imx6q_tpc_defconfig            |  34 ++++-
 include/configs/kp_imx6q_tpc.h            |  54 ++++----
 8 files changed, 377 insertions(+), 309 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-kp-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-kp.dts

-- 
2.11.0

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

* [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  6:35   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update Lukasz Majewski
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 include/configs/kp_imx6q_tpc.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index dbae276121..92f2bbb75b 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -83,11 +83,32 @@
 	"rdinit=/sbin/init\0" \
 	"addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
 	"fit_config=mx6q_tpc70_conf\0" \
+	"uboot_file=u-boot.img\0" \
+	"SPL_file=SPL\0" \
+	"wic_file=kp-image-kpimx6qtpc.wic\0" \
 	"upd_image=st.4k\0" \
 	"updargs=setenv bootargs console=${console} ${smp}"\
 	       "rdinit=${rdinit} ${debug} ${displayargs}\0" \
 	"loadusb=usb start; " \
 	       "fatload usb 0 ${loadaddr} ${upd_image}\0" \
+	"upd_uboot_sd=" \
+	    "if tftp ${loadaddr} ${uboot_file}; then " \
+	       "setexpr blkc ${filesize} / 0x200;" \
+	       "setexpr blkc ${blkc} + 1;" \
+	       "mmc write ${loadaddr} 0x8A ${blkc};" \
+	    "fi;\0" \
+	"upd_SPL_sd=" \
+	    "if tftp ${loadaddr} ${SPL_file}; then " \
+	       "setexpr blkc ${filesize} / 0x200;" \
+	       "setexpr blkc ${blkc} + 1;" \
+	       "mmc write ${loadaddr} 0x2 ${blkc};" \
+	    "fi;\0" \
+	"upd_wic=" \
+	    "if tftp ${loadaddr} ${wic_file}; then " \
+	       "setexpr blkc ${filesize} / 0x200;" \
+	       "setexpr blkc ${blkc} + 1;" \
+	       "mmc write ${loadaddr} 0x0 ${blkc};" \
+	    "fi;\0" \
 	"usbupd=echo Booting update from usb ...; " \
 	       "setenv bootargs; " \
 	       "run updargs; " \
-- 
2.11.0

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

* [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:03   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot Lukasz Majewski
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

The TPC70 can boot from eMMC's boot0. This patch allows it to update
this HW partition's SPL.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 include/configs/kp_imx6q_tpc.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index 92f2bbb75b..2d1d1203b5 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -43,6 +43,7 @@
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 #define CONFIG_SYS_MMC_ENV_DEV		1 /* 0 = SDHC2, 1 = SDHC4 (eMMC) */
+#define CONFIG_SUPPORT_EMMC_BOOT
 
 /* UART */
 #define CONFIG_MXC_UART
@@ -103,6 +104,10 @@
 	       "setexpr blkc ${blkc} + 1;" \
 	       "mmc write ${loadaddr} 0x2 ${blkc};" \
 	    "fi;\0" \
+	"upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
+	"upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
+	"up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
+	"up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
 	"upd_wic=" \
 	    "if tftp ${loadaddr} ${wic_file}; then " \
 	       "setexpr blkc ${filesize} / 0x200;" \
-- 
2.11.0

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

* [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:04   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation Lukasz Majewski
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

The TPC70 can boot from SD card (debug/development) and eMMC (production).
The board_boot_order() function provides a run time check for the device
from which one wants to boot (it is selected by GPIO pins setup).

Moreover, a fallback to SD card is provided if the detection is not
possible or working properly.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
index e284d5ec57..e48a577f79 100644
--- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
@@ -308,6 +308,26 @@ int board_mmc_init(bd_t *bd)
 	return fsl_esdhc_initialize(bd, &usdhc_cfg[0]);
 }
 
+void board_boot_order(u32 *spl_boot_list)
+{
+	u32 boot_device = spl_boot_device();
+	u32 reg = imx6_src_get_boot_mode();
+
+	reg = (reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT;
+
+	debug("%s: boot device: 0x%x (0x4 SD, 0x6 eMMC)\n", __func__, reg);
+	if (boot_device == BOOT_DEVICE_MMC1)
+		if (reg == IMX6_BMODE_MMC || reg == IMX6_BMODE_EMMC)
+			boot_device = BOOT_DEVICE_MMC2;
+
+	spl_boot_list[0] = boot_device;
+	/*
+	 * Below boot device is a 'fallback' - it shall always be possible to
+	 * boot from SD card
+	 */
+	spl_boot_list[1] = BOOT_DEVICE_MMC1;
+}
+
 void board_init_f(ulong dummy)
 {
 	/* setup AIPS and disable watchdog */
-- 
2.11.0

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

* [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (2 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:05   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock Lukasz Majewski
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This commit is necessary to fix following error:

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=<device_tree>' argument

dts/Makefile:28: recipe for target 'arch/arm/dts/imx6q-kp.dtb' failed

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 arch/arm/dts/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 49d1faef32..e7005663a8 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -564,6 +564,7 @@ dtb-$(CONFIG_MX6QDL) += \
 	imx6q-icore.dtb \
 	imx6q-icore-mipi.dtb \
 	imx6q-icore-rqs.dtb \
+	imx6q-kp.dtb \
 	imx6q-sabreauto.dtb \
 	imx6q-sabresd.dtb \
 	imx6q-wandboard-revb1.dtb \
-- 
2.11.0

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

* [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (3 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:07   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state Lukasz Majewski
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This is a cosmetic change, just to use proper define instead
of magic numbers.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
index 7bdc64b1be..1dbd03efd8 100644
--- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
@@ -118,7 +118,8 @@ static int setup_fec_clock(void)
 	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
 
 	/* set gpr1[21] to select anatop clock */
-	clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 << 21);
+	clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_ENET_CLK_SEL_MASK,
+			IOMUXC_GPR1_ENET_CLK_SEL_MASK);
 
 	return enable_fec_anatop_clock(0, ENET_50MHZ);
 }
-- 
2.11.0

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

* [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (4 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:08   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description Lukasz Majewski
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This change sets the default state of LEDs on TPC70.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
index 1dbd03efd8..97af6bd65b 100644
--- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
@@ -27,6 +27,7 @@
 #include <netdev.h>
 #include <usb.h>
 #include <usb/ehci-ci.h>
+#include <led.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -290,6 +291,9 @@ int board_late_init(void)
 	add_board_boot_modes(board_boot_modes);
 #endif
 
+	if (IS_ENABLED(CONFIG_LED))
+		led_default_state();
+
 	env_set("boardname", "kp-tpc");
 	env_set("boardsoc", "imx6q");
 	return 0;
-- 
2.11.0

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (5 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:10   ` Peng Fan
  2019-08-13  8:41   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 08/11] imx: dts: Add u-boot specific set of device tree properties for tpc70 Lukasz Majewski
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This commit defines the TPC70 imx6q board with device tree description.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 arch/arm/dts/imx6q-kp.dts | 219 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 219 insertions(+)
 create mode 100644 arch/arm/dts/imx6q-kp.dts

diff --git a/arch/arm/dts/imx6q-kp.dts b/arch/arm/dts/imx6q-kp.dts
new file mode 100644
index 0000000000..12d6db6f80
--- /dev/null
+++ b/arch/arm/dts/imx6q-kp.dts
@@ -0,0 +1,219 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018
+ * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
+ *
+ * SPDX-License-Identifier:     GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include "imx6q.dtsi"
+
+/ {
+	model = "K+P iMX6Q";
+	compatible = "kp,imx6-kp", "fsl,imx6";
+
+	aliases {
+		mmc0 = &usdhc2;
+		mmc1 = &usdhc4;
+		usb1 = &usbh1;
+	};
+
+	chosen {
+		stdout-path = &uart1;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_leds>;
+
+		green {
+			label = "green";
+			gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "gpio";
+			default-state = "off";
+		};
+
+		red {
+			label = "red";
+			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "gpio";
+			default-state = "off";
+		};
+	};
+
+	memory at 10000000 {
+		reg = <0x10000000 0x40000000>;
+	};
+
+	reg_usb_h1_vbus: regulator-usb_h1_vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_h1_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+};
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <10>;
+	phy-mode = "rgmii";
+	fsl,magic-packet;
+	fsl,enet-loopback-clk; /* anatop reference clk via PAD loopback */
+	fsl,enet-freq = <1>; /* ENET_25MHZ  = 0, ENET_50MHZ  = 1 */
+			     /* ENET_100MHZ = 2, ENET_125MHZ = 3 */
+	status = "okay";
+};
+
+&i2c1 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+};
+
+&i2c2 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	status = "okay";
+};
+
+&iomuxc {
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX6QDL_PAD_ENET_MDIO__ENET_MDIO	0x1b0b0
+			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
+			MX6QDL_PAD_RGMII_TXC__RGMII_TXC	0x1b0b0
+			MX6QDL_PAD_RGMII_TD0__RGMII_TD0	0x1b0b0
+			MX6QDL_PAD_RGMII_TD1__RGMII_TD1	0x1b0b0
+			MX6QDL_PAD_RGMII_TD2__RGMII_TD2	0x1b0b0
+			MX6QDL_PAD_RGMII_TD3__RGMII_TD3	0x1b0b0
+			MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
+			MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
+			MX6QDL_PAD_RGMII_RXC__RGMII_RXC	0x1b0b0
+			MX6QDL_PAD_RGMII_RD0__RGMII_RD0	0x1b0b0
+			MX6QDL_PAD_RGMII_RD1__RGMII_RD1	0x1b0b0
+			MX6QDL_PAD_RGMII_RD2__RGMII_RD2	0x1b0b0
+			MX6QDL_PAD_RGMII_RD3__RGMII_RD3	0x1b0b0
+			MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
+			MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
+			MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25	0x1b0b0
+		>;
+	};
+
+	pinctrl_leds: gpioledsgrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D23__GPIO3_IO23          0x4001b0b0
+			MX6QDL_PAD_EIM_D16__GPIO3_IO16          0x4001b0b0
+		>;
+	};
+
+	pinctrl_i2c1: i2c1grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA	0x4001b8b1
+			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL	0x4001b8b1
+		>;
+	};
+
+	pinctrl_i2c2: i2c2grp {
+		fsl,pins = <
+			MX6QDL_PAD_KEY_COL3__I2C2_SCL	0x4001b8b1
+			MX6QDL_PAD_KEY_ROW3__I2C2_SDA	0x4001b8b1
+		 >;
+	};
+
+	pinctrl_uart1: uart1grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA	0x1b0b1
+			MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA	0x1b0b1
+		>;
+	};
+
+	pinctrl_uart2: uart2grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D26__UART2_TX_DATA       0x1b0b1
+			MX6QDL_PAD_EIM_D27__UART2_RX_DATA       0x1b0b1
+			MX6QDL_PAD_EIM_D28__UART2_CTS_B         0x1b0b1
+			MX6QDL_PAD_EIM_D29__UART2_RTS_B         0x1b0b1
+		>;
+	};
+
+	pinctrl_usbh1: usbh1grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D31__GPIO3_IO31          0x1b0b1
+			MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x17059
+		>;
+	};
+
+	pinctrl_usdhc2: usdhc2grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x17019
+			MX6QDL_PAD_SD2_CLK__SD2_CLK		0x10019
+			MX6QDL_PAD_SD2_DAT0__SD2_DATA0		0x17019
+			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17019
+			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17019
+			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17019
+			MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x20000
+			MX6QDL_PAD_GPIO_4__GPIO1_IO04           0x20000
+		>;
+	};
+
+	pinctrl_usdhc4: usdhc4grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD4_CMD__SD4_CMD		0x17019
+			MX6QDL_PAD_SD4_CLK__SD4_CLK		0x10019
+			MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17019
+			MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17019
+			MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17019
+			MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17019
+			MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17019
+			MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17019
+			MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17019
+			MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17019
+		>;
+	};
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart1>;
+	status = "okay";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart2>;
+	uart-has-rtscts;
+};
+
+&usbh1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh1>;
+	vbus-supply = <&reg_usb_h1_vbus>;
+	status = "okay";
+};
+
+&usdhc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc2>;
+	bus-width = <4>;
+	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
+&usdhc4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc4>;
+	bus-width = <8>;
+	non-removable;
+	no-1-8-v;
+	keep-power-in-suspend;
+	status = "okay";
+};
-- 
2.11.0

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

* [U-Boot] [PATCH v2 08/11] imx: dts: Add u-boot specific set of device tree properties for tpc70
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (6 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 09/11] imx: tpc70: Convert TPC70 (imx6q) board to use DM/DTS in SPL and u-boot Lukasz Majewski
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This commit adds new file - imx6q-kp-u-boot.dtsi with a set of u-boot
specific properties for imx6q KP device.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 arch/arm/dts/imx6q-kp-u-boot.dtsi | 59 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 arch/arm/dts/imx6q-kp-u-boot.dtsi

diff --git a/arch/arm/dts/imx6q-kp-u-boot.dtsi b/arch/arm/dts/imx6q-kp-u-boot.dtsi
new file mode 100644
index 0000000000..e6b71b22ae
--- /dev/null
+++ b/arch/arm/dts/imx6q-kp-u-boot.dtsi
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019
+ * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
+ *
+ * SPDX-License-Identifier:     GPL-2.0+ or X11
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+/ {
+	clocks {
+		u-boot,dm-spl;
+		osc {
+			u-boot,dm-spl;
+		};
+	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+	};
+};
+
+&clks {
+	u-boot,dm-pre-reloc;
+};
+
+&gpio2 {
+	u-boot,dm-spl;
+};
+
+&pinctrl_uart1 {
+	u-boot,dm-spl;
+};
+
+&pinctrl_usdhc2 {
+	u-boot,dm-spl;
+};
+
+&pinctrl_usdhc4 {
+	u-boot,dm-spl;
+};
+
+&uart1 {
+	u-boot,dm-spl;
+};
+
+&usdhc2 {
+	u-boot,dm-spl;
+};
+
+&usdhc4 {
+	u-boot,dm-spl;
+};
+
+&wdog1 {
+	u-boot,dm-spl;
+};
-- 
2.11.0

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

* [U-Boot] [PATCH v2 09/11] imx: tpc70: Convert TPC70 (imx6q) board to use DM/DTS in SPL and u-boot
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (7 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 08/11] imx: dts: Add u-boot specific set of device tree properties for tpc70 Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS Lukasz Majewski
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 11/11] imx: config: Update KP's TPC70 config to support SWUpdate Lukasz Majewski
  10 siblings, 0 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This patch converts the TPC70 to use driver model and device tree
description in both SPL and u-boot proper.

Notable changes (DM/DTS conversion):

- PINCTRL{_IMX6}
- DM_I2C
- enable 'regulator' and 'pmic' commands
- DM_MMC and BLK (USDHC)
- DM_ETH
- DM WDT (including SYSRESET)

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---

 arch/arm/mach-imx/mx6/Kconfig             |  10 ++
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c     | 165 +-----------------------------
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 133 +-----------------------
 configs/kp_imx6q_tpc_defconfig            |  34 +++++-
 include/configs/kp_imx6q_tpc.h            |  21 ----
 5 files changed, 49 insertions(+), 314 deletions(-)

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index fe5991e7c6..910f82664e 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -485,9 +485,19 @@ config TARGET_KP_IMX6Q_TPC
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select DM
+	select SPL_DM if SPL
 	select DM_THERMAL
+	select DM_MMC
+	select DM_ETH
+	select DM_REGULATOR
+	select SPL_DM_REGULATOR if SPL
+	select DM_SERIAL
+	select DM_I2C
+	select DM_GPIO
+	select DM_USB
 	select MX6QDL
 	select SUPPORT_SPL
+	select SPL_SEPARATE_BSS if SPL
 	imply CMD_DM
 	imply CMD_SPL
 
diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
index 97af6bd65b..e819127220 100644
--- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
@@ -9,64 +9,17 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/imx-regs.h>
-#include <asm/arch/iomux.h>
 #include <asm/arch/mx6-pins.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
 #include <asm/mach-imx/boot_mode.h>
-#include <asm/mach-imx/iomux-v3.h>
-#include <asm/mach-imx/mxc_i2c.h>
 #include <errno.h>
-#include <fsl_esdhc_imx.h>
-#include <fuse.h>
-#include <i2c.h>
 #include <miiphy.h>
-#include <mmc.h>
-#include <net.h>
-#include <netdev.h>
 #include <usb.h>
 #include <usb/ehci-ci.h>
 #include <led.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ENET_PAD_CTRL							\
-	(PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |	\
-	 PAD_CTL_HYS)
-
-#define I2C_PAD_CTRL							\
-	(PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |	\
-	PAD_CTL_HYS | PAD_CTL_ODE | PAD_CTL_SRE_FAST)
-
-#define PC			MUX_PAD_CTRL(I2C_PAD_CTRL)
-
-static struct i2c_pads_info kp_imx6q_tpc_i2c_pad_info0 = {
-	.scl = {
-		.i2c_mode  = MX6Q_PAD_CSI0_DAT9__I2C1_SCL | PC,
-		.gpio_mode = MX6Q_PAD_CSI0_DAT9__GPIO5_IO27 | PC,
-		.gp = IMX_GPIO_NR(5, 27)
-	},
-	.sda = {
-		 .i2c_mode = MX6Q_PAD_CSI0_DAT8__I2C1_SDA | PC,
-		 .gpio_mode = MX6Q_PAD_CSI0_DAT8__GPIO5_IO26 | PC,
-		 .gp = IMX_GPIO_NR(5, 26)
-	}
-};
-
-static struct i2c_pads_info kp_imx6q_tpc_i2c_pad_info1 = {
-	.scl = {
-		.i2c_mode  = MX6Q_PAD_KEY_COL3__I2C2_SCL | PC,
-		.gpio_mode = MX6Q_PAD_KEY_COL3__GPIO4_IO12 | PC,
-		.gp = IMX_GPIO_NR(4, 12)
-	},
-	.sda = {
-		 .i2c_mode = MX6Q_PAD_KEY_ROW3__I2C2_SDA | PC,
-		 .gpio_mode = MX6Q_PAD_KEY_ROW3__GPIO4_IO13 | PC,
-		 .gp = IMX_GPIO_NR(4, 13)
-	}
-};
-
 int dram_init(void)
 {
 	gd->ram_size = imx_ddr_size();
@@ -83,37 +36,6 @@ int overwrite_console(void)
 }
 
 #ifdef CONFIG_FEC_MXC
-static iomux_v3_cfg_t const enet_pads[] = {
-	IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_ENET_MDC__ENET_MDC	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TXC__RGMII_TXC	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TD0__RGMII_TD0	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TD1__RGMII_TD1	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TD2__RGMII_TD2	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TD3__RGMII_TD3	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_TX_CTL__RGMII_TX_CTL |
-		   MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RXC__RGMII_RXC	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RD0__RGMII_RD0	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RD1__RGMII_RD1	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RD2__RGMII_RD2	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RD3__RGMII_RD3	| MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	IOMUX_PADS(PAD_RGMII_RX_CTL__RGMII_RX_CTL |
-		   MUX_PAD_CTRL(ENET_PAD_CTRL)),
-	/* AR8031 PHY Reset */
-	IOMUX_PADS(PAD_ENET_CRS_DV__GPIO1_IO25	| MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-static void eth_phy_reset(void)
-{
-	/* Reset AR8031 PHY */
-	gpio_direction_output(IMX_GPIO_NR(1, 25), 0);
-	mdelay(10);
-	gpio_set_value(IMX_GPIO_NR(1, 25), 1);
-	udelay(100);
-}
-
 static int setup_fec_clock(void)
 {
 	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
@@ -125,15 +47,6 @@ static int setup_fec_clock(void)
 	return enable_fec_anatop_clock(0, ENET_50MHZ);
 }
 
-int board_eth_init(bd_t *bis)
-{
-	SETUP_IOMUX_PADS(enet_pads);
-	setup_fec_clock();
-	eth_phy_reset();
-
-	return cpu_eth_init(bis);
-}
-
 static int ar8031_phy_fixup(struct phy_device *phydev)
 {
 	unsigned short val;
@@ -168,53 +81,6 @@ int board_phy_config(struct phy_device *phydev)
 }
 #endif
 
-#ifdef CONFIG_FSL_ESDHC_IMX
-
-#define USDHC2_CD_GPIO	IMX_GPIO_NR(1, 4)
-static struct fsl_esdhc_cfg usdhc_cfg[] = {
-	{ USDHC2_BASE_ADDR },
-	{ USDHC4_BASE_ADDR },
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-
-	switch (cfg->esdhc_base) {
-	case USDHC2_BASE_ADDR:
-		return !gpio_get_value(USDHC2_CD_GPIO);
-	case USDHC4_BASE_ADDR:
-		return 1; /* eMMC/uSDHC4 is always present */
-	}
-
-	return 0;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	int i, ret;
-
-	/*
-	 * According to the board_mmc_init() the following map is done:
-	 * (U-Boot device node)    (Physical Port)
-	 * mmc0                    micro SD
-	 * mmc2                    eMMC
-	 */
-	gpio_direction_input(USDHC2_CD_GPIO);
-
-	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-	usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
-
-	for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
-		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
-		if (ret)
-			return ret;
-	}
-
-	return 0;
-}
-#endif
-
 #ifdef CONFIG_USB_EHCI_MX6
 static void setup_usb(void)
 {
@@ -224,30 +90,6 @@ static void setup_usb(void)
 	 */
 	imx_iomux_set_gpr_register(1, 13, 1, 0);
 }
-
-int board_usb_phy_mode(int port)
-{
-	if (port == 1)
-		return USB_INIT_HOST;
-	else
-		return USB_INIT_DEVICE;
-}
-
-int board_ehci_power(int port, int on)
-{
-	switch (port) {
-	case 0:
-		break;
-	case 1:
-		gpio_direction_output(IMX_GPIO_NR(3, 31), !!on);
-		break;
-	default:
-		printf("MXC USB port %d not yet supported\n", port);
-		return -EINVAL;
-	}
-
-	return 0;
-}
 #endif
 
 int board_early_init_f(void)
@@ -256,6 +98,10 @@ int board_early_init_f(void)
 	setup_usb();
 #endif
 
+#ifdef CONFIG_FEC_MXC
+	setup_fec_clock();
+#endif
+
 	return 0;
 }
 
@@ -269,9 +115,6 @@ int board_init(void)
 	/* Enable eim_slow clocks */
 	setbits_le32(&mxc_ccm->CCGR6, 0x1 << MXC_CCM_CCGR6_EMI_SLOW_OFFSET);
 
-	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &kp_imx6q_tpc_i2c_pad_info0);
-	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &kp_imx6q_tpc_i2c_pad_info1);
-
 	return 0;
 }
 
diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
index e48a577f79..25a5e4b9ba 100644
--- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
@@ -9,30 +9,12 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/imx-regs.h>
-#include <asm/arch/iomux.h>
 #include <asm/arch/mx6-ddr.h>
-#include <asm/arch/mx6-pins.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/gpio.h>
-#include <asm/mach-imx/boot_mode.h>
-#include <asm/mach-imx/iomux-v3.h>
-#include <asm/mach-imx/mxc_i2c.h>
 #include <asm/io.h>
 #include <errno.h>
-#include <fuse.h>
-#include <fsl_esdhc_imx.h>
-#include <i2c.h>
-#include <mmc.h>
 #include <spl.h>
 
-#define UART_PAD_CTRL							\
-	(PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |	\
-	 PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
-#define USDHC_PAD_CTRL							\
-	(PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm |	\
-	 PAD_CTL_SRE_FAST | PAD_CTL_HYS)
-
 DECLARE_GLOBAL_DATA_PTR;
 
 static void ccgr_init(void)
@@ -48,60 +30,6 @@ static void ccgr_init(void)
 	writel(0x000003FF, &ccm->CCGR6);
 }
 
-/* onboard microSD */
-static iomux_v3_cfg_t const usdhc2_pads[] = {
-	IOMUX_PADS(PAD_SD2_DAT0__SD2_DATA0	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD2_DAT1__SD2_DATA1	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD2_DAT2__SD2_DATA2	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD2_CLK__SD2_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD2_CMD__SD2_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_NANDF_CS3__GPIO6_IO16	| MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-/* eMMC */
-static iomux_v3_cfg_t const usdhc4_pads[] = {
-	IOMUX_PADS(PAD_SD4_DAT0__SD4_DATA0	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT1__SD4_DATA1	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT2__SD4_DATA2	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT3__SD4_DATA3	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT4__SD4_DATA4	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT5__SD4_DATA5	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT6__SD4_DATA6	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_DAT7__SD4_DATA7	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_CLK__SD4_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD4_CMD__SD4_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-};
-
-/* SD */
-static void setup_iomux_sd(void)
-{
-	SETUP_IOMUX_PADS(usdhc2_pads);
-	SETUP_IOMUX_PADS(usdhc4_pads);
-}
-
-/* UART */
-static iomux_v3_cfg_t const uart1_pads[] = {
-	IOMUX_PADS(PAD_SD3_DAT7__UART1_TX_DATA	| MUX_PAD_CTRL(UART_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_DAT6__UART1_RX_DATA	| MUX_PAD_CTRL(UART_PAD_CTRL)),
-};
-
-static void setup_iomux_uart(void)
-{
-	SETUP_IOMUX_PADS(uart1_pads);
-}
-
-/* USB */
-static iomux_v3_cfg_t const usb_pads[] = {
-	IOMUX_PADS(PAD_GPIO_1__USB_OTG_ID	| MUX_PAD_CTRL(NO_PAD_CTRL)),
-	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31	| MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-static void setup_iomux_usb(void)
-{
-	SETUP_IOMUX_PADS(usb_pads);
-}
-
 /* DDR3 */
 static const struct mx6dq_iomux_ddr_regs mx6_ddr_ioregs = {
 	.dram_sdclk_0 = 0x00000030,
@@ -255,59 +183,6 @@ static void spl_dram_init(void)
 #endif
 }
 
-struct fsl_esdhc_cfg usdhc_cfg[] = {
-	{USDHC2_BASE_ADDR},
-	{USDHC4_BASE_ADDR},
-};
-
-#define USDHC2_CD_GPIO	IMX_GPIO_NR(1, 4)
-int board_mmc_getcd(struct mmc *mmc)
-{
-	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-	int ret = 0;
-
-	switch (cfg->esdhc_base) {
-	case USDHC2_BASE_ADDR:
-		ret = !gpio_get_value(USDHC2_CD_GPIO);
-		break;
-	case USDHC4_BASE_ADDR:
-		ret = 1; /* eMMC/uSDHC4 is always present */
-		break;
-	}
-
-	return ret;
-}
-
-int board_mmc_init(bd_t *bd)
-{
-	struct src *psrc = (struct src *)SRC_BASE_ADDR;
-	unsigned int reg = readl(&psrc->sbmr1) >> 11;
-	/*
-	 * Upon reading BOOT_CFG register the following map is done:
-	 * Bit 11 and 12 of BOOT_CFG register can determine the current
-	 * mmc port
-	 * 0x1                  SD1
-	 * 0x3                  SD4
-	 */
-
-	switch (reg & 0x3) {
-	case 0x1:
-		SETUP_IOMUX_PADS(usdhc2_pads);
-		usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
-		usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-		gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
-		break;
-	case 0x3:
-		SETUP_IOMUX_PADS(usdhc4_pads);
-		usdhc_cfg[0].esdhc_base = USDHC4_BASE_ADDR;
-		usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
-		gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
-		break;
-	}
-
-	return fsl_esdhc_initialize(bd, &usdhc_cfg[0]);
-}
-
 void board_boot_order(u32 *spl_boot_list)
 {
 	u32 boot_device = spl_boot_device();
@@ -339,9 +214,8 @@ void board_init_f(ulong dummy)
 	/* setup GP timer */
 	timer_init();
 
-	setup_iomux_sd();
-	setup_iomux_uart();
-	setup_iomux_usb();
+	/* Early - pre reloc - driver model setup */
+	spl_early_init();
 
 	/* UART clocks enabled and gd valid - init serial console */
 	preloader_console_init();
@@ -351,7 +225,4 @@ void board_init_f(ulong dummy)
 
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
-
-	/* load/boot image from boot device */
-	board_init_r(NULL, 0);
 }
diff --git a/configs/kp_imx6q_tpc_defconfig b/configs/kp_imx6q_tpc_defconfig
index 87b25e6e1d..abf957f158 100644
--- a/configs/kp_imx6q_tpc_defconfig
+++ b/configs/kp_imx6q_tpc_defconfig
@@ -4,21 +4,28 @@ CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2200
 CONFIG_MX6_DDRCAL=y
 CONFIG_TARGET_KP_IMX6Q_TPC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
+CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=3
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_SPL_RAW_IMAGE_SUPPORT=y
+# CONFIG_TPL_BANNER_PRINT is not set
+CONFIG_SPL_PAYLOAD="u-boot.img"
+CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR="."
@@ -27,19 +34,44 @@ CONFIG_AUTOBOOT_STOP_STR="."
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-kp"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents interrupts clocks dmas dma-names"
 CONFIG_ENV_IS_IN_MMC=y
+# CONFIG_BLOCK_CACHE is not set
+CONFIG_SPL_CLK_IMX6Q=y
+CONFIG_CLK_IMX6Q=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_MXC=y
+CONFIG_SYS_I2C_MXC_I2C1=y
+CONFIG_SYS_I2C_MXC_I2C2=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+# CONFIG_TPL_SERIAL_PRESENT is not set
+CONFIG_MXC_UART=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_IMX_WATCHDOG=y
-CONFIG_OF_LIBFDT=y
diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index 2d1d1203b5..c4dbbf3886 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -25,32 +25,11 @@
 #define CONFIG_SYS_MALLOC_LEN		(4 * SZ_1M)
 
 /* FEC ethernet */
-#define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
-#define CONFIG_ETHPRIME			"FEC"
-#define CONFIG_FEC_MXC_PHYADDR		0
 #define CONFIG_ARP_TIMEOUT		200UL
 
-/* I2C Configs */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
-#define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
-#define CONFIG_SYS_I2C_SPEED		100000
-
-/* MMC Configs */
-#define CONFIG_FSL_USDHC
-#define CONFIG_SYS_FSL_ESDHC_ADDR	0
-#define CONFIG_SYS_FSL_USDHC_NUM	2
 #define CONFIG_SYS_MMC_ENV_DEV		1 /* 0 = SDHC2, 1 = SDHC4 (eMMC) */
 #define CONFIG_SUPPORT_EMMC_BOOT
 
-/* UART */
-#define CONFIG_MXC_UART
-#define CONFIG_MXC_UART_BASE		UART1_BASE
-#define CONFIG_CONS_INDEX		1
-#define CONFIG_BAUDRATE			115200
-
 /* USB Configs */
 #ifdef CONFIG_CMD_USB
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
-- 
2.11.0

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

* [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (8 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 09/11] imx: tpc70: Convert TPC70 (imx6q) board to use DM/DTS in SPL and u-boot Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  2019-08-09  7:11   ` Peng Fan
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 11/11] imx: config: Update KP's TPC70 config to support SWUpdate Lukasz Majewski
  10 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

Those properties will be reused in the SPL to provide proper
clock setting.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 configs/kp_imx6q_tpc_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/kp_imx6q_tpc_defconfig b/configs/kp_imx6q_tpc_defconfig
index abf957f158..7b19323fb5 100644
--- a/configs/kp_imx6q_tpc_defconfig
+++ b/configs/kp_imx6q_tpc_defconfig
@@ -44,7 +44,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-kp"
-CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents interrupts clocks dmas dma-names"
+CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents interrupts dmas dma-names"
 CONFIG_ENV_IS_IN_MMC=y
 # CONFIG_BLOCK_CACHE is not set
 CONFIG_SPL_CLK_IMX6Q=y
-- 
2.11.0

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

* [U-Boot] [PATCH v2 11/11] imx: config: Update KP's TPC70 config to support SWUpdate
  2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
                   ` (9 preceding siblings ...)
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS Lukasz Majewski
@ 2019-07-30  7:12 ` Lukasz Majewski
  10 siblings, 0 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-07-30  7:12 UTC (permalink / raw)
  To: u-boot

This patch updates envs responsible for using USB pendrive as a
SWUpdate based tool for recovery and update.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 include/configs/kp_imx6q_tpc.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index c4dbbf3886..502ae66628 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -67,8 +67,9 @@
 	"SPL_file=SPL\0" \
 	"wic_file=kp-image-kpimx6qtpc.wic\0" \
 	"upd_image=st.4k\0" \
-	"updargs=setenv bootargs console=${console} ${smp}"\
-	       "rdinit=${rdinit} ${debug} ${displayargs}\0" \
+	"updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
+	"initrd_ram_dev=/dev/ram\0" \
+	"addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
 	"loadusb=usb start; " \
 	       "fatload usb 0 ${loadaddr} ${upd_image}\0" \
 	"upd_uboot_sd=" \
@@ -96,6 +97,8 @@
 	"usbupd=echo Booting update from usb ...; " \
 	       "setenv bootargs; " \
 	       "run updargs; " \
+	       "run addinitrd; " \
+	       "run addswupdate; " \
 	       "run loadusb; " \
 	       "bootm ${loadaddr}#${fit_config}\0" \
 	BOOTENV
-- 
2.11.0

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

* [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic Lukasz Majewski
@ 2019-08-09  6:35   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  6:35 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 01/11] imx: tpc70: config: Add script commands to update
> u-boot and OE's wic
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  include/configs/kp_imx6q_tpc.h | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
> index dbae276121..92f2bbb75b 100644
> --- a/include/configs/kp_imx6q_tpc.h
> +++ b/include/configs/kp_imx6q_tpc.h
> @@ -83,11 +83,32 @@
>  	"rdinit=/sbin/init\0" \
>  	"addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
>  	"fit_config=mx6q_tpc70_conf\0" \
> +	"uboot_file=u-boot.img\0" \
> +	"SPL_file=SPL\0" \
> +	"wic_file=kp-image-kpimx6qtpc.wic\0" \
>  	"upd_image=st.4k\0" \
>  	"updargs=setenv bootargs console=${console} ${smp}"\
>  	       "rdinit=${rdinit} ${debug} ${displayargs}\0" \
>  	"loadusb=usb start; " \
>  	       "fatload usb 0 ${loadaddr} ${upd_image}\0" \
> +	"upd_uboot_sd=" \
> +	    "if tftp ${loadaddr} ${uboot_file}; then " \
> +	       "setexpr blkc ${filesize} / 0x200;" \
> +	       "setexpr blkc ${blkc} + 1;" \
> +	       "mmc write ${loadaddr} 0x8A ${blkc};" \
> +	    "fi;\0" \
> +	"upd_SPL_sd=" \
> +	    "if tftp ${loadaddr} ${SPL_file}; then " \
> +	       "setexpr blkc ${filesize} / 0x200;" \
> +	       "setexpr blkc ${blkc} + 1;" \
> +	       "mmc write ${loadaddr} 0x2 ${blkc};" \
> +	    "fi;\0" \
> +	"upd_wic=" \
> +	    "if tftp ${loadaddr} ${wic_file}; then " \
> +	       "setexpr blkc ${filesize} / 0x200;" \
> +	       "setexpr blkc ${blkc} + 1;" \
> +	       "mmc write ${loadaddr} 0x0 ${blkc};" \
> +	    "fi;\0" \
>  	"usbupd=echo Booting update from usb ...; " \
>  	       "setenv bootargs; " \
>  	       "run updargs; " \

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update Lukasz Majewski
@ 2019-08-09  7:03   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:03 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support
> eMMC's boot0 SPL update
> 
> The TPC70 can boot from eMMC's boot0. This patch allows it to update this
> HW partition's SPL.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  include/configs/kp_imx6q_tpc.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
> index 92f2bbb75b..2d1d1203b5 100644
> --- a/include/configs/kp_imx6q_tpc.h
> +++ b/include/configs/kp_imx6q_tpc.h
> @@ -43,6 +43,7 @@
>  #define CONFIG_SYS_FSL_ESDHC_ADDR	0
>  #define CONFIG_SYS_FSL_USDHC_NUM	2
>  #define CONFIG_SYS_MMC_ENV_DEV		1 /* 0 = SDHC2, 1 = SDHC4
> (eMMC) */
> +#define CONFIG_SUPPORT_EMMC_BOOT
> 
>  /* UART */
>  #define CONFIG_MXC_UART
> @@ -103,6 +104,10 @@
>  	       "setexpr blkc ${blkc} + 1;" \
>  	       "mmc write ${loadaddr} 0x2 ${blkc};" \
>  	    "fi;\0" \
> +	"upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
> +	"upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run
> upd_uboot_sd\0" \
> +	"up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
> +	"up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
>  	"upd_wic=" \
>  	    "if tftp ${loadaddr} ${wic_file}; then " \
>  	       "setexpr blkc ${filesize} / 0x200;" \

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot Lukasz Majewski
@ 2019-08-09  7:04   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:04 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish
> between eMMC and SD boot
> 
> The TPC70 can boot from SD card (debug/development) and eMMC
> (production).
> The board_boot_order() function provides a run time check for the device
> from which one wants to boot (it is selected by GPIO pins setup).
> 
> Moreover, a fallback to SD card is provided if the detection is not possible or
> working properly.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 20
> ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
> b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
> index e284d5ec57..e48a577f79 100644
> --- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
> +++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
> @@ -308,6 +308,26 @@ int board_mmc_init(bd_t *bd)
>  	return fsl_esdhc_initialize(bd, &usdhc_cfg[0]);  }
> 
> +void board_boot_order(u32 *spl_boot_list) {
> +	u32 boot_device = spl_boot_device();
> +	u32 reg = imx6_src_get_boot_mode();
> +
> +	reg = (reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT;
> +
> +	debug("%s: boot device: 0x%x (0x4 SD, 0x6 eMMC)\n", __func__, reg);
> +	if (boot_device == BOOT_DEVICE_MMC1)
> +		if (reg == IMX6_BMODE_MMC || reg == IMX6_BMODE_EMMC)
> +			boot_device = BOOT_DEVICE_MMC2;
> +
> +	spl_boot_list[0] = boot_device;
> +	/*
> +	 * Below boot device is a 'fallback' - it shall always be possible to
> +	 * boot from SD card
> +	 */
> +	spl_boot_list[1] = BOOT_DEVICE_MMC1;
> +}
> +
>  void board_init_f(ulong dummy)
>  {
>  	/* setup AIPS and disable watchdog */

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation Lukasz Majewski
@ 2019-08-09  7:05   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:05 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to
> Makefile for DTB compilation
> 
> This commit is necessary to fix following error:
> 
> Device Tree Source is not correctly specified.
> Please define 'CONFIG_DEFAULT_DEVICE_TREE'
> or build with 'DEVICE_TREE=<device_tree>' argument
> 
> dts/Makefile:28: recipe for target 'arch/arm/dts/imx6q-kp.dtb' failed
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  arch/arm/dts/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
> 49d1faef32..e7005663a8 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -564,6 +564,7 @@ dtb-$(CONFIG_MX6QDL) += \
>  	imx6q-icore.dtb \
>  	imx6q-icore-mipi.dtb \
>  	imx6q-icore-rqs.dtb \
> +	imx6q-kp.dtb \
>  	imx6q-sabreauto.dtb \
>  	imx6q-sabresd.dtb \
>  	imx6q-wandboard-revb1.dtb \

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock Lukasz Majewski
@ 2019-08-09  7:07   ` Peng Fan
  2019-08-11 21:27     ` Lukasz Majewski
  0 siblings, 1 reply; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:07 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers
> when setting ENET clock
> 
> This is a cosmetic change, just to use proper define instead of magic numbers.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> index 7bdc64b1be..1dbd03efd8 100644
> --- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> +++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> @@ -118,7 +118,8 @@ static int setup_fec_clock(void)
>  	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
> 
>  	/* set gpr1[21] to select anatop clock */
> -	clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 << 21);
> +	clrsetbits_le32(&iomuxc_regs->gpr[1],
> IOMUXC_GPR1_ENET_CLK_SEL_MASK,
> +			IOMUXC_GPR1_ENET_CLK_SEL_MASK);

Would setbits_le32 work here?

Regards,
Peng.

> 
>  	return enable_fec_anatop_clock(0, ENET_50MHZ);  }
> --
> 2.11.0

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

* [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state Lukasz Majewski
@ 2019-08-09  7:08   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:08 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 06/11] imx: tpc70: led: Enable LED default state
> 
> This change sets the default state of LEDs on TPC70.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> index 1dbd03efd8..97af6bd65b 100644
> --- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> +++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> @@ -27,6 +27,7 @@
>  #include <netdev.h>
>  #include <usb.h>
>  #include <usb/ehci-ci.h>
> +#include <led.h>
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -290,6 +291,9 @@ int board_late_init(void)
>  	add_board_boot_modes(board_boot_modes);
>  #endif
> 
> +	if (IS_ENABLED(CONFIG_LED))
> +		led_default_state();
> +
>  	env_set("boardname", "kp-tpc");
>  	env_set("boardsoc", "imx6q");
>  	return 0;

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description Lukasz Majewski
@ 2019-08-09  7:10   ` Peng Fan
  2019-08-11 21:25     ` Lukasz Majewski
  2019-08-13  8:41   ` Peng Fan
  1 sibling, 1 reply; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:10 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based)
> device tree description
> 
> This commit defines the TPC70 imx6q board with device tree description.

Is the imx6q-kp.dtsi usable for this board from Linux kernel?

Regards,
Peng.

> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  arch/arm/dts/imx6q-kp.dts | 219
> ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 219 insertions(+)
>  create mode 100644 arch/arm/dts/imx6q-kp.dts
> 
> diff --git a/arch/arm/dts/imx6q-kp.dts b/arch/arm/dts/imx6q-kp.dts new file
> mode 100644 index 0000000000..12d6db6f80
> --- /dev/null
> +++ b/arch/arm/dts/imx6q-kp.dts
> @@ -0,0 +1,219 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2018
> + * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
> + *
> + * SPDX-License-Identifier:     GPL-2.0+ or X11
> + */
> +
> +/dts-v1/;
> +#include <dt-bindings/gpio/gpio.h>
> +#include "imx6q.dtsi"
> +
> +/ {
> +	model = "K+P iMX6Q";
> +	compatible = "kp,imx6-kp", "fsl,imx6";
> +
> +	aliases {
> +		mmc0 = &usdhc2;
> +		mmc1 = &usdhc4;
> +		usb1 = &usbh1;
> +	};
> +
> +	chosen {
> +		stdout-path = &uart1;
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_leds>;
> +
> +		green {
> +			label = "green";
> +			gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "gpio";
> +			default-state = "off";
> +		};
> +
> +		red {
> +			label = "red";
> +			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "gpio";
> +			default-state = "off";
> +		};
> +	};
> +
> +	memory at 10000000 {
> +		reg = <0x10000000 0x40000000>;
> +	};
> +
> +	reg_usb_h1_vbus: regulator-usb_h1_vbus {
> +		compatible = "regulator-fixed";
> +		regulator-name = "usb_h1_vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +};
> +
> +&fec {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_enet>;
> +	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
> +	phy-reset-duration = <10>;
> +	phy-mode = "rgmii";
> +	fsl,magic-packet;
> +	fsl,enet-loopback-clk; /* anatop reference clk via PAD loopback */
> +	fsl,enet-freq = <1>; /* ENET_25MHZ  = 0, ENET_50MHZ  = 1 */
> +			     /* ENET_100MHZ = 2, ENET_125MHZ = 3 */
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c1>;
> +	status = "okay";
> +};
> +
> +&i2c2 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c2>;
> +	status = "okay";
> +};
> +
> +&iomuxc {
> +	pinctrl_enet: enetgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_ENET_MDIO__ENET_MDIO	0x1b0b0
> +			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
> +			MX6QDL_PAD_RGMII_TXC__RGMII_TXC	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD0__RGMII_TD0	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD1__RGMII_TD1	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD2__RGMII_TD2	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD3__RGMII_TD3	0x1b0b0
> +			MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
> +			MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
> +			MX6QDL_PAD_RGMII_RXC__RGMII_RXC	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD0__RGMII_RD0	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD1__RGMII_RD1	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD2__RGMII_RD2	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD3__RGMII_RD3	0x1b0b0
> +			MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
> +			MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
> +			MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25	0x1b0b0
> +		>;
> +	};
> +
> +	pinctrl_leds: gpioledsgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D23__GPIO3_IO23
> 0x4001b0b0
> +			MX6QDL_PAD_EIM_D16__GPIO3_IO16
> 0x4001b0b0
> +		>;
> +	};
> +
> +	pinctrl_i2c1: i2c1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA	0x4001b8b1
> +			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL	0x4001b8b1
> +		>;
> +	};
> +
> +	pinctrl_i2c2: i2c2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_KEY_COL3__I2C2_SCL	0x4001b8b1
> +			MX6QDL_PAD_KEY_ROW3__I2C2_SDA	0x4001b8b1
> +		 >;
> +	};
> +
> +	pinctrl_uart1: uart1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA	0x1b0b1
> +			MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA	0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_uart2: uart2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D26__UART2_TX_DATA       0x1b0b1
> +			MX6QDL_PAD_EIM_D27__UART2_RX_DATA       0x1b0b1
> +			MX6QDL_PAD_EIM_D28__UART2_CTS_B         0x1b0b1
> +			MX6QDL_PAD_EIM_D29__UART2_RTS_B         0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_usbh1: usbh1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D31__GPIO3_IO31          0x1b0b1
> +			MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x17059
> +		>;
> +	};
> +
> +	pinctrl_usdhc2: usdhc2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x17019
> +			MX6QDL_PAD_SD2_CLK__SD2_CLK		0x10019
> +			MX6QDL_PAD_SD2_DAT0__SD2_DATA0		0x17019
> +			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17019
> +			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17019
> +			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17019
> +			MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x20000
> +			MX6QDL_PAD_GPIO_4__GPIO1_IO04           0x20000
> +		>;
> +	};
> +
> +	pinctrl_usdhc4: usdhc4grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD4_CMD__SD4_CMD		0x17019
> +			MX6QDL_PAD_SD4_CLK__SD4_CLK		0x10019
> +			MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17019
> +			MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17019
> +			MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17019
> +			MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17019
> +			MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17019
> +			MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17019
> +			MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17019
> +			MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17019
> +		>;
> +	};
> +};
> +
> +&uart1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart1>;
> +	status = "okay";
> +};
> +
> +&uart2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart2>;
> +	uart-has-rtscts;
> +};
> +
> +&usbh1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usbh1>;
> +	vbus-supply = <&reg_usb_h1_vbus>;
> +	status = "okay";
> +};
> +
> +&usdhc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc2>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
> +	status = "okay";
> +};
> +
> +&usdhc4 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc4>;
> +	bus-width = <8>;
> +	non-removable;
> +	no-1-8-v;
> +	keep-power-in-suspend;
> +	status = "okay";
> +};
> --
> 2.11.0

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

* [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS Lukasz Majewski
@ 2019-08-09  7:11   ` Peng Fan
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-09  7:11 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related
> properties from DTS
> 
> Those properties will be reused in the SPL to provide proper clock setting.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  configs/kp_imx6q_tpc_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/kp_imx6q_tpc_defconfig b/configs/kp_imx6q_tpc_defconfig
> index abf957f158..7b19323fb5 100644
> --- a/configs/kp_imx6q_tpc_defconfig
> +++ b/configs/kp_imx6q_tpc_defconfig
> @@ -44,7 +44,7 @@ CONFIG_CMD_EXT4_WRITE=y
> CONFIG_OF_CONTROL=y  CONFIG_SPL_OF_CONTROL=y
> CONFIG_DEFAULT_DEVICE_TREE="imx6q-kp"
> -CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent
> assigned-clocks assigned-clock-rates assigned-clock-parents interrupts clocks
> dmas dma-names"
> +CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent assigned-clocks
> assigned-clock-rates assigned-clock-parents interrupts dmas dma-names"
>  CONFIG_ENV_IS_IN_MMC=y
>  # CONFIG_BLOCK_CACHE is not set
>  CONFIG_SPL_CLK_IMX6Q=y

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-08-09  7:10   ` Peng Fan
@ 2019-08-11 21:25     ` Lukasz Majewski
  2019-08-11 23:55       ` Tom Rini
  0 siblings, 1 reply; 25+ messages in thread
From: Lukasz Majewski @ 2019-08-11 21:25 UTC (permalink / raw)
  To: u-boot

Hi Peng,

> > Subject: [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q
> > based) device tree description
> > 
> > This commit defines the TPC70 imx6q board with device tree
> > description.  
> 
> Is the imx6q-kp.dtsi usable for this board from Linux kernel?
> 

The imx6q-kp.dtsi is defined in the Linux kernel [1].

However, not all features - like backlight, CAN, etc. are needed in
U-Boot. To reduce SPL footprint, as the TPC70 is the first
board (from i.MX6Q family of SoCs) which uses only DM in SPL and U-Boot
proper, only the necessary subset of [1] was added to U-Boot.

Note:

[1] -
https://elixir.bootlin.com/linux/v5.2.8/source/arch/arm/boot/dts/imx6q-kp.dtsi

> Regards,
> Peng.
> 
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > 
> >  arch/arm/dts/imx6q-kp.dts | 219
> > ++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 219 insertions(+)
> >  create mode 100644 arch/arm/dts/imx6q-kp.dts
> > 
> > diff --git a/arch/arm/dts/imx6q-kp.dts b/arch/arm/dts/imx6q-kp.dts
> > new file mode 100644 index 0000000000..12d6db6f80
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6q-kp.dts
> > @@ -0,0 +1,219 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright 2018
> > + * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
> > + *
> > + * SPDX-License-Identifier:     GPL-2.0+ or X11
> > + */
> > +
> > +/dts-v1/;
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include "imx6q.dtsi"
> > +
> > +/ {
> > +	model = "K+P iMX6Q";
> > +	compatible = "kp,imx6-kp", "fsl,imx6";
> > +
> > +	aliases {
> > +		mmc0 = &usdhc2;
> > +		mmc1 = &usdhc4;
> > +		usb1 = &usbh1;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = &uart1;
> > +	};
> > +
> > +	leds {
> > +		compatible = "gpio-leds";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&pinctrl_leds>;
> > +
> > +		green {
> > +			label = "green";
> > +			gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
> > +			linux,default-trigger = "gpio";
> > +			default-state = "off";
> > +		};
> > +
> > +		red {
> > +			label = "red";
> > +			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
> > +			linux,default-trigger = "gpio";
> > +			default-state = "off";
> > +		};
> > +	};
> > +
> > +	memory at 10000000 {
> > +		reg = <0x10000000 0x40000000>;
> > +	};
> > +
> > +	reg_usb_h1_vbus: regulator-usb_h1_vbus {
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "usb_h1_vbus";
> > +		regulator-min-microvolt = <5000000>;
> > +		regulator-max-microvolt = <5000000>;
> > +		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
> > +		enable-active-high;
> > +	};
> > +};
> > +
> > +&fec {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_enet>;
> > +	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
> > +	phy-reset-duration = <10>;
> > +	phy-mode = "rgmii";
> > +	fsl,magic-packet;
> > +	fsl,enet-loopback-clk; /* anatop reference clk via PAD
> > loopback */
> > +	fsl,enet-freq = <1>; /* ENET_25MHZ  = 0, ENET_50MHZ  = 1 */
> > +			     /* ENET_100MHZ = 2, ENET_125MHZ = 3 */
> > +	status = "okay";
> > +};
> > +
> > +&i2c1 {
> > +	clock-frequency = <400000>;
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_i2c1>;
> > +	status = "okay";
> > +};
> > +
> > +&i2c2 {
> > +	clock-frequency = <400000>;
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_i2c2>;
> > +	status = "okay";
> > +};
> > +
> > +&iomuxc {
> > +	pinctrl_enet: enetgrp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_ENET_MDIO__ENET_MDIO
> > 0x1b0b0
> > +			MX6QDL_PAD_ENET_MDC__ENET_MDC
> > 	0x1b0b0
> > +			MX6QDL_PAD_RGMII_TXC__RGMII_TXC
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_TD0__RGMII_TD0
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_TD1__RGMII_TD1
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_TD2__RGMII_TD2
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_TD3__RGMII_TD3
> > 0x1b0b0
> > +
> > MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
> > +
> > MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
> > +			MX6QDL_PAD_RGMII_RXC__RGMII_RXC
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_RD0__RGMII_RD0
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_RD1__RGMII_RD1
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_RD2__RGMII_RD2
> > 0x1b0b0
> > +			MX6QDL_PAD_RGMII_RD3__RGMII_RD3
> > 0x1b0b0
> > +
> > MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
> > +			MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
> > +			MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25
> > 0x1b0b0
> > +		>;
> > +	};
> > +
> > +	pinctrl_leds: gpioledsgrp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_EIM_D23__GPIO3_IO23
> > 0x4001b0b0
> > +			MX6QDL_PAD_EIM_D16__GPIO3_IO16
> > 0x4001b0b0
> > +		>;
> > +	};
> > +
> > +	pinctrl_i2c1: i2c1grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA
> > 0x4001b8b1
> > +			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL
> > 0x4001b8b1
> > +		>;
> > +	};
> > +
> > +	pinctrl_i2c2: i2c2grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_KEY_COL3__I2C2_SCL
> > 0x4001b8b1
> > +			MX6QDL_PAD_KEY_ROW3__I2C2_SDA
> > 0x4001b8b1
> > +		 >;
> > +	};
> > +
> > +	pinctrl_uart1: uart1grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA
> > 0x1b0b1
> > +			MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA
> > 0x1b0b1
> > +		>;
> > +	};
> > +
> > +	pinctrl_uart2: uart2grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_EIM_D26__UART2_TX_DATA
> > 0x1b0b1
> > +			MX6QDL_PAD_EIM_D27__UART2_RX_DATA
> > 0x1b0b1
> > +			MX6QDL_PAD_EIM_D28__UART2_CTS_B
> > 0x1b0b1
> > +			MX6QDL_PAD_EIM_D29__UART2_RTS_B
> > 0x1b0b1
> > +		>;
> > +	};
> > +
> > +	pinctrl_usbh1: usbh1grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_EIM_D31__GPIO3_IO31
> > 0x1b0b1
> > +			MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID
> > 0x17059
> > +		>;
> > +	};
> > +
> > +	pinctrl_usdhc2: usdhc2grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_SD2_CMD__SD2_CMD
> > 0x17019
> > +			MX6QDL_PAD_SD2_CLK__SD2_CLK
> > 0x10019
> > +			MX6QDL_PAD_SD2_DAT0__SD2_DATA0
> > 	0x17019
> > +			MX6QDL_PAD_SD2_DAT1__SD2_DATA1
> > 	0x17019
> > +			MX6QDL_PAD_SD2_DAT2__SD2_DATA2
> > 	0x17019
> > +			MX6QDL_PAD_SD2_DAT3__SD2_DATA3
> > 	0x17019
> > +			MX6QDL_PAD_NANDF_CS3__GPIO6_IO16
> > 0x20000
> > +			MX6QDL_PAD_GPIO_4__GPIO1_IO04
> > 0x20000
> > +		>;
> > +	};
> > +
> > +	pinctrl_usdhc4: usdhc4grp {
> > +		fsl,pins = <
> > +			MX6QDL_PAD_SD4_CMD__SD4_CMD
> > 0x17019
> > +			MX6QDL_PAD_SD4_CLK__SD4_CLK
> > 0x10019
> > +			MX6QDL_PAD_SD4_DAT0__SD4_DATA0
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT1__SD4_DATA1
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT2__SD4_DATA2
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT3__SD4_DATA3
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT4__SD4_DATA4
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT5__SD4_DATA5
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT6__SD4_DATA6
> > 	0x17019
> > +			MX6QDL_PAD_SD4_DAT7__SD4_DATA7
> > 	0x17019
> > +		>;
> > +	};
> > +};
> > +
> > +&uart1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_uart1>;
> > +	status = "okay";
> > +};
> > +
> > +&uart2 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_uart2>;
> > +	uart-has-rtscts;
> > +};
> > +
> > +&usbh1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_usbh1>;
> > +	vbus-supply = <&reg_usb_h1_vbus>;
> > +	status = "okay";
> > +};
> > +
> > +&usdhc2 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_usdhc2>;
> > +	bus-width = <4>;
> > +	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
> > +	status = "okay";
> > +};
> > +
> > +&usdhc4 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_usdhc4>;
> > +	bus-width = <8>;
> > +	non-removable;
> > +	no-1-8-v;
> > +	keep-power-in-suspend;
> > +	status = "okay";
> > +};
> > --
> > 2.11.0  
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190811/cf78427e/attachment.sig>

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

* [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock
  2019-08-09  7:07   ` Peng Fan
@ 2019-08-11 21:27     ` Lukasz Majewski
  0 siblings, 0 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-08-11 21:27 UTC (permalink / raw)
  To: u-boot

Hi Peng,

> > Subject: [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic
> > numbers when setting ENET clock
> > 
> > This is a cosmetic change, just to use proper define instead of
> > magic numbers.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > 
> >  board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> > b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> > index 7bdc64b1be..1dbd03efd8 100644
> > --- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> > +++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> > @@ -118,7 +118,8 @@ static int setup_fec_clock(void)
> >  	struct iomuxc *iomuxc_regs = (struct iomuxc
> > *)IOMUXC_BASE_ADDR;
> > 
> >  	/* set gpr1[21] to select anatop clock */
> > -	clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 <<
> > 21);
> > +	clrsetbits_le32(&iomuxc_regs->gpr[1],
> > IOMUXC_GPR1_ENET_CLK_SEL_MASK,
> > +			IOMUXC_GPR1_ENET_CLK_SEL_MASK);  
> 
> Would setbits_le32 work here?

Good point. It shall be possible to use setbits_le32. I will try to use
it.

> 
> Regards,
> Peng.
> 
> > 
> >  	return enable_fec_anatop_clock(0, ENET_50MHZ);  }
> > --
> > 2.11.0  
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190811/f98c836c/attachment.sig>

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-08-11 21:25     ` Lukasz Majewski
@ 2019-08-11 23:55       ` Tom Rini
  2019-08-12  6:39         ` Lukasz Majewski
  0 siblings, 1 reply; 25+ messages in thread
From: Tom Rini @ 2019-08-11 23:55 UTC (permalink / raw)
  To: u-boot

On Sun, Aug 11, 2019 at 11:25:37PM +0200, Lukasz Majewski wrote:
> Hi Peng,
> 
> > > Subject: [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q
> > > based) device tree description
> > > 
> > > This commit defines the TPC70 imx6q board with device tree
> > > description.  
> > 
> > Is the imx6q-kp.dtsi usable for this board from Linux kernel?
> > 
> 
> The imx6q-kp.dtsi is defined in the Linux kernel [1].
> 
> However, not all features - like backlight, CAN, etc. are needed in
> U-Boot. To reduce SPL footprint, as the TPC70 is the first
> board (from i.MX6Q family of SoCs) which uses only DM in SPL and U-Boot
> proper, only the necessary subset of [1] was added to U-Boot.
> 
> Note:
> 
> [1] -
> https://elixir.bootlin.com/linux/v5.2.8/source/arch/arm/boot/dts/imx6q-kp.dtsi

Right, and that's what we have CONFIG_OF_SPL_REMOVE_PROPS for, yes?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190811/143ba3bc/attachment.sig>

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-08-11 23:55       ` Tom Rini
@ 2019-08-12  6:39         ` Lukasz Majewski
  0 siblings, 0 replies; 25+ messages in thread
From: Lukasz Majewski @ 2019-08-12  6:39 UTC (permalink / raw)
  To: u-boot

Hi Tom,

> On Sun, Aug 11, 2019 at 11:25:37PM +0200, Lukasz Majewski wrote:
> > Hi Peng,
> >   
> > > > Subject: [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board
> > > > (imx6q based) device tree description
> > > > 
> > > > This commit defines the TPC70 imx6q board with device tree
> > > > description.    
> > > 
> > > Is the imx6q-kp.dtsi usable for this board from Linux kernel?
> > >   
> > 
> > The imx6q-kp.dtsi is defined in the Linux kernel [1].
> > 
> > However, not all features - like backlight, CAN, etc. are needed in
> > U-Boot. To reduce SPL footprint, as the TPC70 is the first
> > board (from i.MX6Q family of SoCs) which uses only DM in SPL and
> > U-Boot proper, only the necessary subset of [1] was added to U-Boot.
> > 
> > Note:
> > 
> > [1] -
> > https://elixir.bootlin.com/linux/v5.2.8/source/arch/arm/boot/dts/imx6q-kp.dtsi
> >  
> 
> Right, and that's what we have CONFIG_OF_SPL_REMOVE_PROPS for, yes?
> 

Not quite. For example I need "clocks" property, which is defined for
almost all nodes. This incurs some extra cost in terms of footprint.

To reduce the SPL size (to which dtb file size contributes), I had to
not include full DTS from Linux in U-Boot.

I only used a subset of it (only _really_ necessary description to run
U-Boot) to reduce size of SPL binary.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190812/3f84ecef/attachment.sig>

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

* [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description
  2019-07-30  7:12 ` [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description Lukasz Majewski
  2019-08-09  7:10   ` Peng Fan
@ 2019-08-13  8:41   ` Peng Fan
  1 sibling, 0 replies; 25+ messages in thread
From: Peng Fan @ 2019-08-13  8:41 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based)
> device tree description
> 
> This commit defines the TPC70 imx6q board with device tree description.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Peng Fan <peng.fan@nxp.com>

> ---
> 
>  arch/arm/dts/imx6q-kp.dts | 219
> ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 219 insertions(+)
>  create mode 100644 arch/arm/dts/imx6q-kp.dts
> 
> diff --git a/arch/arm/dts/imx6q-kp.dts b/arch/arm/dts/imx6q-kp.dts new file
> mode 100644 index 0000000000..12d6db6f80
> --- /dev/null
> +++ b/arch/arm/dts/imx6q-kp.dts
> @@ -0,0 +1,219 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2018
> + * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
> + *
> + * SPDX-License-Identifier:     GPL-2.0+ or X11
> + */
> +
> +/dts-v1/;
> +#include <dt-bindings/gpio/gpio.h>
> +#include "imx6q.dtsi"
> +
> +/ {
> +	model = "K+P iMX6Q";
> +	compatible = "kp,imx6-kp", "fsl,imx6";
> +
> +	aliases {
> +		mmc0 = &usdhc2;
> +		mmc1 = &usdhc4;
> +		usb1 = &usbh1;
> +	};
> +
> +	chosen {
> +		stdout-path = &uart1;
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_leds>;
> +
> +		green {
> +			label = "green";
> +			gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "gpio";
> +			default-state = "off";
> +		};
> +
> +		red {
> +			label = "red";
> +			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "gpio";
> +			default-state = "off";
> +		};
> +	};
> +
> +	memory at 10000000 {
> +		reg = <0x10000000 0x40000000>;
> +	};
> +
> +	reg_usb_h1_vbus: regulator-usb_h1_vbus {
> +		compatible = "regulator-fixed";
> +		regulator-name = "usb_h1_vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +};
> +
> +&fec {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_enet>;
> +	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
> +	phy-reset-duration = <10>;
> +	phy-mode = "rgmii";
> +	fsl,magic-packet;
> +	fsl,enet-loopback-clk; /* anatop reference clk via PAD loopback */
> +	fsl,enet-freq = <1>; /* ENET_25MHZ  = 0, ENET_50MHZ  = 1 */
> +			     /* ENET_100MHZ = 2, ENET_125MHZ = 3 */
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c1>;
> +	status = "okay";
> +};
> +
> +&i2c2 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c2>;
> +	status = "okay";
> +};
> +
> +&iomuxc {
> +	pinctrl_enet: enetgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_ENET_MDIO__ENET_MDIO	0x1b0b0
> +			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
> +			MX6QDL_PAD_RGMII_TXC__RGMII_TXC	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD0__RGMII_TD0	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD1__RGMII_TD1	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD2__RGMII_TD2	0x1b0b0
> +			MX6QDL_PAD_RGMII_TD3__RGMII_TD3	0x1b0b0
> +			MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
> +			MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
> +			MX6QDL_PAD_RGMII_RXC__RGMII_RXC	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD0__RGMII_RD0	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD1__RGMII_RD1	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD2__RGMII_RD2	0x1b0b0
> +			MX6QDL_PAD_RGMII_RD3__RGMII_RD3	0x1b0b0
> +			MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
> +			MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
> +			MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25	0x1b0b0
> +		>;
> +	};
> +
> +	pinctrl_leds: gpioledsgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D23__GPIO3_IO23
> 0x4001b0b0
> +			MX6QDL_PAD_EIM_D16__GPIO3_IO16
> 0x4001b0b0
> +		>;
> +	};
> +
> +	pinctrl_i2c1: i2c1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA	0x4001b8b1
> +			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL	0x4001b8b1
> +		>;
> +	};
> +
> +	pinctrl_i2c2: i2c2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_KEY_COL3__I2C2_SCL	0x4001b8b1
> +			MX6QDL_PAD_KEY_ROW3__I2C2_SDA	0x4001b8b1
> +		 >;
> +	};
> +
> +	pinctrl_uart1: uart1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA	0x1b0b1
> +			MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA	0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_uart2: uart2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D26__UART2_TX_DATA       0x1b0b1
> +			MX6QDL_PAD_EIM_D27__UART2_RX_DATA       0x1b0b1
> +			MX6QDL_PAD_EIM_D28__UART2_CTS_B         0x1b0b1
> +			MX6QDL_PAD_EIM_D29__UART2_RTS_B         0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_usbh1: usbh1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D31__GPIO3_IO31          0x1b0b1
> +			MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x17059
> +		>;
> +	};
> +
> +	pinctrl_usdhc2: usdhc2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x17019
> +			MX6QDL_PAD_SD2_CLK__SD2_CLK		0x10019
> +			MX6QDL_PAD_SD2_DAT0__SD2_DATA0		0x17019
> +			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17019
> +			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17019
> +			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17019
> +			MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x20000
> +			MX6QDL_PAD_GPIO_4__GPIO1_IO04           0x20000
> +		>;
> +	};
> +
> +	pinctrl_usdhc4: usdhc4grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD4_CMD__SD4_CMD		0x17019
> +			MX6QDL_PAD_SD4_CLK__SD4_CLK		0x10019
> +			MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17019
> +			MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17019
> +			MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17019
> +			MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17019
> +			MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17019
> +			MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17019
> +			MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17019
> +			MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17019
> +		>;
> +	};
> +};
> +
> +&uart1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart1>;
> +	status = "okay";
> +};
> +
> +&uart2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart2>;
> +	uart-has-rtscts;
> +};
> +
> +&usbh1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usbh1>;
> +	vbus-supply = <&reg_usb_h1_vbus>;
> +	status = "okay";
> +};
> +
> +&usdhc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc2>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
> +	status = "okay";
> +};
> +
> +&usdhc4 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc4>;
> +	bus-width = <8>;
> +	non-removable;
> +	no-1-8-v;
> +	keep-power-in-suspend;
> +	status = "okay";
> +};
> --
> 2.11.0

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

end of thread, other threads:[~2019-08-13  8:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-30  7:12 [U-Boot] [PATCH v2 00/11] dm: Convert TPC70 to use DM and DTS in SPL and u-boot proper Lukasz Majewski
2019-07-30  7:12 ` [U-Boot] [PATCH v2 01/11] imx: tpc70: config: Add script commands to update u-boot and OE's wic Lukasz Majewski
2019-08-09  6:35   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 02/11] imx: tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update Lukasz Majewski
2019-08-09  7:03   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 03/11] imx: tpc70: Add board_boot_order() to distinguish between eMMC and SD boot Lukasz Majewski
2019-08-09  7:04   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 04/11] imx: tpc70: DTS: Explicitly add imx6q-kp.dtb to Makefile for DTB compilation Lukasz Majewski
2019-08-09  7:05   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 05/11] imx: tpc70: cosmetic: Replace magic numbers when setting ENET clock Lukasz Majewski
2019-08-09  7:07   ` Peng Fan
2019-08-11 21:27     ` Lukasz Majewski
2019-07-30  7:12 ` [U-Boot] [PATCH v2 06/11] imx: tpc70: led: Enable LED default state Lukasz Majewski
2019-08-09  7:08   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 07/11] imx: tpc70: dts: Add TPC70 board (imx6q based) device tree description Lukasz Majewski
2019-08-09  7:10   ` Peng Fan
2019-08-11 21:25     ` Lukasz Majewski
2019-08-11 23:55       ` Tom Rini
2019-08-12  6:39         ` Lukasz Majewski
2019-08-13  8:41   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 08/11] imx: dts: Add u-boot specific set of device tree properties for tpc70 Lukasz Majewski
2019-07-30  7:12 ` [U-Boot] [PATCH v2 09/11] imx: tpc70: Convert TPC70 (imx6q) board to use DM/DTS in SPL and u-boot Lukasz Majewski
2019-07-30  7:12 ` [U-Boot] [PATCH v2 10/11] imx: spl: tpc70: Do not remove clock related properties from DTS Lukasz Majewski
2019-08-09  7:11   ` Peng Fan
2019-07-30  7:12 ` [U-Boot] [PATCH v2 11/11] imx: config: Update KP's TPC70 config to support SWUpdate Lukasz Majewski

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