Skip to contentSkip to conversation

imx: dm: Update mccmon6 board to only use DM/DTS in u-boot proper

PATCH Superseded Lukasz Majewski 4 participants 25 messages Jan 19, 2019 – Jan 31, 2019

Subsystems (7)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover imx: dm: Update mccmon6 board to only use DM/DTS in u-boot proper

This patch series converts mccmon6 to use Driver Model and Device Tree in u-boot proper.
As the SPL is size constrained (and most notably the device has a strict boot time requirements) for this board (and uses falcon boot)
- its conversion to DM/DTB will be added with separate patch series.

In the SPL/u-boot proper it now uses fitImage instead of legacy uImage and DTB.

Some notable changes:
- Use fitImage to boot Linux kernel (and also use of SPL's Falcon mode when running from parallel NOR flash)
- DTS sync with kernel (tag: v4.20)
- Decoupling SPL and u-boot proper for easy SPL DM/DTS conversion
- Adding CONFIG_CLK for IMX6Q (reuse clock.c file functions)
- Conversion to DM_MMC, DM_SPI, and BLK (u-boot proper)
- Removal of DM_USB (as this board is not using it - no connector present)

Buildman CI:

./tools/buildman/buildman.py --branch=HEAD imx6 mccmon6 --detail \
	--verbose --show_errors --force-build --count=15 \
	--output-dir=../BUILD/

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

Patches applicable on top of TAG: v2019.01

    SHA1: d3689267f92c5956e09cc7d1baa4700141662bff
as well as newest origin/master:
    SHA1: f83ef0dac83110d20389eb71f09285f009f3d198

Lukasz Majewski (15):
ARM: imx: cosmetic: Remove not needed comment from the mccmon6.h file
ARM: imx: config: Disable support for USB on MCCMON6
net: imx: Add support for waiting some time after FEC gpio reset
clk: imx: Rename and export get_usdhc_clk() to imx6_get_usdhc_clk()
clk: imx: Rename and export get_cspi_clk() to imx6_get_cspi_clk()
dm: clk: imx: Add support for controlling imx6q clocks via Driver
Model
spi: imx: Add support for 'per' clock enabling via driver model
ARM: imx: Covnert mccmon6 to use DM/DTS in the u-boot proper
ARM: imx: Decouple mccmon6's SPL and u-boot proper code
ARM: imx: Disable 1Gbps support on MCCMON6's KSZ9031 PHY
Kconfig: Make CMD_SPL_NAND_OFS only available when proper memory is
used
Kconfig: cosmetic: Update description of CMD_SPL_NAND_OFS
Kconfig: Add CMD_SPL_NOR_OFS config for falcon boot argument offset
doc: Update parallel NOR flash related information in README.falcon
imx: Convert mccmon6 to use fitImage instead of uImage+DTB

 arch/arm/dts/imx6q-mccmon6.dts        | 382 +++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-mx6/clock.h |   2 +
 arch/arm/mach-imx/mx6/Kconfig         |   7 +
 arch/arm/mach-imx/mx6/clock.c         |  14 +-
 board/liebherr/mccmon6/Makefile       |   7 +-
 board/liebherr/mccmon6/mccmon6.c      | 446 ----------------------------------
 board/liebherr/mccmon6/spl.c          | 271 ++++++++++++++++++++-
 cmd/Kconfig                           |  12 +-
 common/spl/spl_nor.c                  |   5 +
 configs/mccmon6_nor_defconfig         |  40 ++-
 configs/mccmon6_sd_defconfig          |  37 ++-
 doc/README.falcon                     |   3 +
 drivers/clk/imx/Kconfig               |   7 +
 drivers/clk/imx/Makefile              |   1 +
 drivers/clk/imx/clk-imx6q.c           | 176 ++++++++++++++
 drivers/net/fec_mxc.c                 |  11 +
 drivers/net/fec_mxc.h                 |   1 +
 drivers/spi/mxc_spi.c                 |  17 ++
 include/configs/mccmon6.h             |  83 ++-----
 19 files changed, 994 insertions(+), 528 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-mccmon6.dts
 create mode 100644 drivers/clk/imx/clk-imx6q.c
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/15 ARM: imx: cosmetic: Remove not needed comment from the mccmon6.h file

This comment is a leftover from the Kconfig CONFIG_*MTD* move.

---

 include/configs/mccmon6.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/mccmon6.h +0 -2
index 644f339993..86ab66f3ab 100644
@@ -70,8 +70,6 @@
 #define CONFIG_SYS_FLASH_BANKS_LIST	{ (CONFIG_SYS_FLASH_BASE) }
 #define CONFIG_SYS_FLASH_BANKS_SIZES	{ (32 * SZ_1M) }
 
-/* MTD support */
-
 /* USB Configs */
 #define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/15 ARM: imx: config: Disable support for USB on MCCMON6

In reply to Lukasz Majewski

The IMX6Q based MCCMON6 is not using USB for any purpose.

---

 configs/mccmon6_nor_defconfig | 2 --
 configs/mccmon6_sd_defconfig  | 2 --
 include/configs/mccmon6.h     | 5 -----
 3 files changed, 9 deletions(-)
configs/mccmon6_nor_defconfig +0 -2
index 61231557bf..80a4fcccdc 100644
@@ -18,7 +18,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
-CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
@@ -45,5 +44,4 @@ CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
-CONFIG_USB=y
 CONFIG_OF_LIBFDT=y
configs/mccmon6_sd_defconfig +0 -2
index 3047ae6e76..7199be2f5c 100644
@@ -19,7 +19,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
-CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
@@ -46,5 +45,4 @@ CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
-CONFIG_USB=y
 CONFIG_OF_LIBFDT=y
include/configs/mccmon6.h +0 -5
index 86ab66f3ab..5ca9bc6848 100644
@@ -70,11 +70,6 @@
 #define CONFIG_SYS_FLASH_BANKS_LIST	{ (CONFIG_SYS_FLASH_BASE) }
 #define CONFIG_SYS_FLASH_BANKS_SIZES	{ (32 * SZ_1M) }
 
-/* USB Configs */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
-#define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS		0
-
 /* Ethernet Configuration */
 #define CONFIG_FEC_MXC
 #define IMX_FEC_BASE			ENET_BASE_ADDR
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/15 net: imx: Add support for waiting some time after FEC gpio reset

In reply to Lukasz Majewski

The support for in-kernel (v4.20) "phy-reset-post-delay" property has been implemented in u-boot's FEC IMX driver. It has the same range (1 to 1000ms) as in Linux.

Some PHYs require waiting some time after the reset to be accessible via MII bus. This problem has been observed on mccmon6 board with KSZ9031 PHY IC, when DM_ETH was enabled (as DM slightly changes time between PHY initialization and first access).

---

 drivers/net/fec_mxc.c | 11 +++++++++++
 drivers/net/fec_mxc.h |  1 +
 2 files changed, 12 insertions(+)
drivers/net/fec_mxc.c +11 -0
index 32fb34b793..b13c9c15f3 100644
@@ -1294,6 +1294,8 @@ static void fec_gpio_reset(struct fec_priv *priv)
 		dm_gpio_set_value(&priv->phy_reset_gpio, 1);
 		mdelay(priv->reset_delay);
 		dm_gpio_set_value(&priv->phy_reset_gpio, 0);
+		if (priv->post_reset_delay)
+			mdelay(priv->post_reset_delay);
 	}
 }
 #endif
