All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup)
@ 2019-06-09 20:54 Lukasz Majewski
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
                   ` (10 more replies)
  0 siblings, 11 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This patch series converts display5 to use DM/DTS.
The SPL conversion to DM/DTS has been omited.

It has been divided to following parts:
- First 2 patches are cosmetic ones and clean the U-Boot code base
- Next 3 patches fix display5 to make it bootable again
- Next 2 patches port DTS description from Linux kernel
- Next 2 patches convert the 'display5_defconfig' and
  'display5_factory_defconfig' to DM/DTS. The conversion has been
  done at once to avoid problems with unbuildable state of the board.
- Last 2 patches move the code which was common before DM/DTS conversion
  to SPL.

This patch depends on:
"watchdog: Split WDT from SPL_WDT" (v2)
https://patchwork.ozlabs.org/patch/1112591/
"watchdog: imx: Add DM support"  (v2)
https://patchwork.ozlabs.org/patch/11112592/

"usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDP"
https://patchwork.ozlabs.org/patch/1110113/

"IMX: serial: dm: Set DM_FLAG_PRE_RELOC in the IMX uart driver"
https://patchwork.ozlabs.org/patch/1109923/

Travis-CI:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/543404916
(Only errors on RockCHip due to exceeding size limit).

Applied on top of u-boot/master branch
SHA1: 6d277fb0ed145f82dd50cc6e99d2fa553a588c3b



Lukasz Majewski (11):
  cosmetic: display5: Remove not needed comments
  cosmetic: Update comment in cmd/eeprom.c
  ARM: display5: Fix CS check after moving some SPI related CONFIGs to
    Kconfig
  gpio: Add missing parenthesis to the GPIO_TO_PORT define
  ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  DTS: imx: Add display5 board (imx6q based) device tree description
    (v5.1)
  DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific
    properties
  ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc
  DM: display5: Convert display5 board to use DM/DTS
  ARM: display5: Remove UART initialization code after DM/DTS conversion
    (non-console)
  ARM: display5: Remove common.c file (after DM/DTS U-Boot proper
    conversion)

 arch/arm/dts/imx6q-display5-u-boot.dtsi |  49 +++++
 arch/arm/dts/imx6q-display5.dts         | 352 ++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/mx6/Kconfig           |   5 +
 board/liebherr/display5/Makefile        |   4 +-
 board/liebherr/display5/common.c        | 120 -----------
 board/liebherr/display5/common.h        |   8 -
 board/liebherr/display5/display5.c      | 236 +++------------------
 board/liebherr/display5/spl.c           |  74 +++++++
 cmd/eeprom.c                            |   2 +-
 configs/display5_defconfig              |  32 +++
 configs/display5_factory_defconfig      |  43 +++-
 drivers/gpio/mxc_gpio.c                 |   2 +-
 include/configs/display5.h              |  34 +--
 13 files changed, 592 insertions(+), 369 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-display5-u-boot.dtsi
 delete mode 100644 board/liebherr/display5/common.c

-- 
2.11.0

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

* [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:36   ` Peng Fan
  2019-07-20  8:57   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c Lukasz Majewski
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

Some comments are not needed anymore after Kconfig automated conversion.

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

 include/configs/display5.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/configs/display5.h b/include/configs/display5.h
index 5e982b8d27..5dbe5b8528 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -55,11 +55,8 @@
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(16 * 1024 * 1024)
 
-/*#define CONFIG_MXC_UART*/
 #define CONFIG_MXC_UART_BASE		UART5_BASE
 
-/* SPI NOR Flash */
-
 /* I2C Configs */
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
@@ -364,8 +361,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR \
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
-/* Commands */
-
 /* Watchdog */
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   15000
 
-- 
2.11.0

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