@@ -1453,6 +1455,15 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)
 		/* property value wrong, use default value */
 		priv->reset_delay = 1;
 	}
+
+	priv->post_reset_delay = dev_read_u32_default(dev,
+						      "phy-reset-post-delay",
+						      0);
+	if (priv->post_reset_delay > 1000) {
+		printf("FEC MXC: phy reset post delay should be <= 1000ms\n");
+		/* property value wrong, use default value */
+		priv->post_reset_delay = 0;
+	}
 #endif
 
 	return 0;
drivers/net/fec_mxc.h +1 -0
index e9a661f0a1..d069af533a 100644
@@ -258,6 +258,7 @@ struct fec_priv {
 #ifdef CONFIG_DM_GPIO
 	struct gpio_desc phy_reset_gpio;
 	uint32_t reset_delay;
+	u32 post_reset_delay;
 #endif
 #ifdef CONFIG_DM_ETH
 	u32 interface;
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/15 clk: imx: Rename and export get_usdhc_clk() to imx6_get_usdhc_clk()

In reply to Lukasz Majewski

This commit allows reusing the mach-imx/mx6/clock.c code in the CLK driver model (DM) driver for iMX6Q.

---

 arch/arm/include/asm/arch-mx6/clock.h |  1 +
 arch/arm/mach-imx/mx6/clock.c         | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/include/asm/arch-mx6/clock.h +1 -0
index a9481a5fea..5ce58e1b7a 100644
@@ -59,6 +59,7 @@ enum enet_freq {
 u32 imx_get_uartclk(void);
 u32 imx_get_fecclk(void);
 unsigned int mxc_get_clock(enum mxc_clock clk);
+u32 imx6_get_usdhc_clk(u32 port);
 void setup_gpmi_io_clk(u32 cfg);
 void hab_caam_clock_enable(unsigned char enable);
 void enable_ocotp_clk(unsigned char enable);
arch/arm/mach-imx/mx6/clock.c +5 -5
index 366a4e3c6b..96348b742b 100644
@@ -978,7 +978,7 @@ int enable_fec_anatop_clock(int fec_id, enum enet_freq freq)
 }
 #endif
 
-static u32 get_usdhc_clk(u32 port)
+u32 imx6_get_usdhc_clk(u32 port)
 {
 	u32 root_freq = 0, usdhc_podf = 0, clk_sel = 0;
 	u32 cscmr1 = __raw_readl(&imx_ccm->cscmr1);
@@ -1258,13 +1258,13 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 	case MXC_DDR_CLK:
 		return get_mmdc_ch0_clk();
 	case MXC_ESDHC_CLK:
-		return get_usdhc_clk(0);
+		return imx6_get_usdhc_clk(0);
 	case MXC_ESDHC2_CLK:
-		return get_usdhc_clk(1);
+		return imx6_get_usdhc_clk(1);
 	case MXC_ESDHC3_CLK:
-		return get_usdhc_clk(2);
+		return imx6_get_usdhc_clk(2);
 	case MXC_ESDHC4_CLK:
-		return get_usdhc_clk(3);
+		return imx6_get_usdhc_clk(3);
 	case MXC_SATA_CLK:
 		return get_ahb_clk();
 	default:
Signature · 1 line
2.11.0
#5 lore raw

PATCH 5/15 clk: imx: Rename and export get_cspi_clk() to imx6_get_cspi_clk()

In reply to Lukasz Majewski

This commit allows reusing the mach-imx/mx6/clock.c code in the CLK driver model (DM) driver for iMX6Q.

---

 arch/arm/include/asm/arch-mx6/clock.h | 1 +
 arch/arm/mach-imx/mx6/clock.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-mx6/clock.h +1 -0
index 5ce58e1b7a..81f5b43fcc 100644
@@ -60,6 +60,7 @@ u32 imx_get_uartclk(void);
 u32 imx_get_fecclk(void);
 unsigned int mxc_get_clock(enum mxc_clock clk);
 u32 imx6_get_usdhc_clk(u32 port);
+u32 imx6_get_cspi_clk(void);
 void setup_gpmi_io_clk(u32 cfg);
 void hab_caam_clock_enable(unsigned char enable);
 void enable_ocotp_clk(unsigned char enable);
arch/arm/mach-imx/mx6/clock.c +2 -2
index 96348b742b..cc19c92a4d 100644
@@ -412,7 +412,7 @@ static u32 get_uart_clk(void)
 	return freq / (uart_podf + 1);
 }
 
-static u32 get_cspi_clk(void)
+u32 imx6_get_cspi_clk(void)
 {
 	u32 reg, cspi_podf;
 
@@ -1250,7 +1250,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 	case MXC_UART_CLK:
 		return get_uart_clk();
 	case MXC_CSPI_CLK:
-		return get_cspi_clk();
+		return imx6_get_cspi_clk();
 	case MXC_AXI_CLK:
 		return get_axi_clk();
 	case MXC_EMI_SLOW_CLK:
Signature · 1 line
2.11.0
#6 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

In reply to Lukasz Majewski

This commit provides support for setting USDHCx/ECSPIx clocks depending on used bus. Moreover, it is agnostic to the alias numbering as the information about the clock is read from device tree.

Last but not least - the current IMX6Q clock code in mach-imx/mx6/clock.c has been reused to avoid code duplication.
Code from this file will be moved to clk-imx6q.c when other iMX6Q based boards adopt usage of this driver.

FIX: clk-imx6q
---

 drivers/clk/imx/Kconfig     |   7 ++
 drivers/clk/imx/Makefile    |   1 +
 drivers/clk/imx/clk-imx6q.c | 176 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 184 insertions(+)
 create mode 100644 drivers/clk/imx/clk-imx6q.c
drivers/clk/imx/Kconfig +7 -0
index a6fb58d6cf..7dc261f23e 100644
@@ -1,3 +1,10 @@
+config CLK_IMX6Q
+	bool "Clock support for i.MX6Q"
+	depends on ARCH_MX6
+	select CLK
+	help
+	  This enables support clock driver for i.MX6Q platforms.
+
 config CLK_IMX8
 	bool "Clock support for i.MX8"
 	depends on ARCH_IMX8
drivers/clk/imx/Makefile +1 -0
index 5505ae52e2..b32744812f 100644
@@ -2,4 +2,5 @@
 #
 # SPDX-License-Identifier: GPL-2.0
 
+obj-$(CONFIG_CLK_IMX6Q) += clk-imx6q.o
 obj-$(CONFIG_CLK_IMX8) += clk-imx8.o
drivers/clk/imx/clk-imx6q.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
2.11.0
reviewer
#7 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Lukasz,

Quoted 8 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +8 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:

drivers/clk/imx/clk-imx6q.c line 48

Quoted 10 lines
drivers/clk/imx/clk-imx6q.c new file +10 -0
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id - IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

Barebox imports the clock driver from the kernel and it is much cleaner:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx6.c

#8 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Fabio,

Quoted 18 lines

Hi Lukasz,

Quoted 14 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +14 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
Quoted 8 lines
Quoted 5 lines
drivers/clk/imx/clk-imx6q.c new file +4 -0
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Quoted 3 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Quoted 4 lines

Barebox imports the clock driver from the kernel and it is much cleaner:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx6.c

Yes, it has been trimmed (...a bit...) when compared to original v4.20 :-) .

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/20190121/5d208d98/attachment.sig>

reviewer
#9 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Lukasz,

Quoted 3 lines · Lukasz Majewski

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

Yes, the problem is that clock.c does not scale well as we have dedicated clock functions for each peripheral:
enable_uart_clk(), enable_usdhc_clk(), enable_i2c_clk(), etc

If we have a chance to use common clock framework now in U-Boot that would be a much better implementation and easier to maintain in sync with the kernel.

Quoted 2 lines

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

The problem is that up to now no imx clock driver uses the kernel approach.

Barebox uses the kernel approach for all imx SoCs, imx8mq included:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx8mq.c

Quoted 6 lines
Quoted 2 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

That would be much appreciated. Thanks

#10 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

In reply to Lukasz Majewski

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 6 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 8 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

Quoted 9 lines
Quoted 5 lines

Barebox imports the clock driver from the kernel and it is much cleaner:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx6.c

Yes, it has been trimmed (...a bit...) when compared to original v4.20 :-) .

Best regards,
Stefano

Signature · 5 lines
=====================================================================
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
=====================================================================
#11 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Stefano, Fabio,

Quoted 54 lines

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 6 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 5 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

Quoted 6 lines
Quoted 3 lines

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

The work is in progress - I will add the same directory structure as Linux's Common Clock Framework [CCF]. I shall finish in 2-3 days.

There are a few problems to tackle (when porting code from Linux):

1. As it is now - for IMX6Q we need a static table to store clock pointers. It is around 1KiB of SRAM/SDRAM. This is _a_lot_ for SPL. For u-boot proper this is not a huge problem.

2. The SPL shall use OF_PLATDATA, as we do need clock management mostly in SPL. Moreover, I do think that SPL will be bigger (this is a _real_ problem, IMHO).

3. The CCF design needs to be fitted into U-Boot's Driver Model - this is achievable. The most annoying problem is the lack of .get_rate() method in the CCF's API.

4. The CCF driver for imx6q uses

clks: ccm at 020c4000 {

}

Node as a "manager". In its probe we create other (proper) clocks (hierarchy). Also, this driver is a starting point for getting access to other clocks.

As said above - I will first post the CCF port very similar to Barebox/Linux. Afterwards, we can decide if and how we optimise it.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Barebox imports the clock driver from the kernel and it is much cleaner:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx6.c

Quoted 6 lines
Quoted 3 lines

Yes, it has been trimmed (...a bit...) when compared to original v4.20 :-) .

Best regards,
Stefano

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/20190129/e3c34ce3/attachment.sig>

#12 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Quoted 61 lines · Lukasz Majewski

Hi Stefano, Fabio,

Quoted 58 lines

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 6 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 8 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Quoted 7 lines
Quoted 2 lines

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

The work is in progress - I will add the same directory structure as Linux's Common Clock Framework [CCF]. I shall finish in 2-3 days.

There are a few problems to tackle (when porting code from Linux):

Just to add my experience with previous CLK support series[1]. Do we really need to port it from Linux, because I'm thinking we can manage it as simple as other SoC support in U-Boot.(I have few clocks addition on this series other than ENET)

What do you think?

[1] https://patchwork.ozlabs.org/cover/950964/

#13 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Jagan,

Quoted 71 lines
Quoted 69 lines · Lukasz Majewski

Hi Stefano, Fabio,

Quoted 56 lines

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
drivers/clk/imx/clk-imx6q.c new file +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 7 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 5 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

Quoted 6 lines
Quoted 3 lines

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

The work is in progress - I will add the same directory structure as Linux's Common Clock Framework [CCF]. I shall finish in 2-3 days.

Quoted 8 lines
Quoted 1 line

There are a few problems to tackle (when porting code from Linux):

Just to add my experience with previous CLK support series[1]. Do we really need to port it from Linux, because I'm thinking we can manage it as simple as other SoC support in U-Boot.(I have few clocks addition on this series other than ENET)

What do you think?

This patch series seems to me like the one which reuses the "large" switch/case approach with "fsl,imx6q-ccm" driver [*].

The ENET shall also be handled by the CCF from Linux.

Another problem - the U-boot's clock DM API is not supporting passing parent clock rate, which is important in the hierarchical clock tree. The Linux CCF is a hierarchical one built in the driver's [*] probe.