* [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:36   ` Peng Fan
  2019-07-20  8:45   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig Lukasz Majewski
                   ` (8 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This commit just corrects spelling of 'accessed' word in the EEPROM
comment.

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

 cmd/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/eeprom.c b/cmd/eeprom.c
index 7b1f81477f..19953df082 100644
--- a/cmd/eeprom.c
+++ b/cmd/eeprom.c
@@ -108,7 +108,7 @@ static int eeprom_len(unsigned offset, unsigned end)
 
 	/*
 	 * For a FRAM device there is no limit on the number of the
-	 * bytes that can be ccessed with the single read or write
+	 * bytes that can be accessed with the single read or write
 	 * operation.
 	 */
 #if !defined(CONFIG_SYS_I2C_FRAM)
-- 
2.11.0

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

* [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-07-20  8:46   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define Lukasz Majewski
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

After commit 14453fbfadc2 ("Convert CONFIG_SF_DEFAULT_* to Kconfig")
and commit abe66b1b5dec ("Convert CONFIG_ENV_SPI_* to Kconfig") ,which
moved some SPI related CONFIG_* defines to Kconfig the display5 board has
become unbootable as the SPI CS check condition had wrong value.

This commit fixes this check and allows proper SPI NOR flash operation in
SPL.

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

 board/liebherr/display5/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/liebherr/display5/common.c b/board/liebherr/display5/common.c
index 4eb86d8c5d..48b5c1a6f5 100644
--- a/board/liebherr/display5/common.c
+++ b/board/liebherr/display5/common.c
@@ -68,7 +68,7 @@ iomux_v3_cfg_t const ecspi2_pads[] = {
 
 int board_spi_cs_gpio(unsigned int bus, unsigned int cs)
 {
-	if (bus != 1 || cs != (IMX_GPIO_NR(5, 29) << 8))
+	if (bus != 1 || cs != 0)
 		return -EINVAL;
 
 	return IMX_GPIO_NR(5, 29);
-- 
2.11.0

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

* [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (2 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:38   ` Peng Fan
  2019-07-20  8:46   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB Lukasz Majewski
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

Add missing parenthesis to the GPIO_TO_PORT macro.

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

 drivers/gpio/mxc_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 8bd30c75b2..64ab7a303f 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -31,7 +31,7 @@ struct mxc_bank_info {
 };
 
 #ifndef CONFIG_DM_GPIO
-#define GPIO_TO_PORT(n)		(n / 32)
+#define GPIO_TO_PORT(n)		((n) / 32)
 
 /* GPIO port description */
 static unsigned long gpio_ports[] = {
-- 
2.11.0

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

* [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (3 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:41   ` Peng Fan
  2019-07-20  8:46   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1) Lukasz Majewski
                   ` (5 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

Porting more DTS code from Linux kernel for display5 board required
increase of pre-relocation malloc pool size in U-Boot proper.

The early malloc memory is necessary for handling parsing and setup of
e.g. serial port device (and all its ancestors in DT tree).

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

 configs/display5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 3b793f4500..0ef56024e9 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -4,16 +4,19 @@ 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=0x1000
 CONFIG_MX6_DDRCAL=y
 CONFIG_TARGET_DISPLAY5=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
 CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
-- 
2.11.0

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

* [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1)
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (4 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:41   ` Peng Fan
  2019-07-20  8:57   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
                   ` (4 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This commit ports from Linux kernel - tag: v5.1 - the device tree
description for display5 board.

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

 arch/arm/dts/imx6q-display5.dts | 352 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 352 insertions(+)

diff --git a/arch/arm/dts/imx6q-display5.dts b/arch/arm/dts/imx6q-display5.dts
index 50347ff26b..4e2aa363ed 100644
--- a/arch/arm/dts/imx6q-display5.dts
+++ b/arch/arm/dts/imx6q-display5.dts
@@ -10,9 +10,361 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
 #include "imx6q.dtsi"
 
 / {
 	model = "Liebherr (LWN) display5 i.MX6 Quad Board";
 	compatible = "lwn,display5", "fsl,imx6q";
+
+	memory at 10000000 {
+		device_type = "memory";
+		reg = <0x10000000 0x40000000>;
+	};
+};
+
+&ecspi2 {
+	cs-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs &pinctrl_ecspi2_flwp>;
+	status = "okay";
+
+	s25fl256s: flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		spi-max-frequency = <40000000>;
+		reg = <0>;
+
+		partition at 0 {
+			label = "SPL (spi)";
+			reg = <0x0 0x20000>;
+			read-only;
+		};
+		partition at 1 {
+			label = "u-boot (spi)";
+			reg = <0x20000 0x100000>;
+			read-only;
+		};
+		partition at 2 {
+			label = "uboot-env (spi)";
+			reg = <0x120000 0x10000>;
+		};
+		partition at 3 {
+			label = "uboot-envr (spi)";
+			reg = <0x130000 0x10000>;
+		};
+		partition at 4 {
+			label = "linux-recovery (spi)";
+			reg = <0x140000 0x800000>;
+		};
+		partition at 5 {
+			label = "swupdate-fitImg (spi)";
+			reg = <0x940000 0x400000>;
+		};
+		partition at 6 {
+			label = "swupdate-initramfs (spi)";
+			reg = <0xD40000 0x800000>;
+		};
+	};
+};
+
+&ecspi3 {
+	cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ecspi3 &pinctrl_ecspi3_cs &pinctrl_ecspi3_flwp>;
+	status = "okay";
+};
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-handle = <&ethernet_phy0>;
+	phy-mode = "rgmii-id";
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ethernet_phy0: ethernet-phy at 0 {
+			compatible = "marvell,88E1510";
+			device_type = "ethernet-phy";
+			/* Set LED0 control: */
+			/* On - Link, Blink - Activity, Off - No Link */
+			marvell,reg-init = <3 0x10 0 0x1011>;
+			max-speed = <100>;
+			reg = <0>;
+		};
+	};
+};
+
+&i2c1 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+
+	codec: tfa9879 at 6c {
+		#sound-dai-cells = <0>;
+		compatible = "nxp,tfa9879";
+		reg = <0x6C>;
+	};
+};
+
+&i2c2 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	status = "okay";
+};
+
+&i2c3 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	status = "okay";
+
+	at24 at 50 {
+		compatible = "atmel,24c256";
+		pagesize = <64>;
+		reg = <0x50>;
+	};
+
+	pfuze100: pmic at 8 {
+		compatible = "fsl,pfuze100";
+		reg = <0x08>;
+
+		regulators {
+			sw1a_reg: sw1ab {
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1875000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw1c_reg: sw1c {
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1875000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw2_reg: sw2 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <3950000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3a_reg: sw3a {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3b_reg: sw3b {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw4_reg: sw4 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <3300000>;
+			};
+
+			swbst_reg: swbst {
+				regulator-min-microvolt = <5000000>;
+				regulator-max-microvolt = <5150000>;
+			};
+
+			snvs_reg: vsnvs {
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vref_reg: vrefddr {
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vgen1_reg: vgen1 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1550000>;
+			};
+
+			vgen2_reg: vgen2 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1550000>;
+			};
+
+			vgen3_reg: vgen3 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+			};
+
+			vgen4_reg: vgen4 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen5_reg: vgen5 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen6_reg: vgen6 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&uart4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart4>;
+	uart-has-rtscts;
+	status = "okay";
+};
+
+&uart5 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart5>;
+	status = "okay";
+};
+
+&usdhc4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc4>;
+	bus-width = <8>;
+	non-removable;
+	status = "okay";
+};
+
+&iomuxc {
+	pinctrl_ecspi2: ecspi2grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT10__ECSPI2_MISO	0x100b1
+			MX6QDL_PAD_CSI0_DAT9__ECSPI2_MOSI	0x100b1
+			MX6QDL_PAD_CSI0_DAT8__ECSPI2_SCLK	0x100b1
+		>;
+	};
+
+	pinctrl_ecspi2_cs: ecspi2csgrp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29 0x100b1
+		>;
+	};
+
+	pinctrl_ecspi2_flwp: ecspi2flwpgrp {
+		fsl,pins = <
+			MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0
+		>;
+	};
+
+	pinctrl_ecspi3: ecspi3grp {
+		fsl,pins = <
+			MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO	0x100b1
+			MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI	0x100b1
+			MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK	0x100b1
+		>;
+	};
+
+	pinctrl_ecspi3_cs: ecspi3csgrp {
+		fsl,pins = <
+			MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x1b0b0
+		>;
+	};
+
+	pinctrl_ecspi3_flwp: ecspi3flwpgrp {
+		fsl,pins = <
+			MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27 0x1b0b0
+		>;
+	};
+
+	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_GPIO_6__ENET_IRQ		0x000b1
+			MX6QDL_PAD_ENET_RXD0__GPIO1_IO27        0x1b0b0
+		>;
+	};
+
+	pinctrl_i2c1: i2c1grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D21__I2C1_SCL	0x4001b8b1
+			MX6QDL_PAD_EIM_D28__I2C1_SDA	0x4001b8b1
+		>;
+	};
+
+	pinctrl_i2c2: i2c2grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_EB2__I2C2_SCL	0x4001b8b1
+			MX6QDL_PAD_EIM_D16__I2C2_SDA	0x4001b8b1
+		>;
+	};
+
+	pinctrl_i2c3: i2c3grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D17__I2C3_SCL	0x4001b8b1
+			MX6QDL_PAD_EIM_D18__I2C3_SDA	0x4001b8b1
+		>;
+	};
+
+	pinctrl_uart4: uart4grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA	0x1b0b1
+			MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA	0x1b0b1
+			MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B	0x1b0b1
+			MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B	0x1b0b1
+		>;
+	};
+
+	pinctrl_uart5: uart5grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA	0x1b0b1
+			MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA    0x1b0b1
+		>;
+	};
+
+	pinctrl_usdhc4: usdhc4grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD4_CMD__SD4_CMD		0x17059
+			MX6QDL_PAD_SD4_CLK__SD4_CLK		0x10059
+			MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17059
+			MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17059
+			MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17059
+			MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17059
+			MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17059
+			MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17059
+			MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17059
+			MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17059
+			MX6QDL_PAD_NANDF_ALE__SD4_RESET	0x17059
+		>;
+	};
 };
-- 
2.11.0

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

* [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (5 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1) Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:43   ` Peng Fan
                     ` (2 more replies)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc Lukasz Majewski
                   ` (3 subsequent siblings)
  10 siblings, 3 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This file setups UART5 based serial to be used as pre-relocation
console in the U-Boot proper.

On purpose pinux configuration is omitted here as it has been already
done in SPL. For early pre-relocation code we only need the serial
device from DTS.

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

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

diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi b/arch/arm/dts/imx6q-display5-u-boot.dtsi
new file mode 100644
index 0000000000..b942218b7a
--- /dev/null
+++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
@@ -0,0 +1,44 @@
+// 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
+ */
+
+/*
+ * The minimal augmentation DTS U-Boot file to allow UART5
+ * configuration in the pre-relocation stage of U-Boot
+ * proper.
+ *
+ * As the same UART is already configured in SPL, we don't need
+ * setup pinmux for it again.
+ */
+
+/ {
+	aliases {
+		mmc0 = &usdhc4;
+	};
+
+	soc {
+		u-boot,dm-pre-reloc;
+
+		aips-bus at 2100000 {
+			u-boot,dm-pre-reloc;
+		};
+	};
+
+	chosen {
+		stdout-path = &uart5;
+	};
+};
+
+&i2c3 {
+	at24 at 50 {
+		u-boot,i2c-offset-len = <2>;
+	};
+};
+
+&uart5 {
+	u-boot,dm-pre-reloc;
+};
-- 
2.11.0

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

* [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (6 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:44   ` Peng Fan
  2019-07-20  8:45   ` sbabic at denx.de
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS Lukasz Majewski
                   ` (2 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

Before the wide DM/DTS adoption in the U-Boot proper, the display5
has been using only DM_SERIAL to provide serial console in
pre-relocation.

After moving to full DM/DTS adoption in the U-Boot proper the
U_BOOT_DEVICE definition is not needed anymore, as it has been
replaced with udevice creation from provided DTS description.

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

 board/liebherr/display5/display5.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c
index d8383170d2..410d5bc782 100644
--- a/board/liebherr/display5/display5.c
+++ b/board/liebherr/display5/display5.c
@@ -413,12 +413,3 @@ int misc_init_r(void)
 
 	return 0;
 }
-
-static struct mxc_serial_platdata mxc_serial_plat = {
-	.reg = (struct mxc_uart *)UART5_BASE,
-};
-
-U_BOOT_DEVICE(mxc_serial) = {
-	.name = "serial_mxc",
-	.platdata = &mxc_serial_plat,
-};
-- 
2.11.0

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

* [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (7 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:45   ` Peng Fan
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console) Lukasz Majewski
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion) Lukasz Majewski
  10 siblings, 1 reply; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This commit converts display5 board (also its 'factory' variant) to use
DM/DTS.

The change has been made in a single patch to avoid problems with
unbuildable commits (as DM conversion breaks some of them).

Notable changes (DM/DTS conversion):

- PINCTRL{_IMX6}
- DM_I2C
- enable 'regulator' and 'pmic' commands
- DM_MMC and BLK (USDHC)
- DM_ETH
- DM_SPI and DM_SPI_FLASH (but no in SPL)
- DM WDT (including SYSRESET)
- Update display5_factory_defconfig after switch to DM/DTS and uuu utility

Note regarding 'display5_factory_defconfig'

The VID and PID for SPL running SDP gadget have been updated to
allow seamless work with 'uuu' utility from NXP (the imx_usb doesn't work
properly after embedding the u-boot proper into fitImage - problem with IVT
embedding in FIT).

Example to use 'uuu' session:

cat << EOF > display5_recovery.lst
uuu_version 1.2.135
SDP: boot -f /srv/tftp/SPL
SDPU: write -f /srv/tftp/u-boot-dtb.img -addr 0x10000000
SDPU: jump -addr 0x10000000
SDPU: done
EOF

sudo ./uuu/uuu display5_recovery.lst

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

 arch/arm/dts/imx6q-display5-u-boot.dtsi |   5 +
 arch/arm/mach-imx/mx6/Kconfig           |   5 +
 board/liebherr/display5/common.c        |  24 ----
 board/liebherr/display5/common.h        |   2 -
 board/liebherr/display5/display5.c      | 225 ++++----------------------------
 configs/display5_defconfig              |  29 ++++
 configs/display5_factory_defconfig      |  43 +++++-
 include/configs/display5.h              |  29 ++--
 8 files changed, 115 insertions(+), 247 deletions(-)

diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi b/arch/arm/dts/imx6q-display5-u-boot.dtsi
index b942218b7a..aa660b5aeb 100644
--- a/arch/arm/dts/imx6q-display5-u-boot.dtsi
+++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
@@ -31,6 +31,11 @@
 	chosen {
 		stdout-path = &uart5;
 	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+	};
 };
 
 &i2c3 {
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index f513c4c06f..da00cf611e 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -187,6 +187,11 @@ config TARGET_DHCOMIMX6
 config TARGET_DISPLAY5
 	bool "LWN DISPLAY5 board"
 	select DM
+	select DM_ETH
+	select DM_I2C
+	select DM_MMC
+	select DM_SPI
+	select DM_GPIO
 	select DM_SERIAL
 	select SUPPORT_SPL
 	imply CMD_DM
diff --git a/board/liebherr/display5/common.c b/board/liebherr/display5/common.c
index 48b5c1a6f5..2b3253d88d 100644
--- a/board/liebherr/display5/common.c
+++ b/board/liebherr/display5/common.c
@@ -45,18 +45,6 @@ void displ5_set_iomux_misc_spl(void)
 }
 
 #ifdef CONFIG_MXC_SPI
-iomux_v3_cfg_t const ecspi_pads[] = {
-	/* SPI3 */
-	MX6_PAD_DISP0_DAT2__ECSPI3_MISO	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_DISP0_DAT1__ECSPI3_MOSI	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_DISP0_DAT0__ECSPI3_SCLK	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_DISP0_DAT3__ECSPI3_SS0	| MUX_PAD_CTRL(NO_PAD_CTRL),
-	MX6_PAD_DISP0_DAT4__ECSPI3_SS1	| MUX_PAD_CTRL(NO_PAD_CTRL),
-	MX6_PAD_DISP0_DAT5__ECSPI3_SS2	| MUX_PAD_CTRL(NO_PAD_CTRL),
-	MX6_PAD_DISP0_DAT6__ECSPI3_SS3	| MUX_PAD_CTRL(NO_PAD_CTRL),
-	MX6_PAD_DISP0_DAT7__ECSPI3_RDY	| MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
 iomux_v3_cfg_t const ecspi2_pads[] = {
 	/* SPI2, NOR Flash nWP, CS0 */
 	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	| MUX_PAD_CTRL(SPI_PAD_CTRL),
@@ -79,14 +67,8 @@ void displ5_set_iomux_ecspi_spl(void)
 	SETUP_IOMUX_PADS(ecspi2_pads);
 }
 
-void displ5_set_iomux_ecspi(void)
-{
-	SETUP_IOMUX_PADS(ecspi_pads);
-}
-
 #else
 void displ5_set_iomux_ecspi_spl(void) {}
-void displ5_set_iomux_ecspi(void) {}
 #endif
 
 #ifdef CONFIG_FSL_ESDHC
@@ -109,12 +91,6 @@ void displ5_set_iomux_usdhc_spl(void)
 	SETUP_IOMUX_PADS(usdhc4_pads);
 }
 
-void displ5_set_iomux_usdhc(void)
-{
-	SETUP_IOMUX_PADS(usdhc4_pads);
-}
-
 #else
 void displ5_set_iomux_usdhc_spl(void) {}
-void displ5_set_iomux_usdhc(void) {}
 #endif
diff --git a/board/liebherr/display5/common.h b/board/liebherr/display5/common.h
index 78c64b02e2..2bbd934e7a 100644
--- a/board/liebherr/display5/common.h
+++ b/board/liebherr/display5/common.h
@@ -34,9 +34,7 @@
 void displ5_set_iomux_uart_spl(void);
 void displ5_set_iomux_uart(void);
 void displ5_set_iomux_ecspi_spl(void);
-void displ5_set_iomux_ecspi(void);
 void displ5_set_iomux_usdhc_spl(void);
-void displ5_set_iomux_usdhc(void);
 void displ5_set_iomux_misc_spl(void);
 
 #endif /* __DISPL5_COMMON_H_ */
diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c
index 410d5bc782..6592f0c3ca 100644
--- a/board/liebherr/display5/display5.c
+++ b/board/liebherr/display5/display5.c
@@ -17,25 +17,14 @@
 #include <asm/gpio.h>
 #include <malloc.h>
 #include <asm/mach-imx/iomux-v3.h>
-#include <asm/mach-imx/mxc_i2c.h>
 #include <asm/mach-imx/boot_mode.h>
-#include <asm/mach-imx/spi.h>
-#include <mmc.h>
-#include <fsl_esdhc.h>
 #include <miiphy.h>
-#include <netdev.h>
-#include <i2c.h>
 #include <environment.h>
 
 #include <dm.h>
 #include <dm/platform_data/serial_mxc.h>
 #include <dm/platdata.h>
 
-#ifndef CONFIG_MXC_SPI
-#error "CONFIG_SPI must be set for this board"
-#error "Please check your config file"
-#endif
-
 #include "common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -119,49 +108,6 @@ int dram_init(void)
 	return 0;
 }
 
-#define PC	MUX_PAD_CTRL(I2C_PAD_CTRL)
-/* I2C1: TFA9879 */
-struct i2c_pads_info i2c_pad_info0 = {
-	.scl = {
-		.i2c_mode = MX6_PAD_EIM_D21__I2C1_SCL | PC,
-		.gpio_mode = MX6_PAD_EIM_D21__GPIO3_IO21 | PC,
-		.gp = IMX_GPIO_NR(3, 21)
-	},
-	.sda = {
-		.i2c_mode = MX6_PAD_EIM_D28__I2C1_SDA | PC,
-		.gpio_mode = MX6_PAD_EIM_D28__GPIO3_IO28 | PC,
-		.gp = IMX_GPIO_NR(3, 28)
-	}
-};
-
-/* I2C2: TIVO TM4C123 */
-struct i2c_pads_info i2c_pad_info1 = {
-	.scl = {
-		.i2c_mode = MX6_PAD_EIM_EB2__I2C2_SCL | PC,
-		.gpio_mode = MX6_PAD_EIM_EB2__GPIO2_IO30 | PC,
-		.gp = IMX_GPIO_NR(2, 30)
-	},
-	.sda = {
-		.i2c_mode = MX6_PAD_EIM_D16__I2C2_SDA | PC,
-		.gpio_mode = MX6_PAD_EIM_D16__GPIO3_IO16 | PC,
-		.gp = IMX_GPIO_NR(3, 16)
-	}
-};
-
-/* I2C3: PMIC PF0100, EEPROM AT24C256C */
-struct i2c_pads_info i2c_pad_info2 = {
-	.scl = {
-		.i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | PC,
-		.gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | PC,
-		.gp = IMX_GPIO_NR(3, 17)
-	},
-	.sda = {
-		.i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | PC,
-		.gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | PC,
-		.gp = IMX_GPIO_NR(3, 18)
-	}
-};
-
 iomux_v3_cfg_t const misc_pads[] = {
 	/* Prod ID GPIO pins */
 	MX6_PAD_NANDF_D4__GPIO2_IO04    | MUX_PAD_CTRL(NO_PAD_CTRL),
@@ -186,174 +132,48 @@ iomux_v3_cfg_t const misc_pads[] = {
 	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
-#ifdef CONFIG_FSL_ESDHC
-struct fsl_esdhc_cfg usdhc_cfg[1] = {
-	{ USDHC4_BASE_ADDR, 0, 8, },
-};
-
-int board_mmc_getcd(struct mmc *mmc)
+/*
+ * Do not overwrite the console
+ * Always use serial for U-Boot console
+ */
+int overwrite_console(void)
 {
 	return 1;
 }
 
-int board_mmc_init(bd_t *bis)
-{
-	displ5_set_iomux_usdhc();
-
-	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
-
-	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-}
-#endif /* CONFIG_FSL_ESDHC */
-
-static void displ5_setup_ecspi(void)
-{
-	int ret;
-
-	displ5_set_iomux_ecspi();
-
-	ret = gpio_request(IMX_GPIO_NR(5, 29), "spi2_cs0");
-	if (!ret)
-		gpio_direction_output(IMX_GPIO_NR(5, 29), 1);
-
-	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
-	if (!ret)
-		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
-}
-
-#ifdef CONFIG_FEC_MXC
-iomux_v3_cfg_t const enet_pads[] = {
-	MX6_PAD_ENET_TXD1__ENET_1588_EVENT0_IN	| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT | MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_ENET_MDIO__ENET_MDIO		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_ENET_MDC__ENET_MDC		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_ENET_REF_CLK__ENET_TX_CLK	| MUX_PAD_CTRL(ENET_PAD_CTRL),
-
-	/* for old evalboard with R159 present and R160 not populated */
-	MX6_PAD_GPIO_16__ENET_REF_CLK		| MUX_PAD_CTRL(NO_PAD_CTRL),
-
-	MX6_PAD_RGMII_TXC__RGMII_TXC		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_TD0__RGMII_TD0		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_TD1__RGMII_TD1		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_TD2__RGMII_TD2		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_TD3__RGMII_TD3		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL	| MUX_PAD_CTRL(ENET_PAD_CTRL),
-
-	MX6_PAD_RGMII_RXC__RGMII_RXC		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_RD0__RGMII_RD0		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_RD1__RGMII_RD1		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_RD2__RGMII_RD2		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_RD3__RGMII_RD3		| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL	| MUX_PAD_CTRL(ENET_PAD_CTRL),
-	/*INT#_GBE*/
-	MX6_PAD_ENET_TX_EN__GPIO1_IO28		| MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
-static void setup_iomux_enet(void)
-{
-	SETUP_IOMUX_PADS(enet_pads);
-	gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
-}
-
-static int setup_mac_from_fuse(void)
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
 {
-	unsigned char enetaddr[6];
-	int ret;
-
-	ret = eth_env_get_enetaddr("ethaddr", enetaddr);
-	if (ret)	/* ethaddr is already set */
-		return 0;
-
-	imx_get_mac_from_fuse(0, enetaddr);
-
-	if (is_valid_ethaddr(enetaddr)) {
-		eth_env_set_enetaddr("ethaddr", enetaddr);
-		return 0;
-	}
-
+	fdt_fixup_ethernet(blob);
 	return 0;
 }
+#endif
 
-int board_eth_init(bd_t *bd)
+int board_phy_config(struct phy_device *phydev)
 {
-	struct phy_device *phydev;
-	struct mii_dev *bus;
-	int ret;
-
-	setup_iomux_enet();
-
-	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
-
-	ret = enable_fec_anatop_clock(0, ENET_125MHZ);
-	if (ret)
-		return ret;
-
-	setup_mac_from_fuse();
-
-	bus = fec_get_miibus(IMX_FEC_BASE, -1);
-	if (!bus)
-		return -ENODEV;
-
-	/*
-	 * We use here the "rgmii-id" mode of operation and allow M88E1512
-	 * PHY to use its internally callibrated RX/TX delays
-	 */
-	phydev = phy_find_by_mask(bus, 0xffffffff /* (0xf << 4) */,
-				  PHY_INTERFACE_MODE_RGMII_ID);
-	if (!phydev) {
-		ret = -ENODEV;
-		goto err_phy;
-	}
-
 	/* display5 due to PCB routing can only work with 100 Mbps */
 	phydev->advertising &= ~(ADVERTISED_1000baseX_Half |
 				 ADVERTISED_1000baseX_Full |
 				 SUPPORTED_1000baseT_Half |
 				 SUPPORTED_1000baseT_Full);
 
-	ret  = fec_probe(bd, -1, IMX_FEC_BASE, bus, phydev);
-	if (ret)
-		goto err_sw;
+	if (phydev->drv->config)
+		return phydev->drv->config(phydev);
 
 	return 0;
-
-err_sw:
-	free(phydev);
-err_phy:
-	mdio_unregister(bus);
-	free(bus);
-	return ret;
 }
-#endif /* CONFIG_FEC_MXC */
-
-/*
- * Do not overwrite the console
- * Always use serial for U-Boot console
- */
-int overwrite_console(void)
-{
-	return 1;
-}
-
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-	fdt_fixup_ethernet(blob);
-	return 0;
-}
-#endif
 
 int board_init(void)
 {
+	int ret;
+
 	debug("board init\n");
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
 	/* Setup iomux for non console UARTS */
 	displ5_set_iomux_uart();
-
-	displ5_setup_ecspi();
-
+	/* Setup misc (application specific) stuff */
 	SETUP_IOMUX_PADS(misc_pads);
 
 	get_board_id(gpio_table_sw_ids, &gpio_table_sw_ids_names[0],
@@ -369,9 +189,18 @@ int board_init(void)
 
 	udelay(25);
 
-	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
-	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
-	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
+	/* Setup low level FEC (ETH) */
+	ret = gpio_request(IMX_GPIO_NR(1, 28), "INT_GBE");
+	if (!ret)
+		gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
+
+	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
+	enable_fec_anatop_clock(0, ENET_125MHZ);
+
+	/* Setup #WP for SPI-NOR memory */
+	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
+	if (!ret)
+		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
 
 	return 0;
 }
diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 0ef56024e9..6fca4d059b 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -46,13 +46,17 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
+CONFIG_CMD_WDT=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
@@ -66,20 +70,45 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
+CONFIG_SYS_I2C_MXC=y
+CONFIG_SYS_I2C_MXC_I2C1=y
+CONFIG_SYS_I2C_MXC_I2C2=y
+CONFIG_SYS_I2C_MXC_I2C3=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
+CONFIG_SYS_I2C_EEPROM_BUS=2
+CONFIG_SYS_EEPROM_SIZE=32768
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
+CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD_DEVICE=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MARVELL=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_I2C_EDID=y
 CONFIG_IMX_WATCHDOG=y
diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig
index 0d9eed3a3e..aafeda437d 100644
--- a/configs/display5_factory_defconfig
+++ b/configs/display5_factory_defconfig
@@ -4,13 +4,19 @@ 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=0x1000
+CONFIG_MX6_DDRCAL=y
 CONFIG_TARGET_DISPLAY5=y
+CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_FIT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q"
 CONFIG_BOOTDELAY=3
@@ -20,7 +26,6 @@ CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_MISC_INIT_R=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_SPL_TEXT_BASE=0x00908000
-# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
@@ -46,11 +51,14 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_WDT=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -61,30 +69,57 @@ CONFIG_MTDIDS_DEFAULT="nor0=02008000.spi.1"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-boot),64k(env1),64k(env2),4m(swu-kernel),16m(swu-initramfs),1m(factory),-(reserved)"
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_PARTITION_TYPE_GUID=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
+CONFIG_SYS_I2C_MXC=y
+CONFIG_SYS_I2C_MXC_I2C1=y
+CONFIG_SYS_I2C_MXC_I2C2=y
+CONFIG_SYS_I2C_MXC_I2C3=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
+CONFIG_SYS_I2C_EEPROM_BUS=2
+CONFIG_SYS_EEPROM_SIZE=32768
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
+CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD_DEVICE=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
+CONFIG_PHY_MARVELL=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Liebherr"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
-CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_I2C_EDID=y
 CONFIG_IMX_WATCHDOG=y
-CONFIG_OF_LIBFDT=y
+CONFIG_PANIC_HANG=y
diff --git a/include/configs/display5.h b/include/configs/display5.h
index 5dbe5b8528..c8218effc3 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -35,8 +35,11 @@
  * 0x1540000 - 0x1640000 : SPI.factory  (1MiB)
  */
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_SPI_FLASH_MTD
+/* SPI Flash Configs */
+#if defined(CONFIG_SPL_BUILD)
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_SPI_FLASH_MTD
 #endif
 
 /* Below values are "dummy" - only to avoid build break */
@@ -58,23 +61,7 @@
 #define CONFIG_MXC_UART_BASE		UART5_BASE
 
 /* I2C Configs */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1
-#define CONFIG_SYS_I2C_MXC_I2C2
-#define CONFIG_SYS_I2C_MXC_I2C3
 #define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED		100000
-#define CONFIG_I2C_EDID
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
-
-/* Ethernet */
-#ifdef CONFIG_FEC_MXC
-#define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
-#define CONFIG_ETHPRIME			"FEC"
-#define CONFIG_FEC_MXC_PHYADDR		0
-#endif
 
 /* MMC Configs */
 #define CONFIG_FSL_USDHC
@@ -363,7 +350,11 @@
 
 /* Watchdog */
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   15000
-
+#if defined(CONFIG_SPL_BUILD)
+#undef CONFIG_WDT
+#undef CONFIG_WATCHDOG
+#define CONFIG_HW_WATCHDOG
+#endif
 /* ENV config */
 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_SIZE		(SZ_64K)
-- 
2.11.0

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

* [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console)
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (8 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:44   ` Peng Fan
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion) Lukasz Majewski
  10 siblings, 1 reply; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

This UART is not used in U-Boot, so there is no need to initialize it.

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

 board/liebherr/display5/common.c   | 13 -------------
 board/liebherr/display5/common.h   |  1 -
 board/liebherr/display5/display5.c |  2 --
 3 files changed, 16 deletions(-)

diff --git a/board/liebherr/display5/common.c b/board/liebherr/display5/common.c
index 2b3253d88d..71d79f85ab 100644
--- a/board/liebherr/display5/common.c
+++ b/board/liebherr/display5/common.c
@@ -8,14 +8,6 @@
 #include <asm/arch/mx6-pins.h>
 #include "common.h"
 
-iomux_v3_cfg_t const uart_pads[] = {
-	/* UART4 */
-	MX6_PAD_CSI0_DAT12__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT13__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT16__UART4_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT17__UART4_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 iomux_v3_cfg_t const uart_console_pads[] = {
 	/* UART5 */
 	MX6_PAD_CSI0_DAT14__UART5_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
@@ -29,11 +21,6 @@ void displ5_set_iomux_uart_spl(void)
 	SETUP_IOMUX_PADS(uart_console_pads);
 }
 
-void displ5_set_iomux_uart(void)
-{
-	SETUP_IOMUX_PADS(uart_pads);
-}
-
 iomux_v3_cfg_t const misc_pads_spl[] = {
 	/* Emergency recovery pin */
 	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
diff --git a/board/liebherr/display5/common.h b/board/liebherr/display5/common.h
index 2bbd934e7a..4eb70dc42f 100644
--- a/board/liebherr/display5/common.h
+++ b/board/liebherr/display5/common.h
@@ -32,7 +32,6 @@
 	PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
 
 void displ5_set_iomux_uart_spl(void);
-void displ5_set_iomux_uart(void);
 void displ5_set_iomux_ecspi_spl(void);
 void displ5_set_iomux_usdhc_spl(void);
 void displ5_set_iomux_misc_spl(void);
diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c
index 6592f0c3ca..8d048006da 100644
--- a/board/liebherr/display5/display5.c
+++ b/board/liebherr/display5/display5.c
@@ -171,8 +171,6 @@ int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-	/* Setup iomux for non console UARTS */
-	displ5_set_iomux_uart();
 	/* Setup misc (application specific) stuff */
 	SETUP_IOMUX_PADS(misc_pads);
 
-- 
2.11.0

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

* [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion)
  2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
                   ` (9 preceding siblings ...)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console) Lukasz Majewski
@ 2019-06-09 20:54 ` Lukasz Majewski
  2019-06-10  1:46   ` Peng Fan
  10 siblings, 1 reply; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-09 20:54 UTC (permalink / raw)
  To: u-boot

The common.c file content can be safely moved to spl.c file after
performing the DM/DTS conversion for the U-Boot proper.

It contains the non DM/DTS setup code, which now is only used by SPL.

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

 board/liebherr/display5/Makefile |  4 +-
 board/liebherr/display5/common.c | 83 ----------------------------------------
 board/liebherr/display5/common.h |  5 ---
 board/liebherr/display5/spl.c    | 74 +++++++++++++++++++++++++++++++++++
 4 files changed, 76 insertions(+), 90 deletions(-)
 delete mode 100644 board/liebherr/display5/common.c

diff --git a/board/liebherr/display5/Makefile b/board/liebherr/display5/Makefile
index f934672428..ee503add75 100644
--- a/board/liebherr/display5/Makefile
+++ b/board/liebherr/display5/Makefile
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:    GPL-2.0+
 #
 ifdef CONFIG_SPL_BUILD
-obj-y = common.o spl.o
+obj-y = spl.o
 else
-obj-y := common.o display5.o
+obj-y := display5.o
 endif
diff --git a/board/liebherr/display5/common.c b/board/liebherr/display5/common.c
deleted file mode 100644
index 71d79f85ab..0000000000
--- a/board/liebherr/display5/common.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2017 DENX Software Engineering
- * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
- */
-
-#include <asm/mach-imx/iomux-v3.h>
-#include <asm/arch/mx6-pins.h>
-#include "common.h"
-
-iomux_v3_cfg_t const uart_console_pads[] = {
-	/* UART5 */
-	MX6_PAD_CSI0_DAT14__UART5_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT15__UART5_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT18__UART5_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX6_PAD_CSI0_DAT19__UART5_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
-void displ5_set_iomux_uart_spl(void)
-{
-	SETUP_IOMUX_PADS(uart_console_pads);
-}
-
-iomux_v3_cfg_t const misc_pads_spl[] = {
-	/* Emergency recovery pin */
-	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
-void displ5_set_iomux_misc_spl(void)
-{
-	SETUP_IOMUX_PADS(misc_pads_spl);
-}
-
-#ifdef CONFIG_MXC_SPI
-iomux_v3_cfg_t const ecspi2_pads[] = {
-	/* SPI2, NOR Flash nWP, CS0 */
-	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_CSI0_DAT9__ECSPI2_MOSI	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_CSI0_DAT8__ECSPI2_SCLK	| MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_CSI0_DAT11__GPIO5_IO29	| MUX_PAD_CTRL(NO_PAD_CTRL),
-	MX6_PAD_SD3_DAT5__GPIO7_IO00	| MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
-int board_spi_cs_gpio(unsigned int bus, unsigned int cs)
-{
-	if (bus != 1 || cs != 0)
-		return -EINVAL;
-
-	return IMX_GPIO_NR(5, 29);
-}
-
-void displ5_set_iomux_ecspi_spl(void)
-{
-	SETUP_IOMUX_PADS(ecspi2_pads);
-}
-
-#else
-void displ5_set_iomux_ecspi_spl(void) {}
-#endif
-
-#ifdef CONFIG_FSL_ESDHC
-iomux_v3_cfg_t const usdhc4_pads[] = {
-	MX6_PAD_SD4_CLK__SD4_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_CMD__SD4_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT0__SD4_DATA0	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT1__SD4_DATA1	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT2__SD4_DATA2	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT3__SD4_DATA3	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT4__SD4_DATA4	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT5__SD4_DATA5	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT6__SD4_DATA6	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD4_DAT7__SD4_DATA7	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_NANDF_ALE__SD4_RESET	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
-
-void displ5_set_iomux_usdhc_spl(void)
-{
-	SETUP_IOMUX_PADS(usdhc4_pads);
-}
-
-#else
-void displ5_set_iomux_usdhc_spl(void) {}
-#endif
diff --git a/board/liebherr/display5/common.h b/board/liebherr/display5/common.h
index 4eb70dc42f..44c7470074 100644
--- a/board/liebherr/display5/common.h
+++ b/board/liebherr/display5/common.h
@@ -31,9 +31,4 @@
 #define ENET_PAD_CTRL_CLK  ((PAD_CTL_PUS_100K_UP & ~PAD_CTL_PKE) | \
 	PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
 
-void displ5_set_iomux_uart_spl(void);
-void displ5_set_iomux_ecspi_spl(void);
-void displ5_set_iomux_usdhc_spl(void);
-void displ5_set_iomux_misc_spl(void);
-
 #endif /* __DISPL5_COMMON_H_ */
diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c
index 0c0172e201..3c2587c558 100644
--- a/board/liebherr/display5/spl.c
+++ b/board/liebherr/display5/spl.c
@@ -104,6 +104,80 @@ static const struct mx6_ddr3_cfg mt41k128m16jt_125 = {
 	.trasmin = 3500,
 };
 
+iomux_v3_cfg_t const uart_console_pads[] = {
+	/* UART5 */
+	MX6_PAD_CSI0_DAT14__UART5_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+	MX6_PAD_CSI0_DAT15__UART5_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+	MX6_PAD_CSI0_DAT18__UART5_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
+	MX6_PAD_CSI0_DAT19__UART5_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+void displ5_set_iomux_uart_spl(void)
+{
+	SETUP_IOMUX_PADS(uart_console_pads);
+}
+
+iomux_v3_cfg_t const misc_pads_spl[] = {
+	/* Emergency recovery pin */
+	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+void displ5_set_iomux_misc_spl(void)
+{
+	SETUP_IOMUX_PADS(misc_pads_spl);
+}
+
+#ifdef CONFIG_MXC_SPI
+iomux_v3_cfg_t const ecspi2_pads[] = {
+	/* SPI2, NOR Flash nWP, CS0 */
+	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	| MUX_PAD_CTRL(SPI_PAD_CTRL),
+	MX6_PAD_CSI0_DAT9__ECSPI2_MOSI	| MUX_PAD_CTRL(SPI_PAD_CTRL),
+	MX6_PAD_CSI0_DAT8__ECSPI2_SCLK	| MUX_PAD_CTRL(SPI_PAD_CTRL),
+	MX6_PAD_CSI0_DAT11__GPIO5_IO29	| MUX_PAD_CTRL(NO_PAD_CTRL),
+	MX6_PAD_SD3_DAT5__GPIO7_IO00	| MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+int board_spi_cs_gpio(unsigned int bus, unsigned int cs)
+{
+	if (bus != 1 || cs != 0)
+		return -EINVAL;
+
+	return IMX_GPIO_NR(5, 29);
+}
+
+void displ5_set_iomux_ecspi_spl(void)
+{
+	SETUP_IOMUX_PADS(ecspi2_pads);
+}
+
+#else
+void displ5_set_iomux_ecspi_spl(void) {}
+#endif
+
+#ifdef CONFIG_FSL_ESDHC
+iomux_v3_cfg_t const usdhc4_pads[] = {
+	MX6_PAD_SD4_CLK__SD4_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_CMD__SD4_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT0__SD4_DATA0	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT1__SD4_DATA1	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT2__SD4_DATA2	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT3__SD4_DATA3	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT4__SD4_DATA4	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT5__SD4_DATA5	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT6__SD4_DATA6	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_SD4_DAT7__SD4_DATA7	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+	MX6_PAD_NANDF_ALE__SD4_RESET	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
+};
+
+void displ5_set_iomux_usdhc_spl(void)
+{
+	SETUP_IOMUX_PADS(usdhc4_pads);
+}
+
+#else
+void displ5_set_iomux_usdhc_spl(void) {}
+#endif
+
 static void ccgr_init(void)
 {
 	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
-- 
2.11.0

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

* [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
@ 2019-06-10  1:36   ` Peng Fan
  2019-07-20  8:57   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:36 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 01/11] cosmetic: display5: Remove not needed comments
> 
> Some comments are not needed anymore after Kconfig automated
> conversion.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  include/configs/display5.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/configs/display5.h b/include/configs/display5.h index
> 5e982b8d27..5dbe5b8528 100644
> --- a/include/configs/display5.h
> +++ b/include/configs/display5.h
> @@ -55,11 +55,8 @@
>  /* Size of malloc() pool */
>  #define CONFIG_SYS_MALLOC_LEN		(16 * 1024 * 1024)
> 
> -/*#define CONFIG_MXC_UART*/
>  #define CONFIG_MXC_UART_BASE		UART5_BASE
> 
> -/* SPI NOR Flash */
> -
>  /* I2C Configs */
>  #define CONFIG_SYS_I2C
>  #define CONFIG_SYS_I2C_MXC
> @@ -364,8 +361,6 @@
>  #define CONFIG_SYS_INIT_SP_ADDR \
>  	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
> 
> -/* Commands */
> -
>  /* Watchdog */
>  #define CONFIG_WATCHDOG_TIMEOUT_MSECS   15000

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

> 
> --
> 2.11.0

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

* [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c Lukasz Majewski
@ 2019-06-10  1:36   ` Peng Fan
  2019-07-20  8:45   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:36 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c
> 
> This commit just corrects spelling of 'accessed' word in the EEPROM
> comment.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  cmd/eeprom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmd/eeprom.c b/cmd/eeprom.c index 7b1f81477f..19953df082
> 100644
> --- a/cmd/eeprom.c
> +++ b/cmd/eeprom.c
> @@ -108,7 +108,7 @@ static int eeprom_len(unsigned offset, unsigned end)
> 
>  	/*
>  	 * For a FRAM device there is no limit on the number of the
> -	 * bytes that can be ccessed with the single read or write
> +	 * bytes that can be accessed with the single read or write
>  	 * operation.
>  	 */
>  #if !defined(CONFIG_SYS_I2C_FRAM)

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define Lukasz Majewski
@ 2019-06-10  1:38   ` Peng Fan
  2019-07-20  8:46   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:38 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 04/11] gpio: Add missing parenthesis to the
> GPIO_TO_PORT define
> 
> Add missing parenthesis to the GPIO_TO_PORT macro.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  drivers/gpio/mxc_gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index
> 8bd30c75b2..64ab7a303f 100644
> --- a/drivers/gpio/mxc_gpio.c
> +++ b/drivers/gpio/mxc_gpio.c
> @@ -31,7 +31,7 @@ struct mxc_bank_info {  };
> 
>  #ifndef CONFIG_DM_GPIO
> -#define GPIO_TO_PORT(n)		(n / 32)
> +#define GPIO_TO_PORT(n)		((n) / 32)
> 
>  /* GPIO port description */
>  static unsigned long gpio_ports[] = {

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB Lukasz Majewski
@ 2019-06-10  1:41   ` Peng Fan
  2019-06-10  6:04     ` Lukasz Majewski
  2019-07-20  8:46   ` sbabic at denx.de
  1 sibling, 1 reply; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:41 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc
> pool size to 4KiB
> 
> Porting more DTS code from Linux kernel for display5 board required increase
> of pre-relocation malloc pool size in U-Boot proper.
> 
> The early malloc memory is necessary for handling parsing and setup of e.g.
> serial port device (and all its ancestors in DT tree).
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  configs/display5_defconfig | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/configs/display5_defconfig b/configs/display5_defconfig index
> 3b793f4500..0ef56024e9 100644
> --- a/configs/display5_defconfig
> +++ b/configs/display5_defconfig
> @@ -4,16 +4,19 @@ 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=0x1000
>  CONFIG_MX6_DDRCAL=y
>  CONFIG_TARGET_DISPLAY5=y
>  CONFIG_SPL_MMC_SUPPORT=y
>  CONFIG_SPL_SERIAL_SUPPORT=y
> +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_SPL=y
>  CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
>  CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
>  CONFIG_SPL_SPI_FLASH_SUPPORT=y
>  CONFIG_SPL_SPI_SUPPORT=y
> +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400

Acked-by: Peng Fan <peng.fan@nxp.com>
Just a question, TPL is enabled for this platform?

>  CONFIG_FIT=y
>  CONFIG_SPL_LOAD_FIT=y
>  CONFIG_OF_BOARD_SETUP=y
> --
> 2.11.0

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

* [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1) Lukasz Majewski
@ 2019-06-10  1:41   ` Peng Fan
  2019-07-20  8:57   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:41 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device
> tree description (v5.1)
> 
> This commit ports from Linux kernel - tag: v5.1 - the device tree description
> for display5 board.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  arch/arm/dts/imx6q-display5.dts | 352
> ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 352 insertions(+)
> 
> diff --git a/arch/arm/dts/imx6q-display5.dts
> b/arch/arm/dts/imx6q-display5.dts index 50347ff26b..4e2aa363ed 100644
> --- a/arch/arm/dts/imx6q-display5.dts
> +++ b/arch/arm/dts/imx6q-display5.dts
> @@ -10,9 +10,361 @@
> 
>  /dts-v1/;
> 
> +#include <dt-bindings/gpio/gpio.h>
>  #include "imx6q.dtsi"
> 
>  / {
>  	model = "Liebherr (LWN) display5 i.MX6 Quad Board";
>  	compatible = "lwn,display5", "fsl,imx6q";
> +
> +	memory at 10000000 {
> +		device_type = "memory";
> +		reg = <0x10000000 0x40000000>;
> +	};
> +};
> +
> +&ecspi2 {
> +	cs-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs &pinctrl_ecspi2_flwp>;
> +	status = "okay";
> +
> +	s25fl256s: flash at 0 {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		compatible = "jedec,spi-nor";
> +		spi-max-frequency = <40000000>;
> +		reg = <0>;
> +
> +		partition at 0 {
> +			label = "SPL (spi)";
> +			reg = <0x0 0x20000>;
> +			read-only;
> +		};
> +		partition at 1 {
> +			label = "u-boot (spi)";
> +			reg = <0x20000 0x100000>;
> +			read-only;
> +		};
> +		partition at 2 {
> +			label = "uboot-env (spi)";
> +			reg = <0x120000 0x10000>;
> +		};
> +		partition at 3 {
> +			label = "uboot-envr (spi)";
> +			reg = <0x130000 0x10000>;
> +		};
> +		partition at 4 {
> +			label = "linux-recovery (spi)";
> +			reg = <0x140000 0x800000>;
> +		};
> +		partition at 5 {
> +			label = "swupdate-fitImg (spi)";
> +			reg = <0x940000 0x400000>;
> +		};
> +		partition at 6 {
> +			label = "swupdate-initramfs (spi)";
> +			reg = <0xD40000 0x800000>;
> +		};
> +	};
> +};
> +
> +&ecspi3 {
> +	cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_ecspi3 &pinctrl_ecspi3_cs &pinctrl_ecspi3_flwp>;
> +	status = "okay";
> +};
> +
> +&fec {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_enet>;
> +	phy-handle = <&ethernet_phy0>;
> +	phy-mode = "rgmii-id";
> +	status = "okay";
> +
> +	mdio {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		ethernet_phy0: ethernet-phy at 0 {
> +			compatible = "marvell,88E1510";
> +			device_type = "ethernet-phy";
> +			/* Set LED0 control: */
> +			/* On - Link, Blink - Activity, Off - No Link */
> +			marvell,reg-init = <3 0x10 0 0x1011>;
> +			max-speed = <100>;
> +			reg = <0>;
> +		};
> +	};
> +};
> +
> +&i2c1 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c1>;
> +	status = "okay";
> +
> +	codec: tfa9879 at 6c {
> +		#sound-dai-cells = <0>;
> +		compatible = "nxp,tfa9879";
> +		reg = <0x6C>;
> +	};
> +};
> +
> +&i2c2 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c2>;
> +	status = "okay";
> +};
> +
> +&i2c3 {
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2c3>;
> +	status = "okay";
> +
> +	at24 at 50 {
> +		compatible = "atmel,24c256";
> +		pagesize = <64>;
> +		reg = <0x50>;
> +	};
> +
> +	pfuze100: pmic at 8 {
> +		compatible = "fsl,pfuze100";
> +		reg = <0x08>;
> +
> +		regulators {
> +			sw1a_reg: sw1ab {
> +				regulator-min-microvolt = <300000>;
> +				regulator-max-microvolt = <1875000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +				regulator-ramp-delay = <6250>;
> +			};
> +
> +			sw1c_reg: sw1c {
> +				regulator-min-microvolt = <300000>;
> +				regulator-max-microvolt = <1875000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +				regulator-ramp-delay = <6250>;
> +			};
> +
> +			sw2_reg: sw2 {
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <3950000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			sw3a_reg: sw3a {
> +				regulator-min-microvolt = <400000>;
> +				regulator-max-microvolt = <1975000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			sw3b_reg: sw3b {
> +				regulator-min-microvolt = <400000>;
> +				regulator-max-microvolt = <1975000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			sw4_reg: sw4 {
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <3300000>;
> +			};
> +
> +			swbst_reg: swbst {
> +				regulator-min-microvolt = <5000000>;
> +				regulator-max-microvolt = <5150000>;
> +			};
> +
> +			snvs_reg: vsnvs {
> +				regulator-min-microvolt = <1000000>;
> +				regulator-max-microvolt = <3000000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			vref_reg: vrefddr {
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			vgen1_reg: vgen1 {
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <1550000>;
> +			};
> +
> +			vgen2_reg: vgen2 {
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <1550000>;
> +			};
> +
> +			vgen3_reg: vgen3 {
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <3300000>;
> +			};
> +
> +			vgen4_reg: vgen4 {
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-always-on;
> +			};
> +
> +			vgen5_reg: vgen5 {
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-always-on;
> +			};
> +
> +			vgen6_reg: vgen6 {
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-always-on;
> +			};
> +		};
> +	};
> +};
> +
> +&uart4 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart4>;
> +	uart-has-rtscts;
> +	status = "okay";
> +};
> +
> +&uart5 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart5>;
> +	status = "okay";
> +};
> +
> +&usdhc4 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc4>;
> +	bus-width = <8>;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&iomuxc {
> +	pinctrl_ecspi2: ecspi2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT10__ECSPI2_MISO	0x100b1
> +			MX6QDL_PAD_CSI0_DAT9__ECSPI2_MOSI	0x100b1
> +			MX6QDL_PAD_CSI0_DAT8__ECSPI2_SCLK	0x100b1
> +		>;
> +	};
> +
> +	pinctrl_ecspi2_cs: ecspi2csgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29 0x100b1
> +		>;
> +	};
> +
> +	pinctrl_ecspi2_flwp: ecspi2flwpgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0
> +		>;
> +	};
> +
> +	pinctrl_ecspi3: ecspi3grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO	0x100b1
> +			MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI	0x100b1
> +			MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK	0x100b1
> +		>;
> +	};
> +
> +	pinctrl_ecspi3_cs: ecspi3csgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x1b0b0
> +		>;
> +	};
> +
> +	pinctrl_ecspi3_flwp: ecspi3flwpgrp {
> +		fsl,pins = <
> +			MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27 0x1b0b0
> +		>;
> +	};
> +
> +	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_GPIO_6__ENET_IRQ		0x000b1
> +			MX6QDL_PAD_ENET_RXD0__GPIO1_IO27        0x1b0b0
> +		>;
> +	};
> +
> +	pinctrl_i2c1: i2c1grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D21__I2C1_SCL	0x4001b8b1
> +			MX6QDL_PAD_EIM_D28__I2C1_SDA	0x4001b8b1
> +		>;
> +	};
> +
> +	pinctrl_i2c2: i2c2grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_EB2__I2C2_SCL	0x4001b8b1
> +			MX6QDL_PAD_EIM_D16__I2C2_SDA	0x4001b8b1
> +		>;
> +	};
> +
> +	pinctrl_i2c3: i2c3grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_EIM_D17__I2C3_SCL	0x4001b8b1
> +			MX6QDL_PAD_EIM_D18__I2C3_SDA	0x4001b8b1
> +		>;
> +	};
> +
> +	pinctrl_uart4: uart4grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA	0x1b0b1
> +			MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA	0x1b0b1
> +			MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B	0x1b0b1
> +			MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B	0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_uart5: uart5grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA	0x1b0b1
> +			MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA    0x1b0b1
> +		>;
> +	};
> +
> +	pinctrl_usdhc4: usdhc4grp {
> +		fsl,pins = <
> +			MX6QDL_PAD_SD4_CMD__SD4_CMD		0x17059
> +			MX6QDL_PAD_SD4_CLK__SD4_CLK		0x10059
> +			MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17059
> +			MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17059
> +			MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17059
> +			MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17059
> +			MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17059
> +			MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17059
> +			MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17059
> +			MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17059
> +			MX6QDL_PAD_NANDF_ALE__SD4_RESET	0x17059
> +		>;
> +	};

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

>  };
> --
> 2.11.0

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

* [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
@ 2019-06-10  1:43   ` Peng Fan
  2019-06-10 10:52   ` Adam Ford
  2019-07-20  8:45   ` sbabic at denx.de
  2 siblings, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:43 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with
> u-boot specific properties
> 
> This file setups UART5 based serial to be used as pre-relocation console in the
> U-Boot proper.
> 
> On purpose pinux configuration is omitted here as it has been already done in
> SPL. For early pre-relocation code we only need the serial device from DTS.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  arch/arm/dts/imx6q-display5-u-boot.dtsi | 44
> +++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 arch/arm/dts/imx6q-display5-u-boot.dtsi
> 
> diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> new file mode 100644
> index 0000000000..b942218b7a
> --- /dev/null
> +++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> @@ -0,0 +1,44 @@
> +// 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
> + */
> +
> +/*
> + * The minimal augmentation DTS U-Boot file to allow UART5
> + * configuration in the pre-relocation stage of U-Boot
> + * proper.
> + *
> + * As the same UART is already configured in SPL, we don't need
> + * setup pinmux for it again.
> + */
> +
> +/ {
> +	aliases {
> +		mmc0 = &usdhc4;
> +	};
> +
> +	soc {
> +		u-boot,dm-pre-reloc;
> +
> +		aips-bus at 2100000 {
> +			u-boot,dm-pre-reloc;
> +		};
> +	};
> +
> +	chosen {
> +		stdout-path = &uart5;
> +	};
> +};
> +
> +&i2c3 {
> +	at24 at 50 {
> +		u-boot,i2c-offset-len = <2>;
> +	};
> +};
> +
> +&uart5 {
> +	u-boot,dm-pre-reloc;
> +};

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc Lukasz Majewski
@ 2019-06-10  1:44   ` Peng Fan
  2019-07-20  8:45   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:44 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE
> definition of serial_mxc
> 
> Before the wide DM/DTS adoption in the U-Boot proper, the display5 has
> been using only DM_SERIAL to provide serial console in pre-relocation.
> 
> After moving to full DM/DTS adoption in the U-Boot proper the
> U_BOOT_DEVICE definition is not needed anymore, as it has been replaced
> with udevice creation from provided DTS description.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/liebherr/display5/display5.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/board/liebherr/display5/display5.c
> b/board/liebherr/display5/display5.c
> index d8383170d2..410d5bc782 100644
> --- a/board/liebherr/display5/display5.c
> +++ b/board/liebherr/display5/display5.c
> @@ -413,12 +413,3 @@ int misc_init_r(void)
> 
>  	return 0;
>  }
> -
> -static struct mxc_serial_platdata mxc_serial_plat = {
> -	.reg = (struct mxc_uart *)UART5_BASE,
> -};
> -
> -U_BOOT_DEVICE(mxc_serial) = {
> -	.name = "serial_mxc",
> -	.platdata = &mxc_serial_plat,
> -};

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console) Lukasz Majewski
@ 2019-06-10  1:44   ` Peng Fan
  0 siblings, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:44 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 10/11] ARM: display5: Remove UART initialization code
> after DM/DTS conversion (non-console)
> 
> This UART is not used in U-Boot, so there is no need to initialize it.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/liebherr/display5/common.c   | 13 -------------
>  board/liebherr/display5/common.h   |  1 -
>  board/liebherr/display5/display5.c |  2 --
>  3 files changed, 16 deletions(-)
> 
> diff --git a/board/liebherr/display5/common.c
> b/board/liebherr/display5/common.c
> index 2b3253d88d..71d79f85ab 100644
> --- a/board/liebherr/display5/common.c
> +++ b/board/liebherr/display5/common.c
> @@ -8,14 +8,6 @@
>  #include <asm/arch/mx6-pins.h>
>  #include "common.h"
> 
> -iomux_v3_cfg_t const uart_pads[] = {
> -	/* UART4 */
> -	MX6_PAD_CSI0_DAT12__UART4_TX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT13__UART4_RX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT16__UART4_RTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT17__UART4_CTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -};
> -
>  iomux_v3_cfg_t const uart_console_pads[] = {
>  	/* UART5 */
>  	MX6_PAD_CSI0_DAT14__UART5_TX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL), @@ -29,11 +21,6 @@ void
> displ5_set_iomux_uart_spl(void)
>  	SETUP_IOMUX_PADS(uart_console_pads);
>  }
> 
> -void displ5_set_iomux_uart(void)
> -{
> -	SETUP_IOMUX_PADS(uart_pads);
> -}
> -
>  iomux_v3_cfg_t const misc_pads_spl[] = {
>  	/* Emergency recovery pin */
>  	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
> diff --git a/board/liebherr/display5/common.h
> b/board/liebherr/display5/common.h
> index 2bbd934e7a..4eb70dc42f 100644
> --- a/board/liebherr/display5/common.h
> +++ b/board/liebherr/display5/common.h
> @@ -32,7 +32,6 @@
>  	PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
> 
>  void displ5_set_iomux_uart_spl(void);
> -void displ5_set_iomux_uart(void);
>  void displ5_set_iomux_ecspi_spl(void);
>  void displ5_set_iomux_usdhc_spl(void);
>  void displ5_set_iomux_misc_spl(void);
> diff --git a/board/liebherr/display5/display5.c
> b/board/liebherr/display5/display5.c
> index 6592f0c3ca..8d048006da 100644
> --- a/board/liebherr/display5/display5.c
> +++ b/board/liebherr/display5/display5.c
> @@ -171,8 +171,6 @@ int board_init(void)
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
> 
> -	/* Setup iomux for non console UARTS */
> -	displ5_set_iomux_uart();
>  	/* Setup misc (application specific) stuff */
>  	SETUP_IOMUX_PADS(misc_pads);
> 

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS Lukasz Majewski
@ 2019-06-10  1:45   ` Peng Fan
  0 siblings, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:45 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 09/11] DM: display5: Convert display5 board to use
> DM/DTS
> 
> This commit converts display5 board (also its 'factory' variant) to use DM/DTS.
> 
> The change has been made in a single patch to avoid problems with
> unbuildable commits (as DM conversion breaks some of them).
> 
> Notable changes (DM/DTS conversion):
> 
> - PINCTRL{_IMX6}
> - DM_I2C
> - enable 'regulator' and 'pmic' commands
> - DM_MMC and BLK (USDHC)
> - DM_ETH
> - DM_SPI and DM_SPI_FLASH (but no in SPL)
> - DM WDT (including SYSRESET)
> - Update display5_factory_defconfig after switch to DM/DTS and uuu utility
> 
> Note regarding 'display5_factory_defconfig'
> 
> The VID and PID for SPL running SDP gadget have been updated to allow
> seamless work with 'uuu' utility from NXP (the imx_usb doesn't work properly
> after embedding the u-boot proper into fitImage - problem with IVT
> embedding in FIT).
> 
> Example to use 'uuu' session:
> 
> cat << EOF > display5_recovery.lst
> uuu_version 1.2.135
> SDP: boot -f /srv/tftp/SPL
> SDPU: write -f /srv/tftp/u-boot-dtb.img -addr 0x10000000
> SDPU: jump -addr 0x10000000
> SDPU: done
> EOF
> 
> sudo ./uuu/uuu display5_recovery.lst
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  arch/arm/dts/imx6q-display5-u-boot.dtsi |   5 +
>  arch/arm/mach-imx/mx6/Kconfig           |   5 +
>  board/liebherr/display5/common.c        |  24 ----
>  board/liebherr/display5/common.h        |   2 -
>  board/liebherr/display5/display5.c      | 225 ++++----------------------------
>  configs/display5_defconfig              |  29 ++++
>  configs/display5_factory_defconfig      |  43 +++++-
>  include/configs/display5.h              |  29 ++--
>  8 files changed, 115 insertions(+), 247 deletions(-)
> 
> diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> index b942218b7a..aa660b5aeb 100644
> --- a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> +++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> @@ -31,6 +31,11 @@
>  	chosen {
>  		stdout-path = &uart5;
>  	};
> +
> +	wdt-reboot {
> +		compatible = "wdt-reboot";
> +		wdt = <&wdog1>;
> +	};
>  };
> 
>  &i2c3 {
> diff --git a/arch/arm/mach-imx/mx6/Kconfig
> b/arch/arm/mach-imx/mx6/Kconfig index f513c4c06f..da00cf611e 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -187,6 +187,11 @@ config TARGET_DHCOMIMX6  config
> TARGET_DISPLAY5
>  	bool "LWN DISPLAY5 board"
>  	select DM
> +	select DM_ETH
> +	select DM_I2C
> +	select DM_MMC
> +	select DM_SPI
> +	select DM_GPIO
>  	select DM_SERIAL
>  	select SUPPORT_SPL
>  	imply CMD_DM
> diff --git a/board/liebherr/display5/common.c
> b/board/liebherr/display5/common.c
> index 48b5c1a6f5..2b3253d88d 100644
> --- a/board/liebherr/display5/common.c
> +++ b/board/liebherr/display5/common.c
> @@ -45,18 +45,6 @@ void displ5_set_iomux_misc_spl(void)  }
> 
>  #ifdef CONFIG_MXC_SPI
> -iomux_v3_cfg_t const ecspi_pads[] = {
> -	/* SPI3 */
> -	MX6_PAD_DISP0_DAT2__ECSPI3_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT1__ECSPI3_MOSI	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT0__ECSPI3_SCLK	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT3__ECSPI3_SS0	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT4__ECSPI3_SS1	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT5__ECSPI3_SS2	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT6__ECSPI3_SS3	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT7__ECSPI3_RDY	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
>  iomux_v3_cfg_t const ecspi2_pads[] = {
>  	/* SPI2, NOR Flash nWP, CS0 */
>  	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> @@ -79,14 +67,8 @@ void displ5_set_iomux_ecspi_spl(void)
>  	SETUP_IOMUX_PADS(ecspi2_pads);
>  }
> 
> -void displ5_set_iomux_ecspi(void)
> -{
> -	SETUP_IOMUX_PADS(ecspi_pads);
> -}
> -
>  #else
>  void displ5_set_iomux_ecspi_spl(void) {} -void displ5_set_iomux_ecspi(void)
> {}  #endif
> 
>  #ifdef CONFIG_FSL_ESDHC
> @@ -109,12 +91,6 @@ void displ5_set_iomux_usdhc_spl(void)
>  	SETUP_IOMUX_PADS(usdhc4_pads);
>  }
> 
> -void displ5_set_iomux_usdhc(void)
> -{
> -	SETUP_IOMUX_PADS(usdhc4_pads);
> -}
> -
>  #else
>  void displ5_set_iomux_usdhc_spl(void) {} -void displ5_set_iomux_usdhc(void)
> {}  #endif diff --git a/board/liebherr/display5/common.h
> b/board/liebherr/display5/common.h
> index 78c64b02e2..2bbd934e7a 100644
> --- a/board/liebherr/display5/common.h
> +++ b/board/liebherr/display5/common.h
> @@ -34,9 +34,7 @@
>  void displ5_set_iomux_uart_spl(void);
>  void displ5_set_iomux_uart(void);
>  void displ5_set_iomux_ecspi_spl(void);
> -void displ5_set_iomux_ecspi(void);
>  void displ5_set_iomux_usdhc_spl(void);
> -void displ5_set_iomux_usdhc(void);
>  void displ5_set_iomux_misc_spl(void);
> 
>  #endif /* __DISPL5_COMMON_H_ */
> diff --git a/board/liebherr/display5/display5.c
> b/board/liebherr/display5/display5.c
> index 410d5bc782..6592f0c3ca 100644
> --- a/board/liebherr/display5/display5.c
> +++ b/board/liebherr/display5/display5.c
> @@ -17,25 +17,14 @@
>  #include <asm/gpio.h>
>  #include <malloc.h>
>  #include <asm/mach-imx/iomux-v3.h>
> -#include <asm/mach-imx/mxc_i2c.h>
>  #include <asm/mach-imx/boot_mode.h>
> -#include <asm/mach-imx/spi.h>
> -#include <mmc.h>
> -#include <fsl_esdhc.h>
>  #include <miiphy.h>
> -#include <netdev.h>
> -#include <i2c.h>
>  #include <environment.h>
> 
>  #include <dm.h>
>  #include <dm/platform_data/serial_mxc.h>  #include <dm/platdata.h>
> 
> -#ifndef CONFIG_MXC_SPI
> -#error "CONFIG_SPI must be set for this board"
> -#error "Please check your config file"
> -#endif
> -
>  #include "common.h"
> 
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -119,49 +108,6 @@ int dram_init(void)
>  	return 0;
>  }
> 
> -#define PC	MUX_PAD_CTRL(I2C_PAD_CTRL)
> -/* I2C1: TFA9879 */
> -struct i2c_pads_info i2c_pad_info0 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_D21__I2C1_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_D21__GPIO3_IO21 | PC,
> -		.gp = IMX_GPIO_NR(3, 21)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D28__I2C1_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D28__GPIO3_IO28 | PC,
> -		.gp = IMX_GPIO_NR(3, 28)
> -	}
> -};
> -
> -/* I2C2: TIVO TM4C123 */
> -struct i2c_pads_info i2c_pad_info1 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_EB2__I2C2_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_EB2__GPIO2_IO30 | PC,
> -		.gp = IMX_GPIO_NR(2, 30)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D16__I2C2_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D16__GPIO3_IO16 | PC,
> -		.gp = IMX_GPIO_NR(3, 16)
> -	}
> -};
> -
> -/* I2C3: PMIC PF0100, EEPROM AT24C256C */ -struct i2c_pads_info
> i2c_pad_info2 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | PC,
> -		.gp = IMX_GPIO_NR(3, 17)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | PC,
> -		.gp = IMX_GPIO_NR(3, 18)
> -	}
> -};
> -
>  iomux_v3_cfg_t const misc_pads[] = {
>  	/* Prod ID GPIO pins */
>  	MX6_PAD_NANDF_D4__GPIO2_IO04    |
> MUX_PAD_CTRL(NO_PAD_CTRL),
> @@ -186,174 +132,48 @@ iomux_v3_cfg_t const misc_pads[] = {
>  	MX6_PAD_EIM_D29__GPIO3_IO29 |
> MUX_PAD_CTRL(NO_PAD_CTRL),  };
> 
> -#ifdef CONFIG_FSL_ESDHC
> -struct fsl_esdhc_cfg usdhc_cfg[1] = {
> -	{ USDHC4_BASE_ADDR, 0, 8, },
> -};
> -
> -int board_mmc_getcd(struct mmc *mmc)
> +/*
> + * Do not overwrite the console
> + * Always use serial for U-Boot console  */ int overwrite_console(void)
>  {
>  	return 1;
>  }
> 
> -int board_mmc_init(bd_t *bis)
> -{
> -	displ5_set_iomux_usdhc();
> -
> -	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
> -
> -	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
> -}
> -#endif /* CONFIG_FSL_ESDHC */
> -
> -static void displ5_setup_ecspi(void)
> -{
> -	int ret;
> -
> -	displ5_set_iomux_ecspi();
> -
> -	ret = gpio_request(IMX_GPIO_NR(5, 29), "spi2_cs0");
> -	if (!ret)
> -		gpio_direction_output(IMX_GPIO_NR(5, 29), 1);
> -
> -	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
> -	if (!ret)
> -		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
> -}
> -
> -#ifdef CONFIG_FEC_MXC
> -iomux_v3_cfg_t const enet_pads[] = {
> -	MX6_PAD_ENET_TXD1__ENET_1588_EVENT0_IN	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT |
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_MDIO__ENET_MDIO		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_MDC__ENET_MDC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_REF_CLK__ENET_TX_CLK	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -
> -	/* for old evalboard with R159 present and R160 not populated */
> -	MX6_PAD_GPIO_16__ENET_REF_CLK		|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -
> -	MX6_PAD_RGMII_TXC__RGMII_TXC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD0__RGMII_TD0		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD1__RGMII_TD1		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD2__RGMII_TD2		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD3__RGMII_TD3		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -
> -	MX6_PAD_RGMII_RXC__RGMII_RXC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD0__RGMII_RD0		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD1__RGMII_RD1		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD2__RGMII_RD2		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD3__RGMII_RD3		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	/*INT#_GBE*/
> -	MX6_PAD_ENET_TX_EN__GPIO1_IO28		|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
> -static void setup_iomux_enet(void)
> -{
> -	SETUP_IOMUX_PADS(enet_pads);
> -	gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
> -}
> -
> -static int setup_mac_from_fuse(void)
> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> int
> +ft_board_setup(void *blob, bd_t *bd)
>  {
> -	unsigned char enetaddr[6];
> -	int ret;
> -
> -	ret = eth_env_get_enetaddr("ethaddr", enetaddr);
> -	if (ret)	/* ethaddr is already set */
> -		return 0;
> -
> -	imx_get_mac_from_fuse(0, enetaddr);
> -
> -	if (is_valid_ethaddr(enetaddr)) {
> -		eth_env_set_enetaddr("ethaddr", enetaddr);
> -		return 0;
> -	}
> -
> +	fdt_fixup_ethernet(blob);
>  	return 0;
>  }
> +#endif
> 
> -int board_eth_init(bd_t *bd)
> +int board_phy_config(struct phy_device *phydev)
>  {
> -	struct phy_device *phydev;
> -	struct mii_dev *bus;
> -	int ret;
> -
> -	setup_iomux_enet();
> -
> -	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
> -
> -	ret = enable_fec_anatop_clock(0, ENET_125MHZ);
> -	if (ret)
> -		return ret;
> -
> -	setup_mac_from_fuse();
> -
> -	bus = fec_get_miibus(IMX_FEC_BASE, -1);
> -	if (!bus)
> -		return -ENODEV;
> -
> -	/*
> -	 * We use here the "rgmii-id" mode of operation and allow M88E1512
> -	 * PHY to use its internally callibrated RX/TX delays
> -	 */
> -	phydev = phy_find_by_mask(bus, 0xffffffff /* (0xf << 4) */,
> -				  PHY_INTERFACE_MODE_RGMII_ID);
> -	if (!phydev) {
> -		ret = -ENODEV;
> -		goto err_phy;
> -	}
> -
>  	/* display5 due to PCB routing can only work with 100 Mbps */
>  	phydev->advertising &= ~(ADVERTISED_1000baseX_Half |
>  				 ADVERTISED_1000baseX_Full |
>  				 SUPPORTED_1000baseT_Half |
>  				 SUPPORTED_1000baseT_Full);
> 
> -	ret  = fec_probe(bd, -1, IMX_FEC_BASE, bus, phydev);
> -	if (ret)
> -		goto err_sw;
> +	if (phydev->drv->config)
> +		return phydev->drv->config(phydev);
> 
>  	return 0;
> -
> -err_sw:
> -	free(phydev);
> -err_phy:
> -	mdio_unregister(bus);
> -	free(bus);
> -	return ret;
>  }
> -#endif /* CONFIG_FEC_MXC */
> -
> -/*
> - * Do not overwrite the console
> - * Always use serial for U-Boot console
> - */
> -int overwrite_console(void)
> -{
> -	return 1;
> -}
> -
> -#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> -int ft_board_setup(void *blob, bd_t *bd) -{
> -	fdt_fixup_ethernet(blob);
> -	return 0;
> -}
> -#endif
> 
>  int board_init(void)
>  {
> +	int ret;
> +
>  	debug("board init\n");
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
> 
>  	/* Setup iomux for non console UARTS */
>  	displ5_set_iomux_uart();
> -
> -	displ5_setup_ecspi();
> -
> +	/* Setup misc (application specific) stuff */
>  	SETUP_IOMUX_PADS(misc_pads);
> 
>  	get_board_id(gpio_table_sw_ids, &gpio_table_sw_ids_names[0], @@
> -369,9 +189,18 @@ int board_init(void)
> 
>  	udelay(25);
> 
> -	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
> -	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
> -	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
> +	/* Setup low level FEC (ETH) */
> +	ret = gpio_request(IMX_GPIO_NR(1, 28), "INT_GBE");
> +	if (!ret)
> +		gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
> +
> +	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
> +	enable_fec_anatop_clock(0, ENET_125MHZ);
> +
> +	/* Setup #WP for SPI-NOR memory */
> +	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
> +	if (!ret)
> +		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
> 
>  	return 0;
>  }
> diff --git a/configs/display5_defconfig b/configs/display5_defconfig index
> 0ef56024e9..6fca4d059b 100644
> --- a/configs/display5_defconfig
> +++ b/configs/display5_defconfig
> @@ -46,13 +46,17 @@ CONFIG_CMD_GPT=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
>  CONFIG_CMD_PART=y
> +# CONFIG_CMD_PINMUX is not set
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_SPI=y
> +CONFIG_CMD_WDT=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
> +CONFIG_CMD_PMIC=y
> +CONFIG_CMD_REGULATOR=y
>  CONFIG_CMD_EXT2=y
>  CONFIG_CMD_EXT4=y
>  CONFIG_CMD_FAT=y
> @@ -66,20 +70,45 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_BOOTLIMIT=3
> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
> +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
> +CONFIG_SYS_I2C_MXC=y
> +CONFIG_SYS_I2C_MXC_I2C1=y
> +CONFIG_SYS_I2C_MXC_I2C2=y
> +CONFIG_SYS_I2C_MXC_I2C3=y
> +CONFIG_MISC=y
> +CONFIG_I2C_EEPROM=y
> +CONFIG_SYS_I2C_EEPROM_ADDR=0x50
> +CONFIG_SYS_I2C_EEPROM_BUS=2
> +CONFIG_SYS_EEPROM_SIZE=32768
> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
> +CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_FSL_ESDHC=y
>  CONFIG_MTD_DEVICE=y
> +CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH=y
>  CONFIG_SF_DEFAULT_BUS=1
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=50000000
> +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHYLIB=y
>  CONFIG_PHY_MARVELL=y
>  CONFIG_FEC_MXC=y
>  CONFIG_MII=y
> +CONFIG_PINCTRL=y
> +CONFIG_PINCTRL_IMX6=y
> +CONFIG_DM_PMIC=y
> +CONFIG_DM_PMIC_PFUZE100=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_PFUZE100=y
>  CONFIG_MXC_UART=y
>  CONFIG_SPI=y
>  CONFIG_MXC_SPI=y
> +CONFIG_SYSRESET=y
> +CONFIG_SYSRESET_WATCHDOG=y
> +CONFIG_I2C_EDID=y
>  CONFIG_IMX_WATCHDOG=y
> diff --git a/configs/display5_factory_defconfig
> b/configs/display5_factory_defconfig
> index 0d9eed3a3e..aafeda437d 100644
> --- a/configs/display5_factory_defconfig
> +++ b/configs/display5_factory_defconfig
> @@ -4,13 +4,19 @@ 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=0x1000
> +CONFIG_MX6_DDRCAL=y
>  CONFIG_TARGET_DISPLAY5=y
> +CONFIG_SPL_MMC_SUPPORT=y
>  CONFIG_SPL_SERIAL_SUPPORT=y
> +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_SPL=y
>  CONFIG_SPL_SPI_FLASH_SUPPORT=y
>  CONFIG_SPL_SPI_SUPPORT=y
> +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_FIT=y
> +CONFIG_SPL_LOAD_FIT=y
>  CONFIG_OF_BOARD_SETUP=y
> 
> CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cf
> g,MX6Q"
>  CONFIG_BOOTDELAY=3
> @@ -20,7 +26,6 @@ CONFIG_SUPPORT_RAW_INITRD=y
> CONFIG_MISC_INIT_R=y  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_SPL_TEXT_BASE=0x00908000
> -# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set  #
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
> CONFIG_SPL_DMA_SUPPORT=y  CONFIG_SPL_I2C_SUPPORT=y @@ -46,11
> +51,14 @@ CONFIG_CMD_PART=y  CONFIG_CMD_SF=y
> CONFIG_CMD_SPI=y  CONFIG_CMD_USB_SDP=y
> +CONFIG_CMD_WDT=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
> +CONFIG_CMD_PMIC=y
> +CONFIG_CMD_REGULATOR=y
>  CONFIG_CMD_EXT2=y
>  CONFIG_CMD_EXT4=y
>  CONFIG_CMD_EXT4_WRITE=y
> @@ -61,30 +69,57 @@ CONFIG_MTDIDS_DEFAULT="nor0=02008000.spi.1"
> 
> CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-bo
> ot),64k(env1),64k(env2),4m(swu-kernel),16m(swu-initramfs),1m(factory),-(res
> erved)"
>  # CONFIG_SPL_EFI_PARTITION is not set
>  CONFIG_PARTITION_TYPE_GUID=y
> +CONFIG_OF_CONTROL=y
> +CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_SF=y
> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
> +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
> +CONFIG_SYS_I2C_MXC=y
> +CONFIG_SYS_I2C_MXC_I2C1=y
> +CONFIG_SYS_I2C_MXC_I2C2=y
> +CONFIG_SYS_I2C_MXC_I2C3=y
> +CONFIG_MISC=y
> +CONFIG_I2C_EEPROM=y
> +CONFIG_SYS_I2C_EEPROM_ADDR=0x50
> +CONFIG_SYS_I2C_EEPROM_BUS=2
> +CONFIG_SYS_EEPROM_SIZE=32768
> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
> +CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_FSL_ESDHC=y
>  CONFIG_MTD_DEVICE=y
> +CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH=y
>  CONFIG_SF_DEFAULT_BUS=1
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=50000000
> +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHYLIB=y
> +CONFIG_PHY_MARVELL=y
>  CONFIG_FEC_MXC=y
>  CONFIG_MII=y
> +CONFIG_DM_PMIC=y
> +CONFIG_DM_PMIC_PFUZE100=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_PFUZE100=y
>  CONFIG_MXC_UART=y
>  CONFIG_SPI=y
>  CONFIG_MXC_SPI=y
> +CONFIG_SYSRESET=y
> +CONFIG_SYSRESET_WATCHDOG=y
>  CONFIG_USB=y
> +CONFIG_DM_USB=y
>  CONFIG_USB_GADGET=y
>  CONFIG_USB_GADGET_MANUFACTURER="Liebherr"
> -CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
> -CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
> +CONFIG_USB_GADGET_VENDOR_NUM=0x0525
> +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
>  CONFIG_CI_UDC=y
>  CONFIG_USB_GADGET_DOWNLOAD=y
> +CONFIG_I2C_EDID=y
>  CONFIG_IMX_WATCHDOG=y
> -CONFIG_OF_LIBFDT=y
> +CONFIG_PANIC_HANG=y
> diff --git a/include/configs/display5.h b/include/configs/display5.h index
> 5dbe5b8528..c8218effc3 100644
> --- a/include/configs/display5.h
> +++ b/include/configs/display5.h
> @@ -35,8 +35,11 @@
>   * 0x1540000 - 0x1640000 : SPI.factory  (1MiB)
>   */
> 
> -#ifndef CONFIG_SPL_BUILD
> -#define CONFIG_SPI_FLASH_MTD
> +/* SPI Flash Configs */
> +#if defined(CONFIG_SPL_BUILD)
> +#undef CONFIG_DM_SPI
> +#undef CONFIG_DM_SPI_FLASH
> +#undef CONFIG_SPI_FLASH_MTD
>  #endif
> 
>  /* Below values are "dummy" - only to avoid build break */ @@ -58,23
> +61,7 @@
>  #define CONFIG_MXC_UART_BASE		UART5_BASE
> 
>  /* I2C Configs */
> -#define CONFIG_SYS_I2C
> -#define CONFIG_SYS_I2C_MXC
> -#define CONFIG_SYS_I2C_MXC_I2C1
> -#define CONFIG_SYS_I2C_MXC_I2C2
> -#define CONFIG_SYS_I2C_MXC_I2C3
>  #define CONFIG_I2C_MULTI_BUS
> -#define CONFIG_SYS_I2C_SPEED		100000
> -#define CONFIG_I2C_EDID
> -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
> -
> -/* Ethernet */
> -#ifdef CONFIG_FEC_MXC
> -#define IMX_FEC_BASE			ENET_BASE_ADDR
> -#define CONFIG_FEC_XCV_TYPE		RGMII
> -#define CONFIG_ETHPRIME			"FEC"
> -#define CONFIG_FEC_MXC_PHYADDR		0
> -#endif
> 
>  /* MMC Configs */
>  #define CONFIG_FSL_USDHC
> @@ -363,7 +350,11 @@
> 
>  /* Watchdog */
>  #define CONFIG_WATCHDOG_TIMEOUT_MSECS   15000
> -
> +#if defined(CONFIG_SPL_BUILD)
> +#undef CONFIG_WDT
> +#undef CONFIG_WATCHDOG
> +#define CONFIG_HW_WATCHDOG
> +#endif
>  /* ENV config */
>  #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>  #define CONFIG_ENV_SIZE		(SZ_64K)

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion) Lukasz Majewski
@ 2019-06-10  1:46   ` Peng Fan
  0 siblings, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  1:46 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH v1 11/11] ARM: display5: Remove common.c file (after
> DM/DTS U-Boot proper conversion)
> 
> The common.c file content can be safely moved to spl.c file after performing
> the DM/DTS conversion for the U-Boot proper.
> 
> It contains the non DM/DTS setup code, which now is only used by SPL.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
>  board/liebherr/display5/Makefile |  4 +-
> board/liebherr/display5/common.c | 83 ----------------------------------------
>  board/liebherr/display5/common.h |  5 ---
>  board/liebherr/display5/spl.c    | 74
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 76 insertions(+), 90 deletions(-)  delete mode 100644
> board/liebherr/display5/common.c
> 
> diff --git a/board/liebherr/display5/Makefile
> b/board/liebherr/display5/Makefile
> index f934672428..ee503add75 100644
> --- a/board/liebherr/display5/Makefile
> +++ b/board/liebherr/display5/Makefile
> @@ -5,7 +5,7 @@
>  # SPDX-License-Identifier:    GPL-2.0+
>  #
>  ifdef CONFIG_SPL_BUILD
> -obj-y = common.o spl.o
> +obj-y = spl.o
>  else
> -obj-y := common.o display5.o
> +obj-y := display5.o
>  endif
> diff --git a/board/liebherr/display5/common.c
> b/board/liebherr/display5/common.c
> deleted file mode 100644
> index 71d79f85ab..0000000000
> --- a/board/liebherr/display5/common.c
> +++ /dev/null
> @@ -1,83 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - * Copyright (C) 2017 DENX Software Engineering
> - * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
> - */
> -
> -#include <asm/mach-imx/iomux-v3.h>
> -#include <asm/arch/mx6-pins.h>
> -#include "common.h"
> -
> -iomux_v3_cfg_t const uart_console_pads[] = {
> -	/* UART5 */
> -	MX6_PAD_CSI0_DAT14__UART5_TX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT15__UART5_RX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT18__UART5_RTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT19__UART5_CTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> -};
> -
> -void displ5_set_iomux_uart_spl(void)
> -{
> -	SETUP_IOMUX_PADS(uart_console_pads);
> -}
> -
> -iomux_v3_cfg_t const misc_pads_spl[] = {
> -	/* Emergency recovery pin */
> -	MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
> -void displ5_set_iomux_misc_spl(void)
> -{
> -	SETUP_IOMUX_PADS(misc_pads_spl);
> -}
> -
> -#ifdef CONFIG_MXC_SPI
> -iomux_v3_cfg_t const ecspi2_pads[] = {
> -	/* SPI2, NOR Flash nWP, CS0 */
> -	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT9__ECSPI2_MOSI	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT8__ECSPI2_SCLK	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_CSI0_DAT11__GPIO5_IO29	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_SD3_DAT5__GPIO7_IO00	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
> -int board_spi_cs_gpio(unsigned int bus, unsigned int cs) -{
> -	if (bus != 1 || cs != 0)
> -		return -EINVAL;
> -
> -	return IMX_GPIO_NR(5, 29);
> -}
> -
> -void displ5_set_iomux_ecspi_spl(void)
> -{
> -	SETUP_IOMUX_PADS(ecspi2_pads);
> -}
> -
> -#else
> -void displ5_set_iomux_ecspi_spl(void) {} -#endif
> -
> -#ifdef CONFIG_FSL_ESDHC
> -iomux_v3_cfg_t const usdhc4_pads[] = {
> -	MX6_PAD_SD4_CLK__SD4_CLK	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_CMD__SD4_CMD	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT0__SD4_DATA0	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT1__SD4_DATA1	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT2__SD4_DATA2	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT3__SD4_DATA3	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT4__SD4_DATA4	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT5__SD4_DATA5	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT6__SD4_DATA6	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_SD4_DAT7__SD4_DATA7	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -	MX6_PAD_NANDF_ALE__SD4_RESET	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> -};
> -
> -void displ5_set_iomux_usdhc_spl(void)
> -{
> -	SETUP_IOMUX_PADS(usdhc4_pads);
> -}
> -
> -#else
> -void displ5_set_iomux_usdhc_spl(void) {} -#endif diff --git
> a/board/liebherr/display5/common.h b/board/liebherr/display5/common.h
> index 4eb70dc42f..44c7470074 100644
> --- a/board/liebherr/display5/common.h
> +++ b/board/liebherr/display5/common.h
> @@ -31,9 +31,4 @@
>  #define ENET_PAD_CTRL_CLK  ((PAD_CTL_PUS_100K_UP &
> ~PAD_CTL_PKE) | \
>  	PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
> 
> -void displ5_set_iomux_uart_spl(void);
> -void displ5_set_iomux_ecspi_spl(void);
> -void displ5_set_iomux_usdhc_spl(void);
> -void displ5_set_iomux_misc_spl(void);
> -
>  #endif /* __DISPL5_COMMON_H_ */
> diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index
> 0c0172e201..3c2587c558 100644
> --- a/board/liebherr/display5/spl.c
> +++ b/board/liebherr/display5/spl.c
> @@ -104,6 +104,80 @@ static const struct mx6_ddr3_cfg
> mt41k128m16jt_125 = {
>  	.trasmin = 3500,
>  };
> 
> +iomux_v3_cfg_t const uart_console_pads[] = {
> +	/* UART5 */
> +	MX6_PAD_CSI0_DAT14__UART5_TX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT15__UART5_RX_DATA |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT18__UART5_RTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT19__UART5_CTS_B |
> MUX_PAD_CTRL(UART_PAD_CTRL), };
> +
> +void displ5_set_iomux_uart_spl(void)
> +{
> +	SETUP_IOMUX_PADS(uart_console_pads);
> +}
> +
> +iomux_v3_cfg_t const misc_pads_spl[] = {
> +	/* Emergency recovery pin */
> +	MX6_PAD_EIM_D29__GPIO3_IO29 |
> MUX_PAD_CTRL(NO_PAD_CTRL), };
> +
> +void displ5_set_iomux_misc_spl(void)
> +{
> +	SETUP_IOMUX_PADS(misc_pads_spl);
> +}
> +
> +#ifdef CONFIG_MXC_SPI
> +iomux_v3_cfg_t const ecspi2_pads[] = {
> +	/* SPI2, NOR Flash nWP, CS0 */
> +	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT9__ECSPI2_MOSI	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT8__ECSPI2_SCLK	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> +	MX6_PAD_CSI0_DAT11__GPIO5_IO29	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> +	MX6_PAD_SD3_DAT5__GPIO7_IO00	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> +};
> +
> +int board_spi_cs_gpio(unsigned int bus, unsigned int cs) {
> +	if (bus != 1 || cs != 0)
> +		return -EINVAL;
> +
> +	return IMX_GPIO_NR(5, 29);
> +}
> +
> +void displ5_set_iomux_ecspi_spl(void)
> +{
> +	SETUP_IOMUX_PADS(ecspi2_pads);
> +}
> +
> +#else
> +void displ5_set_iomux_ecspi_spl(void) {} #endif
> +
> +#ifdef CONFIG_FSL_ESDHC
> +iomux_v3_cfg_t const usdhc4_pads[] = {
> +	MX6_PAD_SD4_CLK__SD4_CLK	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_CMD__SD4_CMD	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT0__SD4_DATA0	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT1__SD4_DATA1	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT2__SD4_DATA2	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT3__SD4_DATA3	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT4__SD4_DATA4	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT5__SD4_DATA5	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT6__SD4_DATA6	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_SD4_DAT7__SD4_DATA7	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +	MX6_PAD_NANDF_ALE__SD4_RESET	|
> MUX_PAD_CTRL(USDHC_PAD_CTRL),
> +};
> +
> +void displ5_set_iomux_usdhc_spl(void)
> +{
> +	SETUP_IOMUX_PADS(usdhc4_pads);
> +}
> +
> +#else
> +void displ5_set_iomux_usdhc_spl(void) {} #endif
> +
>  static void ccgr_init(void)
>  {
>  	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;

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

> --
> 2.11.0

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

* [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  2019-06-10  1:41   ` Peng Fan
@ 2019-06-10  6:04     ` Lukasz Majewski
  2019-06-10  6:43       ` Peng Fan
  0 siblings, 1 reply; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-10  6:04 UTC (permalink / raw)
  To: u-boot

Hi Peng,

> > Subject: [PATCH v1 05/11] ARM: display5: Increase the
> > pre-relocation malloc pool size to 4KiB
> > 
> > Porting more DTS code from Linux kernel for display5 board required
> > increase of pre-relocation malloc pool size in U-Boot proper.
> > 
> > The early malloc memory is necessary for handling parsing and setup
> > of e.g. serial port device (and all its ancestors in DT tree).
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > 
> >  configs/display5_defconfig | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/configs/display5_defconfig
> > b/configs/display5_defconfig index 3b793f4500..0ef56024e9 100644
> > --- a/configs/display5_defconfig
> > +++ b/configs/display5_defconfig
> > @@ -4,16 +4,19 @@ 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=0x1000
> >  CONFIG_MX6_DDRCAL=y
> >  CONFIG_TARGET_DISPLAY5=y
> >  CONFIG_SPL_MMC_SUPPORT=y
> >  CONFIG_SPL_SERIAL_SUPPORT=y
> > +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
> >  CONFIG_NR_DRAM_BANKS=1
> >  CONFIG_SPL=y
> >  CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
> >  CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
> >  CONFIG_SPL_SPI_FLASH_SUPPORT=y
> >  CONFIG_SPL_SPI_SUPPORT=y
> > +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400  
> 
> Acked-by: Peng Fan <peng.fan@nxp.com>
> Just a question, TPL is enabled for this platform?

No, display5 is not using TPL. This CONFIG_TPL_SYS_MALLOC_F_LEN seems
to be enabled by default when setting SPL counterpart.

> 
> >  CONFIG_FIT=y
> >  CONFIG_SPL_LOAD_FIT=y
> >  CONFIG_OF_BOARD_SETUP=y
> > --
> > 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/20190610/486d339d/attachment.sig>

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

* [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  2019-06-10  6:04     ` Lukasz Majewski
@ 2019-06-10  6:43       ` Peng Fan
  0 siblings, 0 replies; 34+ messages in thread
From: Peng Fan @ 2019-06-10  6:43 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [PATCH v1 05/11] ARM: display5: Increase the pre-relocation
> malloc pool size to 4KiB
> 
> Hi Peng,
> 
> > > Subject: [PATCH v1 05/11] ARM: display5: Increase the pre-relocation
> > > malloc pool size to 4KiB
> > >
> > > Porting more DTS code from Linux kernel for display5 board required
> > > increase of pre-relocation malloc pool size in U-Boot proper.
> > >
> > > The early malloc memory is necessary for handling parsing and setup
> > > of e.g. serial port device (and all its ancestors in DT tree).
> > >
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > >
> > >  configs/display5_defconfig | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/configs/display5_defconfig b/configs/display5_defconfig
> > > index 3b793f4500..0ef56024e9 100644
> > > --- a/configs/display5_defconfig
> > > +++ b/configs/display5_defconfig
> > > @@ -4,16 +4,19 @@ 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=0x1000
> > >  CONFIG_MX6_DDRCAL=y
> > >  CONFIG_TARGET_DISPLAY5=y
> > >  CONFIG_SPL_MMC_SUPPORT=y
> > >  CONFIG_SPL_SERIAL_SUPPORT=y
> > > +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
> > >  CONFIG_NR_DRAM_BANKS=1
> > >  CONFIG_SPL=y
> > >  CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
> > >  CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
> > >  CONFIG_SPL_SPI_FLASH_SUPPORT=y
> > >  CONFIG_SPL_SPI_SUPPORT=y
> > > +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
> >
> > Acked-by: Peng Fan <peng.fan@nxp.com>
> > Just a question, TPL is enabled for this platform?
> 
> No, display5 is not using TPL. This CONFIG_TPL_SYS_MALLOC_F_LEN seems
> to be enabled by default when setting SPL counterpart.

ok. But not make sense to set this macro if TPL is not enabled.

Regards,
Peng.

> 
> >
> > >  CONFIG_FIT=y
> > >  CONFIG_SPL_LOAD_FIT=y
> > >  CONFIG_OF_BOARD_SETUP=y
> > > --
> > > 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

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

* [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
  2019-06-10  1:43   ` Peng Fan
@ 2019-06-10 10:52   ` Adam Ford
  2019-06-10 12:23     ` Lukasz Majewski
  2019-07-20  8:45   ` sbabic at denx.de
  2 siblings, 1 reply; 34+ messages in thread
From: Adam Ford @ 2019-06-10 10:52 UTC (permalink / raw)
  To: u-boot

On Sun, Jun 9, 2019 at 3:55 PM Lukasz Majewski <lukma@denx.de> wrote:
>
> This file setups UART5 based serial to be used as pre-relocation
> console in the U-Boot proper.
>
> On purpose pinux configuration is omitted here as it has been already
> done in SPL. For early pre-relocation code we only need the serial
> device from DTS.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
>
>  arch/arm/dts/imx6q-display5-u-boot.dtsi | 44 +++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 arch/arm/dts/imx6q-display5-u-boot.dtsi
>
> diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> new file mode 100644
> index 0000000000..b942218b7a
> --- /dev/null
> +++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> @@ -0,0 +1,44 @@
> +// 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
> + */
> +
> +/*
> + * The minimal augmentation DTS U-Boot file to allow UART5
> + * configuration in the pre-relocation stage of U-Boot
> + * proper.
> + *
> + * As the same UART is already configured in SPL, we don't need
> + * setup pinmux for it again.
> + */
> +
> +/ {
> +       aliases {
> +               mmc0 = &usdhc4;
> +       };
> +
> +       soc {
> +               u-boot,dm-pre-reloc;
> +
> +               aips-bus at 2100000 {
> +                       u-boot,dm-pre-reloc;
> +               };
> +       };

You could consider including  arch/arm/dts/imx6qdl-u-boot.dtsi.  This
would have the soc node, aips-bus node, and the iomuxc and then you
could just add the uart, stdio-patch and aliases.  It's just a
suggestion.


adam
> +
> +       chosen {
> +               stdout-path = &uart5;
> +       };
> +};
> +
> +&i2c3 {
> +       at24 at 50 {
> +               u-boot,i2c-offset-len = <2>;
> +       };
> +};
> +
> +&uart5 {
> +       u-boot,dm-pre-reloc;
> +};
> --
> 2.11.0
>

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

* [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties
  2019-06-10 10:52   ` Adam Ford
@ 2019-06-10 12:23     ` Lukasz Majewski
  0 siblings, 0 replies; 34+ messages in thread
From: Lukasz Majewski @ 2019-06-10 12:23 UTC (permalink / raw)
  To: u-boot

Hi Adam,

> On Sun, Jun 9, 2019 at 3:55 PM Lukasz Majewski <lukma@denx.de> wrote:
> >
> > This file setups UART5 based serial to be used as pre-relocation
> > console in the U-Boot proper.
> >
> > On purpose pinux configuration is omitted here as it has been
> > already done in SPL. For early pre-relocation code we only need the
> > serial device from DTS.
> >
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >
> >  arch/arm/dts/imx6q-display5-u-boot.dtsi | 44
> > +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
> >  create mode 100644 arch/arm/dts/imx6q-display5-u-boot.dtsi
> >
> > diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> > b/arch/arm/dts/imx6q-display5-u-boot.dtsi new file mode 100644
> > index 0000000000..b942218b7a
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> > @@ -0,0 +1,44 @@
> > +// 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
> > + */
> > +
> > +/*
> > + * The minimal augmentation DTS U-Boot file to allow UART5
> > + * configuration in the pre-relocation stage of U-Boot
> > + * proper.
> > + *
> > + * As the same UART is already configured in SPL, we don't need
> > + * setup pinmux for it again.
> > + */
> > +
> > +/ {
> > +       aliases {
> > +               mmc0 = &usdhc4;
> > +       };
> > +
> > +       soc {
> > +               u-boot,dm-pre-reloc;
> > +
> > +               aips-bus at 2100000 {
> > +                       u-boot,dm-pre-reloc;
> > +               };
> > +       };  
> 
> You could consider including  arch/arm/dts/imx6qdl-u-boot.dtsi.  This
> would have the soc node, aips-bus node, and the iomuxc and then you
> could just add the uart, stdio-patch and aliases.  It's just a
> suggestion.

Thanks for the suggestion. Indeed in the first draft of this conversion
I indeed used the imx6qdl-u-boot.dts [1] and then included the rest.

However, my goal is to not start any unnecessary devices before
relocation for U-Boot proper (excluding the serial, which is only used).

Unfortunately, the imx6qdl-u-boot.dts defines the above properties as
'u-boot,dm-spl' which I want to avoid (as SPL for now must be left
untouched).

Moreover, the gpio1 and iomux have the 'u-boot,dm-spl' property, which
I do not want to use.

I will probably reuse this file when we convert SPL to DM. 



[1] -
http://git.denx.de/?p=u-boot/u-boot-dfu.git;a=blob;f=arch/arm/dts/imx6qdl-u-boot.dtsi;h=0aa29e38b831deb48db8990bc00929dbd3877a39;hb=refs/heads/master

> 
> 
> adam
> > +
> > +       chosen {
> > +               stdout-path = &uart5;
> > +       };
> > +};
> > +
> > +&i2c3 {
> > +       at24 at 50 {
> > +               u-boot,i2c-offset-len = <2>;
> > +       };
> > +};
> > +
> > +&uart5 {
> > +       u-boot,dm-pre-reloc;
> > +};
> > --
> > 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/20190610/c7a61d21/attachment.sig>

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

* [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c Lukasz Majewski
  2019-06-10  1:36   ` Peng Fan
@ 2019-07-20  8:45   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:45 UTC (permalink / raw)
  To: u-boot

> This commit just corrects spelling of 'accessed' word in the EEPROM
> comment.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
  2019-06-10  1:43   ` Peng Fan
  2019-06-10 10:52   ` Adam Ford
@ 2019-07-20  8:45   ` sbabic at denx.de
  2 siblings, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:45 UTC (permalink / raw)
  To: u-boot

> This file setups UART5 based serial to be used as pre-relocation
> console in the U-Boot proper.
> On purpose pinux configuration is omitted here as it has been already
> done in SPL. For early pre-relocation code we only need the serial
> device from DTS.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc Lukasz Majewski
  2019-06-10  1:44   ` Peng Fan
@ 2019-07-20  8:45   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:45 UTC (permalink / raw)
  To: u-boot

> Before the wide DM/DTS adoption in the U-Boot proper, the display5
> has been using only DM_SERIAL to provide serial console in
> pre-relocation.
> After moving to full DM/DTS adoption in the U-Boot proper the
> U_BOOT_DEVICE definition is not needed anymore, as it has been
> replaced with udevice creation from provided DTS description.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB Lukasz Majewski
  2019-06-10  1:41   ` Peng Fan
@ 2019-07-20  8:46   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:46 UTC (permalink / raw)
  To: u-boot

> Porting more DTS code from Linux kernel for display5 board required
> increase of pre-relocation malloc pool size in U-Boot proper.
> The early malloc memory is necessary for handling parsing and setup of
> e.g. serial port device (and all its ancestors in DT tree).
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig Lukasz Majewski
@ 2019-07-20  8:46   ` sbabic at denx.de
  0 siblings, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:46 UTC (permalink / raw)
  To: u-boot

> After commit 14453fbfadc2 ("Convert CONFIG_SF_DEFAULT_* to Kconfig")
> and commit abe66b1b5dec ("Convert CONFIG_ENV_SPI_* to Kconfig") ,which
> moved some SPI related CONFIG_* defines to Kconfig the display5 board has
> become unbootable as the SPI CS check condition had wrong value.
> This commit fixes this check and allows proper SPI NOR flash operation in
> SPL.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define Lukasz Majewski
  2019-06-10  1:38   ` Peng Fan
@ 2019-07-20  8:46   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:46 UTC (permalink / raw)
  To: u-boot

> Add missing parenthesis to the GPIO_TO_PORT macro.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1)
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1) Lukasz Majewski
  2019-06-10  1:41   ` Peng Fan
@ 2019-07-20  8:57   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:57 UTC (permalink / raw)
  To: u-boot

> This commit ports from Linux kernel - tag: v5.1 - the device tree
> description for display5 board.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments
  2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
  2019-06-10  1:36   ` Peng Fan
@ 2019-07-20  8:57   ` sbabic at denx.de
  1 sibling, 0 replies; 34+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:57 UTC (permalink / raw)
  To: u-boot

> Some comments are not needed anymore after Kconfig automated conversion.
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2019-07-20  8:57 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09 20:54 [U-Boot] [PATCH v1 00/11] DM: display5: Convert display5 board to DM/DTS (including 'factory' setup) Lukasz Majewski
2019-06-09 20:54 ` [U-Boot] [PATCH v1 01/11] cosmetic: display5: Remove not needed comments Lukasz Majewski
2019-06-10  1:36   ` Peng Fan
2019-07-20  8:57   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 02/11] cosmetic: Update comment in cmd/eeprom.c Lukasz Majewski
2019-06-10  1:36   ` Peng Fan
2019-07-20  8:45   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 03/11] ARM: display5: Fix CS check after moving some SPI related CONFIGs to Kconfig Lukasz Majewski
2019-07-20  8:46   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 04/11] gpio: Add missing parenthesis to the GPIO_TO_PORT define Lukasz Majewski
2019-06-10  1:38   ` Peng Fan
2019-07-20  8:46   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 05/11] ARM: display5: Increase the pre-relocation malloc pool size to 4KiB Lukasz Majewski
2019-06-10  1:41   ` Peng Fan
2019-06-10  6:04     ` Lukasz Majewski
2019-06-10  6:43       ` Peng Fan
2019-07-20  8:46   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 06/11] DTS: imx: Add display5 board (imx6q based) device tree description (v5.1) Lukasz Majewski
2019-06-10  1:41   ` Peng Fan
2019-07-20  8:57   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 07/11] DTS: Add imx6q-display5-u-boot.dtsi file with u-boot specific properties Lukasz Majewski
2019-06-10  1:43   ` Peng Fan
2019-06-10 10:52   ` Adam Ford
2019-06-10 12:23     ` Lukasz Majewski
2019-07-20  8:45   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 08/11] ARM: display5: Remove U_BOOT_DEVICE definition of serial_mxc Lukasz Majewski
2019-06-10  1:44   ` Peng Fan
2019-07-20  8:45   ` sbabic at denx.de
2019-06-09 20:54 ` [U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS Lukasz Majewski
2019-06-10  1:45   ` Peng Fan
2019-06-09 20:54 ` [U-Boot] [PATCH v1 10/11] ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console) Lukasz Majewski
2019-06-10  1:44   ` Peng Fan
2019-06-09 20:54 ` [U-Boot] [PATCH v1 11/11] ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion) Lukasz Majewski
2019-06-10  1:46   ` Peng Fan

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.