Do we need to port the (trimmed) Common Clock Framework [CCF] from Linux?

With the first version of this patch I also wanted to re-use the code from clock.c imx6 file. This would be good enough for now.

However, in the long term (and taking into consideration the fact that imx6 needs to be converted to DM anyway) it may be beneficial to re-use CCF.

The _real_ problem is to fit it and reuse in SPL (to avoid footprint size regression). The CCF port will work correctly in u-boot proper, but for SPL we would need some hacks (as e.g. by default we now strip clock properties from DTS when appending to SPL).

Now SPLs for IMX6 use solid code without any unneeded stuff (and hence we didn't need TPL...) .

Quoted 2 lines

[1] https://patchwork.ozlabs.org/cover/950964/

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/20190129/649a9023/attachment.sig>

#14 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Quoted 83 lines · Lukasz Majewski

Hi Jagan,

Quoted 71 lines
Quoted 69 lines · Lukasz Majewski

Hi Stefano, Fabio,

Quoted 56 lines

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
(quoted diff) +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 7 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 5 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

Quoted 6 lines
Quoted 3 lines

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

The work is in progress - I will add the same directory structure as Linux's Common Clock Framework [CCF]. I shall finish in 2-3 days.

Quoted 8 lines
Quoted 1 line

There are a few problems to tackle (when porting code from Linux):

Just to add my experience with previous CLK support series[1]. Do we really need to port it from Linux, because I'm thinking we can manage it as simple as other SoC support in U-Boot.(I have few clocks addition on this series other than ENET)

What do you think?

Quoted 8 lines

This patch series seems to me like the one which reuses the "large" switch/case approach with "fsl,imx6q-ccm" driver [*].

The ENET shall also be handled by the CCF from Linux.

Another problem - the U-boot's clock DM API is not supporting passing parent clock rate, which is important in the hierarchical clock tree. The Linux CCF is a hierarchical one built in the driver's [*] probe.

Understand, we need to taken care the parent clock rates as well for set and get rates. In fact we tried similar thing with sunxi, patch[2] implements get_rate by taking parent clock rates in to account by using switch statements. and this change[3] do add same but with recursive calls. Since U-Boot need minimal clocks and most of them run with default parents it better to implement as smooth as possible otherwise it would ended-up size and complex issues, IMHO.

I think other platforms like mediatek clocks are also following same.

Quoted 13 lines

Do we need to port the (trimmed) Common Clock Framework [CCF] from Linux?

With the first version of this patch I also wanted to re-use the code from clock.c imx6 file. This would be good enough for now.

However, in the long term (and taking into consideration the fact that imx6 needs to be converted to DM anyway) it may be beneficial to re-use CCF.

Quoted 7 lines

The _real_ problem is to fit it and reuse in SPL (to avoid footprint size regression). The CCF port will work correctly in u-boot proper, but for SPL we would need some hacks (as e.g. by default we now strip clock properties from DTS when appending to SPL).

Now SPLs for IMX6 use solid code without any unneeded stuff (and hence we didn't need TPL...) .

Yes, all these size issues might occur even in future if we port large things from Linux.

[2] https://patchwork.ozlabs.org/patch/1019673/
[3] https://gist.github.com/apritzel/db93dd06b4defb46504bccbfe4fc2c20#file-sunxi_clk-c-L86-L112

#15 lore raw

PATCH 6/15 dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Hi Jagan,

Quoted 104 lines · Lukasz Majewski
Quoted 88 lines

Hi Jagan,

Quoted 75 lines
Quoted 66 lines · Lukasz Majewski

Hi Stefano, Fabio,

Quoted 56 lines

Hi Lukasz,

Quoted 29 lines · Lukasz Majewski

Hi Fabio,

Quoted 26 lines

Hi Lukasz,

Quoted 18 lines · Lukasz Majewski
(quoted diff) +18 -0
+static ulong imx6q_clk_get_rate(struct clk *clk)
+{
+       ulong rate = 0;
+
+       debug("%s(#%lu)\n", __func__, clk->id);
+
+       switch (clk->id) {
+       case IMX6QDL_CLK_ECSPI1:
+       case IMX6QDL_CLK_ECSPI2:
+       case IMX6QDL_CLK_ECSPI3:
+       case IMX6QDL_CLK_ECSPI4:
+               return imx6_get_cspi_clk();
+
+       case IMX6QDL_CLK_USDHC1:
+       case IMX6QDL_CLK_USDHC2:
+       case IMX6QDL_CLK_USDHC3:
+       case IMX6QDL_CLK_USDHC4:
+               return imx6_get_usdhc_clk(clk->id -
Quoted 1 line

IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other peripherals and for each port instance.

I am hiiting the same doubts as Fabio when I reviewed Peng's patches with clocks for i.MX8M. The current approach was introduced some years ago with i.MX5, but it does not fit well now and it does not scale.

Quoted 7 lines

The rationale regarding this approach:

1. Reuse the clock.c code for iMX6Q as much as possible.

2, This code is based on the clk-imx8q.c file - hence the question why the Linux clock API was not ported for this new SoC?.

Many reasons, first there was already a set of functions to get / set clocks coming from previos i.MX platforms, and this API was simply reused. And nobody was in charge to port the clock API.

Quoted 5 lines
Quoted 4 lines

If we are adding a clock driver for mx6, why don't we add it just like the kernel one?

Quoted 6 lines
Quoted 3 lines

I can try to port the Linux code, but IMHO it would be feasible to port only relevant (ECSPI, USDHC) parts of it (not all as I cannot test it all properly).

Fully agree. Further parts will be added on demand. Less is better. I disagree to add not tested code.

Quoted 6 lines

The work is in progress - I will add the same directory structure as Linux's Common Clock Framework [CCF]. I shall finish in 2-3 days.

There are a few problems to tackle (when porting code from Linux):

Quoted 6 lines

Just to add my experience with previous CLK support series[1]. Do we really need to port it from Linux, because I'm thinking we can manage it as simple as other SoC support in U-Boot.(I have few clocks addition on this series other than ENET)

What do you think?

This patch series seems to me like the one which reuses the "large" switch/case approach with "fsl,imx6q-ccm" driver [*].

Quoted 6 lines

The ENET shall also be handled by the CCF from Linux.

Another problem - the U-boot's clock DM API is not supporting passing parent clock rate, which is important in the hierarchical clock tree. The Linux CCF is a hierarchical one built in the driver's [*] probe.

Understand, we need to taken care the parent clock rates as well for set and get rates. In fact we tried similar thing with sunxi, patch[2] implements get_rate by taking parent clock rates in to account by using switch statements. and this change[3] do add same but with recursive calls. Since U-Boot need minimal clocks and most of them run with default parents it better to implement as smooth as possible otherwise it would ended-up size and complex issues, IMHO.

Quoted 1 line

I think other platforms like mediatek clocks are also following same.

I've posted some patches today:
http://patchwork.ozlabs.org/cover/1034127/

Quoted 22 lines
Quoted 14 lines

Do we need to port the (trimmed) Common Clock Framework [CCF] from Linux?

With the first version of this patch I also wanted to re-use the code from clock.c imx6 file. This would be good enough for now.

However, in the long term (and taking into consideration the fact that imx6 needs to be converted to DM anyway) it may be beneficial to re-use CCF.

Quoted 7 lines

The _real_ problem is to fit it and reuse in SPL (to avoid footprint size regression). The CCF port will work correctly in u-boot proper, but for SPL we would need some hacks (as e.g. by default we now strip clock properties from DTS when appending to SPL).

Now SPLs for IMX6 use solid code without any unneeded stuff (and hence we didn't need TPL...) .

Quoted 6 lines

Yes, all these size issues might occur even in future if we port large things from Linux.

[2] https://patchwork.ozlabs.org/patch/1019673/
[3]
https://gist.github.com/apritzel/db93dd06b4defb46504bccbfe4fc2c20#file-sunxi_clk-c-L86-L112

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/20190131/6c1ddcee/attachment.sig>

#16 lore raw

PATCH 7/15 spi: imx: Add support for 'per' clock enabling via driver model

In reply to Lukasz Majewski

With this commit one can enable ECSPI clock on imx6q without the need to define direct call to it in the board file (as it is done up to now).

The information regarding proper clocks is provided via DTS description.

---

 drivers/spi/mxc_spi.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/spi/mxc_spi.c +17 -0
index b2636909ce..371e8d8e44 100644
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <malloc.h>
 #include <spi.h>
+#include <clk.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
@@ -50,6 +51,9 @@ struct mxc_spi_slave {
 	unsigned int	max_hz;
 	unsigned int	mode;
 	struct gpio_desc ss;
+#if CONFIG_IS_ENABLED(CLK)
+	struct clk per_clk;
+#endif
 };
 
 static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
@@ -494,6 +498,19 @@ static int mxc_spi_probe(struct udevice *bus)
 	const void *blob = gd->fdt_blob;
 	int ret;
 
+#if CONFIG_IS_ENABLED(CLK)
+	ret = clk_get_by_name(bus, "per", &mxcs->per_clk);
+	if (ret) {
+		printf("%s: Failed to get per_clk\n", __func__);
+		return ret;
+	}
+
+	ret = clk_enable(&mxcs->per_clk);
+	if (ret) {
+		printf("%s: Failed to enable per_clk\n", __func__);
+		return ret;
+	}
+#endif
 	if (gpio_request_by_name(bus, "cs-gpios", 0, &plat->ss,
 				 GPIOD_IS_OUT)) {
 		dev_err(bus, "No cs-gpios property\n");
Signature · 1 line
2.11.0
#17 lore raw

PATCH 8/15 ARM: imx: Covnert mccmon6 to use DM/DTS in the u-boot proper

In reply to Lukasz Majewski

This commit converts mccmon6's u-boot proper (in a single commit to avoid build breaks) to use solely DM/DTS.

The DTS description of the mccmon6 has been ported from Linux kernel (v4.20, SHA1: 8fe28cb58bcb235034b64cbbb7550a8a43fd88be)

---

 arch/arm/dts/imx6q-mccmon6.dts   | 382 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/mx6/Kconfig    |   7 +
 board/liebherr/mccmon6/mccmon6.c | 161 -----------------
 configs/mccmon6_nor_defconfig    |  30 ++-
 configs/mccmon6_sd_defconfig     |  29 ++-
 include/configs/mccmon6.h        |  18 --
 6 files changed, 444 insertions(+), 183 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-mccmon6.dts
arch/arm/dts/imx6q-mccmon6.dts new file +382 -0
new file mode 100644
index 0000000000..27cde56115
@@ -0,0 +1,382 @@
+// 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
+ */
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include "imx6q.dtsi"
+
+/ {
+	model = "Liebherr Nenzig (LWN) iMX6Q";
+	compatible = "lwn,imx6-mccmon6", "fsl,imx6";
+
+	aliases {
+		mmc0 = &usdhc3;
+		mmc1 = &usdhc2;
+		spi0 = &ecspi3;
+	};
+
+	chosen {
+		stdout-path = &uart1;
+	};
+
+	memory at 10000000 {
+		reg = <0x10000000 0x80000000>;
+	};
+};
+
+&ecspi3 {
+	cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ecspi3 &pinctrl_ecspi3_cs &pinctrl_ecspi3_flwp>;
+	spi-max-frequency = <25000000>;
+	status = "okay";
+
+	s25sl032p: flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		spi-max-frequency = <40000000>;
+		reg = <0>;
+	};
+};
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-mode = "rgmii";
+	phy-reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <10>;
+	phy-reset-post-delay = <1>;
+	/* KSZ9031 PHY SKEW setup - old values * 60 ps */
+	rxc-skew-ps = <1860>;
+	txc-skew-ps = <1860>;
+	txen-skew-ps = <900>;
+	rxdv-skew-ps = <900>;
+	rxd0-skew-ps = <180>;
+	rxd1-skew-ps = <180>;
+	rxd2-skew-ps = <180>;
+	rxd3-skew-ps = <180>;
+	txd0-skew-ps = <120>;
+	txd1-skew-ps = <300>;
+	txd2-skew-ps = <0>;
+	txd3-skew-ps = <120>;
+	status = "okay";
+};
+
+&i2c1 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+};
+
+&i2c2 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	status = "okay";
+
+	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;
+			};
+		};
+	};
+};
+
+&weim {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_weim_nor &pinctrl_weim_cs0>;
+	ranges = <0 0 0x08000000 0x08000000>;
+	status = "okay";
+
+	nor at 0,0 {
+		compatible = "cfi-flash";
+		reg = <0 0 0x02000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		bank-width = <2>;
+		use-advanced-sector-protection;
+		fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
+				0x0000c000 0x1404a38e 0x00000000>;
+	};
+};
+
+&iomuxc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hog>;
+
+	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 0x80000000
+		>;
+	};
+
+	pinctrl_ecspi3_flwp: ecspi3flwpgrp {
+		fsl,pins = <
+			MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27 0x80000000
+		>;
+	};
+
+	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_hog: hoggrp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x1b0b0
+			MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x1b0b0
+		>;
+	};
+
+	pinctrl_i2c1: i2c1grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL	0x4001b8b1
+			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA	0x4001b8b1
+		>;
+	};
+
+	pinctrl_i2c2: i2c2grp {
+		fsl,pins = <
+			MX6QDL_PAD_KEY_COL3__I2C2_SCL	0x4001b8b1
+			MX6QDL_PAD_KEY_ROW3__I2C2_SDA	0x4001b8b1
+		>;
+	};
+
+	pinctrl_uart1: uart1grp {
+		fsl,pins = <
+			MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA	0x1b0b1
+			MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA	0x1b0b1
+		>;
+	};
+
+	pinctrl_usdhc2: usdhc2grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x17059
+			MX6QDL_PAD_SD2_CLK__SD2_CLK		0x10059
+			MX6QDL_PAD_SD2_DAT0__SD2_DATA0		0x17059
+			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17059
+			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17059
+			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17059
+			MX6QDL_PAD_GPIO_4__GPIO1_IO04           0x1b0b1
+		>;
+	};
+
+	pinctrl_usdhc3: usdhc3grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD3_CMD__SD3_CMD		0x17059
+			MX6QDL_PAD_SD3_CLK__SD3_CLK		0x10059
+			MX6QDL_PAD_SD3_DAT0__SD3_DATA0		0x17059
+			MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x17059
+			MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x17059
+			MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x17059
+			MX6QDL_PAD_SD3_DAT4__SD3_DATA4		0x17059
+			MX6QDL_PAD_SD3_DAT5__SD3_DATA5		0x17059
+			MX6QDL_PAD_SD3_DAT6__SD3_DATA6		0x17059
+			MX6QDL_PAD_SD3_DAT7__SD3_DATA7		0x17059
+			MX6QDL_PAD_SD3_RST__SD3_RESET		0x17059
+		>;
+	};
+
+	pinctrl_weim_cs0: weimcs0grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_CS0__EIM_CS0_B		0xb0b1
+		>;
+	};
+
+	pinctrl_weim_nor: weimnorgrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_OE__EIM_OE_B		0xb0b1
+			MX6QDL_PAD_EIM_RW__EIM_RW		0xb0b1
+			MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B	0xb060
+			MX6QDL_PAD_EIM_D16__EIM_DATA16		0x1b0b0
+			MX6QDL_PAD_EIM_D17__EIM_DATA17		0x1b0b0
+			MX6QDL_PAD_EIM_D18__EIM_DATA18		0x1b0b0
+			MX6QDL_PAD_EIM_D19__EIM_DATA19		0x1b0b0
+			MX6QDL_PAD_EIM_D20__EIM_DATA20		0x1b0b0
+			MX6QDL_PAD_EIM_D21__EIM_DATA21		0x1b0b0
+			MX6QDL_PAD_EIM_D22__EIM_DATA22		0x1b0b0
+			MX6QDL_PAD_EIM_D23__EIM_DATA23		0x1b0b0
+			MX6QDL_PAD_EIM_D24__EIM_DATA24		0x1b0b0
+			MX6QDL_PAD_EIM_D25__EIM_DATA25		0x1b0b0
+			MX6QDL_PAD_EIM_D26__EIM_DATA26		0x1b0b0
+			MX6QDL_PAD_EIM_D27__EIM_DATA27		0x1b0b0
+			MX6QDL_PAD_EIM_D28__EIM_DATA28		0x1b0b0
+			MX6QDL_PAD_EIM_D29__EIM_DATA29		0x1b0b0
+			MX6QDL_PAD_EIM_D30__EIM_DATA30		0x1b0b0
+			MX6QDL_PAD_EIM_D31__EIM_DATA31		0x1b0b0
+			MX6QDL_PAD_EIM_A23__EIM_ADDR23		0xb0b1
+			MX6QDL_PAD_EIM_A22__EIM_ADDR22		0xb0b1
+			MX6QDL_PAD_EIM_A21__EIM_ADDR21		0xb0b1
+			MX6QDL_PAD_EIM_A20__EIM_ADDR20		0xb0b1
+			MX6QDL_PAD_EIM_A19__EIM_ADDR19		0xb0b1
+			MX6QDL_PAD_EIM_A18__EIM_ADDR18		0xb0b1
+			MX6QDL_PAD_EIM_A17__EIM_ADDR17		0xb0b1
+			MX6QDL_PAD_EIM_A16__EIM_ADDR16		0xb0b1
+			MX6QDL_PAD_EIM_DA15__EIM_AD15		0xb0b1
+			MX6QDL_PAD_EIM_DA14__EIM_AD14		0xb0b1
+			MX6QDL_PAD_EIM_DA13__EIM_AD13		0xb0b1
+			MX6QDL_PAD_EIM_DA12__EIM_AD12		0xb0b1
+			MX6QDL_PAD_EIM_DA11__EIM_AD11		0xb0b1
+			MX6QDL_PAD_EIM_DA10__EIM_AD10		0xb0b1
+			MX6QDL_PAD_EIM_DA9__EIM_AD09		0xb0b1
+			MX6QDL_PAD_EIM_DA8__EIM_AD08		0xb0b1
+			MX6QDL_PAD_EIM_DA7__EIM_AD07		0xb0b1
+			MX6QDL_PAD_EIM_DA6__EIM_AD06		0xb0b1
+			MX6QDL_PAD_EIM_DA5__EIM_AD05		0xb0b1
+			MX6QDL_PAD_EIM_DA4__EIM_AD04		0xb0b1
+			MX6QDL_PAD_EIM_DA3__EIM_AD03		0xb0b1
+			MX6QDL_PAD_EIM_DA2__EIM_AD02		0xb0b1
+			MX6QDL_PAD_EIM_DA1__EIM_AD01		0xb0b1
+			MX6QDL_PAD_EIM_DA0__EIM_AD00		0xb0b1
+		>;
+	};
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart1>;
+	status = "okay";
+};
+
+&usdhc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc2>;
+	bus-width = <4>;
+	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
+&usdhc3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc3>;
+	bus-width = <8>;
+	non-removable;
+	no-1-8-v;
+	keep-power-in-suspend;
+	status = "okay";
+};
arch/arm/mach-imx/mx6/Kconfig +7 -0
index 3d56346ccb..3ebe205009 100644
@@ -205,6 +205,13 @@ config TARGET_MCCMON6
 	bool "mccmon6"
 	select MX6QDL
 	select SUPPORT_SPL
+	select DM
+	select DM_GPIO
+	select DM_ETH
+	select DM_SERIAL
+	select DM_I2C
+	select DM_SPI
+	imply CMD_DM
 
 config TARGET_MX6CUBOXI
 	bool "Solid-run mx6 boards"
board/liebherr/mccmon6/mccmon6.c +0 -161

214 lines not on this page · raw message

configs/mccmon6_nor_defconfig +28 -2
index 80a4fcccdc..9dea3a5b23 100644
@@ -9,23 +9,35 @@ CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_nor.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
+CONFIG_CMD_CLK=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=8000000.nor"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor),128k at 0x1980000(kernel-dtb.nor),128k at 0x19C0000(swupdate-kernel-dtb.nor)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_DM=y
+CONFIG_CLK_IMX6Q=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_MXC=y
+CONFIG_SYS_I2C_MXC_I2C1=y
+CONFIG_SYS_I2C_MXC_I2C2=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -35,13 +47,27 @@ CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_FEC_MXC=y
+CONFIG_RGMII=y
 CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+# CONFIG_SPECIFY_CONSOLE_INDEX is not set
+# CONFIG_SPL_SERIAL_PRESENT is not set
+# CONFIG_TPL_SERIAL_PRESENT is not set
+CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
-CONFIG_OF_LIBFDT=y
configs/mccmon6_sd_defconfig +27 -2
index 7199be2f5c..86acd3cefe 100644
@@ -10,23 +10,35 @@ CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
+CONFIG_CMD_CLK=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=8000000.nor"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor),128k at 0x1980000(kernel-dtb.nor),128k at 0x19C0000(swupdate-kernel-dtb.nor)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_DM=y
+CONFIG_CLK_IMX6Q=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_MXC=y
+CONFIG_SYS_I2C_MXC_I2C1=y
+CONFIG_SYS_I2C_MXC_I2C2=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -36,13 +48,26 @@ CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_FEC_MXC=y
+CONFIG_RGMII=y
 CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+# CONFIG_SPL_SERIAL_PRESENT is not set
+# CONFIG_TPL_SERIAL_PRESENT is not set
+CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
-CONFIG_OF_LIBFDT=y
include/configs/mccmon6.h +0 -18
index 5ca9bc6848..f72d8cba2b 100644
@@ -34,27 +34,12 @@
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
 
-#define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_LATE_INIT
-
-#define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE		UART1_BASE
 
 #define CONFIG_SYS_MEMTEST_START	0x10000000
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
 
-#define CONFIG_SF_DEFAULT_BUS  2
-#define CONFIG_SF_DEFAULT_CS   0
-#define CONFIG_SF_DEFAULT_SPEED 25000000
-#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
-
-/* I2C Configs */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
-#define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
-#define CONFIG_SYS_I2C_SPEED		100000
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
@@ -71,10 +56,7 @@
 #define CONFIG_SYS_FLASH_BANKS_SIZES	{ (32 * SZ_1M) }
 
 /* Ethernet Configuration */
-#define 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		1
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
Signature · 1 line
2.11.0
#18 lore raw

PATCH 9/15 ARM: imx: Decouple mccmon6's SPL and u-boot proper code

In reply to Lukasz Majewski

The mccmon6 has been used a "mixed" approach between SPL and u-boot proper sources.

This commit decoupes SPL and u-boot proper, which allows clear distinction between those two code bases and facilitates conversion to DM/DTS on this particular board.

---

 board/liebherr/mccmon6/Makefile  |   7 +-
 board/liebherr/mccmon6/mccmon6.c | 285 ---------------------------------------
 board/liebherr/mccmon6/spl.c     | 266 +++++++++++++++++++++++++++++++++++-
 3 files changed, 268 insertions(+), 290 deletions(-)
board/liebherr/mccmon6/Makefile +5 -2
index ead6750ebf..3c9786c6b7 100644
@@ -2,5 +2,8 @@
 #
 # (C) Copyright 2016-2017
 # Lukasz Majewski, DENX Software Engineering, lukma at denx.de
-
-obj-y  := mccmon6.o spl.o
+ifdef CONFIG_SPL_BUILD
+obj-y  := spl.o
+else
+obj-y  := mccmon6.o
+endif
board/liebherr/mccmon6/mccmon6.c +0 -285

310 lines not on this page · raw message

board/liebherr/mccmon6/spl.c +263 -3

287 lines not on this page · raw message

Signature · 1 line
2.11.0
#19 lore raw

PATCH 10/15 ARM: imx: Disable 1Gbps support on MCCMON6's KSZ9031 PHY

In reply to Lukasz Majewski

mccmon6 works in 10/100 MiB Ethernet environment, so disabling 1GiB support improves robustness of the network after power up (as one don't need to wait for autoneg).

---

 include/configs/mccmon6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/mccmon6.h +1 -0
index f72d8cba2b..b25aacbf41 100644
@@ -65,6 +65,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"boot_os=yes\0" \
+	"disable_giga=yes\0" \
 	"download_kernel=" \
 		"tftpboot ${kernel_addr} ${kernel_file};" \
 		"tftpboot ${fdt_addr} ${fdtfile};\0" \
Signature · 1 line
2.11.0
#20 lore raw

PATCH 11/15 Kconfig: Make CMD_SPL_NAND_OFS only available when proper memory is used

In reply to Lukasz Majewski

This commit makes the CMD_SPL_NAND_OFS only visible when we use NAND memory.
Before this change it was present when only CMD_SPL was enabled (and would stay when board with other falcon boot medium is used).

---

 cmd/Kconfig | 1 +
 1 file changed, 1 insertion(+)
cmd/Kconfig +1 -0
index ea1a325eb3..bc08b935a5 100644
@@ -316,6 +316,7 @@ config CMD_SPL
 config CMD_SPL_NAND_OFS
 	hex "Offset of OS command line args for Falcon-mode NAND boot"
 	depends on CMD_SPL
+	depends on CMD_SPL && (TPL_NAND_SUPPORT || SPL_NAND_SUPPORT)
 	default 0
 	help
 	  This provides the offset of the command line arguments for Linux
Signature · 1 line
2.11.0
#21 lore raw

PATCH 12/15 Kconfig: cosmetic: Update description of CMD_SPL_NAND_OFS

In reply to Lukasz Majewski

The CMD_SPL_NAND_OFS description was a bit misleading, has been updated.

---

 cmd/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
cmd/Kconfig +1 -2
index bc08b935a5..f9a668b80f 100644
@@ -314,8 +314,7 @@ config CMD_SPL
 	  command.
 
 config CMD_SPL_NAND_OFS
-	hex "Offset of OS command line args for Falcon-mode NAND boot"
-	depends on CMD_SPL
+	hex "Offset of OS args or dtb for Falcon-mode NAND boot"
 	depends on CMD_SPL && (TPL_NAND_SUPPORT || SPL_NAND_SUPPORT)
 	default 0
 	help
Signature · 1 line
2.11.0
#22 lore raw

PATCH 13/15 Kconfig: Add CMD_SPL_NOR_OFS config for falcon boot argument offset

In reply to Lukasz Majewski

This option will provide the offset in the parallel NOR flash memory to, which the falcon boot data is stored.

---

 cmd/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
cmd/Kconfig +8 -0
index f9a668b80f..e37d28e86a 100644
@@ -323,6 +323,14 @@ config CMD_SPL_NAND_OFS
 	  for full information about how to use this option (and also see
 	  board/gateworks/gw_ventana/README for an example).
 
+config CMD_SPL_NOR_OFS
+	hex "Offset of OS args or dtb for Falcon-mode NOR boot"
+	depends on CMD_SPL && SPL_NOR_SUPPORT
+	default 0
+	help
+	  This provides the offset of the command line arguments or dtb for
+	  Linux when booting from NOR in Falcon mode.
+
 config CMD_SPL_WRITE_SIZE
 	hex "Size of argument area"
 	depends on CMD_SPL
Signature · 1 line
2.11.0
#23 lore raw

PATCH 14/15 doc: Update parallel NOR flash related information in README.falcon

In reply to Lukasz Majewski

This commit updates the doc/README.falcon regarding Falcon boot on NOR flash memories.

---

 doc/README.falcon | 3 +++
 1 file changed, 3 insertions(+)
doc/README.falcon +3 -0
index 9a7f0bc235..204f4b12b6 100644
@@ -67,6 +67,9 @@ CONFIG_SYS_NAND_SPL_KERNEL_OFFS	Offset in NAND where the kernel is stored
 
 CONFIG_CMD_SPL_NAND_OFS	Offset in NAND where the parameters area was saved.
 
+CONFIG_CMD_SPL_NOR_OFS	Offset in NOR where the parameters area was saved.
+			(Please refer to MCCMON6 board's configuraiton)
+
 CONFIG_CMD_SPL_WRITE_SIZE 	Size of the parameters area to be copied
 
 CONFIG_SPL_OS_BOOT	Activate Falcon Mode.
Signature · 1 line
2.11.0
#24 lore raw

PATCH 15/15 imx: Convert mccmon6 to use fitImage instead of uImage+DTB

In reply to Lukasz Majewski

This commit enabled support for fitImage on mccmon6 when we switch to DT/DTS.

Moreover, it provides Falcon boot functionality to parallel NOR flash memories (spl_nor.c).

---

 board/liebherr/mccmon6/spl.c  |  7 ++++++
 common/spl/spl_nor.c          |  5 ++++
 configs/mccmon6_nor_defconfig |  8 +++++-
 configs/mccmon6_sd_defconfig  |  6 ++++-
 include/configs/mccmon6.h     | 57 +++++++++++++++++--------------------------
 5 files changed, 47 insertions(+), 36 deletions(-)
board/liebherr/mccmon6/spl.c +7 -0
index afd080fe26..c5cfea2a55 100644
@@ -324,6 +324,13 @@ void board_boot_order(u32 *spl_boot_list)
 	}
 }
 
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+	return 0;
+}
+#endif
+
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
common/spl/spl_nor.c +5 -0
index 969e319de0..c9364072f3 100644
@@ -48,6 +48,11 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
 						  CONFIG_SYS_OS_BASE,
 						  (void *)header);
 
+#ifdef CONFIG_SYS_SPL_ARGS_ADDR
+			memcpy((void *)CONFIG_SYS_SPL_ARGS_ADDR,
+			       (void *)CONFIG_CMD_SPL_NOR_OFS,
+			       CONFIG_CMD_SPL_WRITE_SIZE);
+#endif
 			return ret;
 		}
 #endif
configs/mccmon6_nor_defconfig +7 -1
index 9dea3a5b23..e4774d53da 100644
@@ -10,11 +10,17 @@ CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_nor.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
+CONFIG_SPL_OS_BOOT=y
+CONFIG_SYS_OS_BASE=0x8180000
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NOR_OFS=0x09600000
+CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -27,7 +33,7 @@ CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=8000000.nor"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor),128k at 0x1980000(kernel-dtb.nor),128k at 0x19C0000(swupdate-kernel-dtb.nor)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor)"
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
configs/mccmon6_sd_defconfig +5 -1
index 86acd3cefe..926ca76cf4 100644
@@ -11,11 +11,15 @@ CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NOR_OFS=0x09600000
+CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -28,7 +32,7 @@ CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=8000000.nor"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor),128k at 0x1980000(kernel-dtb.nor),128k at 0x19C0000(swupdate-kernel-dtb.nor)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nor:32m at 0x0(mccmon6-image.nor),256k at 0x40000(u-boot-env.nor),1m at 0x80000(u-boot.nor),8m at 0x180000(kernel.nor),8m at 0x980000(swupdate-kernel.nor),8m at 0x1180000(swupdate-rootfs.nor)"
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
include/configs/mccmon6.h +23 -34

145 lines not on this page · raw message

Signature · 1 line
2.11.0