All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support
@ 2018-09-26 13:52 Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 01/32] dt-bindings: pinctrl: add i.MX8QXP pads definition Peng Fan
                   ` (32 more replies)
  0 siblings, 33 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

This patchset is to upstream i.MX8QXP and mek board support, with some
drivers update to support i.MX8QXP. The information about the processor
could be found
https://www.nxp.com/products/processors-and-microcontrollers/applications-processors/i.mx-applications-processors/i.mx-8-processors/i.mx-8x-family-arm-cortex-a35-3d-graphics-4k-video-dsp-error-correcting-code-on-ddr:i.MX8X

The architecture of i.MX8QXP is different from i.MX6/7/8M, inside i.MX8QXP,
there is a dedicated processor(SCU) used for power/clock/pin/
pad/resource management/thermal and etc.


V5:
Addressed Lothar Waßmann's comments for patch 24 and 32.
Rebased on master.

V4:
Add reviewed tag from Anatolij Gustschin
Addressed comments from Anatolig for patch "misc: add i.MX8 misc driver"
Addressed comments from Anatolig for patch "misc: imx8: add scfw api impementation"
 Merged the files into one
 Moved one error handle to patch 4
Moved patch "arm: global_data: add scu_dev for i.MX8" to patch 7
For Fabio's comments to imx-mkimage, I'll start the porting work, but needs
more time, it will be not be in this patchset.

V3:

patch 7: use CONFIG_IMX8
patch 29: use CONFIG_IMX8
patch 32: Added README with scfw_tcm.bin link added
misc: remove sc_rpc_msg_t typedef, use struct sc_rpc_msg_s in patchset.

V2:
In this V2 patchset, the SCFW API is replaced by uclass driver
implementation, but the api name is not changed from scfw api.
The related macro definitions are kept in different api.h file
following SCFW API file structure.

Impelemnted scu misc driver to handle the low level communication
between Acore and SCU.
Implemented rm/pm/pad/misc protocol code to invoke misc_call for
different functionality.
The dm clk/pinctrl/power and others will invokde the protocol api
to communicate with SCU.

The arch/arm/mach-imx/imx8/clock.c currently is only a dummy
file to avoid build break for mxc_get_clock.

The i2c patch and common power domain patches are removed
from this patchset.

The imx8 name still kept, this is because NXP marketing
requires to use this name for i.MX branding.


Peng Fan (30):
  dt-bindings: pinctrl: add i.MX8QXP pads definition
  dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks
    definition
  dt-bindings: soc: add i.MX8QXP pm and rsrc definition
  imx8: add scfw macro definition
  imx: add Kconfig entry for i.MX8QXP
  arm: build mach-imx for i.MX8
  arm: global_data: add scu_dev for i.MX8
  misc: add i.MX8 misc driver
  misc: imx8: add scfw api impementation
  imx: boot_mode: Add FLEXSPI boot entry
  imx8: add imx-regs header file
  imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined
  imx: add i.MX8 cpu type
  armv8: add cpu core helper functions
  imx8: add basic cpu support
  imx8: add boot device detection
  imx8: implement mmc_get_env_dev
  imx8: add mmu and dram related functiions
  imx8: add arch_cpu_init arch_cpu_init_dm
  imx8: add iomux configuration api
  imx8: add dummy clock
  gpio: mxc_gpio: add support for i.MX8
  pinctrl: Add pinctrl driver for i.MX8
  power: Add power domain driver for i.MX8
  clk: imx: add clk driver for i.MX8QXP
  serial_lpuart: Update lpuart driver to support i.MX8
  serial: lpuart: support uclass clk api
  mmc: fsl_esdhc: add uclass clk support
  arm: dts: introduce dtsi for i.MX8QXP
  imx: add i.MX8QXP MEK board support

Ye Li (2):
  serial: lpuart: Enable RX and TX FIFO
  fsl_esdhc: Update usdhc driver to support i.MX8

 arch/arm/Kconfig                                  |   8 +
 arch/arm/Makefile                                 |   2 +-
 arch/arm/dts/Makefile                             |   2 +
 arch/arm/dts/fsl-imx8-ca35.dtsi                   |  66 ++
 arch/arm/dts/fsl-imx8dx.dtsi                      | 452 +++++++++++++
 arch/arm/dts/fsl-imx8dxp.dtsi                     |  11 +
 arch/arm/dts/fsl-imx8qxp-mek.dts                  | 136 ++++
 arch/arm/dts/fsl-imx8qxp.dtsi                     |  51 ++
 arch/arm/include/asm/arch-imx/cpu.h               |   5 +
 arch/arm/include/asm/arch-imx8/clock.h            |  27 +
 arch/arm/include/asm/arch-imx8/gpio.h             |  21 +
 arch/arm/include/asm/arch-imx8/imx-regs.h         |  46 ++
 arch/arm/include/asm/arch-imx8/imx8-pins.h        |  15 +
 arch/arm/include/asm/arch-imx8/iomux.h            |  40 ++
 arch/arm/include/asm/arch-imx8/power-domain.h     |  15 +
 arch/arm/include/asm/arch-imx8/sci/rpc.h          | 158 +++++
 arch/arm/include/asm/arch-imx8/sci/sci.h          |  86 +++
 arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h |  30 +
 arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h  |  57 ++
 arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h   |  44 ++
 arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h   |  69 ++
 arch/arm/include/asm/arch-imx8/sci/types.h        | 220 +++++++
 arch/arm/include/asm/arch-imx8/sys_proto.h        |  19 +
 arch/arm/include/asm/armv8/cpu.h                  |  26 +
 arch/arm/include/asm/global_data.h                |   4 +
 arch/arm/include/asm/mach-imx/boot_mode.h         |   1 +
 arch/arm/include/asm/mach-imx/sys_proto.h         |   3 +
 arch/arm/mach-imx/Makefile                        |   1 +
 arch/arm/mach-imx/imx8/Kconfig                    |  26 +
 arch/arm/mach-imx/imx8/Makefile                   |   7 +
 arch/arm/mach-imx/imx8/clock.c                    |  21 +
 arch/arm/mach-imx/imx8/cpu.c                      | 544 ++++++++++++++++
 arch/arm/mach-imx/imx8/iomux.c                    |  43 ++
 board/freescale/imx8qxp_mek/Kconfig               |  14 +
 board/freescale/imx8qxp_mek/MAINTAINERS           |   6 +
 board/freescale/imx8qxp_mek/Makefile              |   7 +
 board/freescale/imx8qxp_mek/README                |  72 ++
 board/freescale/imx8qxp_mek/imx8qxp_mek.c         | 152 +++++
 board/freescale/mx8mq_evk/README                  |  81 +++
 configs/imx8qxp_mek_defconfig                     |  38 ++
 drivers/clk/Kconfig                               |   1 +
 drivers/clk/Makefile                              |   1 +
 drivers/clk/imx/Kconfig                           |   6 +
 drivers/clk/imx/Makefile                          |   5 +
 drivers/clk/imx/clk-imx8.c                        | 212 ++++++
 drivers/gpio/mxc_gpio.c                           |  30 +-
 drivers/misc/Makefile                             |   1 +
 drivers/misc/imx8/Makefile                        |   3 +
 drivers/misc/imx8/scu.c                           | 266 ++++++++
 drivers/misc/imx8/scu_api.c                       | 316 +++++++++
 drivers/mmc/fsl_esdhc.c                           |  30 +-
 drivers/pinctrl/nxp/Kconfig                       |  18 +
 drivers/pinctrl/nxp/Makefile                      |   2 +
 drivers/pinctrl/nxp/pinctrl-imx.c                 | 209 +++---
 drivers/pinctrl/nxp/pinctrl-imx.h                 |  16 +
 drivers/pinctrl/nxp/pinctrl-imx8.c                |  40 ++
 drivers/pinctrl/nxp/pinctrl-scu.c                 |  66 ++
 drivers/power/domain/Kconfig                      |   8 +-
 drivers/power/domain/Makefile                     |   1 +
 drivers/power/domain/imx8-power-domain.c          | 315 +++++++++
 drivers/serial/serial_lpuart.c                    | 126 +++-
 include/configs/imx8qxp_mek.h                     | 156 +++++
 include/dt-bindings/clock/imx8qxp-clock.h         | 583 +++++++++++++++++
 include/dt-bindings/pinctrl/pads-imx8qxp.h        | 757 ++++++++++++++++++++++
 include/dt-bindings/soc/imx8_pd.h                 | 188 ++++++
 include/dt-bindings/soc/imx_rsrc.h                | 557 ++++++++++++++++
 include/fsl_lpuart.h                              |   2 +-
 67 files changed, 6399 insertions(+), 142 deletions(-)
 create mode 100644 arch/arm/dts/fsl-imx8-ca35.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8dx.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8dxp.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8qxp-mek.dts
 create mode 100644 arch/arm/dts/fsl-imx8qxp.dtsi
 create mode 100644 arch/arm/include/asm/arch-imx8/clock.h
 create mode 100644 arch/arm/include/asm/arch-imx8/gpio.h
 create mode 100644 arch/arm/include/asm/arch-imx8/imx-regs.h
 create mode 100644 arch/arm/include/asm/arch-imx8/imx8-pins.h
 create mode 100644 arch/arm/include/asm/arch-imx8/iomux.h
 create mode 100644 arch/arm/include/asm/arch-imx8/power-domain.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/rpc.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/sci.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/types.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sys_proto.h
 create mode 100644 arch/arm/include/asm/armv8/cpu.h
 create mode 100644 arch/arm/mach-imx/imx8/Kconfig
 create mode 100644 arch/arm/mach-imx/imx8/Makefile
 create mode 100644 arch/arm/mach-imx/imx8/clock.c
 create mode 100644 arch/arm/mach-imx/imx8/cpu.c
 create mode 100644 arch/arm/mach-imx/imx8/iomux.c
 create mode 100644 board/freescale/imx8qxp_mek/Kconfig
 create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
 create mode 100644 board/freescale/imx8qxp_mek/Makefile
 create mode 100644 board/freescale/imx8qxp_mek/README
 create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
 create mode 100644 board/freescale/mx8mq_evk/README
 create mode 100644 configs/imx8qxp_mek_defconfig
 create mode 100644 drivers/clk/imx/Kconfig
 create mode 100644 drivers/clk/imx/Makefile
 create mode 100644 drivers/clk/imx/clk-imx8.c
 create mode 100644 drivers/misc/imx8/Makefile
 create mode 100644 drivers/misc/imx8/scu.c
 create mode 100644 drivers/misc/imx8/scu_api.c
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx8.c
 create mode 100644 drivers/pinctrl/nxp/pinctrl-scu.c
 create mode 100644 drivers/power/domain/imx8-power-domain.c
 create mode 100644 include/configs/imx8qxp_mek.h
 create mode 100644 include/dt-bindings/clock/imx8qxp-clock.h
 create mode 100644 include/dt-bindings/pinctrl/pads-imx8qxp.h
 create mode 100644 include/dt-bindings/soc/imx8_pd.h
 create mode 100644 include/dt-bindings/soc/imx_rsrc.h

-- 
2.14.1

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

* [U-Boot] [PATCH V5 01/32] dt-bindings: pinctrl: add i.MX8QXP pads definition
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 02/32] dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition Peng Fan
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8QXP pads definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 include/dt-bindings/pinctrl/pads-imx8qxp.h | 757 +++++++++++++++++++++++++++++
 1 file changed, 757 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/pads-imx8qxp.h

diff --git a/include/dt-bindings/pinctrl/pads-imx8qxp.h b/include/dt-bindings/pinctrl/pads-imx8qxp.h
new file mode 100644
index 0000000000..41f4fe564c
--- /dev/null
+++ b/include/dt-bindings/pinctrl/pads-imx8qxp.h
@@ -0,0 +1,757 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef _SC_PADS_H
+#define _SC_PADS_H
+
+#define SC_P_PCIE_CTRL0_PERST_B                  0	/* HSIO.PCIE0.PERST_B, LSIO.GPIO4.IO00 */
+#define SC_P_PCIE_CTRL0_CLKREQ_B                 1	/* HSIO.PCIE0.CLKREQ_B, LSIO.GPIO4.IO01 */
+#define SC_P_PCIE_CTRL0_WAKE_B                   2	/* HSIO.PCIE0.WAKE_B, LSIO.GPIO4.IO02 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_PCIESEP       3	/*  */
+#define SC_P_USB_SS3_TC0                         4	/* ADMA.I2C1.SCL, CONN.USB_OTG1.PWR, CONN.USB_OTG2.PWR, LSIO.GPIO4.IO03 */
+#define SC_P_USB_SS3_TC1                         5	/* ADMA.I2C1.SCL, CONN.USB_OTG2.PWR, LSIO.GPIO4.IO04 */
+#define SC_P_USB_SS3_TC2                         6	/* ADMA.I2C1.SDA, CONN.USB_OTG1.OC, CONN.USB_OTG2.OC, LSIO.GPIO4.IO05 */
+#define SC_P_USB_SS3_TC3                         7	/* ADMA.I2C1.SDA, CONN.USB_OTG2.OC, LSIO.GPIO4.IO06 */
+#define SC_P_COMP_CTL_GPIO_3V3_USB3IO            8	/*  */
+#define SC_P_EMMC0_CLK                           9	/* CONN.EMMC0.CLK, CONN.NAND.READY_B, LSIO.GPIO4.IO07 */
+#define SC_P_EMMC0_CMD                           10	/* CONN.EMMC0.CMD, CONN.NAND.DQS, LSIO.GPIO4.IO08 */
+#define SC_P_EMMC0_DATA0                         11	/* CONN.EMMC0.DATA0, CONN.NAND.DATA00, LSIO.GPIO4.IO09 */
+#define SC_P_EMMC0_DATA1                         12	/* CONN.EMMC0.DATA1, CONN.NAND.DATA01, LSIO.GPIO4.IO10 */
+#define SC_P_EMMC0_DATA2                         13	/* CONN.EMMC0.DATA2, CONN.NAND.DATA02, LSIO.GPIO4.IO11 */
+#define SC_P_EMMC0_DATA3                         14	/* CONN.EMMC0.DATA3, CONN.NAND.DATA03, LSIO.GPIO4.IO12 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_SD1FIX0       15	/*  */
+#define SC_P_EMMC0_DATA4                         16	/* CONN.EMMC0.DATA4, CONN.NAND.DATA04, CONN.EMMC0.WP, LSIO.GPIO4.IO13 */
+#define SC_P_EMMC0_DATA5                         17	/* CONN.EMMC0.DATA5, CONN.NAND.DATA05, CONN.EMMC0.VSELECT, LSIO.GPIO4.IO14 */
+#define SC_P_EMMC0_DATA6                         18	/* CONN.EMMC0.DATA6, CONN.NAND.DATA06, CONN.MLB.CLK, LSIO.GPIO4.IO15 */
+#define SC_P_EMMC0_DATA7                         19	/* CONN.EMMC0.DATA7, CONN.NAND.DATA07, CONN.MLB.SIG, LSIO.GPIO4.IO16 */
+#define SC_P_EMMC0_STROBE                        20	/* CONN.EMMC0.STROBE, CONN.NAND.CLE, CONN.MLB.DATA, LSIO.GPIO4.IO17 */
+#define SC_P_EMMC0_RESET_B                       21	/* CONN.EMMC0.RESET_B, CONN.NAND.WP_B, LSIO.GPIO4.IO18 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_SD1FIX1       22	/*  */
+#define SC_P_USDHC1_RESET_B                      23	/* CONN.USDHC1.RESET_B, CONN.NAND.RE_N, ADMA.SPI2.SCK, LSIO.GPIO4.IO19 */
+#define SC_P_USDHC1_VSELECT                      24	/* CONN.USDHC1.VSELECT, CONN.NAND.RE_P, ADMA.SPI2.SDO, CONN.NAND.RE_B, LSIO.GPIO4.IO20 */
+#define SC_P_CTL_NAND_RE_P_N                     25	/*  */
+#define SC_P_USDHC1_WP                           26	/* CONN.USDHC1.WP, CONN.NAND.DQS_N, ADMA.SPI2.SDI, LSIO.GPIO4.IO21 */
+#define SC_P_USDHC1_CD_B                         27	/* CONN.USDHC1.CD_B, CONN.NAND.DQS_P, ADMA.SPI2.CS0, CONN.NAND.DQS, LSIO.GPIO4.IO22 */
+#define SC_P_CTL_NAND_DQS_P_N                    28	/*  */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_VSELSEP       29	/*  */
+#define SC_P_USDHC1_CLK                          30	/* CONN.USDHC1.CLK, ADMA.UART3.RX, LSIO.GPIO4.IO23 */
+#define SC_P_USDHC1_CMD                          31	/* CONN.USDHC1.CMD, CONN.NAND.CE0_B, ADMA.MQS.R, LSIO.GPIO4.IO24 */
+#define SC_P_USDHC1_DATA0                        32	/* CONN.USDHC1.DATA0, CONN.NAND.CE1_B, ADMA.MQS.L, LSIO.GPIO4.IO25 */
+#define SC_P_USDHC1_DATA1                        33	/* CONN.USDHC1.DATA1, CONN.NAND.RE_B, ADMA.UART3.TX, LSIO.GPIO4.IO26 */
+#define SC_P_USDHC1_DATA2                        34	/* CONN.USDHC1.DATA2, CONN.NAND.WE_B, ADMA.UART3.CTS_B, LSIO.GPIO4.IO27 */
+#define SC_P_USDHC1_DATA3                        35	/* CONN.USDHC1.DATA3, CONN.NAND.ALE, ADMA.UART3.RTS_B, LSIO.GPIO4.IO28 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_VSEL3         36	/*  */
+#define SC_P_ENET0_RGMII_TXC                     37	/* CONN.ENET0.RGMII_TXC, CONN.ENET0.RCLK50M_OUT, CONN.ENET0.RCLK50M_IN, CONN.NAND.CE1_B, LSIO.GPIO4.IO29 */
+#define SC_P_ENET0_RGMII_TX_CTL                  38	/* CONN.ENET0.RGMII_TX_CTL, CONN.USDHC1.RESET_B, LSIO.GPIO4.IO30 */
+#define SC_P_ENET0_RGMII_TXD0                    39	/* CONN.ENET0.RGMII_TXD0, CONN.USDHC1.VSELECT, LSIO.GPIO4.IO31 */
+#define SC_P_ENET0_RGMII_TXD1                    40	/* CONN.ENET0.RGMII_TXD1, CONN.USDHC1.WP, LSIO.GPIO5.IO00 */
+#define SC_P_ENET0_RGMII_TXD2                    41	/* CONN.ENET0.RGMII_TXD2, CONN.MLB.CLK, CONN.NAND.CE0_B, CONN.USDHC1.CD_B, LSIO.GPIO5.IO01 */
+#define SC_P_ENET0_RGMII_TXD3                    42	/* CONN.ENET0.RGMII_TXD3, CONN.MLB.SIG, CONN.NAND.RE_B, LSIO.GPIO5.IO02 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0   43	/*  */
+#define SC_P_ENET0_RGMII_RXC                     44	/* CONN.ENET0.RGMII_RXC, CONN.MLB.DATA, CONN.NAND.WE_B, CONN.USDHC1.CLK, LSIO.GPIO5.IO03 */
+#define SC_P_ENET0_RGMII_RX_CTL                  45	/* CONN.ENET0.RGMII_RX_CTL, CONN.USDHC1.CMD, LSIO.GPIO5.IO04 */
+#define SC_P_ENET0_RGMII_RXD0                    46	/* CONN.ENET0.RGMII_RXD0, CONN.USDHC1.DATA0, LSIO.GPIO5.IO05 */
+#define SC_P_ENET0_RGMII_RXD1                    47	/* CONN.ENET0.RGMII_RXD1, CONN.USDHC1.DATA1, LSIO.GPIO5.IO06 */
+#define SC_P_ENET0_RGMII_RXD2                    48	/* CONN.ENET0.RGMII_RXD2, CONN.ENET0.RMII_RX_ER, CONN.USDHC1.DATA2, LSIO.GPIO5.IO07 */
+#define SC_P_ENET0_RGMII_RXD3                    49	/* CONN.ENET0.RGMII_RXD3, CONN.NAND.ALE, CONN.USDHC1.DATA3, LSIO.GPIO5.IO08 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1   50	/*  */
+#define SC_P_ENET0_REFCLK_125M_25M               51	/* CONN.ENET0.REFCLK_125M_25M, CONN.ENET0.PPS, CONN.ENET1.PPS, LSIO.GPIO5.IO09 */
+#define SC_P_ENET0_MDIO                          52	/* CONN.ENET0.MDIO, ADMA.I2C3.SDA, CONN.ENET1.MDIO, LSIO.GPIO5.IO10 */
+#define SC_P_ENET0_MDC                           53	/* CONN.ENET0.MDC, ADMA.I2C3.SCL, CONN.ENET1.MDC, LSIO.GPIO5.IO11 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIOCT        54	/*  */
+#define SC_P_ESAI0_FSR                           55	/* ADMA.ESAI0.FSR, CONN.ENET1.RCLK50M_OUT, ADMA.LCDIF.D00, CONN.ENET1.RGMII_TXC, CONN.ENET1.RCLK50M_IN */
+#define SC_P_ESAI0_FST                           56	/* ADMA.ESAI0.FST, CONN.MLB.CLK, ADMA.LCDIF.D01, CONN.ENET1.RGMII_TXD2, LSIO.GPIO0.IO01 */
+#define SC_P_ESAI0_SCKR                          57	/* ADMA.ESAI0.SCKR, ADMA.LCDIF.D02, CONN.ENET1.RGMII_TX_CTL, LSIO.GPIO0.IO02 */
+#define SC_P_ESAI0_SCKT                          58	/* ADMA.ESAI0.SCKT, CONN.MLB.SIG, ADMA.LCDIF.D03, CONN.ENET1.RGMII_TXD3, LSIO.GPIO0.IO03 */
+#define SC_P_ESAI0_TX0                           59	/* ADMA.ESAI0.TX0, CONN.MLB.DATA, ADMA.LCDIF.D04, CONN.ENET1.RGMII_RXC, LSIO.GPIO0.IO04 */
+#define SC_P_ESAI0_TX1                           60	/* ADMA.ESAI0.TX1, ADMA.LCDIF.D05, CONN.ENET1.RGMII_RXD3, LSIO.GPIO0.IO05 */
+#define SC_P_ESAI0_TX2_RX3                       61	/* ADMA.ESAI0.TX2_RX3, CONN.ENET1.RMII_RX_ER, ADMA.LCDIF.D06, CONN.ENET1.RGMII_RXD2, LSIO.GPIO0.IO06 */
+#define SC_P_ESAI0_TX3_RX2                       62	/* ADMA.ESAI0.TX3_RX2, ADMA.LCDIF.D07, CONN.ENET1.RGMII_RXD1, LSIO.GPIO0.IO07 */
+#define SC_P_ESAI0_TX4_RX1                       63	/* ADMA.ESAI0.TX4_RX1, ADMA.LCDIF.D08, CONN.ENET1.RGMII_TXD0, LSIO.GPIO0.IO08 */
+#define SC_P_ESAI0_TX5_RX0                       64	/* ADMA.ESAI0.TX5_RX0, ADMA.LCDIF.D09, CONN.ENET1.RGMII_TXD1, LSIO.GPIO0.IO09 */
+#define SC_P_SPDIF0_RX                           65	/* ADMA.SPDIF0.RX, ADMA.MQS.R, ADMA.LCDIF.D10, CONN.ENET1.RGMII_RXD0, LSIO.GPIO0.IO10 */
+#define SC_P_SPDIF0_TX                           66	/* ADMA.SPDIF0.TX, ADMA.MQS.L, ADMA.LCDIF.D11, CONN.ENET1.RGMII_RX_CTL, LSIO.GPIO0.IO11 */
+#define SC_P_SPDIF0_EXT_CLK                      67	/* ADMA.SPDIF0.EXT_CLK, ADMA.LCDIF.D12, CONN.ENET1.REFCLK_125M_25M, LSIO.GPIO0.IO12 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB       68	/*  */
+#define SC_P_SPI3_SCK                            69	/* ADMA.SPI3.SCK, ADMA.LCDIF.D13, LSIO.GPIO0.IO13 */
+#define SC_P_SPI3_SDO                            70	/* ADMA.SPI3.SDO, ADMA.LCDIF.D14, LSIO.GPIO0.IO14 */
+#define SC_P_SPI3_SDI                            71	/* ADMA.SPI3.SDI, ADMA.LCDIF.D15, LSIO.GPIO0.IO15 */
+#define SC_P_SPI3_CS0                            72	/* ADMA.SPI3.CS0, ADMA.ACM.MCLK_OUT1, ADMA.LCDIF.HSYNC, LSIO.GPIO0.IO16 */
+#define SC_P_SPI3_CS1                            73	/* ADMA.SPI3.CS1, ADMA.I2C3.SCL, ADMA.LCDIF.RESET, ADMA.SPI2.CS0, ADMA.LCDIF.D16 */
+#define SC_P_MCLK_IN1                            74	/* ADMA.ACM.MCLK_IN1, ADMA.I2C3.SDA, ADMA.LCDIF.EN, ADMA.SPI2.SCK, ADMA.LCDIF.D17 */
+#define SC_P_MCLK_IN0                            75	/* ADMA.ACM.MCLK_IN0, ADMA.ESAI0.RX_HF_CLK, ADMA.LCDIF.VSYNC, ADMA.SPI2.SDI, LSIO.GPIO0.IO19 */
+#define SC_P_MCLK_OUT0                           76	/* ADMA.ACM.MCLK_OUT0, ADMA.ESAI0.TX_HF_CLK, ADMA.LCDIF.CLK, ADMA.SPI2.SDO, LSIO.GPIO0.IO20 */
+#define SC_P_UART1_TX                            77	/* ADMA.UART1.TX, LSIO.PWM0.OUT, LSIO.GPT0.CAPTURE, LSIO.GPIO0.IO21 */
+#define SC_P_UART1_RX                            78	/* ADMA.UART1.RX, LSIO.PWM1.OUT, LSIO.GPT0.COMPARE, LSIO.GPT1.CLK, LSIO.GPIO0.IO22 */
+#define SC_P_UART1_RTS_B                         79	/* ADMA.UART1.RTS_B, LSIO.PWM2.OUT, ADMA.LCDIF.D16, LSIO.GPT1.CAPTURE, LSIO.GPT0.CLK */
+#define SC_P_UART1_CTS_B                         80	/* ADMA.UART1.CTS_B, LSIO.PWM3.OUT, ADMA.LCDIF.D17, LSIO.GPT1.COMPARE, LSIO.GPIO0.IO24 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHK       81	/*  */
+#define SC_P_SAI0_TXD                            82	/* ADMA.SAI0.TXD, ADMA.SAI1.RXC, ADMA.SPI1.SDO, ADMA.LCDIF.D18, LSIO.GPIO0.IO25 */
+#define SC_P_SAI0_TXC                            83	/* ADMA.SAI0.TXC, ADMA.SAI1.TXD, ADMA.SPI1.SDI, ADMA.LCDIF.D19, LSIO.GPIO0.IO26 */
+#define SC_P_SAI0_RXD                            84	/* ADMA.SAI0.RXD, ADMA.SAI1.RXFS, ADMA.SPI1.CS0, ADMA.LCDIF.D20, LSIO.GPIO0.IO27 */
+#define SC_P_SAI0_TXFS                           85	/* ADMA.SAI0.TXFS, ADMA.SPI2.CS1, ADMA.SPI1.SCK, LSIO.GPIO0.IO28 */
+#define SC_P_SAI1_RXD                            86	/* ADMA.SAI1.RXD, ADMA.SAI0.RXFS, ADMA.SPI1.CS1, ADMA.LCDIF.D21, LSIO.GPIO0.IO29 */
+#define SC_P_SAI1_RXC                            87	/* ADMA.SAI1.RXC, ADMA.SAI1.TXC, ADMA.LCDIF.D22, LSIO.GPIO0.IO30 */
+#define SC_P_SAI1_RXFS                           88	/* ADMA.SAI1.RXFS, ADMA.SAI1.TXFS, ADMA.LCDIF.D23, LSIO.GPIO0.IO31 */
+#define SC_P_SPI2_CS0                            89	/* ADMA.SPI2.CS0, LSIO.GPIO1.IO00 */
+#define SC_P_SPI2_SDO                            90	/* ADMA.SPI2.SDO, LSIO.GPIO1.IO01 */
+#define SC_P_SPI2_SDI                            91	/* ADMA.SPI2.SDI, LSIO.GPIO1.IO02 */
+#define SC_P_SPI2_SCK                            92	/* ADMA.SPI2.SCK, LSIO.GPIO1.IO03 */
+#define SC_P_SPI0_SCK                            93	/* ADMA.SPI0.SCK, ADMA.SAI0.TXC, M40.I2C0.SCL, M40.GPIO0.IO00, LSIO.GPIO1.IO04 */
+#define SC_P_SPI0_SDI                            94	/* ADMA.SPI0.SDI, ADMA.SAI0.TXD, M40.TPM0.CH0, M40.GPIO0.IO02, LSIO.GPIO1.IO05 */
+#define SC_P_SPI0_SDO                            95	/* ADMA.SPI0.SDO, ADMA.SAI0.TXFS, M40.I2C0.SDA, M40.GPIO0.IO01, LSIO.GPIO1.IO06 */
+#define SC_P_SPI0_CS1                            96	/* ADMA.SPI0.CS1, ADMA.SAI0.RXC, ADMA.SAI1.TXD, ADMA.LCD_PWM0.OUT, LSIO.GPIO1.IO07 */
+#define SC_P_SPI0_CS0                            97	/* ADMA.SPI0.CS0, ADMA.SAI0.RXD, M40.TPM0.CH1, M40.GPIO0.IO03, LSIO.GPIO1.IO08 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHT       98	/*  */
+#define SC_P_ADC_IN1                             99	/* ADMA.ADC.IN1, M40.I2C0.SDA, M40.GPIO0.IO01, LSIO.GPIO1.IO09 */
+#define SC_P_ADC_IN0                             100	/* ADMA.ADC.IN0, M40.I2C0.SCL, M40.GPIO0.IO00, LSIO.GPIO1.IO10 */
+#define SC_P_ADC_IN3                             101	/* ADMA.ADC.IN3, M40.UART0.TX, M40.GPIO0.IO03, ADMA.ACM.MCLK_OUT0, LSIO.GPIO1.IO11 */
+#define SC_P_ADC_IN2                             102	/* ADMA.ADC.IN2, M40.UART0.RX, M40.GPIO0.IO02, ADMA.ACM.MCLK_IN0, LSIO.GPIO1.IO12 */
+#define SC_P_ADC_IN5                             103	/* ADMA.ADC.IN5, M40.TPM0.CH1, M40.GPIO0.IO05, LSIO.GPIO1.IO13 */
+#define SC_P_ADC_IN4                             104	/* ADMA.ADC.IN4, M40.TPM0.CH0, M40.GPIO0.IO04, LSIO.GPIO1.IO14 */
+#define SC_P_FLEXCAN0_RX                         105	/* ADMA.FLEXCAN0.RX, ADMA.SAI2.RXC, ADMA.UART0.RTS_B, ADMA.SAI1.TXC, LSIO.GPIO1.IO15 */
+#define SC_P_FLEXCAN0_TX                         106	/* ADMA.FLEXCAN0.TX, ADMA.SAI2.RXD, ADMA.UART0.CTS_B, ADMA.SAI1.TXFS, LSIO.GPIO1.IO16 */
+#define SC_P_FLEXCAN1_RX                         107	/* ADMA.FLEXCAN1.RX, ADMA.SAI2.RXFS, ADMA.FTM.CH2, ADMA.SAI1.TXD, LSIO.GPIO1.IO17 */
+#define SC_P_FLEXCAN1_TX                         108	/* ADMA.FLEXCAN1.TX, ADMA.SAI3.RXC, ADMA.DMA0.REQ_IN0, ADMA.SAI1.RXD, LSIO.GPIO1.IO18 */
+#define SC_P_FLEXCAN2_RX                         109	/* ADMA.FLEXCAN2.RX, ADMA.SAI3.RXD, ADMA.UART3.RX, ADMA.SAI1.RXFS, LSIO.GPIO1.IO19 */
+#define SC_P_FLEXCAN2_TX                         110	/* ADMA.FLEXCAN2.TX, ADMA.SAI3.RXFS, ADMA.UART3.TX, ADMA.SAI1.RXC, LSIO.GPIO1.IO20 */
+#define SC_P_UART0_RX                            111	/* ADMA.UART0.RX, ADMA.MQS.R, ADMA.FLEXCAN0.RX, SCU.UART0.RX, LSIO.GPIO1.IO21 */
+#define SC_P_UART0_TX                            112	/* ADMA.UART0.TX, ADMA.MQS.L, ADMA.FLEXCAN0.TX, SCU.UART0.TX, LSIO.GPIO1.IO22 */
+#define SC_P_UART2_TX                            113	/* ADMA.UART2.TX, ADMA.FTM.CH1, ADMA.FLEXCAN1.TX, LSIO.GPIO1.IO23 */
+#define SC_P_UART2_RX                            114	/* ADMA.UART2.RX, ADMA.FTM.CH0, ADMA.FLEXCAN1.RX, LSIO.GPIO1.IO24 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIOLH        115	/*  */
+#define SC_P_MIPI_DSI0_I2C0_SCL                  116	/* MIPI_DSI0.I2C0.SCL, MIPI_DSI1.GPIO0.IO02, LSIO.GPIO1.IO25 */
+#define SC_P_MIPI_DSI0_I2C0_SDA                  117	/* MIPI_DSI0.I2C0.SDA, MIPI_DSI1.GPIO0.IO03, LSIO.GPIO1.IO26 */
+#define SC_P_MIPI_DSI0_GPIO0_00                  118	/* MIPI_DSI0.GPIO0.IO00, ADMA.I2C1.SCL, MIPI_DSI0.PWM0.OUT, LSIO.GPIO1.IO27 */
+#define SC_P_MIPI_DSI0_GPIO0_01                  119	/* MIPI_DSI0.GPIO0.IO01, ADMA.I2C1.SDA, LSIO.GPIO1.IO28 */
+#define SC_P_MIPI_DSI1_I2C0_SCL                  120	/* MIPI_DSI1.I2C0.SCL, MIPI_DSI0.GPIO0.IO02, LSIO.GPIO1.IO29 */
+#define SC_P_MIPI_DSI1_I2C0_SDA                  121	/* MIPI_DSI1.I2C0.SDA, MIPI_DSI0.GPIO0.IO03, LSIO.GPIO1.IO30 */
+#define SC_P_MIPI_DSI1_GPIO0_00                  122	/* MIPI_DSI1.GPIO0.IO00, ADMA.I2C2.SCL, MIPI_DSI1.PWM0.OUT, LSIO.GPIO1.IO31 */
+#define SC_P_MIPI_DSI1_GPIO0_01                  123	/* MIPI_DSI1.GPIO0.IO01, ADMA.I2C2.SDA, LSIO.GPIO2.IO00 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_MIPIDSIGPIO   124	/*  */
+#define SC_P_JTAG_TRST_B                         125	/* SCU.JTAG.TRST_B, SCU.WDOG0.WDOG_OUT */
+#define SC_P_PMIC_I2C_SCL                        126	/* SCU.PMIC_I2C.SCL, SCU.GPIO0.IOXX_PMIC_A35_ON, LSIO.GPIO2.IO01 */
+#define SC_P_PMIC_I2C_SDA                        127	/* SCU.PMIC_I2C.SDA, SCU.GPIO0.IOXX_PMIC_GPU_ON, LSIO.GPIO2.IO02 */
+#define SC_P_PMIC_INT_B                          128	/* SCU.DSC.PMIC_INT_B */
+#define SC_P_SCU_GPIO0_00                        129	/* SCU.GPIO0.IO00, SCU.UART0.RX, M40.UART0.RX, ADMA.UART3.RX, LSIO.GPIO2.IO03 */
+#define SC_P_SCU_GPIO0_01                        130	/* SCU.GPIO0.IO01, SCU.UART0.TX, M40.UART0.TX, ADMA.UART3.TX, SCU.WDOG0.WDOG_OUT */
+#define SC_P_SCU_PMIC_STANDBY                    131	/* SCU.DSC.PMIC_STANDBY */
+#define SC_P_SCU_BOOT_MODE0                      132	/* SCU.DSC.BOOT_MODE0 */
+#define SC_P_SCU_BOOT_MODE1                      133	/* SCU.DSC.BOOT_MODE1 */
+#define SC_P_SCU_BOOT_MODE2                      134	/* SCU.DSC.BOOT_MODE2, SCU.PMIC_I2C.SDA */
+#define SC_P_SCU_BOOT_MODE3                      135	/* SCU.DSC.BOOT_MODE3, SCU.PMIC_I2C.SCL, SCU.DSC.RTC_CLOCK_OUTPUT_32K */
+#define SC_P_CSI_D00                             136	/* CI_PI.D02, ADMA.SAI0.RXC */
+#define SC_P_CSI_D01                             137	/* CI_PI.D03, ADMA.SAI0.RXD */
+#define SC_P_CSI_D02                             138	/* CI_PI.D04, ADMA.SAI0.RXFS */
+#define SC_P_CSI_D03                             139	/* CI_PI.D05, ADMA.SAI2.RXC */
+#define SC_P_CSI_D04                             140	/* CI_PI.D06, ADMA.SAI2.RXD */
+#define SC_P_CSI_D05                             141	/* CI_PI.D07, ADMA.SAI2.RXFS */
+#define SC_P_CSI_D06                             142	/* CI_PI.D08, ADMA.SAI3.RXC */
+#define SC_P_CSI_D07                             143	/* CI_PI.D09, ADMA.SAI3.RXD */
+#define SC_P_CSI_HSYNC                           144	/* CI_PI.HSYNC, CI_PI.D00, ADMA.SAI3.RXFS */
+#define SC_P_CSI_VSYNC                           145	/* CI_PI.VSYNC, CI_PI.D01 */
+#define SC_P_CSI_PCLK                            146	/* CI_PI.PCLK, MIPI_CSI0.I2C0.SCL, ADMA.SPI1.SCK, LSIO.GPIO3.IO00 */
+#define SC_P_CSI_MCLK                            147	/* CI_PI.MCLK, MIPI_CSI0.I2C0.SDA, ADMA.SPI1.SDO, LSIO.GPIO3.IO01 */
+#define SC_P_CSI_EN                              148	/* CI_PI.EN, CI_PI.I2C.SCL, ADMA.I2C3.SCL, ADMA.SPI1.SDI, LSIO.GPIO3.IO02 */
+#define SC_P_CSI_RESET                           149	/* CI_PI.RESET, CI_PI.I2C.SDA, ADMA.I2C3.SDA, ADMA.SPI1.CS0, LSIO.GPIO3.IO03 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHD       150	/*  */
+#define SC_P_MIPI_CSI0_MCLK_OUT                  151	/* MIPI_CSI0.ACM.MCLK_OUT, LSIO.GPIO3.IO04 */
+#define SC_P_MIPI_CSI0_I2C0_SCL                  152	/* MIPI_CSI0.I2C0.SCL, MIPI_CSI0.GPIO0.IO02, LSIO.GPIO3.IO05 */
+#define SC_P_MIPI_CSI0_I2C0_SDA                  153	/* MIPI_CSI0.I2C0.SDA, MIPI_CSI0.GPIO0.IO03, LSIO.GPIO3.IO06 */
+#define SC_P_MIPI_CSI0_GPIO0_01                  154	/* MIPI_CSI0.GPIO0.IO01, ADMA.I2C0.SDA, LSIO.GPIO3.IO07 */
+#define SC_P_MIPI_CSI0_GPIO0_00                  155	/* MIPI_CSI0.GPIO0.IO00, ADMA.I2C0.SCL, LSIO.GPIO3.IO08 */
+#define SC_P_QSPI0A_DATA0                        156	/* LSIO.QSPI0A.DATA0, LSIO.GPIO3.IO09 */
+#define SC_P_QSPI0A_DATA1                        157	/* LSIO.QSPI0A.DATA1, LSIO.GPIO3.IO10 */
+#define SC_P_QSPI0A_DATA2                        158	/* LSIO.QSPI0A.DATA2, LSIO.GPIO3.IO11 */
+#define SC_P_QSPI0A_DATA3                        159	/* LSIO.QSPI0A.DATA3, LSIO.GPIO3.IO12 */
+#define SC_P_QSPI0A_DQS                          160	/* LSIO.QSPI0A.DQS, LSIO.GPIO3.IO13 */
+#define SC_P_QSPI0A_SS0_B                        161	/* LSIO.QSPI0A.SS0_B, LSIO.GPIO3.IO14 */
+#define SC_P_QSPI0A_SS1_B                        162	/* LSIO.QSPI0A.SS1_B, LSIO.GPIO3.IO15 */
+#define SC_P_QSPI0A_SCLK                         163	/* LSIO.QSPI0A.SCLK, LSIO.GPIO3.IO16 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_QSPI0A        164	/*  */
+#define SC_P_QSPI0B_SCLK                         165	/* LSIO.QSPI0B.SCLK, LSIO.QSPI1A.SCLK, LSIO.KPP0.COL0, LSIO.GPIO3.IO17 */
+#define SC_P_QSPI0B_DATA0                        166	/* LSIO.QSPI0B.DATA0, LSIO.QSPI1A.DATA0, LSIO.KPP0.COL1, LSIO.GPIO3.IO18 */
+#define SC_P_QSPI0B_DATA1                        167	/* LSIO.QSPI0B.DATA1, LSIO.QSPI1A.DATA1, LSIO.KPP0.COL2, LSIO.GPIO3.IO19 */
+#define SC_P_QSPI0B_DATA2                        168	/* LSIO.QSPI0B.DATA2, LSIO.QSPI1A.DATA2, LSIO.KPP0.COL3, LSIO.GPIO3.IO20 */
+#define SC_P_QSPI0B_DATA3                        169	/* LSIO.QSPI0B.DATA3, LSIO.QSPI1A.DATA3, LSIO.KPP0.ROW0, LSIO.GPIO3.IO21 */
+#define SC_P_QSPI0B_DQS                          170	/* LSIO.QSPI0B.DQS, LSIO.QSPI1A.DQS, LSIO.KPP0.ROW1, LSIO.GPIO3.IO22 */
+#define SC_P_QSPI0B_SS0_B                        171	/* LSIO.QSPI0B.SS0_B, LSIO.QSPI1A.SS0_B, LSIO.KPP0.ROW2, LSIO.GPIO3.IO23 */
+#define SC_P_QSPI0B_SS1_B                        172	/* LSIO.QSPI0B.SS1_B, LSIO.QSPI1A.SS1_B, LSIO.KPP0.ROW3, LSIO.GPIO3.IO24 */
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_QSPI0B        173	/*  */
+/*@}*/
+
+/*!
+ * @name Pad Mux Definitions
+ * format: name padid padmux
+ */
+/*@{*/
+#define SC_P_PCIE_CTRL0_PERST_B_HSIO_PCIE0_PERST_B              SC_P_PCIE_CTRL0_PERST_B            0
+#define SC_P_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00                 SC_P_PCIE_CTRL0_PERST_B            4
+#define SC_P_PCIE_CTRL0_CLKREQ_B_HSIO_PCIE0_CLKREQ_B            SC_P_PCIE_CTRL0_CLKREQ_B           0
+#define SC_P_PCIE_CTRL0_CLKREQ_B_LSIO_GPIO4_IO01                SC_P_PCIE_CTRL0_CLKREQ_B           4
+#define SC_P_PCIE_CTRL0_WAKE_B_HSIO_PCIE0_WAKE_B                SC_P_PCIE_CTRL0_WAKE_B             0
+#define SC_P_PCIE_CTRL0_WAKE_B_LSIO_GPIO4_IO02                  SC_P_PCIE_CTRL0_WAKE_B             4
+#define SC_P_USB_SS3_TC0_ADMA_I2C1_SCL                          SC_P_USB_SS3_TC0                   0
+#define SC_P_USB_SS3_TC0_CONN_USB_OTG1_PWR                      SC_P_USB_SS3_TC0                   1
+#define SC_P_USB_SS3_TC0_CONN_USB_OTG2_PWR                      SC_P_USB_SS3_TC0                   2
+#define SC_P_USB_SS3_TC0_LSIO_GPIO4_IO03                        SC_P_USB_SS3_TC0                   4
+#define SC_P_USB_SS3_TC1_ADMA_I2C1_SCL                          SC_P_USB_SS3_TC1                   0
+#define SC_P_USB_SS3_TC1_CONN_USB_OTG2_PWR                      SC_P_USB_SS3_TC1                   1
+#define SC_P_USB_SS3_TC1_LSIO_GPIO4_IO04                        SC_P_USB_SS3_TC1                   4
+#define SC_P_USB_SS3_TC2_ADMA_I2C1_SDA                          SC_P_USB_SS3_TC2                   0
+#define SC_P_USB_SS3_TC2_CONN_USB_OTG1_OC                       SC_P_USB_SS3_TC2                   1
+#define SC_P_USB_SS3_TC2_CONN_USB_OTG2_OC                       SC_P_USB_SS3_TC2                   2
+#define SC_P_USB_SS3_TC2_LSIO_GPIO4_IO05                        SC_P_USB_SS3_TC2                   4
+#define SC_P_USB_SS3_TC3_ADMA_I2C1_SDA                          SC_P_USB_SS3_TC3                   0
+#define SC_P_USB_SS3_TC3_CONN_USB_OTG2_OC                       SC_P_USB_SS3_TC3                   1
+#define SC_P_USB_SS3_TC3_LSIO_GPIO4_IO06                        SC_P_USB_SS3_TC3                   4
+#define SC_P_EMMC0_CLK_CONN_EMMC0_CLK                           SC_P_EMMC0_CLK                     0
+#define SC_P_EMMC0_CLK_CONN_NAND_READY_B                        SC_P_EMMC0_CLK                     1
+#define SC_P_EMMC0_CLK_LSIO_GPIO4_IO07                          SC_P_EMMC0_CLK                     4
+#define SC_P_EMMC0_CMD_CONN_EMMC0_CMD                           SC_P_EMMC0_CMD                     0
+#define SC_P_EMMC0_CMD_CONN_NAND_DQS                            SC_P_EMMC0_CMD                     1
+#define SC_P_EMMC0_CMD_LSIO_GPIO4_IO08                          SC_P_EMMC0_CMD                     4
+#define SC_P_EMMC0_DATA0_CONN_EMMC0_DATA0                       SC_P_EMMC0_DATA0                   0
+#define SC_P_EMMC0_DATA0_CONN_NAND_DATA00                       SC_P_EMMC0_DATA0                   1
+#define SC_P_EMMC0_DATA0_LSIO_GPIO4_IO09                        SC_P_EMMC0_DATA0                   4
+#define SC_P_EMMC0_DATA1_CONN_EMMC0_DATA1                       SC_P_EMMC0_DATA1                   0
+#define SC_P_EMMC0_DATA1_CONN_NAND_DATA01                       SC_P_EMMC0_DATA1                   1
+#define SC_P_EMMC0_DATA1_LSIO_GPIO4_IO10                        SC_P_EMMC0_DATA1                   4
+#define SC_P_EMMC0_DATA2_CONN_EMMC0_DATA2                       SC_P_EMMC0_DATA2                   0
+#define SC_P_EMMC0_DATA2_CONN_NAND_DATA02                       SC_P_EMMC0_DATA2                   1
+#define SC_P_EMMC0_DATA2_LSIO_GPIO4_IO11                        SC_P_EMMC0_DATA2                   4
+#define SC_P_EMMC0_DATA3_CONN_EMMC0_DATA3                       SC_P_EMMC0_DATA3                   0
+#define SC_P_EMMC0_DATA3_CONN_NAND_DATA03                       SC_P_EMMC0_DATA3                   1
+#define SC_P_EMMC0_DATA3_LSIO_GPIO4_IO12                        SC_P_EMMC0_DATA3                   4
+#define SC_P_EMMC0_DATA4_CONN_EMMC0_DATA4                       SC_P_EMMC0_DATA4                   0
+#define SC_P_EMMC0_DATA4_CONN_NAND_DATA04                       SC_P_EMMC0_DATA4                   1
+#define SC_P_EMMC0_DATA4_CONN_EMMC0_WP                          SC_P_EMMC0_DATA4                   3
+#define SC_P_EMMC0_DATA4_LSIO_GPIO4_IO13                        SC_P_EMMC0_DATA4                   4
+#define SC_P_EMMC0_DATA5_CONN_EMMC0_DATA5                       SC_P_EMMC0_DATA5                   0
+#define SC_P_EMMC0_DATA5_CONN_NAND_DATA05                       SC_P_EMMC0_DATA5                   1
+#define SC_P_EMMC0_DATA5_CONN_EMMC0_VSELECT                     SC_P_EMMC0_DATA5                   3
+#define SC_P_EMMC0_DATA5_LSIO_GPIO4_IO14                        SC_P_EMMC0_DATA5                   4
+#define SC_P_EMMC0_DATA6_CONN_EMMC0_DATA6                       SC_P_EMMC0_DATA6                   0
+#define SC_P_EMMC0_DATA6_CONN_NAND_DATA06                       SC_P_EMMC0_DATA6                   1
+#define SC_P_EMMC0_DATA6_CONN_MLB_CLK                           SC_P_EMMC0_DATA6                   3
+#define SC_P_EMMC0_DATA6_LSIO_GPIO4_IO15                        SC_P_EMMC0_DATA6                   4
+#define SC_P_EMMC0_DATA7_CONN_EMMC0_DATA7                       SC_P_EMMC0_DATA7                   0
+#define SC_P_EMMC0_DATA7_CONN_NAND_DATA07                       SC_P_EMMC0_DATA7                   1
+#define SC_P_EMMC0_DATA7_CONN_MLB_SIG                           SC_P_EMMC0_DATA7                   3
+#define SC_P_EMMC0_DATA7_LSIO_GPIO4_IO16                        SC_P_EMMC0_DATA7                   4
+#define SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE                     SC_P_EMMC0_STROBE                  0
+#define SC_P_EMMC0_STROBE_CONN_NAND_CLE                         SC_P_EMMC0_STROBE                  1
+#define SC_P_EMMC0_STROBE_CONN_MLB_DATA                         SC_P_EMMC0_STROBE                  3
+#define SC_P_EMMC0_STROBE_LSIO_GPIO4_IO17                       SC_P_EMMC0_STROBE                  4
+#define SC_P_EMMC0_RESET_B_CONN_EMMC0_RESET_B                   SC_P_EMMC0_RESET_B                 0
+#define SC_P_EMMC0_RESET_B_CONN_NAND_WP_B                       SC_P_EMMC0_RESET_B                 1
+#define SC_P_EMMC0_RESET_B_LSIO_GPIO4_IO18                      SC_P_EMMC0_RESET_B                 4
+#define SC_P_USDHC1_RESET_B_CONN_USDHC1_RESET_B                 SC_P_USDHC1_RESET_B                0
+#define SC_P_USDHC1_RESET_B_CONN_NAND_RE_N                      SC_P_USDHC1_RESET_B                1
+#define SC_P_USDHC1_RESET_B_ADMA_SPI2_SCK                       SC_P_USDHC1_RESET_B                2
+#define SC_P_USDHC1_RESET_B_LSIO_GPIO4_IO19                     SC_P_USDHC1_RESET_B                4
+#define SC_P_USDHC1_VSELECT_CONN_USDHC1_VSELECT                 SC_P_USDHC1_VSELECT                0
+#define SC_P_USDHC1_VSELECT_CONN_NAND_RE_P                      SC_P_USDHC1_VSELECT                1
+#define SC_P_USDHC1_VSELECT_ADMA_SPI2_SDO                       SC_P_USDHC1_VSELECT                2
+#define SC_P_USDHC1_VSELECT_CONN_NAND_RE_B                      SC_P_USDHC1_VSELECT                3
+#define SC_P_USDHC1_VSELECT_LSIO_GPIO4_IO20                     SC_P_USDHC1_VSELECT                4
+#define SC_P_USDHC1_WP_CONN_USDHC1_WP                           SC_P_USDHC1_WP                     0
+#define SC_P_USDHC1_WP_CONN_NAND_DQS_N                          SC_P_USDHC1_WP                     1
+#define SC_P_USDHC1_WP_ADMA_SPI2_SDI                            SC_P_USDHC1_WP                     2
+#define SC_P_USDHC1_WP_LSIO_GPIO4_IO21                          SC_P_USDHC1_WP                     4
+#define SC_P_USDHC1_CD_B_CONN_USDHC1_CD_B                       SC_P_USDHC1_CD_B                   0
+#define SC_P_USDHC1_CD_B_CONN_NAND_DQS_P                        SC_P_USDHC1_CD_B                   1
+#define SC_P_USDHC1_CD_B_ADMA_SPI2_CS0                          SC_P_USDHC1_CD_B                   2
+#define SC_P_USDHC1_CD_B_CONN_NAND_DQS                          SC_P_USDHC1_CD_B                   3
+#define SC_P_USDHC1_CD_B_LSIO_GPIO4_IO22                        SC_P_USDHC1_CD_B                   4
+#define SC_P_USDHC1_CLK_CONN_USDHC1_CLK                         SC_P_USDHC1_CLK                    0
+#define SC_P_USDHC1_CLK_ADMA_UART3_RX                           SC_P_USDHC1_CLK                    2
+#define SC_P_USDHC1_CLK_LSIO_GPIO4_IO23                         SC_P_USDHC1_CLK                    4
+#define SC_P_USDHC1_CMD_CONN_USDHC1_CMD                         SC_P_USDHC1_CMD                    0
+#define SC_P_USDHC1_CMD_CONN_NAND_CE0_B                         SC_P_USDHC1_CMD                    1
+#define SC_P_USDHC1_CMD_ADMA_MQS_R                              SC_P_USDHC1_CMD                    2
+#define SC_P_USDHC1_CMD_LSIO_GPIO4_IO24                         SC_P_USDHC1_CMD                    4
+#define SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0                     SC_P_USDHC1_DATA0                  0
+#define SC_P_USDHC1_DATA0_CONN_NAND_CE1_B                       SC_P_USDHC1_DATA0                  1
+#define SC_P_USDHC1_DATA0_ADMA_MQS_L                            SC_P_USDHC1_DATA0                  2
+#define SC_P_USDHC1_DATA0_LSIO_GPIO4_IO25                       SC_P_USDHC1_DATA0                  4
+#define SC_P_USDHC1_DATA1_CONN_USDHC1_DATA1                     SC_P_USDHC1_DATA1                  0
+#define SC_P_USDHC1_DATA1_CONN_NAND_RE_B                        SC_P_USDHC1_DATA1                  1
+#define SC_P_USDHC1_DATA1_ADMA_UART3_TX                         SC_P_USDHC1_DATA1                  2
+#define SC_P_USDHC1_DATA1_LSIO_GPIO4_IO26                       SC_P_USDHC1_DATA1                  4
+#define SC_P_USDHC1_DATA2_CONN_USDHC1_DATA2                     SC_P_USDHC1_DATA2                  0
+#define SC_P_USDHC1_DATA2_CONN_NAND_WE_B                        SC_P_USDHC1_DATA2                  1
+#define SC_P_USDHC1_DATA2_ADMA_UART3_CTS_B                      SC_P_USDHC1_DATA2                  2
+#define SC_P_USDHC1_DATA2_LSIO_GPIO4_IO27                       SC_P_USDHC1_DATA2                  4
+#define SC_P_USDHC1_DATA3_CONN_USDHC1_DATA3                     SC_P_USDHC1_DATA3                  0
+#define SC_P_USDHC1_DATA3_CONN_NAND_ALE                         SC_P_USDHC1_DATA3                  1
+#define SC_P_USDHC1_DATA3_ADMA_UART3_RTS_B                      SC_P_USDHC1_DATA3                  2
+#define SC_P_USDHC1_DATA3_LSIO_GPIO4_IO28                       SC_P_USDHC1_DATA3                  4
+#define SC_P_ENET0_RGMII_TXC_CONN_ENET0_RGMII_TXC               SC_P_ENET0_RGMII_TXC               0
+#define SC_P_ENET0_RGMII_TXC_CONN_ENET0_RCLK50M_OUT             SC_P_ENET0_RGMII_TXC               1
+#define SC_P_ENET0_RGMII_TXC_CONN_ENET0_RCLK50M_IN              SC_P_ENET0_RGMII_TXC               2
+#define SC_P_ENET0_RGMII_TXC_CONN_NAND_CE1_B                    SC_P_ENET0_RGMII_TXC               3
+#define SC_P_ENET0_RGMII_TXC_LSIO_GPIO4_IO29                    SC_P_ENET0_RGMII_TXC               4
+#define SC_P_ENET0_RGMII_TX_CTL_CONN_ENET0_RGMII_TX_CTL         SC_P_ENET0_RGMII_TX_CTL            0
+#define SC_P_ENET0_RGMII_TX_CTL_CONN_USDHC1_RESET_B             SC_P_ENET0_RGMII_TX_CTL            3
+#define SC_P_ENET0_RGMII_TX_CTL_LSIO_GPIO4_IO30                 SC_P_ENET0_RGMII_TX_CTL            4
+#define SC_P_ENET0_RGMII_TXD0_CONN_ENET0_RGMII_TXD0             SC_P_ENET0_RGMII_TXD0              0
+#define SC_P_ENET0_RGMII_TXD0_CONN_USDHC1_VSELECT               SC_P_ENET0_RGMII_TXD0              3
+#define SC_P_ENET0_RGMII_TXD0_LSIO_GPIO4_IO31                   SC_P_ENET0_RGMII_TXD0              4
+#define SC_P_ENET0_RGMII_TXD1_CONN_ENET0_RGMII_TXD1             SC_P_ENET0_RGMII_TXD1              0
+#define SC_P_ENET0_RGMII_TXD1_CONN_USDHC1_WP                    SC_P_ENET0_RGMII_TXD1              3
+#define SC_P_ENET0_RGMII_TXD1_LSIO_GPIO5_IO00                   SC_P_ENET0_RGMII_TXD1              4
+#define SC_P_ENET0_RGMII_TXD2_CONN_ENET0_RGMII_TXD2             SC_P_ENET0_RGMII_TXD2              0
+#define SC_P_ENET0_RGMII_TXD2_CONN_MLB_CLK                      SC_P_ENET0_RGMII_TXD2              1
+#define SC_P_ENET0_RGMII_TXD2_CONN_NAND_CE0_B                   SC_P_ENET0_RGMII_TXD2              2
+#define SC_P_ENET0_RGMII_TXD2_CONN_USDHC1_CD_B                  SC_P_ENET0_RGMII_TXD2              3
+#define SC_P_ENET0_RGMII_TXD2_LSIO_GPIO5_IO01                   SC_P_ENET0_RGMII_TXD2              4
+#define SC_P_ENET0_RGMII_TXD3_CONN_ENET0_RGMII_TXD3             SC_P_ENET0_RGMII_TXD3              0
+#define SC_P_ENET0_RGMII_TXD3_CONN_MLB_SIG                      SC_P_ENET0_RGMII_TXD3              1
+#define SC_P_ENET0_RGMII_TXD3_CONN_NAND_RE_B                    SC_P_ENET0_RGMII_TXD3              2
+#define SC_P_ENET0_RGMII_TXD3_LSIO_GPIO5_IO02                   SC_P_ENET0_RGMII_TXD3              4
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0_PAD              SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0	0
+#define SC_P_ENET0_RGMII_RXC_CONN_ENET0_RGMII_RXC               SC_P_ENET0_RGMII_RXC               0
+#define SC_P_ENET0_RGMII_RXC_CONN_MLB_DATA                      SC_P_ENET0_RGMII_RXC               1
+#define SC_P_ENET0_RGMII_RXC_CONN_NAND_WE_B                     SC_P_ENET0_RGMII_RXC               2
+#define SC_P_ENET0_RGMII_RXC_CONN_USDHC1_CLK                    SC_P_ENET0_RGMII_RXC               3
+#define SC_P_ENET0_RGMII_RXC_LSIO_GPIO5_IO03                    SC_P_ENET0_RGMII_RXC               4
+#define SC_P_ENET0_RGMII_RX_CTL_CONN_ENET0_RGMII_RX_CTL         SC_P_ENET0_RGMII_RX_CTL            0
+#define SC_P_ENET0_RGMII_RX_CTL_CONN_USDHC1_CMD                 SC_P_ENET0_RGMII_RX_CTL            3
+#define SC_P_ENET0_RGMII_RX_CTL_LSIO_GPIO5_IO04                 SC_P_ENET0_RGMII_RX_CTL            4
+#define SC_P_ENET0_RGMII_RXD0_CONN_ENET0_RGMII_RXD0             SC_P_ENET0_RGMII_RXD0              0
+#define SC_P_ENET0_RGMII_RXD0_CONN_USDHC1_DATA0                 SC_P_ENET0_RGMII_RXD0              3
+#define SC_P_ENET0_RGMII_RXD0_LSIO_GPIO5_IO05                   SC_P_ENET0_RGMII_RXD0              4
+#define SC_P_ENET0_RGMII_RXD1_CONN_ENET0_RGMII_RXD1             SC_P_ENET0_RGMII_RXD1              0
+#define SC_P_ENET0_RGMII_RXD1_CONN_USDHC1_DATA1                 SC_P_ENET0_RGMII_RXD1              3
+#define SC_P_ENET0_RGMII_RXD1_LSIO_GPIO5_IO06                   SC_P_ENET0_RGMII_RXD1              4
+#define SC_P_ENET0_RGMII_RXD2_CONN_ENET0_RGMII_RXD2             SC_P_ENET0_RGMII_RXD2              0
+#define SC_P_ENET0_RGMII_RXD2_CONN_ENET0_RMII_RX_ER             SC_P_ENET0_RGMII_RXD2              1
+#define SC_P_ENET0_RGMII_RXD2_CONN_USDHC1_DATA2                 SC_P_ENET0_RGMII_RXD2              3
+#define SC_P_ENET0_RGMII_RXD2_LSIO_GPIO5_IO07                   SC_P_ENET0_RGMII_RXD2              4
+#define SC_P_ENET0_RGMII_RXD3_CONN_ENET0_RGMII_RXD3             SC_P_ENET0_RGMII_RXD3              0
+#define SC_P_ENET0_RGMII_RXD3_CONN_NAND_ALE                     SC_P_ENET0_RGMII_RXD3              2
+#define SC_P_ENET0_RGMII_RXD3_CONN_USDHC1_DATA3                 SC_P_ENET0_RGMII_RXD3              3
+#define SC_P_ENET0_RGMII_RXD3_LSIO_GPIO5_IO08                   SC_P_ENET0_RGMII_RXD3              4
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1_PAD              SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1	0
+#define SC_P_ENET0_REFCLK_125M_25M_CONN_ENET0_REFCLK_125M_25M   SC_P_ENET0_REFCLK_125M_25M         0
+#define SC_P_ENET0_REFCLK_125M_25M_CONN_ENET0_PPS               SC_P_ENET0_REFCLK_125M_25M         1
+#define SC_P_ENET0_REFCLK_125M_25M_CONN_ENET1_PPS               SC_P_ENET0_REFCLK_125M_25M         2
+#define SC_P_ENET0_REFCLK_125M_25M_LSIO_GPIO5_IO09              SC_P_ENET0_REFCLK_125M_25M         4
+#define SC_P_ENET0_MDIO_CONN_ENET0_MDIO                         SC_P_ENET0_MDIO                    0
+#define SC_P_ENET0_MDIO_ADMA_I2C3_SDA                           SC_P_ENET0_MDIO                    1
+#define SC_P_ENET0_MDIO_CONN_ENET1_MDIO                         SC_P_ENET0_MDIO                    2
+#define SC_P_ENET0_MDIO_LSIO_GPIO5_IO10                         SC_P_ENET0_MDIO                    4
+#define SC_P_ENET0_MDC_CONN_ENET0_MDC                           SC_P_ENET0_MDC                     0
+#define SC_P_ENET0_MDC_ADMA_I2C3_SCL                            SC_P_ENET0_MDC                     1
+#define SC_P_ENET0_MDC_CONN_ENET1_MDC                           SC_P_ENET0_MDC                     2
+#define SC_P_ENET0_MDC_LSIO_GPIO5_IO11                          SC_P_ENET0_MDC                     4
+#define SC_P_ESAI0_FSR_ADMA_ESAI0_FSR                           SC_P_ESAI0_FSR                     0
+#define SC_P_ESAI0_FSR_CONN_ENET1_RCLK50M_OUT                   SC_P_ESAI0_FSR                     1
+#define SC_P_ESAI0_FSR_ADMA_LCDIF_D00                           SC_P_ESAI0_FSR                     2
+#define SC_P_ESAI0_FSR_CONN_ENET1_RGMII_TXC                     SC_P_ESAI0_FSR                     3
+#define SC_P_ESAI0_FSR_CONN_ENET1_RCLK50M_IN                    SC_P_ESAI0_FSR                     4
+#define SC_P_ESAI0_FST_ADMA_ESAI0_FST                           SC_P_ESAI0_FST                     0
+#define SC_P_ESAI0_FST_CONN_MLB_CLK                             SC_P_ESAI0_FST                     1
+#define SC_P_ESAI0_FST_ADMA_LCDIF_D01                           SC_P_ESAI0_FST                     2
+#define SC_P_ESAI0_FST_CONN_ENET1_RGMII_TXD2                    SC_P_ESAI0_FST                     3
+#define SC_P_ESAI0_FST_LSIO_GPIO0_IO01                          SC_P_ESAI0_FST                     4
+#define SC_P_ESAI0_SCKR_ADMA_ESAI0_SCKR                         SC_P_ESAI0_SCKR                    0
+#define SC_P_ESAI0_SCKR_ADMA_LCDIF_D02                          SC_P_ESAI0_SCKR                    2
+#define SC_P_ESAI0_SCKR_CONN_ENET1_RGMII_TX_CTL                 SC_P_ESAI0_SCKR                    3
+#define SC_P_ESAI0_SCKR_LSIO_GPIO0_IO02                         SC_P_ESAI0_SCKR                    4
+#define SC_P_ESAI0_SCKT_ADMA_ESAI0_SCKT                         SC_P_ESAI0_SCKT                    0
+#define SC_P_ESAI0_SCKT_CONN_MLB_SIG                            SC_P_ESAI0_SCKT                    1
+#define SC_P_ESAI0_SCKT_ADMA_LCDIF_D03                          SC_P_ESAI0_SCKT                    2
+#define SC_P_ESAI0_SCKT_CONN_ENET1_RGMII_TXD3                   SC_P_ESAI0_SCKT                    3
+#define SC_P_ESAI0_SCKT_LSIO_GPIO0_IO03                         SC_P_ESAI0_SCKT                    4
+#define SC_P_ESAI0_TX0_ADMA_ESAI0_TX0                           SC_P_ESAI0_TX0                     0
+#define SC_P_ESAI0_TX0_CONN_MLB_DATA                            SC_P_ESAI0_TX0                     1
+#define SC_P_ESAI0_TX0_ADMA_LCDIF_D04                           SC_P_ESAI0_TX0                     2
+#define SC_P_ESAI0_TX0_CONN_ENET1_RGMII_RXC                     SC_P_ESAI0_TX0                     3
+#define SC_P_ESAI0_TX0_LSIO_GPIO0_IO04                          SC_P_ESAI0_TX0                     4
+#define SC_P_ESAI0_TX1_ADMA_ESAI0_TX1                           SC_P_ESAI0_TX1                     0
+#define SC_P_ESAI0_TX1_ADMA_LCDIF_D05                           SC_P_ESAI0_TX1                     2
+#define SC_P_ESAI0_TX1_CONN_ENET1_RGMII_RXD3                    SC_P_ESAI0_TX1                     3
+#define SC_P_ESAI0_TX1_LSIO_GPIO0_IO05                          SC_P_ESAI0_TX1                     4
+#define SC_P_ESAI0_TX2_RX3_ADMA_ESAI0_TX2_RX3                   SC_P_ESAI0_TX2_RX3                 0
+#define SC_P_ESAI0_TX2_RX3_CONN_ENET1_RMII_RX_ER                SC_P_ESAI0_TX2_RX3                 1
+#define SC_P_ESAI0_TX2_RX3_ADMA_LCDIF_D06                       SC_P_ESAI0_TX2_RX3                 2
+#define SC_P_ESAI0_TX2_RX3_CONN_ENET1_RGMII_RXD2                SC_P_ESAI0_TX2_RX3                 3
+#define SC_P_ESAI0_TX2_RX3_LSIO_GPIO0_IO06                      SC_P_ESAI0_TX2_RX3                 4
+#define SC_P_ESAI0_TX3_RX2_ADMA_ESAI0_TX3_RX2                   SC_P_ESAI0_TX3_RX2                 0
+#define SC_P_ESAI0_TX3_RX2_ADMA_LCDIF_D07                       SC_P_ESAI0_TX3_RX2                 2
+#define SC_P_ESAI0_TX3_RX2_CONN_ENET1_RGMII_RXD1                SC_P_ESAI0_TX3_RX2                 3
+#define SC_P_ESAI0_TX3_RX2_LSIO_GPIO0_IO07                      SC_P_ESAI0_TX3_RX2                 4
+#define SC_P_ESAI0_TX4_RX1_ADMA_ESAI0_TX4_RX1                   SC_P_ESAI0_TX4_RX1                 0
+#define SC_P_ESAI0_TX4_RX1_ADMA_LCDIF_D08                       SC_P_ESAI0_TX4_RX1                 2
+#define SC_P_ESAI0_TX4_RX1_CONN_ENET1_RGMII_TXD0                SC_P_ESAI0_TX4_RX1                 3
+#define SC_P_ESAI0_TX4_RX1_LSIO_GPIO0_IO08                      SC_P_ESAI0_TX4_RX1                 4
+#define SC_P_ESAI0_TX5_RX0_ADMA_ESAI0_TX5_RX0                   SC_P_ESAI0_TX5_RX0                 0
+#define SC_P_ESAI0_TX5_RX0_ADMA_LCDIF_D09                       SC_P_ESAI0_TX5_RX0                 2
+#define SC_P_ESAI0_TX5_RX0_CONN_ENET1_RGMII_TXD1                SC_P_ESAI0_TX5_RX0                 3
+#define SC_P_ESAI0_TX5_RX0_LSIO_GPIO0_IO09                      SC_P_ESAI0_TX5_RX0                 4
+#define SC_P_SPDIF0_RX_ADMA_SPDIF0_RX                           SC_P_SPDIF0_RX                     0
+#define SC_P_SPDIF0_RX_ADMA_MQS_R                               SC_P_SPDIF0_RX                     1
+#define SC_P_SPDIF0_RX_ADMA_LCDIF_D10                           SC_P_SPDIF0_RX                     2
+#define SC_P_SPDIF0_RX_CONN_ENET1_RGMII_RXD0                    SC_P_SPDIF0_RX                     3
+#define SC_P_SPDIF0_RX_LSIO_GPIO0_IO10                          SC_P_SPDIF0_RX                     4
+#define SC_P_SPDIF0_TX_ADMA_SPDIF0_TX                           SC_P_SPDIF0_TX                     0
+#define SC_P_SPDIF0_TX_ADMA_MQS_L                               SC_P_SPDIF0_TX                     1
+#define SC_P_SPDIF0_TX_ADMA_LCDIF_D11                           SC_P_SPDIF0_TX                     2
+#define SC_P_SPDIF0_TX_CONN_ENET1_RGMII_RX_CTL                  SC_P_SPDIF0_TX                     3
+#define SC_P_SPDIF0_TX_LSIO_GPIO0_IO11                          SC_P_SPDIF0_TX                     4
+#define SC_P_SPDIF0_EXT_CLK_ADMA_SPDIF0_EXT_CLK                 SC_P_SPDIF0_EXT_CLK                0
+#define SC_P_SPDIF0_EXT_CLK_ADMA_LCDIF_D12                      SC_P_SPDIF0_EXT_CLK                2
+#define SC_P_SPDIF0_EXT_CLK_CONN_ENET1_REFCLK_125M_25M          SC_P_SPDIF0_EXT_CLK                3
+#define SC_P_SPDIF0_EXT_CLK_LSIO_GPIO0_IO12                     SC_P_SPDIF0_EXT_CLK                4
+#define SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD			SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB 0
+#define SC_P_SPI3_SCK_ADMA_SPI3_SCK                             SC_P_SPI3_SCK                      0
+#define SC_P_SPI3_SCK_ADMA_LCDIF_D13                            SC_P_SPI3_SCK                      2
+#define SC_P_SPI3_SCK_LSIO_GPIO0_IO13                           SC_P_SPI3_SCK                      4
+#define SC_P_SPI3_SDO_ADMA_SPI3_SDO                             SC_P_SPI3_SDO                      0
+#define SC_P_SPI3_SDO_ADMA_LCDIF_D14                            SC_P_SPI3_SDO                      2
+#define SC_P_SPI3_SDO_LSIO_GPIO0_IO14                           SC_P_SPI3_SDO                      4
+#define SC_P_SPI3_SDI_ADMA_SPI3_SDI                             SC_P_SPI3_SDI                      0
+#define SC_P_SPI3_SDI_ADMA_LCDIF_D15                            SC_P_SPI3_SDI                      2
+#define SC_P_SPI3_SDI_LSIO_GPIO0_IO15                           SC_P_SPI3_SDI                      4
+#define SC_P_SPI3_CS0_ADMA_SPI3_CS0                             SC_P_SPI3_CS0                      0
+#define SC_P_SPI3_CS0_ADMA_ACM_MCLK_OUT1                        SC_P_SPI3_CS0                      1
+#define SC_P_SPI3_CS0_ADMA_LCDIF_HSYNC                          SC_P_SPI3_CS0                      2
+#define SC_P_SPI3_CS0_LSIO_GPIO0_IO16                           SC_P_SPI3_CS0                      4
+#define SC_P_SPI3_CS1_ADMA_SPI3_CS1                             SC_P_SPI3_CS1                      0
+#define SC_P_SPI3_CS1_ADMA_I2C3_SCL                             SC_P_SPI3_CS1                      1
+#define SC_P_SPI3_CS1_ADMA_LCDIF_RESET                          SC_P_SPI3_CS1                      2
+#define SC_P_SPI3_CS1_ADMA_SPI2_CS0                             SC_P_SPI3_CS1                      3
+#define SC_P_SPI3_CS1_ADMA_LCDIF_D16                            SC_P_SPI3_CS1                      4
+#define SC_P_MCLK_IN1_ADMA_ACM_MCLK_IN1                         SC_P_MCLK_IN1                      0
+#define SC_P_MCLK_IN1_ADMA_I2C3_SDA                             SC_P_MCLK_IN1                      1
+#define SC_P_MCLK_IN1_ADMA_LCDIF_EN                             SC_P_MCLK_IN1                      2
+#define SC_P_MCLK_IN1_ADMA_SPI2_SCK                             SC_P_MCLK_IN1                      3
+#define SC_P_MCLK_IN1_ADMA_LCDIF_D17                            SC_P_MCLK_IN1                      4
+#define SC_P_MCLK_IN0_ADMA_ACM_MCLK_IN0                         SC_P_MCLK_IN0                      0
+#define SC_P_MCLK_IN0_ADMA_ESAI0_RX_HF_CLK                      SC_P_MCLK_IN0                      1
+#define SC_P_MCLK_IN0_ADMA_LCDIF_VSYNC                          SC_P_MCLK_IN0                      2
+#define SC_P_MCLK_IN0_ADMA_SPI2_SDI                             SC_P_MCLK_IN0                      3
+#define SC_P_MCLK_IN0_LSIO_GPIO0_IO19                           SC_P_MCLK_IN0                      4
+#define SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0                       SC_P_MCLK_OUT0                     0
+#define SC_P_MCLK_OUT0_ADMA_ESAI0_TX_HF_CLK                     SC_P_MCLK_OUT0                     1
+#define SC_P_MCLK_OUT0_ADMA_LCDIF_CLK                           SC_P_MCLK_OUT0                     2
+#define SC_P_MCLK_OUT0_ADMA_SPI2_SDO                            SC_P_MCLK_OUT0                     3
+#define SC_P_MCLK_OUT0_LSIO_GPIO0_IO20                          SC_P_MCLK_OUT0                     4
+#define SC_P_UART1_TX_ADMA_UART1_TX                             SC_P_UART1_TX                      0
+#define SC_P_UART1_TX_LSIO_PWM0_OUT                             SC_P_UART1_TX                      1
+#define SC_P_UART1_TX_LSIO_GPT0_CAPTURE                         SC_P_UART1_TX                      2
+#define SC_P_UART1_TX_LSIO_GPIO0_IO21                           SC_P_UART1_TX                      4
+#define SC_P_UART1_RX_ADMA_UART1_RX                             SC_P_UART1_RX                      0
+#define SC_P_UART1_RX_LSIO_PWM1_OUT                             SC_P_UART1_RX                      1
+#define SC_P_UART1_RX_LSIO_GPT0_COMPARE                         SC_P_UART1_RX                      2
+#define SC_P_UART1_RX_LSIO_GPT1_CLK                             SC_P_UART1_RX                      3
+#define SC_P_UART1_RX_LSIO_GPIO0_IO22                           SC_P_UART1_RX                      4
+#define SC_P_UART1_RTS_B_ADMA_UART1_RTS_B                       SC_P_UART1_RTS_B                   0
+#define SC_P_UART1_RTS_B_LSIO_PWM2_OUT                          SC_P_UART1_RTS_B                   1
+#define SC_P_UART1_RTS_B_ADMA_LCDIF_D16                         SC_P_UART1_RTS_B                   2
+#define SC_P_UART1_RTS_B_LSIO_GPT1_CAPTURE                      SC_P_UART1_RTS_B                   3
+#define SC_P_UART1_RTS_B_LSIO_GPT0_CLK                          SC_P_UART1_RTS_B                   4
+#define SC_P_UART1_CTS_B_ADMA_UART1_CTS_B                       SC_P_UART1_CTS_B                   0
+#define SC_P_UART1_CTS_B_LSIO_PWM3_OUT                          SC_P_UART1_CTS_B                   1
+#define SC_P_UART1_CTS_B_ADMA_LCDIF_D17                         SC_P_UART1_CTS_B                   2
+#define SC_P_UART1_CTS_B_LSIO_GPT1_COMPARE                      SC_P_UART1_CTS_B                   3
+#define SC_P_UART1_CTS_B_LSIO_GPIO0_IO24                        SC_P_UART1_CTS_B                   4
+#define SC_P_SAI0_TXD_ADMA_SAI0_TXD                             SC_P_SAI0_TXD                      0
+#define SC_P_SAI0_TXD_ADMA_SAI1_RXC                             SC_P_SAI0_TXD                      1
+#define SC_P_SAI0_TXD_ADMA_SPI1_SDO                             SC_P_SAI0_TXD                      2
+#define SC_P_SAI0_TXD_ADMA_LCDIF_D18                            SC_P_SAI0_TXD                      3
+#define SC_P_SAI0_TXD_LSIO_GPIO0_IO25                           SC_P_SAI0_TXD                      4
+#define SC_P_SAI0_TXC_ADMA_SAI0_TXC                             SC_P_SAI0_TXC                      0
+#define SC_P_SAI0_TXC_ADMA_SAI1_TXD                             SC_P_SAI0_TXC                      1
+#define SC_P_SAI0_TXC_ADMA_SPI1_SDI                             SC_P_SAI0_TXC                      2
+#define SC_P_SAI0_TXC_ADMA_LCDIF_D19                            SC_P_SAI0_TXC                      3
+#define SC_P_SAI0_TXC_LSIO_GPIO0_IO26                           SC_P_SAI0_TXC                      4
+#define SC_P_SAI0_RXD_ADMA_SAI0_RXD                             SC_P_SAI0_RXD                      0
+#define SC_P_SAI0_RXD_ADMA_SAI1_RXFS                            SC_P_SAI0_RXD                      1
+#define SC_P_SAI0_RXD_ADMA_SPI1_CS0                             SC_P_SAI0_RXD                      2
+#define SC_P_SAI0_RXD_ADMA_LCDIF_D20                            SC_P_SAI0_RXD                      3
+#define SC_P_SAI0_RXD_LSIO_GPIO0_IO27                           SC_P_SAI0_RXD                      4
+#define SC_P_SAI0_TXFS_ADMA_SAI0_TXFS                           SC_P_SAI0_TXFS                     0
+#define SC_P_SAI0_TXFS_ADMA_SPI2_CS1                            SC_P_SAI0_TXFS                     1
+#define SC_P_SAI0_TXFS_ADMA_SPI1_SCK                            SC_P_SAI0_TXFS                     2
+#define SC_P_SAI0_TXFS_LSIO_GPIO0_IO28                          SC_P_SAI0_TXFS                     4
+#define SC_P_SAI1_RXD_ADMA_SAI1_RXD                             SC_P_SAI1_RXD                      0
+#define SC_P_SAI1_RXD_ADMA_SAI0_RXFS                            SC_P_SAI1_RXD                      1
+#define SC_P_SAI1_RXD_ADMA_SPI1_CS1                             SC_P_SAI1_RXD                      2
+#define SC_P_SAI1_RXD_ADMA_LCDIF_D21                            SC_P_SAI1_RXD                      3
+#define SC_P_SAI1_RXD_LSIO_GPIO0_IO29                           SC_P_SAI1_RXD                      4
+#define SC_P_SAI1_RXC_ADMA_SAI1_RXC                             SC_P_SAI1_RXC                      0
+#define SC_P_SAI1_RXC_ADMA_SAI1_TXC                             SC_P_SAI1_RXC                      1
+#define SC_P_SAI1_RXC_ADMA_LCDIF_D22                            SC_P_SAI1_RXC                      3
+#define SC_P_SAI1_RXC_LSIO_GPIO0_IO30                           SC_P_SAI1_RXC                      4
+#define SC_P_SAI1_RXFS_ADMA_SAI1_RXFS                           SC_P_SAI1_RXFS                     0
+#define SC_P_SAI1_RXFS_ADMA_SAI1_TXFS                           SC_P_SAI1_RXFS                     1
+#define SC_P_SAI1_RXFS_ADMA_LCDIF_D23                           SC_P_SAI1_RXFS                     3
+#define SC_P_SAI1_RXFS_LSIO_GPIO0_IO31                          SC_P_SAI1_RXFS                     4
+#define SC_P_SPI2_CS0_ADMA_SPI2_CS0                             SC_P_SPI2_CS0                      0
+#define SC_P_SPI2_CS0_LSIO_GPIO1_IO00                           SC_P_SPI2_CS0                      4
+#define SC_P_SPI2_SDO_ADMA_SPI2_SDO                             SC_P_SPI2_SDO                      0
+#define SC_P_SPI2_SDO_LSIO_GPIO1_IO01                           SC_P_SPI2_SDO                      4
+#define SC_P_SPI2_SDI_ADMA_SPI2_SDI                             SC_P_SPI2_SDI                      0
+#define SC_P_SPI2_SDI_LSIO_GPIO1_IO02                           SC_P_SPI2_SDI                      4
+#define SC_P_SPI2_SCK_ADMA_SPI2_SCK                             SC_P_SPI2_SCK                      0
+#define SC_P_SPI2_SCK_LSIO_GPIO1_IO03                           SC_P_SPI2_SCK                      4
+#define SC_P_SPI0_SCK_ADMA_SPI0_SCK                             SC_P_SPI0_SCK                      0
+#define SC_P_SPI0_SCK_ADMA_SAI0_TXC                             SC_P_SPI0_SCK                      1
+#define SC_P_SPI0_SCK_M40_I2C0_SCL                              SC_P_SPI0_SCK                      2
+#define SC_P_SPI0_SCK_M40_GPIO0_IO00                            SC_P_SPI0_SCK                      3
+#define SC_P_SPI0_SCK_LSIO_GPIO1_IO04                           SC_P_SPI0_SCK                      4
+#define SC_P_SPI0_SDI_ADMA_SPI0_SDI                             SC_P_SPI0_SDI                      0
+#define SC_P_SPI0_SDI_ADMA_SAI0_TXD                             SC_P_SPI0_SDI                      1
+#define SC_P_SPI0_SDI_M40_TPM0_CH0                              SC_P_SPI0_SDI                      2
+#define SC_P_SPI0_SDI_M40_GPIO0_IO02                            SC_P_SPI0_SDI                      3
+#define SC_P_SPI0_SDI_LSIO_GPIO1_IO05                           SC_P_SPI0_SDI                      4
+#define SC_P_SPI0_SDO_ADMA_SPI0_SDO                             SC_P_SPI0_SDO                      0
+#define SC_P_SPI0_SDO_ADMA_SAI0_TXFS                            SC_P_SPI0_SDO                      1
+#define SC_P_SPI0_SDO_M40_I2C0_SDA                              SC_P_SPI0_SDO                      2
+#define SC_P_SPI0_SDO_M40_GPIO0_IO01                            SC_P_SPI0_SDO                      3
+#define SC_P_SPI0_SDO_LSIO_GPIO1_IO06                           SC_P_SPI0_SDO                      4
+#define SC_P_SPI0_CS1_ADMA_SPI0_CS1                             SC_P_SPI0_CS1                      0
+#define SC_P_SPI0_CS1_ADMA_SAI0_RXC                             SC_P_SPI0_CS1                      1
+#define SC_P_SPI0_CS1_ADMA_SAI1_TXD                             SC_P_SPI0_CS1                      2
+#define SC_P_SPI0_CS1_ADMA_LCD_PWM0_OUT                         SC_P_SPI0_CS1                      3
+#define SC_P_SPI0_CS1_LSIO_GPIO1_IO07                           SC_P_SPI0_CS1                      4
+#define SC_P_SPI0_CS0_ADMA_SPI0_CS0                             SC_P_SPI0_CS0                      0
+#define SC_P_SPI0_CS0_ADMA_SAI0_RXD                             SC_P_SPI0_CS0                      1
+#define SC_P_SPI0_CS0_M40_TPM0_CH1                              SC_P_SPI0_CS0                      2
+#define SC_P_SPI0_CS0_M40_GPIO0_IO03                            SC_P_SPI0_CS0                      3
+#define SC_P_SPI0_CS0_LSIO_GPIO1_IO08                           SC_P_SPI0_CS0                      4
+#define SC_P_ADC_IN1_ADMA_ADC_IN1                               SC_P_ADC_IN1                       0
+#define SC_P_ADC_IN1_M40_I2C0_SDA                               SC_P_ADC_IN1                       1
+#define SC_P_ADC_IN1_M40_GPIO0_IO01                             SC_P_ADC_IN1                       2
+#define SC_P_ADC_IN1_LSIO_GPIO1_IO09                            SC_P_ADC_IN1                       4
+#define SC_P_ADC_IN0_ADMA_ADC_IN0                               SC_P_ADC_IN0                       0
+#define SC_P_ADC_IN0_M40_I2C0_SCL                               SC_P_ADC_IN0                       1
+#define SC_P_ADC_IN0_M40_GPIO0_IO00                             SC_P_ADC_IN0                       2
+#define SC_P_ADC_IN0_LSIO_GPIO1_IO10                            SC_P_ADC_IN0                       4
+#define SC_P_ADC_IN3_ADMA_ADC_IN3                               SC_P_ADC_IN3                       0
+#define SC_P_ADC_IN3_M40_UART0_TX                               SC_P_ADC_IN3                       1
+#define SC_P_ADC_IN3_M40_GPIO0_IO03                             SC_P_ADC_IN3                       2
+#define SC_P_ADC_IN3_ADMA_ACM_MCLK_OUT0                         SC_P_ADC_IN3                       3
+#define SC_P_ADC_IN3_LSIO_GPIO1_IO11                            SC_P_ADC_IN3                       4
+#define SC_P_ADC_IN2_ADMA_ADC_IN2                               SC_P_ADC_IN2                       0
+#define SC_P_ADC_IN2_M40_UART0_RX                               SC_P_ADC_IN2                       1
+#define SC_P_ADC_IN2_M40_GPIO0_IO02                             SC_P_ADC_IN2                       2
+#define SC_P_ADC_IN2_ADMA_ACM_MCLK_IN0                          SC_P_ADC_IN2                       3
+#define SC_P_ADC_IN2_LSIO_GPIO1_IO12                            SC_P_ADC_IN2                       4
+#define SC_P_ADC_IN5_ADMA_ADC_IN5                               SC_P_ADC_IN5                       0
+#define SC_P_ADC_IN5_M40_TPM0_CH1                               SC_P_ADC_IN5                       1
+#define SC_P_ADC_IN5_M40_GPIO0_IO05                             SC_P_ADC_IN5                       2
+#define SC_P_ADC_IN5_LSIO_GPIO1_IO13                            SC_P_ADC_IN5                       4
+#define SC_P_ADC_IN4_ADMA_ADC_IN4                               SC_P_ADC_IN4                       0
+#define SC_P_ADC_IN4_M40_TPM0_CH0                               SC_P_ADC_IN4                       1
+#define SC_P_ADC_IN4_M40_GPIO0_IO04                             SC_P_ADC_IN4                       2
+#define SC_P_ADC_IN4_LSIO_GPIO1_IO14                            SC_P_ADC_IN4                       4
+#define SC_P_FLEXCAN0_RX_ADMA_FLEXCAN0_RX                       SC_P_FLEXCAN0_RX                   0
+#define SC_P_FLEXCAN0_RX_ADMA_SAI2_RXC                          SC_P_FLEXCAN0_RX                   1
+#define SC_P_FLEXCAN0_RX_ADMA_UART0_RTS_B                       SC_P_FLEXCAN0_RX                   2
+#define SC_P_FLEXCAN0_RX_ADMA_SAI1_TXC                          SC_P_FLEXCAN0_RX                   3
+#define SC_P_FLEXCAN0_RX_LSIO_GPIO1_IO15                        SC_P_FLEXCAN0_RX                   4
+#define SC_P_FLEXCAN0_TX_ADMA_FLEXCAN0_TX                       SC_P_FLEXCAN0_TX                   0
+#define SC_P_FLEXCAN0_TX_ADMA_SAI2_RXD                          SC_P_FLEXCAN0_TX                   1
+#define SC_P_FLEXCAN0_TX_ADMA_UART0_CTS_B                       SC_P_FLEXCAN0_TX                   2
+#define SC_P_FLEXCAN0_TX_ADMA_SAI1_TXFS                         SC_P_FLEXCAN0_TX                   3
+#define SC_P_FLEXCAN0_TX_LSIO_GPIO1_IO16                        SC_P_FLEXCAN0_TX                   4
+#define SC_P_FLEXCAN1_RX_ADMA_FLEXCAN1_RX                       SC_P_FLEXCAN1_RX                   0
+#define SC_P_FLEXCAN1_RX_ADMA_SAI2_RXFS                         SC_P_FLEXCAN1_RX                   1
+#define SC_P_FLEXCAN1_RX_ADMA_FTM_CH2                           SC_P_FLEXCAN1_RX                   2
+#define SC_P_FLEXCAN1_RX_ADMA_SAI1_TXD                          SC_P_FLEXCAN1_RX                   3
+#define SC_P_FLEXCAN1_RX_LSIO_GPIO1_IO17                        SC_P_FLEXCAN1_RX                   4
+#define SC_P_FLEXCAN1_TX_ADMA_FLEXCAN1_TX                       SC_P_FLEXCAN1_TX                   0
+#define SC_P_FLEXCAN1_TX_ADMA_SAI3_RXC                          SC_P_FLEXCAN1_TX                   1
+#define SC_P_FLEXCAN1_TX_ADMA_DMA0_REQ_IN0                      SC_P_FLEXCAN1_TX                   2
+#define SC_P_FLEXCAN1_TX_ADMA_SAI1_RXD                          SC_P_FLEXCAN1_TX                   3
+#define SC_P_FLEXCAN1_TX_LSIO_GPIO1_IO18                        SC_P_FLEXCAN1_TX                   4
+#define SC_P_FLEXCAN2_RX_ADMA_FLEXCAN2_RX                       SC_P_FLEXCAN2_RX                   0
+#define SC_P_FLEXCAN2_RX_ADMA_SAI3_RXD                          SC_P_FLEXCAN2_RX                   1
+#define SC_P_FLEXCAN2_RX_ADMA_UART3_RX                          SC_P_FLEXCAN2_RX                   2
+#define SC_P_FLEXCAN2_RX_ADMA_SAI1_RXFS                         SC_P_FLEXCAN2_RX                   3
+#define SC_P_FLEXCAN2_RX_LSIO_GPIO1_IO19                        SC_P_FLEXCAN2_RX                   4
+#define SC_P_FLEXCAN2_TX_ADMA_FLEXCAN2_TX                       SC_P_FLEXCAN2_TX                   0
+#define SC_P_FLEXCAN2_TX_ADMA_SAI3_RXFS                         SC_P_FLEXCAN2_TX                   1
+#define SC_P_FLEXCAN2_TX_ADMA_UART3_TX                          SC_P_FLEXCAN2_TX                   2
+#define SC_P_FLEXCAN2_TX_ADMA_SAI1_RXC                          SC_P_FLEXCAN2_TX                   3
+#define SC_P_FLEXCAN2_TX_LSIO_GPIO1_IO20                        SC_P_FLEXCAN2_TX                   4
+#define SC_P_UART0_RX_ADMA_UART0_RX                             SC_P_UART0_RX                      0
+#define SC_P_UART0_RX_ADMA_MQS_R                                SC_P_UART0_RX                      1
+#define SC_P_UART0_RX_ADMA_FLEXCAN0_RX                          SC_P_UART0_RX                      2
+#define SC_P_UART0_RX_SCU_UART0_RX                              SC_P_UART0_RX                      3
+#define SC_P_UART0_RX_LSIO_GPIO1_IO21                           SC_P_UART0_RX                      4
+#define SC_P_UART0_TX_ADMA_UART0_TX                             SC_P_UART0_TX                      0
+#define SC_P_UART0_TX_ADMA_MQS_L                                SC_P_UART0_TX                      1
+#define SC_P_UART0_TX_ADMA_FLEXCAN0_TX                          SC_P_UART0_TX                      2
+#define SC_P_UART0_TX_SCU_UART0_TX                              SC_P_UART0_TX                      3
+#define SC_P_UART0_TX_LSIO_GPIO1_IO22                           SC_P_UART0_TX                      4
+#define SC_P_UART2_TX_ADMA_UART2_TX                             SC_P_UART2_TX                      0
+#define SC_P_UART2_TX_ADMA_FTM_CH1                              SC_P_UART2_TX                      1
+#define SC_P_UART2_TX_ADMA_FLEXCAN1_TX                          SC_P_UART2_TX                      2
+#define SC_P_UART2_TX_LSIO_GPIO1_IO23                           SC_P_UART2_TX                      4
+#define SC_P_UART2_RX_ADMA_UART2_RX                             SC_P_UART2_RX                      0
+#define SC_P_UART2_RX_ADMA_FTM_CH0                              SC_P_UART2_RX                      1
+#define SC_P_UART2_RX_ADMA_FLEXCAN1_RX                          SC_P_UART2_RX                      2
+#define SC_P_UART2_RX_LSIO_GPIO1_IO24                           SC_P_UART2_RX                      4
+#define SC_P_MIPI_DSI0_I2C0_SCL_MIPI_DSI0_I2C0_SCL              SC_P_MIPI_DSI0_I2C0_SCL            0
+#define SC_P_MIPI_DSI0_I2C0_SCL_MIPI_DSI1_GPIO0_IO02            SC_P_MIPI_DSI0_I2C0_SCL            1
+#define SC_P_MIPI_DSI0_I2C0_SCL_LSIO_GPIO1_IO25                 SC_P_MIPI_DSI0_I2C0_SCL            4
+#define SC_P_MIPI_DSI0_I2C0_SDA_MIPI_DSI0_I2C0_SDA              SC_P_MIPI_DSI0_I2C0_SDA            0
+#define SC_P_MIPI_DSI0_I2C0_SDA_MIPI_DSI1_GPIO0_IO03            SC_P_MIPI_DSI0_I2C0_SDA            1
+#define SC_P_MIPI_DSI0_I2C0_SDA_LSIO_GPIO1_IO26                 SC_P_MIPI_DSI0_I2C0_SDA            4
+#define SC_P_MIPI_DSI0_GPIO0_00_MIPI_DSI0_GPIO0_IO00            SC_P_MIPI_DSI0_GPIO0_00            0
+#define SC_P_MIPI_DSI0_GPIO0_00_ADMA_I2C1_SCL                   SC_P_MIPI_DSI0_GPIO0_00            1
+#define SC_P_MIPI_DSI0_GPIO0_00_MIPI_DSI0_PWM0_OUT              SC_P_MIPI_DSI0_GPIO0_00            2
+#define SC_P_MIPI_DSI0_GPIO0_00_LSIO_GPIO1_IO27                 SC_P_MIPI_DSI0_GPIO0_00            4
+#define SC_P_MIPI_DSI0_GPIO0_01_MIPI_DSI0_GPIO0_IO01            SC_P_MIPI_DSI0_GPIO0_01            0
+#define SC_P_MIPI_DSI0_GPIO0_01_ADMA_I2C1_SDA                   SC_P_MIPI_DSI0_GPIO0_01            1
+#define SC_P_MIPI_DSI0_GPIO0_01_LSIO_GPIO1_IO28                 SC_P_MIPI_DSI0_GPIO0_01            4
+#define SC_P_MIPI_DSI1_I2C0_SCL_MIPI_DSI1_I2C0_SCL              SC_P_MIPI_DSI1_I2C0_SCL            0
+#define SC_P_MIPI_DSI1_I2C0_SCL_MIPI_DSI0_GPIO0_IO02            SC_P_MIPI_DSI1_I2C0_SCL            1
+#define SC_P_MIPI_DSI1_I2C0_SCL_LSIO_GPIO1_IO29                 SC_P_MIPI_DSI1_I2C0_SCL            4
+#define SC_P_MIPI_DSI1_I2C0_SDA_MIPI_DSI1_I2C0_SDA              SC_P_MIPI_DSI1_I2C0_SDA            0
+#define SC_P_MIPI_DSI1_I2C0_SDA_MIPI_DSI0_GPIO0_IO03            SC_P_MIPI_DSI1_I2C0_SDA            1
+#define SC_P_MIPI_DSI1_I2C0_SDA_LSIO_GPIO1_IO30                 SC_P_MIPI_DSI1_I2C0_SDA            4
+#define SC_P_MIPI_DSI1_GPIO0_00_MIPI_DSI1_GPIO0_IO00            SC_P_MIPI_DSI1_GPIO0_00            0
+#define SC_P_MIPI_DSI1_GPIO0_00_ADMA_I2C2_SCL                   SC_P_MIPI_DSI1_GPIO0_00            1
+#define SC_P_MIPI_DSI1_GPIO0_00_MIPI_DSI1_PWM0_OUT              SC_P_MIPI_DSI1_GPIO0_00            2
+#define SC_P_MIPI_DSI1_GPIO0_00_LSIO_GPIO1_IO31                 SC_P_MIPI_DSI1_GPIO0_00            4
+#define SC_P_MIPI_DSI1_GPIO0_01_MIPI_DSI1_GPIO0_IO01            SC_P_MIPI_DSI1_GPIO0_01            0
+#define SC_P_MIPI_DSI1_GPIO0_01_ADMA_I2C2_SDA                   SC_P_MIPI_DSI1_GPIO0_01            1
+#define SC_P_MIPI_DSI1_GPIO0_01_LSIO_GPIO2_IO00                 SC_P_MIPI_DSI1_GPIO0_01            4
+#define SC_P_JTAG_TRST_B_SCU_JTAG_TRST_B                        SC_P_JTAG_TRST_B                   0
+#define SC_P_JTAG_TRST_B_SCU_WDOG0_WDOG_OUT                     SC_P_JTAG_TRST_B                   1
+#define SC_P_PMIC_I2C_SCL_SCU_PMIC_I2C_SCL                      SC_P_PMIC_I2C_SCL                  0
+#define SC_P_PMIC_I2C_SCL_SCU_GPIO0_IOXX_PMIC_A35_ON            SC_P_PMIC_I2C_SCL                  1
+#define SC_P_PMIC_I2C_SCL_LSIO_GPIO2_IO01                       SC_P_PMIC_I2C_SCL                  4
+#define SC_P_PMIC_I2C_SDA_SCU_PMIC_I2C_SDA                      SC_P_PMIC_I2C_SDA                  0
+#define SC_P_PMIC_I2C_SDA_SCU_GPIO0_IOXX_PMIC_GPU_ON            SC_P_PMIC_I2C_SDA                  1
+#define SC_P_PMIC_I2C_SDA_LSIO_GPIO2_IO02                       SC_P_PMIC_I2C_SDA                  4
+#define SC_P_PMIC_INT_B_SCU_DSC_PMIC_INT_B                      SC_P_PMIC_INT_B                    0
+#define SC_P_SCU_GPIO0_00_SCU_GPIO0_IO00                        SC_P_SCU_GPIO0_00                  0
+#define SC_P_SCU_GPIO0_00_SCU_UART0_RX                          SC_P_SCU_GPIO0_00                  1
+#define SC_P_SCU_GPIO0_00_M40_UART0_RX                          SC_P_SCU_GPIO0_00                  2
+#define SC_P_SCU_GPIO0_00_ADMA_UART3_RX                         SC_P_SCU_GPIO0_00                  3
+#define SC_P_SCU_GPIO0_00_LSIO_GPIO2_IO03                       SC_P_SCU_GPIO0_00                  4
+#define SC_P_SCU_GPIO0_01_SCU_GPIO0_IO01                        SC_P_SCU_GPIO0_01                  0
+#define SC_P_SCU_GPIO0_01_SCU_UART0_TX                          SC_P_SCU_GPIO0_01                  1
+#define SC_P_SCU_GPIO0_01_M40_UART0_TX                          SC_P_SCU_GPIO0_01                  2
+#define SC_P_SCU_GPIO0_01_ADMA_UART3_TX                         SC_P_SCU_GPIO0_01                  3
+#define SC_P_SCU_GPIO0_01_SCU_WDOG0_WDOG_OUT                    SC_P_SCU_GPIO0_01                  4
+#define SC_P_SCU_PMIC_STANDBY_SCU_DSC_PMIC_STANDBY              SC_P_SCU_PMIC_STANDBY              0
+#define SC_P_SCU_BOOT_MODE0_SCU_DSC_BOOT_MODE0                  SC_P_SCU_BOOT_MODE0                0
+#define SC_P_SCU_BOOT_MODE1_SCU_DSC_BOOT_MODE1                  SC_P_SCU_BOOT_MODE1                0
+#define SC_P_SCU_BOOT_MODE2_SCU_DSC_BOOT_MODE2                  SC_P_SCU_BOOT_MODE2                0
+#define SC_P_SCU_BOOT_MODE2_SCU_PMIC_I2C_SDA                    SC_P_SCU_BOOT_MODE2                1
+#define SC_P_SCU_BOOT_MODE3_SCU_DSC_BOOT_MODE3                  SC_P_SCU_BOOT_MODE3                0
+#define SC_P_SCU_BOOT_MODE3_SCU_PMIC_I2C_SCL                    SC_P_SCU_BOOT_MODE3                1
+#define SC_P_SCU_BOOT_MODE3_SCU_DSC_RTC_CLOCK_OUTPUT_32K        SC_P_SCU_BOOT_MODE3                3
+#define SC_P_CSI_D00_CI_PI_D02                                  SC_P_CSI_D00                       0
+#define SC_P_CSI_D00_ADMA_SAI0_RXC                              SC_P_CSI_D00                       2
+#define SC_P_CSI_D01_CI_PI_D03                                  SC_P_CSI_D01                       0
+#define SC_P_CSI_D01_ADMA_SAI0_RXD                              SC_P_CSI_D01                       2
+#define SC_P_CSI_D02_CI_PI_D04                                  SC_P_CSI_D02                       0
+#define SC_P_CSI_D02_ADMA_SAI0_RXFS                             SC_P_CSI_D02                       2
+#define SC_P_CSI_D03_CI_PI_D05                                  SC_P_CSI_D03                       0
+#define SC_P_CSI_D03_ADMA_SAI2_RXC                              SC_P_CSI_D03                       2
+#define SC_P_CSI_D04_CI_PI_D06                                  SC_P_CSI_D04                       0
+#define SC_P_CSI_D04_ADMA_SAI2_RXD                              SC_P_CSI_D04                       2
+#define SC_P_CSI_D05_CI_PI_D07                                  SC_P_CSI_D05                       0
+#define SC_P_CSI_D05_ADMA_SAI2_RXFS                             SC_P_CSI_D05                       2
+#define SC_P_CSI_D06_CI_PI_D08                                  SC_P_CSI_D06                       0
+#define SC_P_CSI_D06_ADMA_SAI3_RXC                              SC_P_CSI_D06                       2
+#define SC_P_CSI_D07_CI_PI_D09                                  SC_P_CSI_D07                       0
+#define SC_P_CSI_D07_ADMA_SAI3_RXD                              SC_P_CSI_D07                       2
+#define SC_P_CSI_HSYNC_CI_PI_HSYNC                              SC_P_CSI_HSYNC                     0
+#define SC_P_CSI_HSYNC_CI_PI_D00                                SC_P_CSI_HSYNC                     1
+#define SC_P_CSI_HSYNC_ADMA_SAI3_RXFS                           SC_P_CSI_HSYNC                     2
+#define SC_P_CSI_VSYNC_CI_PI_VSYNC                              SC_P_CSI_VSYNC                     0
+#define SC_P_CSI_VSYNC_CI_PI_D01                                SC_P_CSI_VSYNC                     1
+#define SC_P_CSI_PCLK_CI_PI_PCLK                                SC_P_CSI_PCLK                      0
+#define SC_P_CSI_PCLK_MIPI_CSI0_I2C0_SCL                        SC_P_CSI_PCLK                      1
+#define SC_P_CSI_PCLK_ADMA_SPI1_SCK                             SC_P_CSI_PCLK                      3
+#define SC_P_CSI_PCLK_LSIO_GPIO3_IO00                           SC_P_CSI_PCLK                      4
+#define SC_P_CSI_MCLK_CI_PI_MCLK                                SC_P_CSI_MCLK                      0
+#define SC_P_CSI_MCLK_MIPI_CSI0_I2C0_SDA                        SC_P_CSI_MCLK                      1
+#define SC_P_CSI_MCLK_ADMA_SPI1_SDO                             SC_P_CSI_MCLK                      3
+#define SC_P_CSI_MCLK_LSIO_GPIO3_IO01                           SC_P_CSI_MCLK                      4
+#define SC_P_CSI_EN_CI_PI_EN                                    SC_P_CSI_EN                        0
+#define SC_P_CSI_EN_CI_PI_I2C_SCL                               SC_P_CSI_EN                        1
+#define SC_P_CSI_EN_ADMA_I2C3_SCL                               SC_P_CSI_EN                        2
+#define SC_P_CSI_EN_ADMA_SPI1_SDI                               SC_P_CSI_EN                        3
+#define SC_P_CSI_EN_LSIO_GPIO3_IO02                             SC_P_CSI_EN                        4
+#define SC_P_CSI_RESET_CI_PI_RESET                              SC_P_CSI_RESET                     0
+#define SC_P_CSI_RESET_CI_PI_I2C_SDA                            SC_P_CSI_RESET                     1
+#define SC_P_CSI_RESET_ADMA_I2C3_SDA                            SC_P_CSI_RESET                     2
+#define SC_P_CSI_RESET_ADMA_SPI1_CS0                            SC_P_CSI_RESET                     3
+#define SC_P_CSI_RESET_LSIO_GPIO3_IO03                          SC_P_CSI_RESET                     4
+#define SC_P_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT          SC_P_MIPI_CSI0_MCLK_OUT            0
+#define SC_P_MIPI_CSI0_MCLK_OUT_LSIO_GPIO3_IO04                 SC_P_MIPI_CSI0_MCLK_OUT            4
+#define SC_P_MIPI_CSI0_I2C0_SCL_MIPI_CSI0_I2C0_SCL              SC_P_MIPI_CSI0_I2C0_SCL            0
+#define SC_P_MIPI_CSI0_I2C0_SCL_MIPI_CSI0_GPIO0_IO02            SC_P_MIPI_CSI0_I2C0_SCL            1
+#define SC_P_MIPI_CSI0_I2C0_SCL_LSIO_GPIO3_IO05                 SC_P_MIPI_CSI0_I2C0_SCL            4
+#define SC_P_MIPI_CSI0_I2C0_SDA_MIPI_CSI0_I2C0_SDA              SC_P_MIPI_CSI0_I2C0_SDA            0
+#define SC_P_MIPI_CSI0_I2C0_SDA_MIPI_CSI0_GPIO0_IO03            SC_P_MIPI_CSI0_I2C0_SDA            1
+#define SC_P_MIPI_CSI0_I2C0_SDA_LSIO_GPIO3_IO06                 SC_P_MIPI_CSI0_I2C0_SDA            4
+#define SC_P_MIPI_CSI0_GPIO0_01_MIPI_CSI0_GPIO0_IO01            SC_P_MIPI_CSI0_GPIO0_01            0
+#define SC_P_MIPI_CSI0_GPIO0_01_ADMA_I2C0_SDA                   SC_P_MIPI_CSI0_GPIO0_01            1
+#define SC_P_MIPI_CSI0_GPIO0_01_LSIO_GPIO3_IO07                 SC_P_MIPI_CSI0_GPIO0_01            4
+#define SC_P_MIPI_CSI0_GPIO0_00_MIPI_CSI0_GPIO0_IO00            SC_P_MIPI_CSI0_GPIO0_00            0
+#define SC_P_MIPI_CSI0_GPIO0_00_ADMA_I2C0_SCL                   SC_P_MIPI_CSI0_GPIO0_00            1
+#define SC_P_MIPI_CSI0_GPIO0_00_LSIO_GPIO3_IO08                 SC_P_MIPI_CSI0_GPIO0_00            4
+#define SC_P_QSPI0A_DATA0_LSIO_QSPI0A_DATA0                     SC_P_QSPI0A_DATA0                  0
+#define SC_P_QSPI0A_DATA0_LSIO_GPIO3_IO09                       SC_P_QSPI0A_DATA0                  4
+#define SC_P_QSPI0A_DATA1_LSIO_QSPI0A_DATA1                     SC_P_QSPI0A_DATA1                  0
+#define SC_P_QSPI0A_DATA1_LSIO_GPIO3_IO10                       SC_P_QSPI0A_DATA1                  4
+#define SC_P_QSPI0A_DATA2_LSIO_QSPI0A_DATA2                     SC_P_QSPI0A_DATA2                  0
+#define SC_P_QSPI0A_DATA2_LSIO_GPIO3_IO11                       SC_P_QSPI0A_DATA2                  4
+#define SC_P_QSPI0A_DATA3_LSIO_QSPI0A_DATA3                     SC_P_QSPI0A_DATA3                  0
+#define SC_P_QSPI0A_DATA3_LSIO_GPIO3_IO12                       SC_P_QSPI0A_DATA3                  4
+#define SC_P_QSPI0A_DQS_LSIO_QSPI0A_DQS                         SC_P_QSPI0A_DQS                    0
+#define SC_P_QSPI0A_DQS_LSIO_GPIO3_IO13                         SC_P_QSPI0A_DQS                    4
+#define SC_P_QSPI0A_SS0_B_LSIO_QSPI0A_SS0_B                     SC_P_QSPI0A_SS0_B                  0
+#define SC_P_QSPI0A_SS0_B_LSIO_GPIO3_IO14                       SC_P_QSPI0A_SS0_B                  4
+#define SC_P_QSPI0A_SS1_B_LSIO_QSPI0A_SS1_B                     SC_P_QSPI0A_SS1_B                  0
+#define SC_P_QSPI0A_SS1_B_LSIO_GPIO3_IO15                       SC_P_QSPI0A_SS1_B                  4
+#define SC_P_QSPI0A_SCLK_LSIO_QSPI0A_SCLK                       SC_P_QSPI0A_SCLK                   0
+#define SC_P_QSPI0A_SCLK_LSIO_GPIO3_IO16                        SC_P_QSPI0A_SCLK                   4
+#define SC_P_QSPI0B_SCLK_LSIO_QSPI0B_SCLK                       SC_P_QSPI0B_SCLK                   0
+#define SC_P_QSPI0B_SCLK_LSIO_QSPI1A_SCLK                       SC_P_QSPI0B_SCLK                   1
+#define SC_P_QSPI0B_SCLK_LSIO_KPP0_COL0                         SC_P_QSPI0B_SCLK                   2
+#define SC_P_QSPI0B_SCLK_LSIO_GPIO3_IO17                        SC_P_QSPI0B_SCLK                   4
+#define SC_P_QSPI0B_DATA0_LSIO_QSPI0B_DATA0                     SC_P_QSPI0B_DATA0                  0
+#define SC_P_QSPI0B_DATA0_LSIO_QSPI1A_DATA0                     SC_P_QSPI0B_DATA0                  1
+#define SC_P_QSPI0B_DATA0_LSIO_KPP0_COL1                        SC_P_QSPI0B_DATA0                  2
+#define SC_P_QSPI0B_DATA0_LSIO_GPIO3_IO18                       SC_P_QSPI0B_DATA0                  4
+#define SC_P_QSPI0B_DATA1_LSIO_QSPI0B_DATA1                     SC_P_QSPI0B_DATA1                  0
+#define SC_P_QSPI0B_DATA1_LSIO_QSPI1A_DATA1                     SC_P_QSPI0B_DATA1                  1
+#define SC_P_QSPI0B_DATA1_LSIO_KPP0_COL2                        SC_P_QSPI0B_DATA1                  2
+#define SC_P_QSPI0B_DATA1_LSIO_GPIO3_IO19                       SC_P_QSPI0B_DATA1                  4
+#define SC_P_QSPI0B_DATA2_LSIO_QSPI0B_DATA2                     SC_P_QSPI0B_DATA2                  0
+#define SC_P_QSPI0B_DATA2_LSIO_QSPI1A_DATA2                     SC_P_QSPI0B_DATA2                  1
+#define SC_P_QSPI0B_DATA2_LSIO_KPP0_COL3                        SC_P_QSPI0B_DATA2                  2
+#define SC_P_QSPI0B_DATA2_LSIO_GPIO3_IO20                       SC_P_QSPI0B_DATA2                  4
+#define SC_P_QSPI0B_DATA3_LSIO_QSPI0B_DATA3                     SC_P_QSPI0B_DATA3                  0
+#define SC_P_QSPI0B_DATA3_LSIO_QSPI1A_DATA3                     SC_P_QSPI0B_DATA3                  1
+#define SC_P_QSPI0B_DATA3_LSIO_KPP0_ROW0                        SC_P_QSPI0B_DATA3                  2
+#define SC_P_QSPI0B_DATA3_LSIO_GPIO3_IO21                       SC_P_QSPI0B_DATA3                  4
+#define SC_P_QSPI0B_DQS_LSIO_QSPI0B_DQS                         SC_P_QSPI0B_DQS                    0
+#define SC_P_QSPI0B_DQS_LSIO_QSPI1A_DQS                         SC_P_QSPI0B_DQS                    1
+#define SC_P_QSPI0B_DQS_LSIO_KPP0_ROW1                          SC_P_QSPI0B_DQS                    2
+#define SC_P_QSPI0B_DQS_LSIO_GPIO3_IO22                         SC_P_QSPI0B_DQS                    4
+#define SC_P_QSPI0B_SS0_B_LSIO_QSPI0B_SS0_B                     SC_P_QSPI0B_SS0_B                  0
+#define SC_P_QSPI0B_SS0_B_LSIO_QSPI1A_SS0_B                     SC_P_QSPI0B_SS0_B                  1
+#define SC_P_QSPI0B_SS0_B_LSIO_KPP0_ROW2                        SC_P_QSPI0B_SS0_B                  2
+#define SC_P_QSPI0B_SS0_B_LSIO_GPIO3_IO23                       SC_P_QSPI0B_SS0_B                  4
+#define SC_P_QSPI0B_SS1_B_LSIO_QSPI0B_SS1_B                     SC_P_QSPI0B_SS1_B                  0
+#define SC_P_QSPI0B_SS1_B_LSIO_QSPI1A_SS1_B                     SC_P_QSPI0B_SS1_B                  1
+#define SC_P_QSPI0B_SS1_B_LSIO_KPP0_ROW3                        SC_P_QSPI0B_SS1_B                  2
+#define SC_P_QSPI0B_SS1_B_LSIO_GPIO3_IO24                       SC_P_QSPI0B_SS1_B                  4
+
+#endif				/* _SC_PADS_H */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 02/32] dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 01/32] dt-bindings: pinctrl: add i.MX8QXP pads definition Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 03/32] dt-bindings: soc: add i.MX8QXP pm and rsrc definition Peng Fan
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8QXP clocks definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 include/dt-bindings/clock/imx8qxp-clock.h | 583 ++++++++++++++++++++++++++++++
 1 file changed, 583 insertions(+)
 create mode 100644 include/dt-bindings/clock/imx8qxp-clock.h

diff --git a/include/dt-bindings/clock/imx8qxp-clock.h b/include/dt-bindings/clock/imx8qxp-clock.h
new file mode 100644
index 0000000000..d0334ea398
--- /dev/null
+++ b/include/dt-bindings/clock/imx8qxp-clock.h
@@ -0,0 +1,583 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_IMX8QXP_H
+#define __DT_BINDINGS_CLOCK_IMX8QXP_H
+
+#define IMX8QXP_CLK_DUMMY					0
+
+#define IMX8QXP_UART0_IPG_CLK					1
+#define IMX8QXP_UART0_DIV					2
+#define IMX8QXP_UART0_CLK					3
+
+#define IMX8QXP_IPG_DMA_CLK_ROOT				4
+
+/* GPU Clocks. */
+#define IMX8QXP_GPU0_CORE_DIV					5
+#define IMX8QXP_GPU0_CORE_CLK					6
+#define IMX8QXP_GPU0_SHADER_DIV					7
+#define IMX8QXP_GPU0_SHADER_CLK					8
+
+#define IMX8QXP_24MHZ						9
+#define IMX8QXP_GPT_3M						10
+#define IMX8QXP_32KHZ						11
+
+/* LSIO SS */
+#define IMX8QXP_LSIO_MEM_CLK					12
+#define IMX8QXP_LSIO_BUS_CLK					13
+#define IMX8QXP_LSIO_PWM0_DIV					14
+#define IMX8QXP_LSIO_PWM0_IPG_S_CLK				15
+#define IMX8QXP_LSIO_PWM0_IPG_SLV_CLK				16
+#define IMX8QXP_LSIO_PWM0_IPG_MSTR_CLK				17
+#define IMX8QXP_LSIO_PWM0_HF_CLK				18
+#define IMX8QXP_LSIO_PWM0_CLK					19
+#define IMX8QXP_LSIO_PWM1_DIV					20
+#define IMX8QXP_LSIO_PWM1_IPG_S_CLK				21
+#define IMX8QXP_LSIO_PWM1_IPG_SLV_CLK				22
+#define IMX8QXP_LSIO_PWM1_IPG_MSTR_CLK				23
+#define IMX8QXP_LSIO_PWM1_HF_CLK				24
+#define IMX8QXP_LSIO_PWM1_CLK					25
+#define IMX8QXP_LSIO_PWM2_DIV					26
+#define IMX8QXP_LSIO_PWM2_IPG_S_CLK				27
+#define IMX8QXP_LSIO_PWM2_IPG_SLV_CLK				28
+#define IMX8QXP_LSIO_PWM2_IPG_MSTR_CLK				29
+#define IMX8QXP_LSIO_PWM2_HF_CLK				30
+#define IMX8QXP_LSIO_PWM2_CLK					31
+#define IMX8QXP_LSIO_PWM3_DIV					32
+#define IMX8QXP_LSIO_PWM3_IPG_S_CLK				33
+#define IMX8QXP_LSIO_PWM3_IPG_SLV_CLK				34
+#define IMX8QXP_LSIO_PWM3_IPG_MSTR_CLK				35
+#define IMX8QXP_LSIO_PWM3_HF_CLK				36
+#define IMX8QXP_LSIO_PWM3_CLK					37
+#define IMX8QXP_LSIO_PWM4_DIV					38
+#define IMX8QXP_LSIO_PWM4_IPG_S_CLK				39
+#define IMX8QXP_LSIO_PWM4_IPG_SLV_CLK				40
+#define IMX8QXP_LSIO_PWM4_IPG_MSTR_CLK				42
+#define IMX8QXP_LSIO_PWM4_HF_CLK				43
+#define IMX8QXP_LSIO_PWM4_CLK					44
+#define IMX8QXP_LSIO_PWM5_DIV					45
+#define IMX8QXP_LSIO_PWM5_IPG_S_CLK				46
+#define IMX8QXP_LSIO_PWM5_IPG_SLV_CLK				47
+#define IMX8QXP_LSIO_PWM5_IPG_MSTR_CLK				48
+#define IMX8QXP_LSIO_PWM5_HF_CLK				49
+#define IMX8QXP_LSIO_PWM5_CLK					50
+#define IMX8QXP_LSIO_PWM6_DIV					51
+#define IMX8QXP_LSIO_PWM6_IPG_S_CLK				52
+#define IMX8QXP_LSIO_PWM6_IPG_SLV_CLK				53
+#define IMX8QXP_LSIO_PWM6_IPG_MSTR_CLK				54
+#define IMX8QXP_LSIO_PWM6_HF_CLK				55
+#define IMX8QXP_LSIO_PWM6_CLK					56
+#define IMX8QXP_LSIO_PWM7_DIV					57
+#define IMX8QXP_LSIO_PWM7_IPG_S_CLK				58
+#define IMX8QXP_LSIO_PWM7_IPG_SLV_CLK				59
+#define IMX8QXP_LSIO_PWM7_IPG_MSTR_CLK				60
+#define IMX8QXP_LSIO_PWM7_HF_CLK				61
+#define IMX8QXP_LSIO_PWM7_CLK					62
+#define IMX8QXP_LSIO_GPT0_DIV					63
+#define IMX8QXP_LSIO_GPT0_IPG_S_CLK				64
+#define IMX8QXP_LSIO_GPT0_IPG_SLV_CLK				65
+#define IMX8QXP_LSIO_GPT0_IPG_MSTR_CLK				66
+#define IMX8QXP_LSIO_GPT0_HF_CLK				67
+#define IMX8QXP_LSIO_GPT0_CLK					68
+#define IMX8QXP_LSIO_GPT1_DIV					69
+#define IMX8QXP_LSIO_GPT1_IPG_S_CLK				70
+#define IMX8QXP_LSIO_GPT1_IPG_SLV_CLK				71
+#define IMX8QXP_LSIO_GPT1_IPG_MSTR_CLK				72
+#define IMX8QXP_LSIO_GPT1_HF_CLK				73
+#define IMX8QXP_LSIO_GPT1_CLK					74
+#define IMX8QXP_LSIO_GPT2_DIV					75
+#define IMX8QXP_LSIO_GPT2_IPG_S_CLK				76
+#define IMX8QXP_LSIO_GPT2_IPG_SLV_CLK				77
+#define IMX8QXP_LSIO_GPT2_IPG_MSTR_CLK				78
+#define IMX8QXP_LSIO_GPT2_HF_CLK				79
+#define IMX8QXP_LSIO_GPT2_CLK					80
+#define IMX8QXP_LSIO_GPT3_DIV					81
+#define IMX8QXP_LSIO_GPT3_IPG_S_CLK				82
+#define IMX8QXP_LSIO_GPT3_IPG_SLV_CLK				83
+#define IMX8QXP_LSIO_GPT3_IPG_MSTR_CLK				84
+#define IMX8QXP_LSIO_GPT3_HF_CLK				85
+#define IMX8QXP_LSIO_GPT3_CLK					86
+#define IMX8QXP_LSIO_GPT4_DIV					87
+#define IMX8QXP_LSIO_GPT4_IPG_S_CLK				88
+#define IMX8QXP_LSIO_GPT4_IPG_SLV_CLK				89
+#define IMX8QXP_LSIO_GPT4_IPG_MSTR_CLK				90
+#define IMX8QXP_LSIO_GPT4_HF_CLK				91
+#define IMX8QXP_LSIO_GPT4_CLK					92
+#define IMX8QXP_LSIO_FSPI0_DIV					93
+#define IMX8QXP_LSIO_FSPI0_HCLK					94
+#define IMX8QXP_LSIO_FSPI0_IPG_S_CLK				95
+#define IMX8QXP_LSIO_FSPI0_IPG_CLK				96
+#define IMX8QXP_LSIO_FSPI0_CLK					97
+#define IMX8QXP_LSIO_FSPI1_DIV					98
+#define IMX8QXP_LSIO_FSPI1_HCLK					99
+#define IMX8QXP_LSIO_FSPI1_IPG_S_CLK				100
+#define IMX8QXP_LSIO_FSPI1_IPG_CLK				101
+#define IMX8QXP_LSIO_FSPI1_CLK					102
+#define IMX8QXP_LSIO_GPIO0_IPG_S_CLK				103
+#define IMX8QXP_LSIO_GPIO1_IPG_S_CLK				104
+#define IMX8QXP_LSIO_GPIO2_IPG_S_CLK				105
+#define IMX8QXP_LSIO_GPIO3_IPG_S_CLK				106
+#define IMX8QXP_LSIO_GPIO4_IPG_S_CLK				107
+#define IMX8QXP_LSIO_GPIO5_IPG_S_CLK				108
+#define IMX8QXP_LSIO_GPIO6_IPG_S_CLK				109
+#define IMX8QXP_LSIO_GPIO7_IPG_S_CLK				110
+#define IMX8QXP_LSIO_ROMCP_REG_CLK				111
+#define IMX8QXP_LSIO_ROMCP_CLK					112
+#define IMX8QXP_LSIO_96KROM_CLK					113
+#define IMX8QXP_LSIO_OCRAM_MEM_CLK				114
+#define IMX8QXP_LSIO_OCRAM_CTRL_CLK				115
+
+/* ADMA SS */
+#define IMX8QXP_UART1_IPG_CLK					116
+#define IMX8QXP_UART2_IPG_CLK					117
+#define IMX8QXP_UART3_IPG_CLK					118
+#define IMX8QXP_UART1_DIV					119
+#define IMX8QXP_UART2_DIV					120
+#define IMX8QXP_UART3_DIV					121
+#define IMX8QXP_UART1_CLK					122
+#define IMX8QXP_UART2_CLK					123
+#define IMX8QXP_UART3_CLK					124
+#define IMX8QXP_SPI0_IPG_CLK					125
+#define IMX8QXP_SPI1_IPG_CLK					126
+#define IMX8QXP_SPI2_IPG_CLK					127
+#define IMX8QXP_SPI3_IPG_CLK					128
+#define IMX8QXP_SPI0_DIV					129
+#define IMX8QXP_SPI1_DIV					130
+#define IMX8QXP_SPI2_DIV					131
+#define IMX8QXP_SPI3_DIV					132
+#define IMX8QXP_SPI0_CLK					133
+#define IMX8QXP_SPI1_CLK					134
+#define IMX8QXP_SPI2_CLK					135
+#define IMX8QXP_SPI3_CLK					136
+#define IMX8QXP_CAN0_IPG_CHI_CLK				137
+#define IMX8QXP_CAN1_IPG_CHI_CLK				138
+#define IMX8QXP_CAN2_IPG_CHI_CLK				139
+#define IMX8QXP_CAN0_IPG_CLK					140
+#define IMX8QXP_CAN1_IPG_CLK					141
+#define IMX8QXP_CAN2_IPG_CLK					142
+#define IMX8QXP_CAN0_DIV					143
+#define IMX8QXP_CAN1_DIV					144
+#define IMX8QXP_CAN2_DIV					145
+#define IMX8QXP_CAN0_CLK					146
+#define IMX8QXP_CAN1_CLK					147
+#define IMX8QXP_CAN2_CLK					148
+#define IMX8QXP_I2C0_IPG_CLK					149
+#define IMX8QXP_I2C1_IPG_CLK					150
+#define IMX8QXP_I2C2_IPG_CLK					151
+#define IMX8QXP_I2C3_IPG_CLK					152
+#define IMX8QXP_I2C0_DIV					153
+#define IMX8QXP_I2C1_DIV					154
+#define IMX8QXP_I2C2_DIV					155
+#define IMX8QXP_I2C3_DIV					156
+#define IMX8QXP_I2C0_CLK					157
+#define IMX8QXP_I2C1_CLK					158
+#define IMX8QXP_I2C2_CLK					159
+#define IMX8QXP_I2C3_CLK					160
+#define IMX8QXP_FTM0_IPG_CLK					161
+#define IMX8QXP_FTM1_IPG_CLK					162
+#define IMX8QXP_FTM0_DIV					163
+#define IMX8QXP_FTM1_DIV					164
+#define IMX8QXP_FTM0_CLK					165
+#define IMX8QXP_FTM1_CLK					166
+#define IMX8QXP_ADC0_IPG_CLK					167
+#define IMX8QXP_ADC0_DIV					168
+#define IMX8QXP_ADC0_CLK					169
+#define IMX8QXP_PWM_IPG_CLK					170
+#define IMX8QXP_PWM_DIV						171
+#define IMX8QXP_PWM_CLK						172
+#define IMX8QXP_LCD_IPG_CLK					173
+#define IMX8QXP_LCD_DIV						174
+#define IMX8QXP_LCD_CLK						175
+
+/* Connectivity SS */
+#define IMX8QXP_AXI_CONN_CLK_ROOT				176
+#define IMX8QXP_AHB_CONN_CLK_ROOT				177
+#define IMX8QXP_IPG_CONN_CLK_ROOT				178
+#define IMX8QXP_SDHC0_IPG_CLK					179
+#define IMX8QXP_SDHC1_IPG_CLK					180
+#define IMX8QXP_SDHC2_IPG_CLK					181
+#define IMX8QXP_SDHC0_DIV					182
+#define IMX8QXP_SDHC1_DIV					183
+#define IMX8QXP_SDHC2_DIV					184
+#define IMX8QXP_SDHC0_CLK					185
+#define IMX8QXP_SDHC1_CLK					186
+#define IMX8QXP_SDHC2_CLK					187
+#define IMX8QXP_ENET0_ROOT_DIV					188
+#define IMX8QXP_ENET0_REF_DIV					189
+#define IMX8QXP_ENET1_REF_DIV					190
+#define IMX8QXP_ENET0_BYPASS_DIV				191
+#define IMX8QXP_ENET0_RGMII_DIV					192
+#define IMX8QXP_ENET1_ROOT_DIV					193
+#define IMX8QXP_ENET1_BYPASS_DIV				194
+#define IMX8QXP_ENET1_RGMII_DIV					195
+#define IMX8QXP_ENET0_AHB_CLK					196
+#define IMX8QXP_ENET0_IPG_S_CLK					197
+#define IMX8QXP_ENET0_IPG_CLK					198
+#define IMX8QXP_ENET1_AHB_CLK					199
+#define IMX8QXP_ENET1_IPG_S_CLK					200
+#define IMX8QXP_ENET1_IPG_CLK					201
+#define IMX8QXP_ENET0_ROOT_CLK					202
+#define IMX8QXP_ENET1_ROOT_CLK					203
+#define IMX8QXP_ENET0_TX_CLK					204
+#define IMX8QXP_ENET1_TX_CLK					205
+#define IMX8QXP_ENET0_PTP_CLK					206
+#define IMX8QXP_ENET1_PTP_CLK					207
+#define IMX8QXP_ENET0_REF_25MHZ_125MHZ_SEL			208
+#define IMX8QXP_ENET1_REF_25MHZ_125MHZ_SEL			209
+#define IMX8QXP_ENET0_RMII_TX_SEL				210
+#define IMX8QXP_ENET1_RMII_TX_SEL				211
+#define IMX8QXP_ENET0_RGMII_TX_CLK				212
+#define IMX8QXP_ENET1_RGMII_TX_CLK				213
+#define IMX8QXP_ENET0_RMII_RX_CLK				214
+#define IMX8QXP_ENET1_RMII_RX_CLK				215
+#define IMX8QXP_ENET0_REF_25MHZ_125MHZ_CLK			216
+#define IMX8QXP_ENET1_REF_25MHZ_125MHZ_CLK			217
+#define IMX8QXP_ENET0_REF_50MHZ_CLK				218
+#define IMX8QXP_ENET1_REF_50MHZ_CLK				219
+#define IMX8QXP_GPMI_BCH_IO_DIV					220
+#define IMX8QXP_GPMI_BCH_DIV					221
+#define IMX8QXP_GPMI_APB_CLK					222
+#define IMX8QXP_GPMI_APB_BCH_CLK				223
+#define IMX8QXP_GPMI_BCH_IO_CLK					224
+#define IMX8QXP_GPMI_BCH_CLK					225
+#define IMX8QXP_APBHDMA_CLK					226
+#define IMX8QXP_USB3_ACLK_DIV					227
+#define IMX8QXP_USB3_BUS_DIV					228
+#define IMX8QXP_USB3_LPM_DIV					229
+#define IMX8QXP_USB3_IPG_CLK					230
+#define IMX8QXP_USB3_CORE_PCLK					231
+#define IMX8QXP_USB3_PHY_CLK					232
+#define IMX8QXP_USB3_ACLK					233
+#define IMX8QXP_USB3_BUS_CLK					234
+#define IMX8QXP_USB3_LPM_CLK					235
+#define IMX8QXP_USB2_OH_AHB_CLK					236
+#define IMX8QXP_USB2_OH_IPG_S_CLK				237
+#define IMX8QXP_USB2_OH_IPG_S_PL301_CLK				238
+#define IMX8QXP_USB2_PHY_IPG_CLK				239
+#define IMX8QXP_EDMA_CLK					240
+#define IMX8QXP_EDMA_IPG_CLK					241
+#define IMX8QXP_MLB_HCLK					242
+#define IMX8QXP_MLB_CLK						243
+#define IMX8QXP_MLB_IPG_CLK					244
+
+/* Display controller SS */
+/* DC part1 */
+#define IMX8QXP_DC_AXI_EXT_CLK					245
+#define IMX8QXP_DC_AXI_INT_CLK					246
+#define IMX8QXP_DC_CFG_CLK					247
+#define IMX8QXP_DC0_DISP0_CLK					248
+#define IMX8QXP_DC0_DISP1_CLK					249
+#define IMX8QXP_DC0_PRG0_RTRAM_CLK				250
+#define IMX8QXP_DC0_PRG0_APB_CLK				251
+#define IMX8QXP_DC0_PRG1_RTRAM_CLK				252
+#define IMX8QXP_DC0_PRG1_APB_CLK				253
+#define IMX8QXP_DC0_PRG2_RTRAM_CLK				254
+#define IMX8QXP_DC0_PRG2_APB_CLK				255
+#define IMX8QXP_DC0_PRG3_RTRAM_CLK				256
+#define IMX8QXP_DC0_PRG3_APB_CLK				257
+#define IMX8QXP_DC0_PRG4_RTRAM_CLK				258
+#define IMX8QXP_DC0_PRG4_APB_CLK				259
+#define IMX8QXP_DC0_PRG5_RTRAM_CLK				260
+#define IMX8QXP_DC0_PRG5_APB_CLK				261
+#define IMX8QXP_DC0_PRG6_RTRAM_CLK				262
+#define IMX8QXP_DC0_PRG6_APB_CLK				263
+#define IMX8QXP_DC0_PRG7_RTRAM_CLK				264
+#define IMX8QXP_DC0_PRG7_APB_CLK				265
+#define IMX8QXP_DC0_PRG8_RTRAM_CLK				266
+#define IMX8QXP_DC0_PRG8_APB_CLK				267
+#define IMX8QXP_DC0_DPR0_APB_CLK				268
+#define IMX8QXP_DC0_DPR0_B_CLK					269
+#define IMX8QXP_DC0_RTRAM0_CLK					270
+#define IMX8QXP_DC0_RTRAM1_CLK					271
+
+/* MIPI-LVDS part1 */
+#define IMX8QXP_MIPI_IPG_CLK					272
+#define IMX8QXP_MIPI0_I2C0_DIV					273
+#define IMX8QXP_MIPI0_I2C1_DIV					274
+#define IMX8QXP_MIPI0_I2C0_CLK					275
+#define IMX8QXP_MIPI0_I2C1_CLK					276
+#define IMX8QXP_MIPI0_I2C0_IPG_S_CLK				277
+#define IMX8QXP_MIPI0_I2C0_IPG_CLK				278
+#define IMX8QXP_MIPI0_I2C1_IPG_S_CLK				279
+#define IMX8QXP_MIPI0_I2C1_IPG_CLK				280
+#define IMX8QXP_MIPI0_PWM_IPG_S_CLK				281
+#define IMX8QXP_MIPI0_PWM_IPG_CLK				282
+#define IMX8QXP_MIPI0_PWM_32K_CLK				283
+#define IMX8QXP_MIPI0_GPIO_IPG_CLK				284
+
+#define IMX8QXP_IMG_JPEG_ENC_IPG_CLK				285
+#define IMX8QXP_IMG_JPEG_ENC_CLK				286
+#define IMX8QXP_IMG_JPEG_DEC_IPG_CLK				287
+#define IMX8QXP_IMG_JPEG_DEC_CLK				288
+#define IMX8QXP_IMG_PXL_LINK_DC0_CLK				289
+#define IMX8QXP_IMG_PXL_LINK_DC1_CLK				290
+#define IMX8QXP_IMG_PXL_LINK_CSI0_CLK				291
+#define IMX8QXP_IMG_PXL_LINK_CSI1_CLK				292
+#define IMX8QXP_IMG_PXL_LINK_HDMI_IN_CLK			293
+#define IMX8QXP_IMG_PDMA_0_CLK					294
+#define IMX8QXP_IMG_PDMA_1_CLK					295
+#define IMX8QXP_IMG_PDMA_2_CLK					296
+#define IMX8QXP_IMG_PDMA_3_CLK					297
+#define IMX8QXP_IMG_PDMA_4_CLK					298
+#define IMX8QXP_IMG_PDMA_5_CLK					299
+#define IMX8QXP_IMG_PDMA_6_CLK					300
+#define IMX8QXP_IMG_PDMA_7_CLK					301
+#define IMX8QXP_IMG_AXI_CLK					302
+#define IMX8QXP_IMG_IPG_CLK					303
+#define IMX8QXP_IMG_PXL_CLK					304
+
+#define IMX8QXP_CSI0_I2C0_DIV					305
+#define IMX8QXP_CSI0_PWM0_DIV					306
+#define IMX8QXP_CSI0_CORE_DIV					307
+#define IMX8QXP_CSI0_ESC_DIV					308
+#define IMX8QXP_CSI0_IPG_CLK_S					309
+#define IMX8QXP_CSI0_IPG_CLK					310
+#define IMX8QXP_CSI0_APB_CLK					311
+#define IMX8QXP_CSI0_I2C0_IPG_CLK				312
+#define IMX8QXP_CSI0_I2C0_CLK					313
+#define IMX8QXP_CSI0_PWM0_IPG_CLK				314
+#define IMX8QXP_CSI0_PWM0_CLK					315
+#define IMX8QXP_CSI0_CORE_CLK					316
+#define IMX8QXP_CSI0_ESC_CLK					317
+
+#define IMX8QXP_HSIO_AXI_CLK					318
+#define IMX8QXP_HSIO_PER_CLK					319
+#define IMX8QXP_HSIO_PCIE_MSTR_AXI_CLK				320
+#define IMX8QXP_HSIO_PCIE_SLV_AXI_CLK				321
+#define IMX8QXP_HSIO_PCIE_DBI_AXI_CLK				322
+#define IMX8QXP_HSIO_PCIE_X1_PER_CLK				323
+#define IMX8QXP_HSIO_PHY_X1_PER_CLK				324
+#define IMX8QXP_HSIO_MISC_PER_CLK				325
+#define IMX8QXP_HSIO_PHY_X1_APB_CLK				326
+#define IMX8QXP_HSIO_GPIO_CLK					327
+#define IMX8QXP_HSIO_PHY_X1_PCLK				328
+
+#define IMX8QXP_A35_DIV						329
+
+/* ACM */
+#define IMX8QXP_EXT_AUD_MCLK0					330
+#define IMX8QXP_EXT_AUD_MCLK1					331
+#define IMX8QXP_ESAI0_RX_CLK					332
+#define IMX8QXP_ESAI0_RX_HF_CLK					333
+#define IMX8QXP_ESAI0_TX_CLK					334
+#define IMX8QXP_ESAI0_TX_HF_CLK					335
+#define IMX8QXP_SPDIF0_RX					336
+#define IMX8QXP_SAI0_RX_BCLK					337
+#define IMX8QXP_SAI0_TX_BCLK					338
+#define IMX8QXP_SAI1_RX_BCLK					339
+#define IMX8QXP_SAI1_TX_BCLK					340
+#define IMX8QXP_SAI2_RX_BCLK					341
+#define IMX8QXP_SAI3_RX_BCLK					342
+#define IMX8QXP_SAI4_RX_BCLK					343
+
+#define IMX8QXP_ACM_AUD_CLK0_SEL				344
+#define IMX8QXP_ACM_AUD_CLK0_CLK				345
+#define IMX8QXP_ACM_AUD_CLK1_SEL				346
+#define IMX8QXP_ACM_AUD_CLK1_CLK				347
+#define IMX8QXP_ACM_MCLKOUT0_SEL				348
+#define IMX8QXP_ACM_MCLKOUT0_CLK				349
+#define IMX8QXP_ACM_MCLKOUT1_SEL				350
+#define IMX8QXP_ACM_MCLKOUT1_CLK				351
+#define IMX8QXP_ACM_ESAI0_MCLK_SEL				352
+#define IMX8QXP_ACM_ESAI0_MCLK_CLK				353
+#define IMX8QXP_ACM_GPT0_MUX_CLK_SEL				354
+#define IMX8QXP_ACM_GPT0_MUX_CLK_CLK				355
+#define IMX8QXP_ACM_GPT1_MUX_CLK_SEL				356
+#define IMX8QXP_ACM_GPT1_MUX_CLK_CLK				357
+#define IMX8QXP_ACM_GPT2_MUX_CLK_SEL				358
+#define IMX8QXP_ACM_GPT2_MUX_CLK_CLK				359
+#define IMX8QXP_ACM_GPT3_MUX_CLK_SEL				360
+#define IMX8QXP_ACM_GPT3_MUX_CLK_CLK				361
+#define IMX8QXP_ACM_GPT4_MUX_CLK_SEL				362
+#define IMX8QXP_ACM_GPT4_MUX_CLK_CLK				363
+#define IMX8QXP_ACM_GPT5_MUX_CLK_SEL				364
+#define IMX8QXP_ACM_GPT5_MUX_CLK_CLK				365
+#define IMX8QXP_ACM_SAI0_MCLK_SEL				366
+#define IMX8QXP_ACM_SAI0_MCLK_CLK				367
+#define IMX8QXP_ACM_SAI1_MCLK_SEL				368
+#define IMX8QXP_ACM_SAI1_MCLK_CLK				369
+#define IMX8QXP_ACM_SAI2_MCLK_SEL				370
+#define IMX8QXP_ACM_SAI2_MCLK_CLK				371
+#define IMX8QXP_ACM_SAI3_MCLK_SEL				372
+#define IMX8QXP_ACM_SAI3_MCLK_CLK				373
+#define IMX8QXP_ACM_SAI4_MCLK_SEL				374
+#define IMX8QXP_ACM_SAI4_MCLK_CLK				375
+#define IMX8QXP_ACM_SAI5_MCLK_SEL				376
+#define IMX8QXP_ACM_SAI5_MCLK_CLK				377
+#define IMX8QXP_ACM_SPDIF0_TX_CLK_SEL				378
+#define IMX8QXP_ACM_SPDIF0_TX_CLK_CLK				379
+#define IMX8QXP_ACM_MQS_TX_CLK_SEL				380
+#define IMX8QXP_ACM_MQS_TX_CLK_CLK				381
+#define IMX8QXP_ACM_ASRC0_MUX_CLK_SEL				382
+#define IMX8QXP_ACM_ASRC1_MUX_CLK_SEL				383
+#define IMX8QXP_ACM_ASRC0_MUX_CLK_CLK				384
+#define IMX8QXP_ACM_ASRC1_MUX_CLK_CLK				385
+
+#define IMX8QXP_IPG_AUD_CLK_ROOT				386
+
+/* Audio */
+#define IMX8QXP_AUD_PLL0_DIV					387
+#define IMX8QXP_AUD_PLL0					388
+#define IMX8QXP_AUD_PLL1_DIV					389
+#define IMX8QXP_AUD_PLL1					390
+#define IMX8QXP_AUD_AMIX_IPG					391
+#define IMX8QXP_AUD_ESAI_0_IPG					392
+#define IMX8QXP_AUD_ESAI_0_EXTAL_IPG				393
+#define IMX8QXP_AUD_SAI_0_IPG					394
+#define IMX8QXP_AUD_SAI_0_MCLK					395
+#define IMX8QXP_AUD_SAI_1_IPG					396
+#define IMX8QXP_AUD_SAI_1_MCLK					397
+#define IMX8QXP_AUD_SAI_2_IPG					398
+#define IMX8QXP_AUD_SAI_2_MCLK					399
+#define IMX8QXP_AUD_SAI_3_IPG					400
+#define IMX8QXP_AUD_SAI_3_MCLK					401
+#define IMX8QXP_AUD_SAI_4_IPG					402
+#define IMX8QXP_AUD_SAI_4_MCLK					403
+#define IMX8QXP_AUD_SAI_5_IPG					404
+#define IMX8QXP_AUD_SAI_5_MCLK					405
+#define IMX8QXP_AUD_MQS_IPG					406
+#define IMX8QXP_AUD_MQS_HMCLK					407
+#define IMX8QXP_AUD_GPT5_IPG					408
+#define IMX8QXP_AUD_GPT5_CLKIN					409
+#define IMX8QXP_AUD_GPT6_IPG					410
+#define IMX8QXP_AUD_GPT6_CLKIN					411
+#define IMX8QXP_AUD_GPT7_IPG					412
+#define IMX8QXP_AUD_GPT7_CLKIN					413
+#define IMX8QXP_AUD_GPT8_IPG					414
+#define IMX8QXP_AUD_GPT8_CLKIN					415
+#define IMX8QXP_AUD_GPT9_IPG					416
+#define IMX8QXP_AUD_GPT9_CLKIN					417
+#define IMX8QXP_AUD_GPT10_IPG					418
+#define IMX8QXP_AUD_GPT10_CLKIN					419
+#define IMX8QXP_AUD_ACM_AUD_PLL_CLK0_DIV			420
+#define IMX8QXP_AUD_ACM_AUD_PLL_CLK0_CLK			421
+#define IMX8QXP_AUD_ACM_AUD_PLL_CLK1_DIV			422
+#define IMX8QXP_AUD_ACM_AUD_PLL_CLK1_CLK			423
+#define IMX8QXP_AUD_ACM_AUD_REC_CLK0_DIV			424
+#define IMX8QXP_AUD_ACM_AUD_REC_CLK0_CLK			425
+#define IMX8QXP_AUD_ACM_AUD_REC_CLK1_DIV			426
+#define IMX8QXP_AUD_ACM_AUD_REC_CLK1_CLK			427
+#define IMX8QXP_AUD_MCLKOUT0					428
+#define IMX8QXP_AUD_MCLKOUT1					429
+#define IMX8QXP_AUD_SPDIF_0_TX_CLK				430
+#define IMX8QXP_AUD_SPDIF_0_GCLKW				431
+#define IMX8QXP_AUD_SPDIF_0_IPG					432
+#define IMX8QXP_AUD_ASRC_0_IPG					433
+#define IMX8QXP_AUD_ASRC_1_IPG					434
+#define IMX8QXP_AUD_DSP_ADB_ACLK				435
+#define IMX8QXP_AUD_DSP_IPG				        436
+#define IMX8QXP_AUD_DSP_CORE_CLK				437
+#define IMX8QXP_AUD_OCRAM_IPG					438
+
+/* DC part2 */
+#define IMX8QXP_DC0_DISP0_DIV					439
+#define IMX8QXP_DC0_DISP1_DIV					440
+#define IMX8QXP_DC0_BYPASS_0_DIV				441
+#define IMX8QXP_DC0_BYPASS_1_DIV				442
+#define IMX8QXP_DC0_PLL0_DIV					443
+#define IMX8QXP_DC0_PLL1_DIV					444
+#define IMX8QXP_DC0_PLL0_CLK					445
+#define IMX8QXP_DC0_PLL1_CLK					446
+
+/* MIPI-LVDS part2 */
+#define IMX8QXP_MIPI0_BYPASS_CLK				447
+#define IMX8QXP_MIPI0_PIXEL_DIV					448
+#define IMX8QXP_MIPI0_PIXEL_CLK					449
+#define IMX8QXP_MIPI0_LVDS_PIXEL_DIV				450
+#define IMX8QXP_MIPI0_LVDS_PIXEL_CLK				451
+#define IMX8QXP_MIPI0_LVDS_BYPASS_CLK				452
+#define IMX8QXP_MIPI0_LVDS_PHY_DIV				453
+#define IMX8QXP_MIPI0_LVDS_PHY_CLK				454
+#define IMX8QXP_MIPI0_DSI_TX_ESC_DIV				455
+#define IMX8QXP_MIPI0_DSI_RX_ESC_DIV				456
+#define IMX8QXP_MIPI0_DSI_TX_ESC_CLK				457
+#define IMX8QXP_MIPI0_DSI_RX_ESC_CLK				458
+#define IMX8QXP_MIPI0_LIS_IPG_CLK				459
+#define IMX8QXP_MIPI1_I2C0_DIV					460
+#define IMX8QXP_MIPI1_I2C1_DIV					461
+#define IMX8QXP_MIPI1_I2C0_CLK					462
+#define IMX8QXP_MIPI1_I2C1_CLK					463
+#define IMX8QXP_MIPI1_I2C0_IPG_S_CLK				464
+#define IMX8QXP_MIPI1_I2C0_IPG_CLK				465
+#define IMX8QXP_MIPI1_I2C1_IPG_S_CLK				466
+#define IMX8QXP_MIPI1_I2C1_IPG_CLK				467
+#define IMX8QXP_MIPI1_PWM_IPG_S_CLK				468
+#define IMX8QXP_MIPI1_PWM_IPG_CLK				469
+#define IMX8QXP_MIPI1_PWM_32K_CLK				470
+#define IMX8QXP_MIPI1_GPIO_IPG_CLK				471
+#define IMX8QXP_MIPI1_BYPASS_CLK				472
+#define IMX8QXP_MIPI1_PIXEL_DIV					473
+#define IMX8QXP_MIPI1_PIXEL_CLK					474
+#define IMX8QXP_MIPI1_LVDS_PIXEL_DIV				475
+#define IMX8QXP_MIPI1_LVDS_PIXEL_CLK				476
+#define IMX8QXP_MIPI1_LVDS_BYPASS_CLK				477
+#define IMX8QXP_MIPI1_LVDS_PHY_DIV				478
+#define IMX8QXP_MIPI1_LVDS_PHY_CLK				479
+#define IMX8QXP_MIPI1_DSI_TX_ESC_DIV				480
+#define IMX8QXP_MIPI1_DSI_RX_ESC_DIV				481
+#define IMX8QXP_MIPI1_DSI_TX_ESC_CLK				482
+#define IMX8QXP_MIPI1_DSI_RX_ESC_CLK				483
+
+#define IMX8QXP_MIPI1_LIS_IPG_CLK				484
+
+/* CM40 */
+#define IMX8QXP_CM40_IPG_CLK					485
+#define IMX8QXP_CM40_I2C_DIV					486
+#define IMX8QXP_CM40_I2C_CLK					487
+#define IMX8QXP_CM40_I2C_IPG_CLK				488
+
+/* VPU clocks. */
+#define IMX8QXP_VPU_ENC_CLK					489
+#define IMX8QXP_VPU_DEC_CLK					490
+
+/* MIPI-LVDS part3 */
+#define IMX8QXP_MIPI0_DSI_PLL_CLK				491
+#define IMX8QXP_MIPI0_DSI_PLL_DIV2_CLK				492
+#define IMX8QXP_MIPI0_LVDS_PIXEL_SEL				493
+#define IMX8QXP_MIPI0_LVDS_PHY_SEL				494
+#define IMX8QXP_MIPI0_DSI_TX_ESC_SEL				495
+#define IMX8QXP_MIPI0_DSI_RX_ESC_SEL				496
+#define IMX8QXP_MIPI0_DSI_PHY_SEL				498
+#define IMX8QXP_MIPI0_DSI_PHY_DIV				499
+#define IMX8QXP_MIPI0_DSI_PHY_CLK				500
+#define IMX8QXP_MIPI1_DSI_PLL_CLK				501
+#define IMX8QXP_MIPI1_DSI_PLL_DIV2_CLK				502
+#define IMX8QXP_MIPI1_LVDS_PIXEL_SEL				503
+#define IMX8QXP_MIPI1_LVDS_PHY_SEL				504
+#define IMX8QXP_MIPI1_DSI_TX_ESC_SEL				505
+#define IMX8QXP_MIPI1_DSI_RX_ESC_SEL				506
+#define IMX8QXP_MIPI1_DSI_PHY_SEL				507
+#define IMX8QXP_MIPI1_DSI_PHY_DIV				508
+#define IMX8QXP_MIPI1_DSI_PHY_CLK				509
+
+/* DC part3 */
+#define IMX8QXP_DC0_DPR1_APB_CLK				510
+#define IMX8QXP_DC0_DPR1_B_CLK					511
+
+#define	IMX8QXP_CONN_PLL0_CLK					512
+#define	IMX8QXP_CONN_PLL1_CLK					513
+#define IMX8QXP_SDHC0_SEL					514
+#define IMX8QXP_SDHC1_SEL					515
+#define IMX8QXP_SDHC2_SEL					516
+
+/* PARALLER CSI */
+#define IMX8QXP_PARALLEL_CSI_CLK_DPLL		517
+#define IMX8QXP_PARALLEL_CSI_CLK_SEL		518
+#define IMX8QXP_PARALLEL_CSI_PER_CLK_DIV	519
+#define IMX8QXP_PARALLEL_CSI_PIXEL_CLK		520
+#define IMX8QXP_PARALLEL_CSI_IPG_CLK		521
+#define IMX8QXP_PARALLEL_CSI_MCLK_DIV		522
+#define IMX8QXP_PARALLEL_CSI_MISC0_CLK		523
+
+#define IMX8QXP_MIPI0_PWM_DIV					524
+#define IMX8QXP_MIPI1_PWM_DIV					525
+#define IMX8QXP_MIPI0_PWM_CLK					526
+#define IMX8QXP_MIPI1_PWM_CLK					527
+
+#define IMX8QXP_LSIO_MU5A_IPG_S_CLK		528
+#define IMX8QXP_LSIO_MU5A_IPG_CLK		529
+
+#define IMX8QXP_CLK_END						530
+#endif /* __DT_BINDINGS_CLOCK_IMX8QXP_H */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 03/32] dt-bindings: soc: add i.MX8QXP pm and rsrc definition
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 01/32] dt-bindings: pinctrl: add i.MX8QXP pads definition Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 02/32] dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 04/32] imx8: add scfw macro definition Peng Fan
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8QXP power and resource definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 include/dt-bindings/soc/imx8_pd.h  | 188 +++++++++++++
 include/dt-bindings/soc/imx_rsrc.h | 557 +++++++++++++++++++++++++++++++++++++
 2 files changed, 745 insertions(+)
 create mode 100644 include/dt-bindings/soc/imx8_pd.h
 create mode 100644 include/dt-bindings/soc/imx_rsrc.h

diff --git a/include/dt-bindings/soc/imx8_pd.h b/include/dt-bindings/soc/imx8_pd.h
new file mode 100644
index 0000000000..682b608eef
--- /dev/null
+++ b/include/dt-bindings/soc/imx8_pd.h
@@ -0,0 +1,188 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __DT_BINDINGS_IMX8_PD_H
+#define __DT_BINDINGS_IMX8_PD_H
+
+/*!
+ * These defines are used to indicate a resource. Resources include peripherals
+ * and bus masters (but not memory regions). Note items from list should
+ * never be changed or removed (only added to at the end of the list).
+ */
+#define PD_DC_0                     dc0_power_domain
+#define PD_DC_0_PLL_0               dc0_pll0
+#define PD_DC_0_PLL_1               dc0_pll1
+#define PD_LVDS0                    lvds0_power_domain
+#define PD_LVDS0_I2C0               lvds0_i2c0
+#define PD_LVDS0_I2C1               lvds0_i2c1
+#define PD_LVDS0_PWM                lvds0_pwm
+#define PD_LVDS0_PWM                lvds0_pwm
+#define PD_LVDS0_GPIO               lvds0_gpio
+#define PD_DC_1                     dc1_power_domain
+#define PD_DC_1_PLL_0               dc1_pll0
+#define PD_DC_1_PLL_1               dc1_pll1
+#define PD_LVDS1                    lvds1_power_domain
+#define PD_LVDS1_I2C0               lvds1_i2c0
+#define PD_LVDS1_I2C1               lvds1_i2c1
+#define PD_LVDS1_PWM                lvds1_pwm
+#define PD_LVDS1_GPIO               lvds1_gpio
+
+#define PD_DMA                      dma_power_domain
+#define PD_DMA_SPI_0                dma_spi0
+#define PD_DMA_SPI_1                dma_spi1
+#define PD_DMA_SPI_2                dma_spi2
+#define PD_DMA_SPI_3                dma_spi3
+#define PD_DMA_UART0                dma_lpuart0
+#define PD_DMA_UART1                dma_lpuart1
+#define PD_DMA_UART2                dma_lpuart2
+#define PD_DMA_UART3                dma_lpuart3
+#define PD_DMA_UART4                dma_lpuart4
+#define PD_DMA_EMVSIM_0             dma_emvsim0
+#define PD_DMA_EMVSIM_1             dma_emvsim1
+#define PD_DMA_I2C_0                dma_lpi2c0
+#define PD_DMA_I2C_1                dma_lpi2c1
+#define PD_DMA_I2C_2                dma_lpi2c2
+#define PD_DMA_I2C_3                dma_lpi2c3
+#define PD_DMA_I2C_4                dma_lpi2c4
+#define PD_DMA_ADC_0                dma_adc0
+#define PD_DMA_ADC_1                dma_adc1
+#define PD_DMA_FTM_0                dma_ftm0
+#define PD_DMA_FTM_1                dma_ftm1
+#define PD_DMA_CAN_0                dma_flexcan0
+#define PD_DMA_CAN_1                dma_flexcan1
+#define PD_DMA_CAN_2                dma_flexcan2
+#define PD_DMA_PWM_0                dma_pwm0
+#define PD_DMA_LCD_0                dma_lcd0
+
+#define PD_HSIO                     hsio_power_domain
+#define PD_HSIO_PCIE_A              hsio_pcie0
+#define PD_HSIO_PCIE_B              hsio_pcie1
+#define PD_HSIO_SATA_0              hsio_sata0
+#define PD_HSIO_GPIO                hsio_gpio
+
+#define PD_LCD_0                    lcd0_power_domain
+#define PD_LCD_0_I2C_0              lcd0_i2c0
+#define PD_LCD_0_I2C_1              lcd0_i2c1
+#define PD_LCD_PWM_0                lcd0_pwm0
+
+#define PD_LSIO                     lsio_power_domain
+#define PD_LSIO_GPIO_0              lsio_gpio0
+#define PD_LSIO_GPIO_1              lsio_gpio1
+#define PD_LSIO_GPIO_2              lsio_gpio2
+#define PD_LSIO_GPIO_3              lsio_gpio3
+#define PD_LSIO_GPIO_4              lsio_gpio4
+#define PD_LSIO_GPIO_5              lsio_gpio5
+#define PD_LSIO_GPIO_6              lsio_gpio6
+#define PD_LSIO_GPIO_7              lsio_gpio7
+#define PD_LSIO_GPT_0               lsio_gpt0
+#define PD_LSIO_GPT_1               lsio_gpt1
+#define PD_LSIO_GPT_2               lsio_gpt2
+#define PD_LSIO_GPT_3               lsio_gpt3
+#define PD_LSIO_GPT_4               lsio_gpt4
+#define PD_LSIO_KPP                 lsio_kpp
+#define PD_LSIO_FSPI_0              lsio_fspi0
+#define PD_LSIO_FSPI_1              lsio_fspi1
+#define PD_LSIO_PWM_0               lsio_pwm0
+#define PD_LSIO_PWM_1               lsio_pwm1
+#define PD_LSIO_PWM_2               lsio_pwm2
+#define PD_LSIO_PWM_3               lsio_pwm3
+#define PD_LSIO_PWM_4               lsio_pwm4
+#define PD_LSIO_PWM_5               lsio_pwm5
+#define PD_LSIO_PWM_6               lsio_pwm6
+#define PD_LSIO_PWM_7               lsio_pwm7
+
+#define PD_CONN                     connectivity_power_domain
+#define PD_CONN_SDHC_0              conn_sdhc0
+#define PD_CONN_SDHC_1              conn_sdhc1
+#define PD_CONN_SDHC_2              conn_sdhc2
+#define PD_CONN_ENET_0              conn_enet0
+#define PD_CONN_ENET_1              conn_enet1
+#define PD_CONN_MLB_0               conn_mlb0
+#define PD_CONN_DMA_4_CH0           conn_dma4_ch0
+#define PD_CONN_DMA_4_CH1           conn_dma4_ch1
+#define PD_CONN_DMA_4_CH2           conn_dma4_ch2
+#define PD_CONN_DMA_4_CH3           conn_dma4_ch3
+#define PD_CONN_DMA_4_CH4           conn_dma4_ch4
+#define PD_CONN_USB_0               conn_usb0
+#define PD_CONN_USB_1               conn_usb1
+#define PD_CONN_USB_0_PHY           conn_usb0_phy
+#define PD_CONN_USB_2               conn_usb2
+#define PD_CONN_USB_2_PHY           conn_usb2_phy
+#define PD_CONN_NAND                conn_nand
+
+#define PD_AUDIO                    audio_power_domain
+#define PD_AUD_SAI_0                audio_sai0
+#define PD_AUD_SAI_1                audio_sai1
+#define PD_AUD_SAI_2                audio_sai2
+#define PD_AUD_ASRC_0               audio_asrc0
+#define PD_AUD_ASRC_1               audio_asrc1
+#define PD_AUD_ESAI_0               audio_esai0
+#define PD_AUD_ESAI_1               audio_esai1
+#define PD_AUD_SPDIF_0              audio_spdif0
+#define PD_AUD_SPDIF_1              audio_spdif1
+#define PD_AUD_SAI_3                audio_sai3
+#define PD_AUD_SAI_4                audio_sai4
+#define PD_AUD_SAI_5                audio_sai5
+#define PD_AUD_SAI_6                audio_sai6
+#define PD_AUD_SAI_7                audio_sai7
+#define PD_AUD_GPT_5                audio_gpt5
+#define PD_AUD_GPT_6                audio_gpt6
+#define PD_AUD_GPT_7                audio_gpt7
+#define PD_AUD_GPT_8                audio_gpt8
+#define PD_AUD_GPT_9                audio_gpt9
+#define PD_AUD_GPT_10               audio_gpt10
+#define PD_AUD_AMIX                 audio_amix
+#define PD_AUD_MQS_0                audio_mqs0
+#define PD_AUD_HIFI                 audio_hifi
+#define PD_AUD_OCRAM                audio_ocram
+#define PD_AUD_MCLK_OUT_0           audio_mclkout0
+#define PD_AUD_MCLK_OUT_1           audio_mclkout1
+#define PD_AUD_AUDIO_PLL_0          audio_audiopll0
+#define PD_AUD_AUDIO_PLL_1          audio_audiopll1
+#define PD_AUD_AUDIO_CLK_0          audio_audioclk0
+#define PD_AUD_AUDIO_CLK_1          audio_audioclk1
+
+#define PD_IMAGING                  imaging_power_domain
+#define PD_IMAGING_JPEG_DEC         imaging_jpeg_dec
+#define PD_IMAGING_JPEG_ENC         imaging_jpeg_enc
+#define PD_IMAGING_PDMA0            PD_IMAGING
+#define PD_IMAGING_PDMA1            imaging_pdma1
+#define PD_IMAGING_PDMA2            imaging_pdma2
+#define PD_IMAGING_PDMA3            imaging_pdma3
+#define PD_IMAGING_PDMA4            imaging_pdma4
+#define PD_IMAGING_PDMA5            imaging_pdma5
+#define PD_IMAGING_PDMA6            imaging_pdma6
+#define PD_IMAGING_PDMA7            imaging_pdma7
+
+#define PD_MIPI_0_DSI               mipi0_dsi_power_domain
+#define PD_MIPI_0_DSI_I2C0          mipi0_dsi_i2c0
+#define PD_MIPI_0_DSI_I2C1          mipi0_dsi_i2c1
+#define PD_MIPI_0_DSI_PWM0          mipi0_dsi_pwm0
+#define PD_MIPI_1_DSI               mipi1_dsi_power_domain
+#define PD_MIPI_1_DSI_I2C0          mipi1_dsi_i2c0
+#define PD_MIPI_1_DSI_I2C1          mipi1_dsi_i2c1
+#define PD_MIPI_1_DSI_PWM0          mipi1_dsi_pwm0
+
+#define PD_MIPI_CSI0                mipi_csi0_power_domain
+#define PD_MIPI_CSI0_PWM            mipi_csi0_pwm
+#define PD_MIPI_CSI0_I2C            mipi_csi0_i2c
+#define PD_MIPI_CSI1                mipi_csi1_power_domain
+#define PD_MIPI_CSI1_PWM_0          mipi_csi1_pwm
+#define PD_MIPI_CSI1_I2C_0          mipi_csi1_i2c
+
+#define PD_HDMI                     hdmi_power_domain
+#define PD_HDMI_I2C_0               hdmi_i2c
+#define PD_HDMI_PWM_0               hdmi_pwm
+#define PD_HDMI_GPIO_0              hdmi_gpio
+
+#define PD_HDMI_RX                  hdmi_rx_power_domain
+#define PD_HDMI_RX_I2C              hdmi_rx_i2c
+#define PD_HDMI_RX_PWM              hdmi_rx_pwm
+
+#define PD_CM40                     cm40_power_domain
+#define PD_CM40_I2C                 cm40_i2c
+#define PD_CM40_INTMUX              cm40_intmux
+
+#endif /* __DT_BINDINGS_IMX8_PD_H */
diff --git a/include/dt-bindings/soc/imx_rsrc.h b/include/dt-bindings/soc/imx_rsrc.h
new file mode 100644
index 0000000000..4870eb985b
--- /dev/null
+++ b/include/dt-bindings/soc/imx_rsrc.h
@@ -0,0 +1,557 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef DT_BINDINGS_RSCRC_IMX_H
+#define DT_BINDINGS_RSCRC_IMX_H
+
+/*!
+ * These defines are used to indicate a resource. Resources include peripherals
+ * and bus masters (but not memory regions). Note items from list should
+ * never be changed or removed (only added to at the end of the list).
+ */
+#define SC_R_A53                        0
+#define SC_R_A53_0                      1
+#define SC_R_A53_1                      2
+#define SC_R_A53_2                      3
+#define SC_R_A53_3                      4
+#define SC_R_A72                        5
+#define SC_R_A72_0                      6
+#define SC_R_A72_1                      7
+#define SC_R_A72_2                      8
+#define SC_R_A72_3                      9
+#define SC_R_CCI                        10
+#define SC_R_DB                         11
+#define SC_R_DRC_0                      12
+#define SC_R_DRC_1                      13
+#define SC_R_GIC_SMMU                   14
+#define SC_R_IRQSTR_M4_0                15
+#define SC_R_IRQSTR_M4_1                16
+#define SC_R_SMMU                       17
+#define SC_R_GIC                        18
+#define SC_R_DC_0_BLIT0                 19
+#define SC_R_DC_0_BLIT1                 20
+#define SC_R_DC_0_BLIT2                 21
+#define SC_R_DC_0_BLIT_OUT              22
+#define SC_R_DC_0_CAPTURE0              23
+#define SC_R_DC_0_CAPTURE1              24
+#define SC_R_DC_0_WARP                  25
+#define SC_R_DC_0_INTEGRAL0             26
+#define SC_R_DC_0_INTEGRAL1             27
+#define SC_R_DC_0_VIDEO0                28
+#define SC_R_DC_0_VIDEO1                29
+#define SC_R_DC_0_FRAC0                 30
+#define SC_R_DC_0_FRAC1                 31
+#define SC_R_DC_0                       32
+#define SC_R_GPU_2_PID0                 33
+#define SC_R_DC_0_PLL_0                 34
+#define SC_R_DC_0_PLL_1                 35
+#define SC_R_DC_1_BLIT0                 36
+#define SC_R_DC_1_BLIT1                 37
+#define SC_R_DC_1_BLIT2                 38
+#define SC_R_DC_1_BLIT_OUT              39
+#define SC_R_DC_1_CAPTURE0              40
+#define SC_R_DC_1_CAPTURE1              41
+#define SC_R_DC_1_WARP                  42
+#define SC_R_DC_1_INTEGRAL0             43
+#define SC_R_DC_1_INTEGRAL1             44
+#define SC_R_DC_1_VIDEO0                45
+#define SC_R_DC_1_VIDEO1                46
+#define SC_R_DC_1_FRAC0                 47
+#define SC_R_DC_1_FRAC1                 48
+#define SC_R_DC_1                       49
+#define SC_R_GPU_3_PID0                 50
+#define SC_R_DC_1_PLL_0                 51
+#define SC_R_DC_1_PLL_1                 52
+#define SC_R_SPI_0                      53
+#define SC_R_SPI_1                      54
+#define SC_R_SPI_2                      55
+#define SC_R_SPI_3                      56
+#define SC_R_UART_0                     57
+#define SC_R_UART_1                     58
+#define SC_R_UART_2                     59
+#define SC_R_UART_3                     60
+#define SC_R_UART_4                     61
+#define SC_R_EMVSIM_0                   62
+#define SC_R_EMVSIM_1                   63
+#define SC_R_DMA_0_CH0                  64
+#define SC_R_DMA_0_CH1                  65
+#define SC_R_DMA_0_CH2                  66
+#define SC_R_DMA_0_CH3                  67
+#define SC_R_DMA_0_CH4                  68
+#define SC_R_DMA_0_CH5                  69
+#define SC_R_DMA_0_CH6                  70
+#define SC_R_DMA_0_CH7                  71
+#define SC_R_DMA_0_CH8                  72
+#define SC_R_DMA_0_CH9                  73
+#define SC_R_DMA_0_CH10                 74
+#define SC_R_DMA_0_CH11                 75
+#define SC_R_DMA_0_CH12                 76
+#define SC_R_DMA_0_CH13                 77
+#define SC_R_DMA_0_CH14                 78
+#define SC_R_DMA_0_CH15                 79
+#define SC_R_DMA_0_CH16                 80
+#define SC_R_DMA_0_CH17                 81
+#define SC_R_DMA_0_CH18                 82
+#define SC_R_DMA_0_CH19                 83
+#define SC_R_DMA_0_CH20                 84
+#define SC_R_DMA_0_CH21                 85
+#define SC_R_DMA_0_CH22                 86
+#define SC_R_DMA_0_CH23                 87
+#define SC_R_DMA_0_CH24                 88
+#define SC_R_DMA_0_CH25                 89
+#define SC_R_DMA_0_CH26                 90
+#define SC_R_DMA_0_CH27                 91
+#define SC_R_DMA_0_CH28                 92
+#define SC_R_DMA_0_CH29                 93
+#define SC_R_DMA_0_CH30                 94
+#define SC_R_DMA_0_CH31                 95
+#define SC_R_I2C_0                      96
+#define SC_R_I2C_1                      97
+#define SC_R_I2C_2                      98
+#define SC_R_I2C_3                      99
+#define SC_R_I2C_4                      100
+#define SC_R_ADC_0                      101
+#define SC_R_ADC_1                      102
+#define SC_R_FTM_0                      103
+#define SC_R_FTM_1                      104
+#define SC_R_CAN_0                      105
+#define SC_R_CAN_1                      106
+#define SC_R_CAN_2                      107
+#define SC_R_DMA_1_CH0                  108
+#define SC_R_DMA_1_CH1                  109
+#define SC_R_DMA_1_CH2                  110
+#define SC_R_DMA_1_CH3                  111
+#define SC_R_DMA_1_CH4                  112
+#define SC_R_DMA_1_CH5                  113
+#define SC_R_DMA_1_CH6                  114
+#define SC_R_DMA_1_CH7                  115
+#define SC_R_DMA_1_CH8                  116
+#define SC_R_DMA_1_CH9                  117
+#define SC_R_DMA_1_CH10                 118
+#define SC_R_DMA_1_CH11                 119
+#define SC_R_DMA_1_CH12                 120
+#define SC_R_DMA_1_CH13                 121
+#define SC_R_DMA_1_CH14                 122
+#define SC_R_DMA_1_CH15                 123
+#define SC_R_DMA_1_CH16                 124
+#define SC_R_DMA_1_CH17                 125
+#define SC_R_DMA_1_CH18                 126
+#define SC_R_DMA_1_CH19                 127
+#define SC_R_DMA_1_CH20                 128
+#define SC_R_DMA_1_CH21                 129
+#define SC_R_DMA_1_CH22                 130
+#define SC_R_DMA_1_CH23                 131
+#define SC_R_DMA_1_CH24                 132
+#define SC_R_DMA_1_CH25                 133
+#define SC_R_DMA_1_CH26                 134
+#define SC_R_DMA_1_CH27                 135
+#define SC_R_DMA_1_CH28                 136
+#define SC_R_DMA_1_CH29                 137
+#define SC_R_DMA_1_CH30                 138
+#define SC_R_DMA_1_CH31                 139
+#define SC_R_UNUSED1                    140
+#define SC_R_UNUSED2                    141
+#define SC_R_UNUSED3                    142
+#define SC_R_UNUSED4                    143
+#define SC_R_GPU_0_PID0                 144
+#define SC_R_GPU_0_PID1                 145
+#define SC_R_GPU_0_PID2                 146
+#define SC_R_GPU_0_PID3                 147
+#define SC_R_GPU_1_PID0                 148
+#define SC_R_GPU_1_PID1                 149
+#define SC_R_GPU_1_PID2                 150
+#define SC_R_GPU_1_PID3                 151
+#define SC_R_PCIE_A                     152
+#define SC_R_SERDES_0                   153
+#define SC_R_MATCH_0                    154
+#define SC_R_MATCH_1                    155
+#define SC_R_MATCH_2                    156
+#define SC_R_MATCH_3                    157
+#define SC_R_MATCH_4                    158
+#define SC_R_MATCH_5                    159
+#define SC_R_MATCH_6                    160
+#define SC_R_MATCH_7                    161
+#define SC_R_MATCH_8                    162
+#define SC_R_MATCH_9                    163
+#define SC_R_MATCH_10                   164
+#define SC_R_MATCH_11                   165
+#define SC_R_MATCH_12                   166
+#define SC_R_MATCH_13                   167
+#define SC_R_MATCH_14                   168
+#define SC_R_PCIE_B                     169
+#define SC_R_SATA_0                     170
+#define SC_R_SERDES_1                   171
+#define SC_R_HSIO_GPIO                  172
+#define SC_R_MATCH_15                   173
+#define SC_R_MATCH_16                   174
+#define SC_R_MATCH_17                   175
+#define SC_R_MATCH_18                   176
+#define SC_R_MATCH_19                   177
+#define SC_R_MATCH_20                   178
+#define SC_R_MATCH_21                   179
+#define SC_R_MATCH_22                   180
+#define SC_R_MATCH_23                   181
+#define SC_R_MATCH_24                   182
+#define SC_R_MATCH_25                   183
+#define SC_R_MATCH_26                   184
+#define SC_R_MATCH_27                   185
+#define SC_R_MATCH_28                   186
+#define SC_R_LCD_0                      187
+#define SC_R_LCD_0_PWM_0                188
+#define SC_R_LCD_0_I2C_0                189
+#define SC_R_LCD_0_I2C_1                190
+#define SC_R_PWM_0                      191
+#define SC_R_PWM_1                      192
+#define SC_R_PWM_2                      193
+#define SC_R_PWM_3                      194
+#define SC_R_PWM_4                      195
+#define SC_R_PWM_5                      196
+#define SC_R_PWM_6                      197
+#define SC_R_PWM_7                      198
+#define SC_R_GPIO_0                     199
+#define SC_R_GPIO_1                     200
+#define SC_R_GPIO_2                     201
+#define SC_R_GPIO_3                     202
+#define SC_R_GPIO_4                     203
+#define SC_R_GPIO_5                     204
+#define SC_R_GPIO_6                     205
+#define SC_R_GPIO_7                     206
+#define SC_R_GPT_0                      207
+#define SC_R_GPT_1                      208
+#define SC_R_GPT_2                      209
+#define SC_R_GPT_3                      210
+#define SC_R_GPT_4                      211
+#define SC_R_KPP                        212
+#define SC_R_MU_0A                      213
+#define SC_R_MU_1A                      214
+#define SC_R_MU_2A                      215
+#define SC_R_MU_3A                      216
+#define SC_R_MU_4A                      217
+#define SC_R_MU_5A                      218
+#define SC_R_MU_6A                      219
+#define SC_R_MU_7A                      220
+#define SC_R_MU_8A                      221
+#define SC_R_MU_9A                      222
+#define SC_R_MU_10A                     223
+#define SC_R_MU_11A                     224
+#define SC_R_MU_12A                     225
+#define SC_R_MU_13A                     226
+#define SC_R_MU_5B                      227
+#define SC_R_MU_6B                      228
+#define SC_R_MU_7B                      229
+#define SC_R_MU_8B                      230
+#define SC_R_MU_9B                      231
+#define SC_R_MU_10B                     232
+#define SC_R_MU_11B                     233
+#define SC_R_MU_12B                     234
+#define SC_R_MU_13B                     235
+#define SC_R_ROM_0                      236
+#define SC_R_FSPI_0                     237
+#define SC_R_FSPI_1                     238
+#define SC_R_IEE                        239
+#define SC_R_IEE_R0                     240
+#define SC_R_IEE_R1                     241
+#define SC_R_IEE_R2                     242
+#define SC_R_IEE_R3                     243
+#define SC_R_IEE_R4                     244
+#define SC_R_IEE_R5                     245
+#define SC_R_IEE_R6                     246
+#define SC_R_IEE_R7                     247
+#define SC_R_SDHC_0                     248
+#define SC_R_SDHC_1                     249
+#define SC_R_SDHC_2                     250
+#define SC_R_ENET_0                     251
+#define SC_R_ENET_1                     252
+#define SC_R_MLB_0                      253
+#define SC_R_DMA_2_CH0                  254
+#define SC_R_DMA_2_CH1                  255
+#define SC_R_DMA_2_CH2                  256
+#define SC_R_DMA_2_CH3                  257
+#define SC_R_DMA_2_CH4                  258
+#define SC_R_USB_0                      259
+#define SC_R_USB_1                      260
+#define SC_R_USB_0_PHY                  261
+#define SC_R_USB_2                      262
+#define SC_R_USB_2_PHY                  263
+#define SC_R_DTCP                       264
+#define SC_R_NAND                       265
+#define SC_R_LVDS_0                     266
+#define SC_R_LVDS_0_PWM_0               267
+#define SC_R_LVDS_0_I2C_0               268
+#define SC_R_LVDS_0_I2C_1               269
+#define SC_R_LVDS_1                     270
+#define SC_R_LVDS_1_PWM_0               271
+#define SC_R_LVDS_1_I2C_0               272
+#define SC_R_LVDS_1_I2C_1               273
+#define SC_R_LVDS_2                     274
+#define SC_R_LVDS_2_PWM_0               275
+#define SC_R_LVDS_2_I2C_0               276
+#define SC_R_LVDS_2_I2C_1               277
+#define SC_R_M4_0_PID0                  278
+#define SC_R_M4_0_PID1                  279
+#define SC_R_M4_0_PID2                  280
+#define SC_R_M4_0_PID3                  281
+#define SC_R_M4_0_PID4                  282
+#define SC_R_M4_0_RGPIO                 283
+#define SC_R_M4_0_SEMA42                284
+#define SC_R_M4_0_TPM                   285
+#define SC_R_M4_0_PIT                   286
+#define SC_R_M4_0_UART                  287
+#define SC_R_M4_0_I2C                   288
+#define SC_R_M4_0_INTMUX                289
+#define SC_R_M4_0_SIM                   290
+#define SC_R_M4_0_WDOG                  291
+#define SC_R_M4_0_MU_0B                 292
+#define SC_R_M4_0_MU_0A0                293
+#define SC_R_M4_0_MU_0A1                294
+#define SC_R_M4_0_MU_0A2                295
+#define SC_R_M4_0_MU_0A3                296
+#define SC_R_M4_0_MU_1A                 297
+#define SC_R_M4_1_PID0                  298
+#define SC_R_M4_1_PID1                  299
+#define SC_R_M4_1_PID2                  300
+#define SC_R_M4_1_PID3                  301
+#define SC_R_M4_1_PID4                  302
+#define SC_R_M4_1_RGPIO                 303
+#define SC_R_M4_1_SEMA42                304
+#define SC_R_M4_1_TPM                   305
+#define SC_R_M4_1_PIT                   306
+#define SC_R_M4_1_UART                  307
+#define SC_R_M4_1_I2C                   308
+#define SC_R_M4_1_INTMUX                309
+#define SC_R_M4_1_SIM                   310
+#define SC_R_M4_1_WDOG                  311
+#define SC_R_M4_1_MU_0B                 312
+#define SC_R_M4_1_MU_0A0                313
+#define SC_R_M4_1_MU_0A1                314
+#define SC_R_M4_1_MU_0A2                315
+#define SC_R_M4_1_MU_0A3                316
+#define SC_R_M4_1_MU_1A                 317
+#define SC_R_SAI_0                      318
+#define SC_R_SAI_1                      319
+#define SC_R_SAI_2                      320
+#define SC_R_IRQSTR_SCU2                321
+#define SC_R_IRQSTR_DSP                 322
+#define SC_R_UNUSED5                    323
+#define SC_R_OCRAM                      324
+#define SC_R_AUDIO_PLL_0                325
+#define SC_R_PI_0                       326
+#define SC_R_PI_0_PWM_0                 327
+#define SC_R_PI_0_PWM_1                 328
+#define SC_R_PI_0_I2C_0                 329
+#define SC_R_PI_0_PLL                   330
+#define SC_R_PI_1                       331
+#define SC_R_PI_1_PWM_0                 332
+#define SC_R_PI_1_PWM_1                 333
+#define SC_R_PI_1_I2C_0                 334
+#define SC_R_PI_1_PLL                   335
+#define SC_R_SC_PID0                    336
+#define SC_R_SC_PID1                    337
+#define SC_R_SC_PID2                    338
+#define SC_R_SC_PID3                    339
+#define SC_R_SC_PID4                    340
+#define SC_R_SC_SEMA42                  341
+#define SC_R_SC_TPM                     342
+#define SC_R_SC_PIT                     343
+#define SC_R_SC_UART                    344
+#define SC_R_SC_I2C                     345
+#define SC_R_SC_MU_0B                   346
+#define SC_R_SC_MU_0A0                  347
+#define SC_R_SC_MU_0A1                  348
+#define SC_R_SC_MU_0A2                  349
+#define SC_R_SC_MU_0A3                  350
+#define SC_R_SC_MU_1A                   351
+#define SC_R_SYSCNT_RD                  352
+#define SC_R_SYSCNT_CMP                 353
+#define SC_R_DEBUG                      354
+#define SC_R_SYSTEM                     355
+#define SC_R_SNVS                       356
+#define SC_R_OTP                        357
+#define SC_R_VPU_PID0                   358
+#define SC_R_VPU_PID1                   359
+#define SC_R_VPU_PID2                   360
+#define SC_R_VPU_PID3                   361
+#define SC_R_VPU_PID4                   362
+#define SC_R_VPU_PID5                   363
+#define SC_R_VPU_PID6                   364
+#define SC_R_VPU_PID7                   365
+#define SC_R_VPU_UART                   366
+#define SC_R_VPUCORE                    367
+#define SC_R_VPUCORE_0                  368
+#define SC_R_VPUCORE_1                  369
+#define SC_R_VPUCORE_2                  370
+#define SC_R_VPUCORE_3                  371
+#define SC_R_DMA_4_CH0                  372
+#define SC_R_DMA_4_CH1                  373
+#define SC_R_DMA_4_CH2                  374
+#define SC_R_DMA_4_CH3                  375
+#define SC_R_DMA_4_CH4                  376
+#define SC_R_ISI_CH0                    377
+#define SC_R_ISI_CH1                    378
+#define SC_R_ISI_CH2                    379
+#define SC_R_ISI_CH3                    380
+#define SC_R_ISI_CH4                    381
+#define SC_R_ISI_CH5                    382
+#define SC_R_ISI_CH6                    383
+#define SC_R_ISI_CH7                    384
+#define SC_R_MJPEG_DEC_S0               385
+#define SC_R_MJPEG_DEC_S1               386
+#define SC_R_MJPEG_DEC_S2               387
+#define SC_R_MJPEG_DEC_S3               388
+#define SC_R_MJPEG_ENC_S0               389
+#define SC_R_MJPEG_ENC_S1               390
+#define SC_R_MJPEG_ENC_S2               391
+#define SC_R_MJPEG_ENC_S3               392
+#define SC_R_MIPI_0                     393
+#define SC_R_MIPI_0_PWM_0               394
+#define SC_R_MIPI_0_I2C_0               395
+#define SC_R_MIPI_0_I2C_1               396
+#define SC_R_MIPI_1                     397
+#define SC_R_MIPI_1_PWM_0               398
+#define SC_R_MIPI_1_I2C_0               399
+#define SC_R_MIPI_1_I2C_1               400
+#define SC_R_CSI_0                      401
+#define SC_R_CSI_0_PWM_0                402
+#define SC_R_CSI_0_I2C_0                403
+#define SC_R_CSI_1                      404
+#define SC_R_CSI_1_PWM_0                405
+#define SC_R_CSI_1_I2C_0                406
+#define SC_R_HDMI                       407
+#define SC_R_HDMI_I2S                   408
+#define SC_R_HDMI_I2C_0                 409
+#define SC_R_HDMI_PLL_0                 410
+#define SC_R_HDMI_RX                    411
+#define SC_R_HDMI_RX_BYPASS             412
+#define SC_R_HDMI_RX_I2C_0              413
+#define SC_R_ASRC_0                     414
+#define SC_R_ESAI_0                     415
+#define SC_R_SPDIF_0                    416
+#define SC_R_SPDIF_1                    417
+#define SC_R_SAI_3                      418
+#define SC_R_SAI_4                      419
+#define SC_R_SAI_5                      420
+#define SC_R_GPT_5                      421
+#define SC_R_GPT_6                      422
+#define SC_R_GPT_7                      423
+#define SC_R_GPT_8                      424
+#define SC_R_GPT_9                      425
+#define SC_R_GPT_10                     426
+#define SC_R_DMA_2_CH5                  427
+#define SC_R_DMA_2_CH6                  428
+#define SC_R_DMA_2_CH7                  429
+#define SC_R_DMA_2_CH8                  430
+#define SC_R_DMA_2_CH9                  431
+#define SC_R_DMA_2_CH10                 432
+#define SC_R_DMA_2_CH11                 433
+#define SC_R_DMA_2_CH12                 434
+#define SC_R_DMA_2_CH13                 435
+#define SC_R_DMA_2_CH14                 436
+#define SC_R_DMA_2_CH15                 437
+#define SC_R_DMA_2_CH16                 438
+#define SC_R_DMA_2_CH17                 439
+#define SC_R_DMA_2_CH18                 440
+#define SC_R_DMA_2_CH19                 441
+#define SC_R_DMA_2_CH20                 442
+#define SC_R_DMA_2_CH21                 443
+#define SC_R_DMA_2_CH22                 444
+#define SC_R_DMA_2_CH23                 445
+#define SC_R_DMA_2_CH24                 446
+#define SC_R_DMA_2_CH25                 447
+#define SC_R_DMA_2_CH26                 448
+#define SC_R_DMA_2_CH27                 449
+#define SC_R_DMA_2_CH28                 450
+#define SC_R_DMA_2_CH29                 451
+#define SC_R_DMA_2_CH30                 452
+#define SC_R_DMA_2_CH31                 453
+#define SC_R_ASRC_1                     454
+#define SC_R_ESAI_1                     455
+#define SC_R_SAI_6                      456
+#define SC_R_SAI_7                      457
+#define SC_R_AMIX                       458
+#define SC_R_MQS_0                      459
+#define SC_R_DMA_3_CH0                  460
+#define SC_R_DMA_3_CH1                  461
+#define SC_R_DMA_3_CH2                  462
+#define SC_R_DMA_3_CH3                  463
+#define SC_R_DMA_3_CH4                  464
+#define SC_R_DMA_3_CH5                  465
+#define SC_R_DMA_3_CH6                  466
+#define SC_R_DMA_3_CH7                  467
+#define SC_R_DMA_3_CH8                  468
+#define SC_R_DMA_3_CH9                  469
+#define SC_R_DMA_3_CH10                 470
+#define SC_R_DMA_3_CH11                 471
+#define SC_R_DMA_3_CH12                 472
+#define SC_R_DMA_3_CH13                 473
+#define SC_R_DMA_3_CH14                 474
+#define SC_R_DMA_3_CH15                 475
+#define SC_R_DMA_3_CH16                 476
+#define SC_R_DMA_3_CH17                 477
+#define SC_R_DMA_3_CH18                 478
+#define SC_R_DMA_3_CH19                 479
+#define SC_R_DMA_3_CH20                 480
+#define SC_R_DMA_3_CH21                 481
+#define SC_R_DMA_3_CH22                 482
+#define SC_R_DMA_3_CH23                 483
+#define SC_R_DMA_3_CH24                 484
+#define SC_R_DMA_3_CH25                 485
+#define SC_R_DMA_3_CH26                 486
+#define SC_R_DMA_3_CH27                 487
+#define SC_R_DMA_3_CH28                 488
+#define SC_R_DMA_3_CH29                 489
+#define SC_R_DMA_3_CH30                 490
+#define SC_R_DMA_3_CH31                 491
+#define SC_R_AUDIO_PLL_1                492
+#define SC_R_AUDIO_CLK_0                493
+#define SC_R_AUDIO_CLK_1                494
+#define SC_R_MCLK_OUT_0                 495
+#define SC_R_MCLK_OUT_1                 496
+#define SC_R_PMIC_0                     497
+#define SC_R_PMIC_1                     498
+#define SC_R_SECO                       499
+#define SC_R_CAAM_JR1                   500
+#define SC_R_CAAM_JR2                   501
+#define SC_R_CAAM_JR3                   502
+#define SC_R_SECO_MU_2                  503
+#define SC_R_SECO_MU_3                  504
+#define SC_R_SECO_MU_4                  505
+#define SC_R_HDMI_RX_PWM_0              506
+#define SC_R_A35                        507
+#define SC_R_A35_0                      508
+#define SC_R_A35_1                      509
+#define SC_R_A35_2                      510
+#define SC_R_A35_3                      511
+#define SC_R_DSP                        512
+#define SC_R_DSP_RAM                    513
+#define SC_R_CAAM_JR1_OUT               514
+#define SC_R_CAAM_JR2_OUT               515
+#define SC_R_CAAM_JR3_OUT               516
+#define SC_R_VPU_DEC_0                  517
+#define SC_R_VPU_ENC_0                  518
+#define SC_R_CAAM_JR0                   519
+#define SC_R_CAAM_JR0_OUT               520
+#define SC_R_PMIC_2                     521
+#define SC_R_DBLOGIC                    522
+#define SC_R_HDMI_PLL_1                 523
+#define SC_R_BOARD_R0                   524
+#define SC_R_BOARD_R1                   525
+#define SC_R_BOARD_R2                   526
+#define SC_R_BOARD_R3                   527
+#define SC_R_BOARD_R4                   528
+#define SC_R_BOARD_R5                   529
+#define SC_R_BOARD_R6                   530
+#define SC_R_BOARD_R7                   531
+#define SC_R_MJPEG_DEC_MP               532
+#define SC_R_MJPEG_ENC_MP               533
+#define SC_R_VPU_TS_0                   534
+#define SC_R_VPU_MU_0                   535
+#define SC_R_VPU_MU_1                   536
+#define SC_R_VPU_MU_2                   537
+#define SC_R_VPU_MU_3                   538
+#define SC_R_VPU_ENC_1                  539
+#define SC_R_VPU                        540
+#define SC_R_LAST                       541
+
+#endif /* DT_BINDINGS_RSCRC_IMX_H */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 04/32] imx8: add scfw macro definition
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (2 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 03/32] dt-bindings: soc: add i.MX8QXP pm and rsrc definition Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 05/32] imx: add Kconfig entry for i.MX8QXP Peng Fan
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add SCFW macro definition.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/sci/rpc.h          | 158 ++++++++++++++++
 arch/arm/include/asm/arch-imx8/sci/sci.h          |  58 ++++++
 arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h |  30 +++
 arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h  |  57 ++++++
 arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h   |  44 +++++
 arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h   |  69 +++++++
 arch/arm/include/asm/arch-imx8/sci/types.h        | 220 ++++++++++++++++++++++
 7 files changed, 636 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/rpc.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/sci.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h
 create mode 100644 arch/arm/include/asm/arch-imx8/sci/types.h

diff --git a/arch/arm/include/asm/arch-imx8/sci/rpc.h b/arch/arm/include/asm/arch-imx8/sci/rpc.h
new file mode 100644
index 0000000000..746c2fa24d
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/rpc.h
@@ -0,0 +1,158 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2017-2018 NXP
+ *
+ */
+
+#ifndef SC_RPC_H
+#define SC_RPC_H
+
+/* Note: Check SCFW API Released DOC before you want to modify something */
+#define SC_RPC_VERSION          1U
+
+#define SC_RPC_MAX_MSG          8U
+
+#define RPC_VER(MSG)            ((MSG)->version)
+#define RPC_SIZE(MSG)           ((MSG)->size)
+#define RPC_SVC(MSG)            ((MSG)->svc)
+#define RPC_FUNC(MSG)           ((MSG)->func)
+#define RPC_R8(MSG)             ((MSG)->func)
+#define RPC_I32(MSG, IDX)       ((MSG)->DATA.i32[(IDX) / 4U])
+#define RPC_I16(MSG, IDX)       ((MSG)->DATA.i16[(IDX) / 2U])
+#define RPC_I8(MSG, IDX)        ((MSG)->DATA.i8[(IDX)])
+#define RPC_U32(MSG, IDX)       ((MSG)->DATA.u32[(IDX) / 4U])
+#define RPC_U16(MSG, IDX)       ((MSG)->DATA.u16[(IDX) / 2U])
+#define RPC_U8(MSG, IDX)        ((MSG)->DATA.u8[(IDX)])
+
+#define SC_RPC_SVC_UNKNOWN      0U
+#define SC_RPC_SVC_RETURN       1U
+#define SC_RPC_SVC_PM           2U
+#define SC_RPC_SVC_RM           3U
+#define SC_RPC_SVC_TIMER        5U
+#define SC_RPC_SVC_PAD          6U
+#define SC_RPC_SVC_MISC         7U
+#define SC_RPC_SVC_IRQ          8U
+#define SC_RPC_SVC_ABORT        9U
+
+/* Types */
+
+struct sc_rpc_msg_s {
+	u8 version;
+	u8 size;
+	u8 svc;
+	u8 func;
+	union {
+		s32 i32[(SC_RPC_MAX_MSG - 1U)];
+		s16 i16[(SC_RPC_MAX_MSG - 1U) * 2U];
+		s8 i8[(SC_RPC_MAX_MSG - 1U) * 4U];
+		u32 u32[(SC_RPC_MAX_MSG - 1U)];
+		u16 u16[(SC_RPC_MAX_MSG - 1U) * 2U];
+		u8 u8[(SC_RPC_MAX_MSG - 1U) * 4U];
+	} DATA;
+};
+
+/* PM RPC */
+#define PM_FUNC_UNKNOWN				0
+#define PM_FUNC_SET_SYS_POWER_MODE		19U
+#define PM_FUNC_SET_PARTITION_POWER_MODE	1U
+#define PM_FUNC_GET_SYS_POWER_MODE		2U
+#define PM_FUNC_SET_RESOURCE_POWER_MODE		3U
+#define PM_FUNC_GET_RESOURCE_POWER_MODE		4U
+#define PM_FUNC_REQ_LOW_POWER_MODE		16U
+#define PM_FUNC_REQ_CPU_LOW_POWER_MODE		20U
+#define PM_FUNC_SET_CPU_RESUME_ADDR		17U
+#define PM_FUNC_SET_CPU_RESUME			21U
+#define PM_FUNC_REQ_SYS_IF_POWER_MODE		18U
+#define PM_FUNC_SET_CLOCK_RATE			5U
+#define PM_FUNC_GET_CLOCK_RATE			6U
+#define PM_FUNC_CLOCK_ENABLE			7U
+#define PM_FUNC_SET_CLOCK_PARENT		14U
+#define PM_FUNC_GET_CLOCK_PARENT		15U
+#define PM_FUNC_RESET				13U
+#define PM_FUNC_RESET_REASON			10U
+#define PM_FUNC_BOOT				8U
+#define PM_FUNC_REBOOT				9U
+#define PM_FUNC_REBOOT_PARTITION		12U
+#define PM_FUNC_CPU_START			11U
+
+/* MISC RPC */
+#define MISC_FUNC_UNKNOWN			0
+#define MISC_FUNC_SET_CONTROL			1U
+#define MISC_FUNC_GET_CONTROL			2U
+#define MISC_FUNC_SET_MAX_DMA_GROUP		4U
+#define MISC_FUNC_SET_DMA_GROUP			5U
+#define MISC_FUNC_SECO_IMAGE_LOAD		8U
+#define MISC_FUNC_SECO_AUTHENTICATE		9U
+#define MISC_FUNC_SECO_FUSE_WRITE		20U
+#define MISC_FUNC_SECO_ENABLE_DEBUG		21U
+#define MISC_FUNC_SECO_FORWARD_LIFECYCLE	22U
+#define MISC_FUNC_SECO_RETURN_LIFECYCLE		23U
+#define MISC_FUNC_SECO_BUILD_INFO		24U
+#define MISC_FUNC_DEBUG_OUT			10U
+#define MISC_FUNC_WAVEFORM_CAPTURE		6U
+#define MISC_FUNC_BUILD_INFO			15U
+#define MISC_FUNC_UNIQUE_ID			19U
+#define MISC_FUNC_SET_ARI			3U
+#define MISC_FUNC_BOOT_STATUS			7U
+#define MISC_FUNC_BOOT_DONE			14U
+#define MISC_FUNC_OTP_FUSE_READ			11U
+#define MISC_FUNC_OTP_FUSE_WRITE		17U
+#define MISC_FUNC_SET_TEMP			12U
+#define MISC_FUNC_GET_TEMP			13U
+#define MISC_FUNC_GET_BOOT_DEV			16U
+#define MISC_FUNC_GET_BUTTON_STATUS		18U
+
+/* PAD RPC */
+#define PAD_FUNC_UNKNOWN			0
+#define PAD_FUNC_SET_MUX			1U
+#define PAD_FUNC_GET_MUX			6U
+#define PAD_FUNC_SET_GP				2U
+#define PAD_FUNC_GET_GP				7U
+#define PAD_FUNC_SET_WAKEUP			4U
+#define PAD_FUNC_GET_WAKEUP			9U
+#define PAD_FUNC_SET_ALL			5U
+#define PAD_FUNC_GET_ALL			10U
+#define PAD_FUNC_SET				15U
+#define PAD_FUNC_GET				16U
+#define PAD_FUNC_SET_GP_28FDSOI			11U
+#define PAD_FUNC_GET_GP_28FDSOI			12U
+#define PAD_FUNC_SET_GP_28FDSOI_HSIC		3U
+#define PAD_FUNC_GET_GP_28FDSOI_HSIC		8U
+#define PAD_FUNC_SET_GP_28FDSOI_COMP		13U
+#define PAD_FUNC_GET_GP_28FDSOI_COMP		14U
+
+/* RM RPC */
+#define RM_FUNC_UNKNOWN				0
+#define RM_FUNC_PARTITION_ALLOC			1U
+#define RM_FUNC_SET_CONFIDENTIAL		31U
+#define RM_FUNC_PARTITION_FREE			2U
+#define RM_FUNC_GET_DID				26U
+#define RM_FUNC_PARTITION_STATIC		3U
+#define RM_FUNC_PARTITION_LOCK			4U
+#define RM_FUNC_GET_PARTITION			5U
+#define RM_FUNC_SET_PARENT			6U
+#define RM_FUNC_MOVE_ALL			7U
+#define RM_FUNC_ASSIGN_RESOURCE			8U
+#define RM_FUNC_SET_RESOURCE_MOVABLE		9U
+#define RM_FUNC_SET_SUBSYS_RSRC_MOVABLE		28U
+#define RM_FUNC_SET_MASTER_ATTRIBUTES		10U
+#define RM_FUNC_SET_MASTER_SID			11U
+#define RM_FUNC_SET_PERIPHERAL_PERMISSIONS	12U
+#define RM_FUNC_IS_RESOURCE_OWNED		13U
+#define RM_FUNC_IS_RESOURCE_MASTER		14U
+#define RM_FUNC_IS_RESOURCE_PERIPHERAL		15U
+#define RM_FUNC_GET_RESOURCE_INFO		16U
+#define RM_FUNC_MEMREG_ALLOC			17U
+#define RM_FUNC_MEMREG_SPLIT			29U
+#define RM_FUNC_MEMREG_FREE			18U
+#define RM_FUNC_FIND_MEMREG			30U
+#define RM_FUNC_ASSIGN_MEMREG			19U
+#define RM_FUNC_SET_MEMREG_PERMISSIONS		20U
+#define RM_FUNC_IS_MEMREG_OWNED			21U
+#define RM_FUNC_GET_MEMREG_INFO			22U
+#define RM_FUNC_ASSIGN_PAD			23U
+#define RM_FUNC_SET_PAD_MOVABLE			24U
+#define RM_FUNC_IS_PAD_OWNED			25U
+#define RM_FUNC_DUMP				27U
+
+#endif /* SC_RPC_H */
diff --git a/arch/arm/include/asm/arch-imx8/sci/sci.h b/arch/arm/include/asm/arch-imx8/sci/sci.h
new file mode 100644
index 0000000000..d0ff5c5c41
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/sci.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef _SC_SCI_H
+#define _SC_SCI_H
+
+#include <asm/arch/sci/types.h>
+#include <asm/arch/sci/svc/misc/api.h>
+#include <asm/arch/sci/svc/pad/api.h>
+#include <asm/arch/sci/svc/pm/api.h>
+#include <asm/arch/sci/svc/rm/api.h>
+#include <asm/arch/sci/rpc.h>
+#include <dt-bindings/soc/imx_rsrc.h>
+#include <linux/errno.h>
+
+static inline int sc_err_to_linux(sc_err_t err)
+{
+	int ret;
+
+	switch (err) {
+	case SC_ERR_NONE:
+		return 0;
+	case SC_ERR_VERSION:
+	case SC_ERR_CONFIG:
+	case SC_ERR_PARM:
+		ret = -EINVAL;
+		break;
+	case SC_ERR_NOACCESS:
+	case SC_ERR_LOCKED:
+	case SC_ERR_UNAVAILABLE:
+		ret = -EACCES;
+		break;
+	case SC_ERR_NOTFOUND:
+	case SC_ERR_NOPOWER:
+		ret = -ENODEV;
+		break;
+	case SC_ERR_IPC:
+		ret = -EIO;
+		break;
+	case SC_ERR_BUSY:
+		ret = -EBUSY;
+		break;
+	case SC_ERR_FAIL:
+		ret = -EIO;
+		break;
+	default:
+		ret = 0;
+		break;
+	}
+
+	debug("%s %d %d\n", __func__, err, ret);
+
+	return ret;
+}
+
+#endif
diff --git a/arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h b/arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h
new file mode 100644
index 0000000000..5d17b553d7
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef SC_MISC_API_H
+#define SC_MISC_API_H
+
+/* Defines for sc_misc_boot_status_t */
+#define SC_MISC_BOOT_STATUS_SUCCESS	0U	/* Success */
+#define SC_MISC_BOOT_STATUS_SECURITY	1U	/* Security violation */
+
+/* Defines for sc_misc_seco_auth_cmd_t */
+#define SC_MISC_SECO_AUTH_SECO_FW	0U   /* SECO Firmware */
+#define SC_MISC_SECO_AUTH_HDMI_TX_FW	1U   /* HDMI TX Firmware */
+#define SC_MISC_SECO_AUTH_HDMI_RX_FW	2U   /* HDMI RX Firmware */
+
+/* Defines for sc_misc_temp_t */
+#define SC_MISC_TEMP			0U	/* Temp sensor */
+#define SC_MISC_TEMP_HIGH		1U	/* Temp high alarm */
+#define SC_MISC_TEMP_LOW		2U	/* Temp low alarm */
+
+/* Defines for sc_misc_seco_auth_cmd_t */
+#define SC_MISC_AUTH_CONTAINER	0U	/* Authenticate container */
+#define SC_MISC_VERIFY_IMAGE	1U	/* Verify image */
+#define SC_MISC_REL_CONTAINER	2U	/* Release container */
+
+typedef u8 sc_misc_boot_status_t;
+
+#endif /* SC_MISC_API_H */
diff --git a/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h b/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h
new file mode 100644
index 0000000000..905c56834e
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef SC_PAD_API_H
+#define SC_PAD_API_H
+
+/* Defines for sc_pad_config_t */
+#define SC_PAD_CONFIG_NORMAL	0U	/* Normal */
+#define SC_PAD_CONFIG_OD	1U	/* Open Drain */
+#define SC_PAD_CONFIG_OD_IN	2U	/* Open Drain and input */
+#define SC_PAD_CONFIG_OUT_IN	3U	/* Output and input */
+
+/* Defines for sc_pad_iso_t */
+#define SC_PAD_ISO_OFF		0U	/* ISO latch is transparent */
+#define SC_PAD_ISO_EARLY	1U	/* Follow EARLY_ISO */
+#define SC_PAD_ISO_LATE		2U	/* Follow LATE_ISO */
+#define SC_PAD_ISO_ON		3U	/* ISO latched data is held */
+
+/* Defines for sc_pad_28fdsoi_dse_t */
+#define SC_PAD_28FDSOI_DSE_18V_1MA	0U /* Drive strength of 1mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_2MA	1U /* Drive strength of 2mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_4MA	2U /* Drive strength of 4mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_6MA	3U /* Drive strength of 6mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_8MA	4U /* Drive strength of 8mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_10MA	5U /* Drive strength of 10mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_12MA	6U /* Drive strength of 12mA for 1.8v */
+#define SC_PAD_28FDSOI_DSE_18V_HS	7U /* High-speed for 1.8v */
+#define SC_PAD_28FDSOI_DSE_33V_2MA	0U /* Drive strength of 2mA for 3.3v */
+#define SC_PAD_28FDSOI_DSE_33V_4MA	1U /* Drive strength of 4mA for 3.3v */
+#define SC_PAD_28FDSOI_DSE_33V_8MA	2U /* Drive strength of 8mA for 3.3v */
+#define SC_PAD_28FDSOI_DSE_33V_12MA	3U /* Drive strength of 12mA for 3.3v */
+#define SC_PAD_28FDSOI_DSE_DV_HIGH	0U /* High drive strength dual volt */
+#define SC_PAD_28FDSOI_DSE_DV_LOW	1U /* Low drive strength  dual volt */
+
+/* Defines for sc_pad_28fdsoi_ps_t */
+#define SC_PAD_28FDSOI_PS_KEEPER 0U /* Bus-keeper (only valid for 1.8v) */
+#define SC_PAD_28FDSOI_PS_PU	1U /* Pull-up */
+#define SC_PAD_28FDSOI_PS_PD	2U /* Pull-down */
+#define SC_PAD_28FDSOI_PS_NONE	3U /* No pull (disabled) */
+
+/* Defines for sc_pad_28fdsoi_pus_t */
+#define SC_PAD_28FDSOI_PUS_30K_PD	0U /* 30K pull-down */
+#define SC_PAD_28FDSOI_PUS_100K_PU	1U /* 100K pull-up */
+#define SC_PAD_28FDSOI_PUS_3K_PU	2U /* 3K pull-up */
+#define SC_PAD_28FDSOI_PUS_30K_PU	3U /* 30K pull-up */
+
+/* Defines for sc_pad_wakeup_t */
+#define SC_PAD_WAKEUP_OFF	0U /* Off */
+#define SC_PAD_WAKEUP_CLEAR	1U /* Clears pending flag */
+#define SC_PAD_WAKEUP_LOW_LVL	4U /* Low level */
+#define SC_PAD_WAKEUP_FALL_EDGE	5U /* Falling edge */
+#define SC_PAD_WAKEUP_RISE_EDGE	6U /* Rising edge */
+#define SC_PAD_WAKEUP_HIGH_LVL	7U /* High-level */
+
+#endif /* SC_PAD_API_H */
diff --git a/arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h b/arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h
new file mode 100644
index 0000000000..9008b85c6f
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef SC_PM_API_H
+#define SC_PM_API_H
+
+/* Defines for sc_pm_power_mode_t */
+#define SC_PM_PW_MODE_OFF	0U /* Power off */
+#define SC_PM_PW_MODE_STBY	1U /* Power in standby */
+#define SC_PM_PW_MODE_LP	2U /* Power in low-power */
+#define SC_PM_PW_MODE_ON	3U /* Power on */
+
+/* Defines for sc_pm_clk_t */
+#define SC_PM_CLK_SLV_BUS	0U /* Slave bus clock */
+#define SC_PM_CLK_MST_BUS	1U /* Master bus clock */
+#define SC_PM_CLK_PER		2U /* Peripheral clock */
+#define SC_PM_CLK_PHY		3U /* Phy clock */
+#define SC_PM_CLK_MISC		4U /* Misc clock */
+#define SC_PM_CLK_MISC0		0U /* Misc 0 clock */
+#define SC_PM_CLK_MISC1		1U /* Misc 1 clock */
+#define SC_PM_CLK_MISC2		2U /* Misc 2 clock */
+#define SC_PM_CLK_MISC3		3U /* Misc 3 clock */
+#define SC_PM_CLK_MISC4		4U /* Misc 4 clock */
+#define SC_PM_CLK_CPU		2U /* CPU clock */
+#define SC_PM_CLK_PLL		4U /* PLL */
+#define SC_PM_CLK_BYPASS	4U /* Bypass clock */
+
+/* Defines for sc_pm_clk_mode_t */
+#define SC_PM_CLK_MODE_ROM_INIT		0U /* Clock is initialized by ROM. */
+#define SC_PM_CLK_MODE_OFF		1U /* Clock is disabled */
+#define SC_PM_CLK_MODE_ON		2U /* Clock is enabled. */
+#define SC_PM_CLK_MODE_AUTOGATE_SW	3U /* Clock is in SW autogate mode */
+#define SC_PM_CLK_MODE_AUTOGATE_HW	4U /* Clock is in HW autogate mode */
+#define SC_PM_CLK_MODE_AUTOGATE_SW_HW	5U /* Clock is in SW-HW autogate mode */
+
+typedef u8 sc_pm_power_mode_t;
+typedef u8 sc_pm_clk_t;
+typedef u8 sc_pm_clk_mode_t;
+typedef u8 sc_pm_clk_parent_t;
+typedef u32 sc_pm_clock_rate_t;
+
+#endif /* SC_PM_API_H */
diff --git a/arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h b/arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h
new file mode 100644
index 0000000000..ed303881e7
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef SC_RM_API_H
+#define SC_RM_API_H
+
+#include <asm/arch/sci/types.h>
+
+/* Defines for type widths */
+#define SC_RM_PARTITION_W   5U      /* Width of sc_rm_pt_t */
+#define SC_RM_MEMREG_W      6U      /* Width of sc_rm_mr_t */
+#define SC_RM_DID_W         4U      /* Width of sc_rm_did_t */
+#define SC_RM_SID_W         6U      /* Width of sc_rm_sid_t */
+#define SC_RM_SPA_W         2U      /* Width of sc_rm_spa_t */
+#define SC_RM_PERM_W        3U      /* Width of sc_rm_perm_t */
+
+/* Defines for ALL parameters */
+#define SC_RM_PT_ALL        ((sc_rm_pt_t)UINT8_MAX)   /* All partitions */
+#define SC_RM_MR_ALL        ((sc_rm_mr_t)UINT8_MAX)   /* All memory regions */
+
+/* Defines for sc_rm_spa_t */
+#define SC_RM_SPA_PASSTHRU  0U   /* Pass through (attribute driven by master) */
+#define SC_RM_SPA_PASSSID   1U   /* Pass through and output on SID */
+#define SC_RM_SPA_ASSERT    2U   /* Assert (force to be secure/privileged) */
+#define SC_RM_SPA_NEGATE    3U   /* Negate (force to be non-secure/user) */
+
+/* Defines for sc_rm_perm_t */
+#define SC_RM_PERM_NONE         0U /* No access */
+#define SC_RM_PERM_SEC_R        1U /* Secure RO */
+#define SC_RM_PERM_SECPRIV_RW   2U /* Secure privilege R/W */
+#define SC_RM_PERM_SEC_RW       3U /* Secure R/W */
+#define SC_RM_PERM_NSPRIV_R     4U /* Secure R/W, non-secure privilege RO */
+#define SC_RM_PERM_NS_R         5U /* Secure R/W, non-secure RO */
+#define SC_RM_PERM_NSPRIV_RW    6U /* Secure R/W, non-secure privilege R/W */
+#define SC_RM_PERM_FULL         7U /* Full access */
+
+/* Types */
+
+/*!
+ * This type is used to declare a resource partition.
+ */
+typedef u8 sc_rm_pt_t;
+
+/*!
+ * This type is used to declare a memory region.
+ */
+typedef u8 sc_rm_mr_t;
+
+/*!
+ * This type is used to declare a resource domain ID used by the
+ * isolation HW.
+ */
+typedef u8 sc_rm_did_t;
+
+/*!
+ * This type is used to declare an SMMU StreamID.
+ */
+typedef u16 sc_rm_sid_t;
+
+/*!
+ * This type is a used to declare master transaction attributes.
+ */
+typedef u8 sc_rm_spa_t;
+
+typedef u8 sc_rm_perm_t;
+
+#endif /* SC_RM_API_H */
diff --git a/arch/arm/include/asm/arch-imx8/sci/types.h b/arch/arm/include/asm/arch-imx8/sci/types.h
new file mode 100644
index 0000000000..9eadc88592
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sci/types.h
@@ -0,0 +1,220 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef SC_TYPES_H
+#define SC_TYPES_H
+
+/* Includes */
+#include <linux/types.h>
+
+/* Defines */
+/*
+ * This type is used to declare a handle for an IPC communication
+ * channel. Its meaning is specific to the IPC implementation.
+ */
+typedef u64 sc_ipc_t;
+
+/* Defines for common frequencies */
+#define SC_32KHZ            32768U   /* 32KHz */
+#define SC_10MHZ         10000000U   /* 10MHz */
+#define SC_20MHZ         20000000U   /* 20MHz */
+#define SC_25MHZ         25000000U   /* 25MHz */
+#define SC_27MHZ         27000000U   /* 27MHz */
+#define SC_40MHZ         40000000U   /* 40MHz */
+#define SC_45MHZ         45000000U   /* 45MHz */
+#define SC_50MHZ         50000000U   /* 50MHz */
+#define SC_60MHZ         60000000U   /* 60MHz */
+#define SC_66MHZ         66666666U   /* 66MHz */
+#define SC_74MHZ         74250000U   /* 74.25MHz */
+#define SC_80MHZ         80000000U   /* 80MHz */
+#define SC_83MHZ         83333333U   /* 83MHz */
+#define SC_84MHZ         84375000U   /* 84.37MHz */
+#define SC_100MHZ       100000000U   /* 100MHz */
+#define SC_125MHZ       125000000U   /* 125MHz */
+#define SC_133MHZ       133333333U   /* 133MHz */
+#define SC_135MHZ       135000000U   /* 135MHz */
+#define SC_150MHZ       150000000U   /* 150MHz */
+#define SC_160MHZ       160000000U   /* 160MHz */
+#define SC_166MHZ       166666666U   /* 166MHz */
+#define SC_175MHZ       175000000U   /* 175MHz */
+#define SC_180MHZ       180000000U   /* 180MHz */
+#define SC_200MHZ       200000000U   /* 200MHz */
+#define SC_250MHZ       250000000U   /* 250MHz */
+#define SC_266MHZ       266666666U   /* 266MHz */
+#define SC_300MHZ       300000000U   /* 300MHz */
+#define SC_312MHZ       312500000U   /* 312.5MHZ */
+#define SC_320MHZ       320000000U   /* 320MHz */
+#define SC_325MHZ       325000000U   /* 325MHz */
+#define SC_333MHZ       333333333U   /* 333MHz */
+#define SC_350MHZ       350000000U   /* 350MHz */
+#define SC_372MHZ       372000000U   /* 372MHz */
+#define SC_375MHZ       375000000U   /* 375MHz */
+#define SC_400MHZ       400000000U   /* 400MHz */
+#define SC_500MHZ       500000000U   /* 500MHz */
+#define SC_594MHZ       594000000U   /* 594MHz */
+#define SC_625MHZ       625000000U   /* 625MHz */
+#define SC_640MHZ       640000000U   /* 640MHz */
+#define SC_650MHZ       650000000U   /* 650MHz */
+#define SC_667MHZ       666666667U   /* 667MHz */
+#define SC_675MHZ       675000000U   /* 675MHz */
+#define SC_700MHZ       700000000U   /* 700MHz */
+#define SC_720MHZ       720000000U   /* 720MHz */
+#define SC_750MHZ       750000000U   /* 750MHz */
+#define SC_800MHZ       800000000U   /* 800MHz */
+#define SC_850MHZ       850000000U   /* 850MHz */
+#define SC_900MHZ       900000000U   /* 900MHz */
+#define SC_1000MHZ     1000000000U   /* 1GHz */
+#define SC_1060MHZ     1060000000U   /* 1.06GHz */
+#define SC_1188MHZ     1188000000U   /* 1.188GHz */
+#define SC_1260MHZ     1260000000U   /* 1.26GHz */
+#define SC_1280MHZ     1280000000U   /* 1.28GHz */
+#define SC_1300MHZ     1300000000U   /* 1.3GHz */
+#define SC_1400MHZ     1400000000U   /* 1.4GHz */
+#define SC_1500MHZ     1500000000U   /* 1.5GHz */
+#define SC_1600MHZ     1600000000U   /* 1.6GHz */
+#define SC_1800MHZ     1800000000U   /* 1.8GHz */
+#define SC_2000MHZ     2000000000U   /* 2.0GHz */
+#define SC_2112MHZ     2112000000U   /* 2.12GHz */
+
+/* Defines for 24M related frequencies */
+#define SC_8MHZ           8000000U   /* 8MHz */
+#define SC_12MHZ         12000000U   /* 12MHz */
+#define SC_19MHZ         19800000U   /* 19.8MHz */
+#define SC_24MHZ         24000000U   /* 24MHz */
+#define SC_48MHZ         48000000U   /* 48MHz */
+#define SC_120MHZ       120000000U   /* 120MHz */
+#define SC_132MHZ       132000000U   /* 132MHz */
+#define SC_144MHZ       144000000U   /* 144MHz */
+#define SC_192MHZ       192000000U   /* 192MHz */
+#define SC_211MHZ       211200000U   /* 211.2MHz */
+#define SC_240MHZ       240000000U   /* 240MHz */
+#define SC_264MHZ       264000000U   /* 264MHz */
+#define SC_352MHZ       352000000U   /* 352MHz */
+#define SC_360MHZ       360000000U   /* 360MHz */
+#define SC_384MHZ       384000000U   /* 384MHz */
+#define SC_396MHZ       396000000U   /* 396MHz */
+#define SC_432MHZ       432000000U   /* 432MHz */
+#define SC_480MHZ       480000000U   /* 480MHz */
+#define SC_600MHZ       600000000U   /* 600MHz */
+#define SC_744MHZ       744000000U   /* 744MHz */
+#define SC_792MHZ       792000000U   /* 792MHz */
+#define SC_864MHZ       864000000U   /* 864MHz */
+#define SC_960MHZ       960000000U   /* 960MHz */
+#define SC_1056MHZ     1056000000U   /* 1056MHz */
+#define SC_1104MHZ     1104000000U   /* 1104MHz */
+#define SC_1200MHZ     1200000000U   /* 1.2GHz */
+#define SC_1464MHZ     1464000000U   /* 1.464GHz */
+#define SC_2400MHZ     2400000000U   /* 2.4GHz */
+
+/* Defines for A/V related frequencies */
+#define SC_62MHZ         62937500U   /* 62.9375MHz */
+#define SC_755MHZ       755250000U   /* 755.25MHz */
+
+/* Defines for type widths */
+#define SC_FADDR_W      36U          /* Width of sc_faddr_t */
+#define SC_BOOL_W       1U           /* Width of sc_bool_t */
+#define SC_ERR_W        4U           /* Width of sc_err_t */
+#define SC_RSRC_W       10U          /* Width of sc_rsrc_t */
+#define SC_CTRL_W       6U           /* Width of sc_ctrl_t */
+
+/* Defines for sc_bool_t */
+#define SC_FALSE        ((sc_bool_t)0U)
+#define SC_TRUE         ((sc_bool_t)1U)
+
+/* Defines for sc_err_t */
+#define SC_ERR_NONE         0U      /* Success */
+#define SC_ERR_VERSION      1U      /* Incompatible API version */
+#define SC_ERR_CONFIG       2U      /* Configuration error */
+#define SC_ERR_PARM         3U      /* Bad parameter */
+#define SC_ERR_NOACCESS     4U      /* Permission error (no access) */
+#define SC_ERR_LOCKED       5U      /* Permission error (locked) */
+#define SC_ERR_UNAVAILABLE  6U      /* Unavailable (out of resources) */
+#define SC_ERR_NOTFOUND     7U      /* Not found */
+#define SC_ERR_NOPOWER      8U      /* No power */
+#define SC_ERR_IPC          9U      /* Generic IPC error */
+#define SC_ERR_BUSY         10U     /* Resource is currently busy/active */
+#define SC_ERR_FAIL         11U     /* General I/O failure */
+#define SC_ERR_LAST         12U
+
+/* Defines for sc_ctrl_t. */
+#define SC_C_TEMP                       0U
+#define SC_C_TEMP_HI                    1U
+#define SC_C_TEMP_LOW                   2U
+#define SC_C_PXL_LINK_MST1_ADDR         3U
+#define SC_C_PXL_LINK_MST2_ADDR         4U
+#define SC_C_PXL_LINK_MST_ENB           5U
+#define SC_C_PXL_LINK_MST1_ENB          6U
+#define SC_C_PXL_LINK_MST2_ENB          7U
+#define SC_C_PXL_LINK_SLV1_ADDR         8U
+#define SC_C_PXL_LINK_SLV2_ADDR         9U
+#define SC_C_PXL_LINK_MST_VLD           10U
+#define SC_C_PXL_LINK_MST1_VLD          11U
+#define SC_C_PXL_LINK_MST2_VLD          12U
+#define SC_C_SINGLE_MODE                13U
+#define SC_C_ID                         14U
+#define SC_C_PXL_CLK_POLARITY           15U
+#define SC_C_LINESTATE                  16U
+#define SC_C_PCIE_G_RST                 17U
+#define SC_C_PCIE_BUTTON_RST            18U
+#define SC_C_PCIE_PERST                 19U
+#define SC_C_PHY_RESET                  20U
+#define SC_C_PXL_LINK_RATE_CORRECTION   21U
+#define SC_C_PANIC                      22U
+#define SC_C_PRIORITY_GROUP             23U
+#define SC_C_TXCLK                      24U
+#define SC_C_CLKDIV                     25U
+#define SC_C_DISABLE_50                 26U
+#define SC_C_DISABLE_125                27U
+#define SC_C_SEL_125                    28U
+#define SC_C_MODE                       29U
+#define SC_C_SYNC_CTRL0                 30U
+#define SC_C_KACHUNK_CNT                31U
+#define SC_C_KACHUNK_SEL                32U
+#define SC_C_SYNC_CTRL1                 33U
+#define SC_C_DPI_RESET                  34U
+#define SC_C_MIPI_RESET                 35U
+#define SC_C_DUAL_MODE                  36U
+#define SC_C_VOLTAGE                    37U
+#define SC_C_PXL_LINK_SEL               38U
+#define SC_C_OFS_SEL                    39U
+#define SC_C_OFS_AUDIO                  40U
+#define SC_C_OFS_PERIPH                 41U
+#define SC_C_OFS_IRQ                    42U
+#define SC_C_RST0                       43U
+#define SC_C_RST1                       44U
+#define SC_C_SEL0                       45U
+#define SC_C_LAST                       46U
+
+#define SC_P_ALL        ((sc_pad_t)UINT16_MAX)   /* All pads */
+
+/* Types */
+
+/* This type is used to store a boolean */
+typedef u8 sc_bool_t;
+
+/* This type is used to store a system (full-size) address.  */
+typedef u64 sc_faddr_t;
+
+/* This type is used to indicate error response for most functions.  */
+typedef u8 sc_err_t;
+
+/*
+ * This type is used to indicate a resource. Resources include peripherals
+ * and bus masters (but not memory regions). Note items from list should
+ * never be changed or removed (only added to at the end of the list).
+ */
+typedef u16 sc_rsrc_t;
+
+/* This type is used to indicate a control.  */
+typedef u8 sc_ctrl_t;
+
+/*
+ * This type is used to indicate a pad. Valid values are SoC specific.
+ *
+ * Refer to the SoC [Pad List](@ref PADS) for valid pad values.
+ */
+typedef u16 sc_pad_t;
+
+#endif /* SC_TYPES_H */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 05/32] imx: add Kconfig entry for i.MX8QXP
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (3 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 04/32] imx8: add scfw macro definition Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 06/32] arm: build mach-imx for i.MX8 Peng Fan
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add Kconfig entry for i.MX8QXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/Kconfig               |  8 ++++++++
 arch/arm/mach-imx/Makefile     |  1 +
 arch/arm/mach-imx/imx8/Kconfig | 13 +++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 arch/arm/mach-imx/imx8/Kconfig

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0f8dd32bdd..b2d778bc7a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -668,6 +668,12 @@ config ARCH_MESON
 	  targeted at media players and tablet computers. We currently
 	  support the S905 (GXBaby) 64-bit SoC.
 
+config ARCH_IMX8
+	bool "NXP i.MX8 platform"
+	select ARM64
+	select DM
+	select OF_CONTROL
+
 config ARCH_MX8M
 	bool "NXP i.MX8M platform"
 	select ARM64
@@ -1405,6 +1411,8 @@ source "arch/arm/mach-imx/mx7/Kconfig"
 
 source "arch/arm/mach-imx/mx7ulp/Kconfig"
 
+source "arch/arm/mach-imx/imx8/Kconfig"
+
 source "arch/arm/mach-imx/mx8m/Kconfig"
 
 source "arch/arm/mach-imx/mxs/Kconfig"
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 733c308670..375789efb2 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -141,3 +141,4 @@ obj-$(CONFIG_MX6) += mx6/
 obj-$(CONFIG_MX7) += mx7/
 obj-$(CONFIG_ARCH_MX7ULP) += mx7ulp/
 obj-$(CONFIG_MX8M) += mx8m/
+obj-$(CONFIG_ARCH_IMX8) += imx8/
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
new file mode 100644
index 0000000000..28910c1509
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -0,0 +1,13 @@
+if ARCH_IMX8
+
+config IMX8
+	bool
+
+config IMX8QXP
+	select IMX8
+	bool
+
+config SYS_SOC
+	default "imx8"
+
+endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 06/32] arm: build mach-imx for i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (4 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 05/32] imx: add Kconfig entry for i.MX8QXP Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev " Peng Fan
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Build mach-imx for i.MX8

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8f50560434..7285913b41 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -105,7 +105,7 @@ ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx5 mx6
 libs-y += arch/arm/mach-imx/
 endif
 else
-ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs mx8m vf610))
+ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs mx8m imx8 vf610))
 libs-y += arch/arm/mach-imx/
 endif
 endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev for i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (5 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 06/32] arm: build mach-imx for i.MX8 Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-10-14  8:26   ` Anatolij Gustschin
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver Peng Fan
                   ` (25 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add scu_dev for i.MX8, this will be used as a handle
to communite with SCU from A35.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/global_data.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 287a7bd5b1..c3ee5f0c7b 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -74,6 +74,10 @@ struct arch_global_data {
 #if defined(CONFIG_FSL_LSCH3) && defined(CONFIG_SYS_FSL_HAS_DP_DDR)
 	unsigned long mem2_clk;
 #endif
+
+#ifdef CONFIG_ARCH_IMX8
+	struct udevice *scu_dev;
+#endif
 };
 
 #include <asm-generic/global_data.h>
-- 
2.14.1

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

* [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (6 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev " Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-10-14  8:44   ` Anatolij Gustschin
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 09/32] misc: imx8: add scfw api impementation Peng Fan
                   ` (24 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8 MISC driver to handle the communication between
A35 Core and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/misc/Makefile      |   1 +
 drivers/misc/imx8/Makefile |   3 +
 drivers/misc/imx8/scu.c    | 266 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 drivers/misc/imx8/Makefile
 create mode 100644 drivers/misc/imx8/scu.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index da4666fdfc..59c816e75a 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_FSL_IIM) += fsl_iim.o
 obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
 obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o
 obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
+obj-$(CONFIG_IMX8) += imx8/
 obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
 obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o
 obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o
diff --git a/drivers/misc/imx8/Makefile b/drivers/misc/imx8/Makefile
new file mode 100644
index 0000000000..3395340d22
--- /dev/null
+++ b/drivers/misc/imx8/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += scu.o
diff --git a/drivers/misc/imx8/scu.c b/drivers/misc/imx8/scu.c
new file mode 100644
index 0000000000..14625ead06
--- /dev/null
+++ b/drivers/misc/imx8/scu.c
@@ -0,0 +1,266 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2018 NXP
+ *
+ * Peng Fan <peng.fan@nxp.com>
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <dm.h>
+#include <dm/lists.h>
+#include <dm/root.h>
+#include <dm/device-internal.h>
+#include <asm/arch/sci/sci.h>
+#include <linux/iopoll.h>
+#include <misc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct mu_type {
+	u32 tr[4];
+	u32 rr[4];
+	u32 sr;
+	u32 cr;
+};
+
+struct imx8_scu {
+	struct mu_type *base;
+	struct udevice *clk;
+	struct udevice *pinclk;
+};
+
+#define MU_CR_GIE_MASK		0xF0000000u
+#define MU_CR_RIE_MASK		0xF000000u
+#define MU_CR_GIR_MASK		0xF0000u
+#define MU_CR_TIE_MASK		0xF00000u
+#define MU_CR_F_MASK		0x7u
+#define MU_SR_TE0_MASK		BIT(23)
+#define MU_SR_RF0_MASK		BIT(27)
+#define MU_TR_COUNT		4
+#define MU_RR_COUNT		4
+
+static inline void mu_hal_init(struct mu_type *base)
+{
+	/* Clear GIEn, RIEn, TIEn, GIRn and ABFn. */
+	clrbits_le32(&base->cr, MU_CR_GIE_MASK | MU_CR_RIE_MASK |
+		     MU_CR_TIE_MASK | MU_CR_GIR_MASK | MU_CR_F_MASK);
+}
+
+static int mu_hal_sendmsg(struct mu_type *base, u32 reg_index, u32 msg)
+{
+	u32 mask = MU_SR_TE0_MASK >> reg_index;
+	u32 val;
+	int ret;
+
+	assert(reg_index < MU_TR_COUNT);
+
+	/* Wait TX register to be empty. */
+	ret = readl_poll_timeout(&base->sr, val, val & mask, 10000);
+	if (ret < 0) {
+		printf("%s timeout\n", __func__);
+		return -ETIMEDOUT;
+	}
+
+	writel(msg, &base->tr[reg_index]);
+
+	return 0;
+}
+
+static int mu_hal_receivemsg(struct mu_type *base, u32 reg_index, u32 *msg)
+{
+	u32 mask = MU_SR_RF0_MASK >> reg_index;
+	u32 val;
+	int ret;
+
+	assert(reg_index < MU_TR_COUNT);
+
+	/* Wait RX register to be full. */
+	ret = readl_poll_timeout(&base->sr, val, val & mask, 10000);
+	if (ret < 0) {
+		printf("%s timeout\n", __func__);
+		return -ETIMEDOUT;
+	}
+
+	*msg = readl(&base->rr[reg_index]);
+
+	return 0;
+}
+
+static int sc_ipc_read(struct mu_type *base, void *data)
+{
+	struct sc_rpc_msg_s *msg = (struct sc_rpc_msg_s *)data;
+	int ret;
+	u8 count = 0;
+
+	if (!msg)
+		return -EINVAL;
+
+	/* Read first word */
+	ret = mu_hal_receivemsg(base, 0, (u32 *)msg);
+	if (ret)
+		return ret;
+	count++;
+
+	/* Check size */
+	if (msg->size > SC_RPC_MAX_MSG) {
+		*((u32 *)msg) = 0;
+		return -EINVAL;
+	}
+
+	/* Read remaining words */
+	while (count < msg->size) {
+		ret = mu_hal_receivemsg(base, count % MU_RR_COUNT,
+					&msg->DATA.u32[count - 1]);
+		if (ret)
+			return ret;
+		count++;
+	}
+
+	return 0;
+}
+
+static int sc_ipc_write(struct mu_type *base, void *data)
+{
+	struct sc_rpc_msg_s *msg = (struct sc_rpc_msg_s *)data;
+	int ret;
+	u8 count = 0;
+
+	if (!msg)
+		return -EINVAL;
+
+	/* Check size */
+	if (msg->size > SC_RPC_MAX_MSG)
+		return -EINVAL;
+
+	/* Write first word */
+	ret = mu_hal_sendmsg(base, 0, *((u32 *)msg));
+	if (ret)
+		return ret;
+	count++;
+
+	/* Write remaining words */
+	while (count < msg->size) {
+		ret = mu_hal_sendmsg(base, count % MU_TR_COUNT,
+				     msg->DATA.u32[count - 1]);
+		if (ret)
+			return ret;
+		count++;
+	}
+
+	return 0;
+}
+
+/*
+ * Note the function prototype use msgid as the 2nd parameter, here
+ * we take it as no_resp.
+ */
+static int imx8_scu_call(struct udevice *dev, int no_resp, void *tx_msg,
+			 int tx_size, void *rx_msg, int rx_size)
+{
+	struct imx8_scu *priv = dev_get_priv(dev);
+	sc_err_t result;
+	int ret;
+
+	/* Expect tx_msg, rx_msg are the same value */
+	if (rx_msg && tx_msg != rx_msg)
+		printf("tx_msg %p, rx_msg %p\n", tx_msg, rx_msg);
+
+	ret = sc_ipc_write(priv->base, tx_msg);
+	if (ret)
+		return ret;
+	if (!no_resp) {
+		ret = sc_ipc_read(priv->base, rx_msg);
+		if (ret)
+			return ret;
+	}
+
+	result = RPC_R8((struct sc_rpc_msg_s *)tx_msg);
+
+	return sc_err_to_linux(result);
+}
+
+static int imx8_scu_probe(struct udevice *dev)
+{
+	struct imx8_scu *priv = dev_get_priv(dev);
+	fdt_addr_t addr;
+
+	debug("%s(dev=%p) (priv=%p)\n", __func__, dev, priv);
+
+	addr = devfdt_get_addr(dev);
+	if (addr == FDT_ADDR_T_NONE)
+		return -EINVAL;
+
+	priv->base = (struct mu_type *)addr;
+
+	/* U-Boot not enable interrupts, so need to enable RX interrupts */
+	mu_hal_init(priv->base);
+
+	gd->arch.scu_dev = dev;
+
+	device_probe(priv->clk);
+	device_probe(priv->pinclk);
+
+	return 0;
+}
+
+static int imx8_scu_remove(struct udevice *dev)
+{
+	return 0;
+}
+
+static int imx8_scu_bind(struct udevice *dev)
+{
+	struct imx8_scu *priv = dev_get_priv(dev);
+	int ret;
+	struct udevice *child;
+	int node;
+
+	debug("%s(dev=%p)\n", __func__, dev);
+
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+					     "fsl,imx8qxp-clk");
+	if (node < 0)
+		panic("No clk node found\n");
+
+	ret = lists_bind_fdt(dev, offset_to_ofnode(node), &child);
+	if (ret)
+		return ret;
+
+	priv->clk = child;
+
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+					     "fsl,imx8qxp-iomuxc");
+	if (node < 0)
+		panic("No clk node found\n");
+
+	ret = lists_bind_fdt(dev, offset_to_ofnode(node), &child);
+	if (ret)
+		return ret;
+
+	priv->pinclk = child;
+
+	return 0;
+}
+
+static struct misc_ops imx8_scu_ops = {
+	.call = imx8_scu_call,
+};
+
+static const struct udevice_id imx8_scu_ids[] = {
+	{ .compatible = "fsl,imx8qxp-mu" },
+	{ .compatible = "fsl,imx8-mu" },
+	{ }
+};
+
+U_BOOT_DRIVER(imx8_scu) = {
+	.name		= "imx8_scu",
+	.id		= UCLASS_MISC,
+	.of_match	= imx8_scu_ids,
+	.probe		= imx8_scu_probe,
+	.bind		= imx8_scu_bind,
+	.remove		= imx8_scu_remove,
+	.ops		= &imx8_scu_ops,
+	.priv_auto_alloc_size = sizeof(struct imx8_scu),
+	.flags		= DM_FLAG_PRE_RELOC,
+};
-- 
2.14.1

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

* [U-Boot] [PATCH V5 09/32] misc: imx8: add scfw api impementation
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (7 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 10/32] imx: boot_mode: Add FLEXSPI boot entry Peng Fan
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add clk/misc/pad/pm/rm scfw api implementaion for different
drivers to invoke. The low level code is using misc_call
to invoke imx8_scu driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/sci/sci.h |  28 +++
 drivers/misc/imx8/Makefile               |   2 +-
 drivers/misc/imx8/scu_api.c              | 316 +++++++++++++++++++++++++++++++
 3 files changed, 345 insertions(+), 1 deletion(-)
 create mode 100644 drivers/misc/imx8/scu_api.c

diff --git a/arch/arm/include/asm/arch-imx8/sci/sci.h b/arch/arm/include/asm/arch-imx8/sci/sci.h
index d0ff5c5c41..4704ba9699 100644
--- a/arch/arm/include/asm/arch-imx8/sci/sci.h
+++ b/arch/arm/include/asm/arch-imx8/sci/sci.h
@@ -55,4 +55,32 @@ static inline int sc_err_to_linux(sc_err_t err)
 	return ret;
 }
 
+/* PM API*/
+int sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource,
+				  sc_pm_power_mode_t mode);
+int sc_pm_set_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate);
+int sc_pm_get_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate);
+int sc_pm_set_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate);
+int sc_pm_get_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate);
+int sc_pm_clock_enable(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+		       sc_bool_t enable, sc_bool_t autog);
+
+/* MISC API */
+int sc_misc_get_control(sc_ipc_t ipc, sc_rsrc_t resource, sc_ctrl_t ctrl,
+			u32 *val);
+void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *boot_dev);
+void sc_misc_boot_status(sc_ipc_t ipc, sc_misc_boot_status_t status);
+
+/* RM API */
+sc_bool_t sc_rm_is_memreg_owned(sc_ipc_t ipc, sc_rm_mr_t mr);
+int sc_rm_get_memreg_info(sc_ipc_t ipc, sc_rm_mr_t mr, sc_faddr_t *addr_start,
+			  sc_faddr_t *addr_end);
+sc_bool_t sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource);
+
+/* PAD API */
+int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val);
 #endif
diff --git a/drivers/misc/imx8/Makefile b/drivers/misc/imx8/Makefile
index 3395340d22..ee05893cbb 100644
--- a/drivers/misc/imx8/Makefile
+++ b/drivers/misc/imx8/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-obj-y += scu.o
+obj-y += scu_api.o scu.o
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c
new file mode 100644
index 0000000000..c19836e84c
--- /dev/null
+++ b/drivers/misc/imx8/scu_api.c
@@ -0,0 +1,316 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2018 NXP
+ *
+ * Peng Fan <peng.fan@nxp.com>
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <dm.h>
+#include <asm/arch/sci/sci.h>
+#include <misc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* CLK and PM */
+int sc_pm_set_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_PM;
+	RPC_FUNC(&msg) = (u8)PM_FUNC_SET_CLOCK_RATE;
+	RPC_U32(&msg, 0U) = *(u32 *)rate;
+	RPC_U16(&msg, 4U) = (u16)resource;
+	RPC_U8(&msg, 6U) = (u8)clk;
+	RPC_SIZE(&msg) = 3U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: rate:%u resource:%u: clk:%u res:%d\n",
+		       __func__, *rate, resource, clk, RPC_R8(&msg));
+
+	*rate = RPC_U32(&msg, 0U);
+
+	return ret;
+}
+
+int sc_pm_get_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+			 sc_pm_clock_rate_t *rate)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_PM;
+	RPC_FUNC(&msg) = (u8)PM_FUNC_GET_CLOCK_RATE;
+	RPC_U16(&msg, 0U) = (u16)resource;
+	RPC_U8(&msg, 2U) = (u8)clk;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret) {
+		printf("%s: resource:%d clk:%d: res:%d\n",
+		       __func__, resource, clk, RPC_R8(&msg));
+		return ret;
+	}
+
+	if (rate)
+		*rate = RPC_U32(&msg, 0U);
+
+	return 0;
+}
+
+int sc_pm_clock_enable(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
+		       sc_bool_t enable, sc_bool_t autog)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_PM;
+	RPC_FUNC(&msg) = (u8)PM_FUNC_CLOCK_ENABLE;
+	RPC_U16(&msg, 0U) = (u16)resource;
+	RPC_U8(&msg, 2U) = (u8)clk;
+	RPC_U8(&msg, 3U) = (u8)enable;
+	RPC_U8(&msg, 4U) = (u8)autog;
+	RPC_SIZE(&msg) = 3U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: resource:%d clk:%d: enable:%d autog: %d, res:%d\n",
+		       __func__, resource, clk, enable, autog, RPC_R8(&msg));
+
+	return ret;
+}
+
+int sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource,
+				  sc_pm_power_mode_t mode)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_PM;
+	RPC_FUNC(&msg) = (u8)PM_FUNC_SET_RESOURCE_POWER_MODE;
+	RPC_U16(&msg, 0U) = (u16)resource;
+	RPC_U8(&msg, 2U) = (u8)mode;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: resource:%d mode:%d: res:%d\n",
+		       __func__, resource, mode, RPC_R8(&msg));
+
+	return ret;
+}
+
+/* PAD */
+int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_PAD;
+	RPC_FUNC(&msg) = (u8)PAD_FUNC_SET;
+	RPC_U32(&msg, 0U) = (u32)val;
+	RPC_U16(&msg, 4U) = (u16)pad;
+	RPC_SIZE(&msg) = 3U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: val:%d pad:%d: res:%d\n",
+		       __func__, val, pad, RPC_R8(&msg));
+
+	return ret;
+}
+
+/* MISC */
+int sc_misc_get_control(sc_ipc_t ipc, sc_rsrc_t resource, sc_ctrl_t ctrl,
+			u32 *val)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC;
+	RPC_FUNC(&msg) = (u8)MISC_FUNC_GET_CONTROL;
+	RPC_U32(&msg, 0U) = (u32)ctrl;
+	RPC_U16(&msg, 4U) = (u16)resource;
+	RPC_SIZE(&msg) = 3U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: ctrl:%d resource:%d: res:%d\n",
+		       __func__, ctrl, resource, RPC_R8(&msg));
+
+	if (!val)
+		*val = RPC_U32(&msg, 0U);
+
+	return ret;
+}
+
+void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *boot_dev)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC;
+	RPC_FUNC(&msg) = (u8)MISC_FUNC_GET_BOOT_DEV;
+	RPC_SIZE(&msg) = 1U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: res:%d\n", __func__, RPC_R8(&msg));
+
+	if (!boot_dev)
+		*boot_dev = RPC_U16(&msg, 0U);
+}
+
+void sc_misc_boot_status(sc_ipc_t ipc, sc_misc_boot_status_t status)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_MISC;
+	RPC_FUNC(&msg) = (u8)MISC_FUNC_BOOT_STATUS;
+	RPC_U8(&msg, 0U) = (u8)status;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_TRUE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: status:%d res:%d\n",
+		       __func__, status, RPC_R8(&msg));
+}
+
+/* RM */
+sc_bool_t sc_rm_is_memreg_owned(sc_ipc_t ipc, sc_rm_mr_t mr)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+	sc_err_t result;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_RM;
+	RPC_FUNC(&msg) = (u8)RM_FUNC_IS_MEMREG_OWNED;
+	RPC_U8(&msg, 0U) = (u8)mr;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	result = RPC_R8(&msg);
+
+	if (result != 0 && result != 1) {
+		printf("%s: mr:%d res:%d\n", __func__, mr, RPC_R8(&msg));
+		if (ret)
+			printf("%s: mr:%d res:%d\n", __func__, mr,
+			       RPC_R8(&msg));
+
+	}
+
+	return (sc_bool_t)result;
+}
+
+int sc_rm_get_memreg_info(sc_ipc_t ipc, sc_rm_mr_t mr, sc_faddr_t *addr_start,
+			  sc_faddr_t *addr_end)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_RM;
+	RPC_FUNC(&msg) = (u8)RM_FUNC_GET_MEMREG_INFO;
+	RPC_U8(&msg, 0U) = (u8)mr;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	if (ret)
+		printf("%s: mr:%d res:%d\n", __func__, mr, RPC_R8(&msg));
+
+	if (addr_start)
+		*addr_start = ((u64)RPC_U32(&msg, 0U) << 32U) |
+			RPC_U32(&msg, 4U);
+
+	if (addr_end)
+		*addr_end = ((u64)RPC_U32(&msg, 8U) << 32U) |
+			RPC_U32(&msg, 12U);
+
+	return ret;
+}
+
+sc_bool_t sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource)
+{
+	struct udevice *dev = gd->arch.scu_dev;
+	int size = sizeof(struct sc_rpc_msg_s);
+	struct sc_rpc_msg_s msg;
+	int ret;
+	u8 result;
+
+	if (!dev)
+		hang();
+
+	RPC_VER(&msg) = SC_RPC_VERSION;
+	RPC_SVC(&msg) = (u8)SC_RPC_SVC_RM;
+	RPC_FUNC(&msg) = (u8)RM_FUNC_IS_RESOURCE_OWNED;
+	RPC_U16(&msg, 0U) = (u16)resource;
+	RPC_SIZE(&msg) = 2U;
+
+	ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+	result = RPC_R8(&msg);
+	if (result != 0 && result != 1) {
+		printf("%s: resource:%d res:%d\n",
+		       __func__, resource, RPC_R8(&msg));
+		if (ret)
+			printf("%s: res:%d res:%d\n", __func__, resource,
+			       RPC_R8(&msg));
+	}
+
+
+	return !!result;
+}
-- 
2.14.1

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

* [U-Boot] [PATCH V5 10/32] imx: boot_mode: Add FLEXSPI boot entry
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (8 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 09/32] misc: imx8: add scfw api impementation Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 11/32] imx8: add imx-regs header file Peng Fan
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

i.MX8 support FLEXSPI boot support. So add FLEXSPI boot entry.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/mach-imx/boot_mode.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/mach-imx/boot_mode.h b/arch/arm/include/asm/mach-imx/boot_mode.h
index 8766e9d180..3a483b6afa 100644
--- a/arch/arm/include/asm/mach-imx/boot_mode.h
+++ b/arch/arm/include/asm/mach-imx/boot_mode.h
@@ -25,6 +25,7 @@ enum boot_device {
 	MMC4_BOOT,
 	NAND_BOOT,
 	QSPI_BOOT,
+	FLEXSPI_BOOT,
 	USB_BOOT,
 	UNKNOWN_BOOT,
 	BOOT_DEV_NUM = UNKNOWN_BOOT,
-- 
2.14.1

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

* [U-Boot] [PATCH V5 11/32] imx8: add imx-regs header file
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (9 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 10/32] imx: boot_mode: Add FLEXSPI boot entry Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 12/32] imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined Peng Fan
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add imx-regs header file to include the register base definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/imx-regs.h | 46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/imx-regs.h

diff --git a/arch/arm/include/asm/arch-imx8/imx-regs.h b/arch/arm/include/asm/arch-imx8/imx-regs.h
new file mode 100644
index 0000000000..af0fb5154b
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/imx-regs.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __ASM_ARCH_IMX8_REGS_H__
+#define __ASM_ARCH_IMX8_REGS_H__
+
+#define LPUART_BASE		0x5A060000
+
+#define GPT1_BASE_ADDR		0x5D140000
+#define SCU_LPUART_BASE		0x33220000
+#define GPIO1_BASE_ADDR		0x5D080000
+#define GPIO2_BASE_ADDR		0x5D090000
+#define GPIO3_BASE_ADDR		0x5D0A0000
+#define GPIO4_BASE_ADDR		0x5D0B0000
+#define GPIO5_BASE_ADDR		0x5D0C0000
+#define GPIO6_BASE_ADDR		0x5D0D0000
+#define GPIO7_BASE_ADDR		0x5D0E0000
+#define GPIO8_BASE_ADDR		0x5D0F0000
+#define LPI2C1_BASE_ADDR	0x5A800000
+#define LPI2C2_BASE_ADDR	0x5A810000
+#define LPI2C3_BASE_ADDR	0x5A820000
+#define LPI2C4_BASE_ADDR	0x5A830000
+#define LPI2C5_BASE_ADDR	0x5A840000
+
+#ifdef CONFIG_IMX8QXP
+#define LVDS0_PHYCTRL_BASE	0x56221000
+#define LVDS1_PHYCTRL_BASE	0x56241000
+#define MIPI0_SS_BASE		0x56220000
+#define MIPI1_SS_BASE		0x56240000
+#endif
+
+#define APBH_DMA_ARB_BASE_ADDR	0x5B810000
+#define APBH_DMA_ARB_END_ADDR	0x5B81FFFF
+#define MXS_APBH_BASE		APBH_DMA_ARB_BASE_ADDR
+
+#define MXS_GPMI_BASE		(APBH_DMA_ARB_BASE_ADDR + 0x02000)
+#define MXS_BCH_BASE		(APBH_DMA_ARB_BASE_ADDR + 0x04000)
+
+#define PASS_OVER_INFO_ADDR	0x0010fe00
+
+#define USB_BASE_ADDR		0x5b0d0000
+#define USB_PHY0_BASE_ADDR	0x5b100000
+
+#endif /* __ASM_ARCH_IMX8_REGS_H__ */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 12/32] imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (10 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 11/32] imx8: add imx-regs header file Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 13/32] imx: add i.MX8 cpu type Peng Fan
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Include i.MX8QXP pin header when CONFIG_IMX8QXP defined,
if no SoC macro defined, report error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/imx8-pins.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/imx8-pins.h

diff --git a/arch/arm/include/asm/arch-imx8/imx8-pins.h b/arch/arm/include/asm/arch-imx8/imx8-pins.h
new file mode 100644
index 0000000000..dcced1010b
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/imx8-pins.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __ASM_ARCH_IMX8_PINS_H__
+#define __ASM_ARCH_IMX8_PINS_H__
+
+#if defined(CONFIG_IMX8QXP)
+#include <dt-bindings/pinctrl/pads-imx8qxp.h>
+#else
+#error "No pin header"
+#endif
+
+#endif	/* __ASM_ARCH_IMX8_PINS_H__ */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 13/32] imx: add i.MX8 cpu type
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (11 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 12/32] imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 14/32] armv8: add cpu core helper functions Peng Fan
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8 cpu type and is_imx8/is_imx8qxp help macros.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx/cpu.h       | 5 +++++
 arch/arm/include/asm/mach-imx/sys_proto.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 62df1b9ad2..cf6303c3f5 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -25,12 +25,14 @@
 #define MXC_CPU_MX7S		0x71 /* dummy ID */
 #define MXC_CPU_MX7D		0x72
 #define MXC_CPU_MX8MQ		0x82
+#define MXC_CPU_IMX8QXP		0x92 /* dummy ID */
 #define MXC_CPU_MX7ULP		0xE1 /* Temporally hard code */
 #define MXC_CPU_VF610		0xF6 /* dummy ID */
 
 #define MXC_SOC_MX6		0x60
 #define MXC_SOC_MX7		0x70
 #define MXC_SOC_MX8M		0x80
+#define MXC_SOC_IMX8		0x90 /* dummy */
 #define MXC_SOC_MX7ULP		0xE0 /* dummy */
 
 #define CHIP_REV_1_0            0x10
@@ -41,6 +43,9 @@
 #define CHIP_REV_2_5            0x25
 #define CHIP_REV_3_0            0x30
 
+#define CHIP_REV_A				0x0
+#define CHIP_REV_B				0x1
+
 #define BOARD_REV_1_0           0x0
 #define BOARD_REV_2_0           0x1
 #define BOARD_VER_OFFSET        0x8
diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index d1d6cbc462..f8890b57da 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -27,6 +27,7 @@
 #define is_mx6() (is_soc_type(MXC_SOC_MX6))
 #define is_mx7() (is_soc_type(MXC_SOC_MX7))
 #define is_mx8m() (is_soc_type(MXC_SOC_MX8M))
+#define is_imx8() (is_soc_type(MXC_SOC_IMX8))
 
 #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))
 #define is_mx6dq() (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
@@ -41,6 +42,8 @@
 
 #define is_mx7ulp() (is_cpu_type(MXC_CPU_MX7ULP))
 
+#define is_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP))
+
 #ifdef CONFIG_MX6
 #define IMX6_SRC_GPR10_BMODE		BIT(28)
 
-- 
2.14.1

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

* [U-Boot] [PATCH V5 14/32] armv8: add cpu core helper functions
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (12 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 13/32] imx: add i.MX8 cpu type Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 15/32] imx8: add basic cpu support Peng Fan
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add helper functions to identify different armv8 variants.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/armv8/cpu.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 arch/arm/include/asm/armv8/cpu.h

diff --git a/arch/arm/include/asm/armv8/cpu.h b/arch/arm/include/asm/armv8/cpu.h
new file mode 100644
index 0000000000..40d54dc85a
--- /dev/null
+++ b/arch/arm/include/asm/armv8/cpu.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#define MIDR_PARTNUM_CORTEX_A35	0xD04
+#define MIDR_PARTNUM_CORTEX_A53	0xD03
+#define MIDR_PARTNUM_CORTEX_A72	0xD08
+#define MIDR_PARTNUM_SHIFT	0x4
+#define MIDR_PARTNUM_MASK	(0xFFF << 0x4)
+
+static inline unsigned int read_midr(void)
+{
+	unsigned long val;
+
+	asm volatile("mrs %0, midr_el1" : "=r" (val));
+
+	return val;
+}
+
+#define is_cortex_a35() (((read_midr() & MIDR_PARTNUM_MASK) >> \
+			 MIDR_PARTNUM_SHIFT) == MIDR_PARTNUM_CORTEX_A35)
+#define is_cortex_a53() (((read_midr() & MIDR_PARTNUM_MASK) >> \
+			 MIDR_PARTNUM_SHIFT) == MIDR_PARTNUM_CORTEX_A53)
+#define is_cortex_a72() (((read_midr() & MIDR_PARTNUM_MASK) >>\
+			 MIDR_PARTNUM_SHIFT) == MIDR_PARTNUM_CORTEX_A72)
-- 
2.14.1

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

* [U-Boot] [PATCH V5 15/32] imx8: add basic cpu support
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (13 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 14/32] armv8: add cpu core helper functions Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 16/32] imx8: add boot device detection Peng Fan
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add basic cpu support, including cpu revision, cpu type,
cpu core detection.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/mach-imx/imx8/Makefile |  7 ++++
 arch/arm/mach-imx/imx8/cpu.c    | 93 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100644 arch/arm/mach-imx/imx8/Makefile
 create mode 100644 arch/arm/mach-imx/imx8/cpu.c

diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile
new file mode 100644
index 0000000000..57876139a1
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright 2018 NXP
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += cpu.o
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
new file mode 100644
index 0000000000..0b841e291d
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <dm/uclass.h>
+#include <errno.h>
+#include <asm/arch/sci/sci.h>
+#include <asm/arch-imx/cpu.h>
+#include <asm/armv8/cpu.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u32 get_cpu_rev(void)
+{
+	u32 id = 0, rev = 0;
+	int ret;
+
+	ret = sc_misc_get_control(-1, SC_R_SYSTEM, SC_C_ID, &id);
+	if (ret)
+		return 0;
+
+	rev = (id >> 5)  & 0xf;
+	id = (id & 0x1f) + MXC_SOC_IMX8;  /* Dummy ID for chip */
+
+	return (id << 12) | rev;
+}
+
+#ifdef CONFIG_DISPLAY_CPUINFO
+const char *get_imx8_type(u32 imxtype)
+{
+	switch (imxtype) {
+	case MXC_CPU_IMX8QXP:
+		return "8QXP";
+	default:
+		return "??";
+	}
+}
+
+const char *get_imx8_rev(u32 rev)
+{
+	switch (rev) {
+	case CHIP_REV_A:
+		return "A";
+	case CHIP_REV_B:
+		return "B";
+	default:
+		return "?";
+	}
+}
+
+const char *get_core_name(void)
+{
+	if (is_cortex_a35())
+		return "A35";
+	else
+		return "?";
+}
+
+int print_cpuinfo(void)
+{
+	struct udevice *dev;
+	struct clk cpu_clk;
+	int ret;
+
+	ret = uclass_get_device(UCLASS_CPU, 0, &dev);
+	if (ret)
+		return 0;
+
+	ret = clk_get_by_index(dev, 0, &cpu_clk);
+	if (ret) {
+		dev_err(dev, "failed to clk\n");
+		return 0;
+	}
+
+	u32 cpurev;
+
+	cpurev = get_cpu_rev();
+
+	printf("CPU:   Freescale i.MX%s rev%s %s@%ld MHz\n",
+	       get_imx8_type((cpurev & 0xFF000) >> 12),
+	       get_imx8_rev((cpurev & 0xFFF)),
+	       get_core_name(),
+	       clk_get_rate(&cpu_clk) / 1000000);
+
+	return 0;
+}
+#endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 16/32] imx8: add boot device detection
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (14 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 15/32] imx8: add basic cpu support Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 17/32] imx8: implement mmc_get_env_dev Peng Fan
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add get_boot_device to detect boot device.
Add print_bootinfo to print the boot device info.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/sys_proto.h | 10 ++++
 arch/arm/mach-imx/imx8/cpu.c               | 85 ++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/sys_proto.h

diff --git a/arch/arm/include/asm/arch-imx8/sys_proto.h b/arch/arm/include/asm/arch-imx8/sys_proto.h
new file mode 100644
index 0000000000..f9a3016132
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/sys_proto.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <asm/mach-imx/sys_proto.h>
+#include <linux/types.h>
+
+enum boot_device get_boot_device(void);
+int print_bootinfo(void);
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 0b841e291d..90b6ea4211 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -11,8 +11,10 @@
 #include <dm/uclass.h>
 #include <errno.h>
 #include <asm/arch/sci/sci.h>
+#include <asm/arch/sys_proto.h>
 #include <asm/arch-imx/cpu.h>
 #include <asm/armv8/cpu.h>
+#include <asm/mach-imx/boot_mode.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -91,3 +93,86 @@ int print_cpuinfo(void)
 	return 0;
 }
 #endif
+
+int print_bootinfo(void)
+{
+	enum boot_device bt_dev = get_boot_device();
+
+	puts("Boot:  ");
+	switch (bt_dev) {
+	case SD1_BOOT:
+		puts("SD0\n");
+		break;
+	case SD2_BOOT:
+		puts("SD1\n");
+		break;
+	case SD3_BOOT:
+		puts("SD2\n");
+		break;
+	case MMC1_BOOT:
+		puts("MMC0\n");
+		break;
+	case MMC2_BOOT:
+		puts("MMC1\n");
+		break;
+	case MMC3_BOOT:
+		puts("MMC2\n");
+		break;
+	case FLEXSPI_BOOT:
+		puts("FLEXSPI\n");
+		break;
+	case SATA_BOOT:
+		puts("SATA\n");
+		break;
+	case NAND_BOOT:
+		puts("NAND\n");
+		break;
+	case USB_BOOT:
+		puts("USB\n");
+		break;
+	default:
+		printf("Unknown device %u\n", bt_dev);
+		break;
+	}
+
+	return 0;
+}
+
+enum boot_device get_boot_device(void)
+{
+	enum boot_device boot_dev = SD1_BOOT;
+
+	sc_rsrc_t dev_rsrc;
+
+	sc_misc_get_boot_dev(-1, &dev_rsrc);
+
+	switch (dev_rsrc) {
+	case SC_R_SDHC_0:
+		boot_dev = MMC1_BOOT;
+		break;
+	case SC_R_SDHC_1:
+		boot_dev = SD2_BOOT;
+		break;
+	case SC_R_SDHC_2:
+		boot_dev = SD3_BOOT;
+		break;
+	case SC_R_NAND:
+		boot_dev = NAND_BOOT;
+		break;
+	case SC_R_FSPI_0:
+		boot_dev = FLEXSPI_BOOT;
+		break;
+	case SC_R_SATA_0:
+		boot_dev = SATA_BOOT;
+		break;
+	case SC_R_USB_0:
+	case SC_R_USB_1:
+	case SC_R_USB_2:
+		boot_dev = USB_BOOT;
+		break;
+	default:
+		break;
+	}
+
+	return boot_dev;
+}
-- 
2.14.1

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

* [U-Boot] [PATCH V5 17/32] imx8: implement mmc_get_env_dev
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (15 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 16/32] imx8: add boot device detection Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 18/32] imx8: add mmu and dram related functiions Peng Fan
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Implement mmc_get_env_dev for i.MX8.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/mach-imx/imx8/cpu.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 90b6ea4211..0cacaa895c 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -176,3 +176,35 @@ enum boot_device get_boot_device(void)
 
 	return boot_dev;
 }
+
+#ifdef CONFIG_ENV_IS_IN_MMC
+__weak int board_mmc_get_env_dev(int devno)
+{
+	return CONFIG_SYS_MMC_ENV_DEV;
+}
+
+int mmc_get_env_dev(void)
+{
+	sc_rsrc_t dev_rsrc;
+	int devno;
+
+	sc_misc_get_boot_dev(-1, &dev_rsrc);
+
+	switch (dev_rsrc) {
+	case SC_R_SDHC_0:
+		devno = 0;
+		break;
+	case SC_R_SDHC_1:
+		devno = 1;
+		break;
+	case SC_R_SDHC_2:
+		devno = 2;
+		break;
+	default:
+		/* If not boot from sd/mmc, use default value */
+		return CONFIG_SYS_MMC_ENV_DEV;
+	}
+
+	return board_mmc_get_env_dev(devno);
+}
+#endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 18/32] imx8: add mmu and dram related functiions
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (16 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 17/32] imx8: implement mmc_get_env_dev Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 19/32] imx8: add arch_cpu_init arch_cpu_init_dm Peng Fan
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add mmu memmap, some memory regions are reserved by M4, Arm Trusted
Firmware, so need to get memreg using SCFW API and setup the memmap.

Add dram_init, dram_init_banksize, get_effective_memsize functions,
according to the memreg.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/mach-imx/imx8/cpu.c | 283 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 283 insertions(+)

diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 0cacaa895c..389f422be7 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -14,6 +14,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch-imx/cpu.h>
 #include <asm/armv8/cpu.h>
+#include <asm/armv8/mmu.h>
 #include <asm/mach-imx/boot_mode.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -208,3 +209,285 @@ int mmc_get_env_dev(void)
 	return board_mmc_get_env_dev(devno);
 }
 #endif
+
+#define MEMSTART_ALIGNMENT  SZ_2M /* Align the memory start with 2MB */
+
+static int get_owned_memreg(sc_rm_mr_t mr, sc_faddr_t *addr_start,
+			    sc_faddr_t *addr_end)
+{
+	sc_faddr_t start, end;
+	int ret;
+	bool owned;
+
+	owned = sc_rm_is_memreg_owned(-1, mr);
+	if (owned) {
+		ret = sc_rm_get_memreg_info(-1, mr, &start, &end);
+		if (ret) {
+			printf("Memreg get info failed, %d\n", ret);
+			return -EINVAL;
+		}
+		debug("0x%llx -- 0x%llx\n", start, end);
+		*addr_start = start;
+		*addr_end = end;
+
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
+phys_size_t get_effective_memsize(void)
+{
+	sc_rm_mr_t mr;
+	sc_faddr_t start, end, end1;
+	int err;
+
+	end1 = (sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE;
+
+	for (mr = 0; mr < 64; mr++) {
+		err = get_owned_memreg(mr, &start, &end);
+		if (!err) {
+			start = roundup(start, MEMSTART_ALIGNMENT);
+			/* Too small memory region, not use it */
+			if (start > end)
+				continue;
+
+			/* Find the memory region runs the u-boot */
+			if (start >= PHYS_SDRAM_1 && start <= end1 &&
+			    (start <= CONFIG_SYS_TEXT_BASE &&
+			    end >= CONFIG_SYS_TEXT_BASE)) {
+				if ((end + 1) <= ((sc_faddr_t)PHYS_SDRAM_1 +
+				    PHYS_SDRAM_1_SIZE))
+					return (end - PHYS_SDRAM_1 + 1);
+				else
+					return PHYS_SDRAM_1_SIZE;
+			}
+		}
+	}
+
+	return PHYS_SDRAM_1_SIZE;
+}
+
+int dram_init(void)
+{
+	sc_rm_mr_t mr;
+	sc_faddr_t start, end, end1, end2;
+	int err;
+
+	end1 = (sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE;
+	end2 = (sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE;
+	for (mr = 0; mr < 64; mr++) {
+		err = get_owned_memreg(mr, &start, &end);
+		if (!err) {
+			start = roundup(start, MEMSTART_ALIGNMENT);
+			/* Too small memory region, not use it */
+			if (start > end)
+				continue;
+
+			if (start >= PHYS_SDRAM_1 && start <= end1) {
+				if ((end + 1) <= end1)
+					gd->ram_size += end - start + 1;
+				else
+					gd->ram_size += end1 - start;
+			} else if (start >= PHYS_SDRAM_2 && start <= end2) {
+				if ((end + 1) <= end2)
+					gd->ram_size += end - start + 1;
+				else
+					gd->ram_size += end2 - start;
+			}
+		}
+	}
+
+	/* If error, set to the default value */
+	if (!gd->ram_size) {
+		gd->ram_size = PHYS_SDRAM_1_SIZE;
+		gd->ram_size += PHYS_SDRAM_2_SIZE;
+	}
+	return 0;
+}
+
+static void dram_bank_sort(int current_bank)
+{
+	phys_addr_t start;
+	phys_size_t size;
+
+	while (current_bank > 0) {
+		if (gd->bd->bi_dram[current_bank - 1].start >
+		    gd->bd->bi_dram[current_bank].start) {
+			start = gd->bd->bi_dram[current_bank - 1].start;
+			size = gd->bd->bi_dram[current_bank - 1].size;
+
+			gd->bd->bi_dram[current_bank - 1].start =
+				gd->bd->bi_dram[current_bank].start;
+			gd->bd->bi_dram[current_bank - 1].size =
+				gd->bd->bi_dram[current_bank].size;
+
+			gd->bd->bi_dram[current_bank].start = start;
+			gd->bd->bi_dram[current_bank].size = size;
+		}
+		current_bank--;
+	}
+}
+
+int dram_init_banksize(void)
+{
+	sc_rm_mr_t mr;
+	sc_faddr_t start, end, end1, end2;
+	int i = 0;
+	int err;
+
+	end1 = (sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE;
+	end2 = (sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE;
+
+	for (mr = 0; mr < 64 && i < CONFIG_NR_DRAM_BANKS; mr++) {
+		err = get_owned_memreg(mr, &start, &end);
+		if (!err) {
+			start = roundup(start, MEMSTART_ALIGNMENT);
+			if (start > end) /* Small memory region, no use it */
+				continue;
+
+			if (start >= PHYS_SDRAM_1 && start <= end1) {
+				gd->bd->bi_dram[i].start = start;
+
+				if ((end + 1) <= end1)
+					gd->bd->bi_dram[i].size =
+						end - start + 1;
+				else
+					gd->bd->bi_dram[i].size = end1 - start;
+
+				dram_bank_sort(i);
+				i++;
+			} else if (start >= PHYS_SDRAM_2 && start <= end2) {
+				gd->bd->bi_dram[i].start = start;
+
+				if ((end + 1) <= end2)
+					gd->bd->bi_dram[i].size =
+						end - start + 1;
+				else
+					gd->bd->bi_dram[i].size = end2 - start;
+
+				dram_bank_sort(i);
+				i++;
+			}
+		}
+	}
+
+	/* If error, set to the default value */
+	if (!i) {
+		gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+		gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+		gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+		gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+	}
+
+	return 0;
+}
+
+static u64 get_block_attrs(sc_faddr_t addr_start)
+{
+	u64 attr = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE |
+		PTE_BLOCK_PXN | PTE_BLOCK_UXN;
+
+	if ((addr_start >= PHYS_SDRAM_1 &&
+	     addr_start <= ((sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)) ||
+	    (addr_start >= PHYS_SDRAM_2 &&
+	     addr_start <= ((sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE)))
+		return (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE);
+
+	return attr;
+}
+
+static u64 get_block_size(sc_faddr_t addr_start, sc_faddr_t addr_end)
+{
+	sc_faddr_t end1, end2;
+
+	end1 = (sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE;
+	end2 = (sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE;
+
+	if (addr_start >= PHYS_SDRAM_1 && addr_start <= end1) {
+		if ((addr_end + 1) > end1)
+			return end1 - addr_start;
+	} else if (addr_start >= PHYS_SDRAM_2 && addr_start <= end2) {
+		if ((addr_end + 1) > end2)
+			return end2 - addr_start;
+	}
+
+	return (addr_end - addr_start + 1);
+}
+
+#define MAX_PTE_ENTRIES 512
+#define MAX_MEM_MAP_REGIONS 16
+
+static struct mm_region imx8_mem_map[MAX_MEM_MAP_REGIONS];
+struct mm_region *mem_map = imx8_mem_map;
+
+void enable_caches(void)
+{
+	sc_rm_mr_t mr;
+	sc_faddr_t start, end;
+	int err, i;
+
+	/* Create map for registers access from 0x1c000000 to 0x80000000*/
+	imx8_mem_map[0].virt = 0x1c000000UL;
+	imx8_mem_map[0].phys = 0x1c000000UL;
+	imx8_mem_map[0].size = 0x64000000UL;
+	imx8_mem_map[0].attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+			 PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN;
+
+	i = 1;
+	for (mr = 0; mr < 64 && i < MAX_MEM_MAP_REGIONS; mr++) {
+		err = get_owned_memreg(mr, &start, &end);
+		if (!err) {
+			imx8_mem_map[i].virt = start;
+			imx8_mem_map[i].phys = start;
+			imx8_mem_map[i].size = get_block_size(start, end);
+			imx8_mem_map[i].attrs = get_block_attrs(start);
+			i++;
+		}
+	}
+
+	if (i < MAX_MEM_MAP_REGIONS) {
+		imx8_mem_map[i].size = 0;
+		imx8_mem_map[i].attrs = 0;
+	} else {
+		puts("Error, need more MEM MAP REGIONS reserved\n");
+		icache_enable();
+		return;
+	}
+
+	for (i = 0; i < MAX_MEM_MAP_REGIONS; i++) {
+		debug("[%d] vir = 0x%llx phys = 0x%llx size = 0x%llx attrs = 0x%llx\n", i,
+		      imx8_mem_map[i].virt, imx8_mem_map[i].phys, imx8_mem_map[i].size, imx8_mem_map[i].attrs);
+	}
+
+	icache_enable();
+	dcache_enable();
+}
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+u64 get_page_table_size(void)
+{
+	u64 one_pt = MAX_PTE_ENTRIES * sizeof(u64);
+	u64 size = 0;
+
+	/*
+	 * For each memory region, the max table size:
+	 * 2 level 3 tables + 2 level 2 tables + 1 level 1 table
+	 */
+	size = (2 + 2 + 1) * one_pt * MAX_MEM_MAP_REGIONS + one_pt;
+
+	/*
+	 * We need to duplicate our page table once to have an emergency pt to
+	 * resort to when splitting page tables later on
+	 */
+	size *= 2;
+
+	/*
+	 * We may need to split page tables later on if dcache settings change,
+	 * so reserve up to 4 (random pick) page tables for that.
+	 */
+	size += one_pt * 4;
+
+	return size;
+}
+#endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 19/32] imx8: add arch_cpu_init arch_cpu_init_dm
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (17 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 18/32] imx8: add mmu and dram related functiions Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 20/32] imx8: add iomux configuration api Peng Fan
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add arch_cpu_init(_dm) mainly to open the channel between ACore and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/sys_proto.h |  9 ++++++
 arch/arm/mach-imx/imx8/cpu.c               | 51 ++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8/sys_proto.h b/arch/arm/include/asm/arch-imx8/sys_proto.h
index f9a3016132..73ffaba7d5 100644
--- a/arch/arm/include/asm/arch-imx8/sys_proto.h
+++ b/arch/arm/include/asm/arch-imx8/sys_proto.h
@@ -6,5 +6,14 @@
 #include <asm/mach-imx/sys_proto.h>
 #include <linux/types.h>
 
+struct pass_over_info_t {
+	u16 barker;
+	u16 len;
+	u32 g_bt_cfg_shadow;
+	u32 card_address_mode;
+	u32 bad_block_count_met;
+	u32 g_ap_mu;
+};
+
 enum boot_device get_boot_device(void);
 int print_bootinfo(void);
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 389f422be7..be5a8ee8ca 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -95,6 +95,57 @@ int print_cpuinfo(void)
 }
 #endif
 
+#define BT_PASSOVER_TAG	0x504F
+struct pass_over_info_t *get_pass_over_info(void)
+{
+	struct pass_over_info_t *p =
+		(struct pass_over_info_t *)PASS_OVER_INFO_ADDR;
+
+	if (p->barker != BT_PASSOVER_TAG ||
+	    p->len != sizeof(struct pass_over_info_t))
+		return NULL;
+
+	return p;
+}
+
+int arch_cpu_init(void)
+{
+	struct pass_over_info_t *pass_over = get_pass_over_info();
+
+	if (pass_over && pass_over->g_ap_mu == 0) {
+		/*
+		 * When ap_mu is 0, means the u-boot is boot
+		 * from first container
+		 */
+		sc_misc_boot_status(-1, SC_MISC_BOOT_STATUS_SUCCESS);
+	}
+
+	return 0;
+}
+
+int arch_cpu_init_dm(void)
+{
+	struct udevice *devp;
+	int node, ret;
+
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "fsl,imx8-mu");
+	ret = device_bind_driver_to_node(gd->dm_root, "imx8_scu", "imx8_scu",
+					 offset_to_ofnode(node), &devp);
+
+	if (ret) {
+		printf("could not find scu %d\n", ret);
+		return ret;
+	}
+
+	ret = device_probe(devp);
+	if (ret) {
+		printf("scu probe failed %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 int print_bootinfo(void)
 {
 	enum boot_device bt_dev = get_boot_device();
-- 
2.14.1

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

* [U-Boot] [PATCH V5 20/32] imx8: add iomux configuration api
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (18 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 19/32] imx8: add arch_cpu_init arch_cpu_init_dm Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 21/32] imx8: add dummy clock Peng Fan
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add iomux configuration api.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/arch-imx8/iomux.h | 40 +++++++++++++++++++++++++++++++
 arch/arm/mach-imx/imx8/Makefile        |  2 +-
 arch/arm/mach-imx/imx8/iomux.c         | 43 ++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-imx8/iomux.h
 create mode 100644 arch/arm/mach-imx/imx8/iomux.c

diff --git a/arch/arm/include/asm/arch-imx8/iomux.h b/arch/arm/include/asm/arch-imx8/iomux.h
new file mode 100644
index 0000000000..bedd01bfd8
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/iomux.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __ASM_ARCH_IMX8_IOMUX_H__
+#define __ASM_ARCH_IMX8_IOMUX_H__
+
+/*
+ * We use 64bits value for iomux settings.
+ * High 32bits are used for padring register value,
+ * low 16bits are used for pin index.
+ */
+typedef u64 iomux_cfg_t;
+
+#define PADRING_IFMUX_EN_SHIFT		31
+#define PADRING_IFMUX_EN_MASK		BIT(31)
+#define PADRING_GP_EN_SHIFT		30
+#define PADRING_GP_EN_MASK		BIT(30)
+#define PADRING_IFMUX_SHIFT		27
+#define PADRING_IFMUX_MASK		GENMASK(29, 27)
+#define PADRING_CONFIG_SHIFT		25
+#define PADRING_LPCONFIG_SHIFT		23
+#define PADRING_PULL_SHIFT		5
+#define PADRING_DSE_SHIFT		0
+
+#define MUX_PAD_CTRL_SHIFT	32
+#define MUX_PAD_CTRL_MASK	((iomux_cfg_t)0xFFFFFFFF << MUX_PAD_CTRL_SHIFT)
+#define MUX_PAD_CTRL(x)		((iomux_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
+#define MUX_MODE_SHIFT		(PADRING_IFMUX_SHIFT + MUX_PAD_CTRL_SHIFT)
+#define MUX_MODE_MASK		((iomux_cfg_t)0x7 << MUX_MODE_SHIFT)
+#define PIN_ID_MASK		((iomux_cfg_t)0xFFFF)
+
+/* Valid mux alt0 to alt7 */
+#define MUX_MODE_ALT(x)		(((iomux_cfg_t)(x) << MUX_MODE_SHIFT) & \
+				 MUX_MODE_MASK)
+
+void imx8_iomux_setup_pad(iomux_cfg_t pad);
+void imx8_iomux_setup_multiple_pads(iomux_cfg_t const *pad_list, u32 count);
+#endif	/* __ASM_ARCH_IMX8_IOMUX_H__ */
diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile
index 57876139a1..31ad169ccf 100644
--- a/arch/arm/mach-imx/imx8/Makefile
+++ b/arch/arm/mach-imx/imx8/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y += cpu.o
+obj-y += cpu.o iomux.o
diff --git a/arch/arm/mach-imx/imx8/iomux.c b/arch/arm/mach-imx/imx8/iomux.c
new file mode 100644
index 0000000000..0ade85fb8f
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/iomux.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/iomux.h>
+#include <asm/arch/sci/sci.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * configures a single pad in the iomuxer
+ */
+void imx8_iomux_setup_pad(iomux_cfg_t pad)
+{
+	sc_pad_t pin_id = pad & PIN_ID_MASK;
+	int ret;
+
+	u32 val = (u32)((pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT);
+
+	val |= PADRING_IFMUX_EN_MASK;
+	val |= PADRING_GP_EN_MASK;
+
+	ret = sc_pad_set(-1, pin_id, val);
+	if (ret)
+		printf("sc_pad_set failed!, pin: %u, val: 0x%x\n", pin_id, val);
+
+	debug("iomux: pin %d, val = 0x%x\n", pin_id, val);
+}
+
+/* configures a list of pads within declared with IOMUX_PADS macro */
+void imx8_iomux_setup_multiple_pads(iomux_cfg_t const *pad_list, u32 count)
+{
+	iomux_cfg_t const *p = pad_list;
+	int i;
+
+	for (i = 0; i < count; i++) {
+		imx8_iomux_setup_pad(*p);
+		p++;
+	}
+}
-- 
2.14.1

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

* [U-Boot] [PATCH V5 21/32] imx8: add dummy clock
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (19 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 20/32] imx8: add iomux configuration api Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 22/32] gpio: mxc_gpio: add support for i.MX8 Peng Fan
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

This driver is mostly used to avoid build error.
We use uclass clk driver to clk related operations.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/arch-imx8/clock.h | 27 +++++++++++++++++++++++++++
 arch/arm/mach-imx/imx8/clock.c         | 21 +++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/clock.h
 create mode 100644 arch/arm/mach-imx/imx8/clock.c

diff --git a/arch/arm/include/asm/arch-imx8/clock.h b/arch/arm/include/asm/arch-imx8/clock.h
new file mode 100644
index 0000000000..bea157171f
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/clock.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __ASM_ARCH_IMX8_CLOCK_H__
+#define __ASM_ARCH_IMX8_CLOCK_H__
+
+/* Mainly for compatible to imx common code. */
+enum mxc_clock {
+	MXC_ARM_CLK = 0,
+	MXC_AHB_CLK,
+	MXC_IPG_CLK,
+	MXC_UART_CLK,
+	MXC_CSPI_CLK,
+	MXC_AXI_CLK,
+	MXC_DDR_CLK,
+	MXC_ESDHC_CLK,
+	MXC_ESDHC2_CLK,
+	MXC_ESDHC3_CLK,
+	MXC_I2C_CLK,
+	MXC_FEC_CLK,
+};
+
+u32 mxc_get_clock(enum mxc_clock clk);
+
+#endif /* __ASM_ARCH_IMX8_CLOCK_H__ */
diff --git a/arch/arm/mach-imx/imx8/clock.c b/arch/arm/mach-imx/imx8/clock.c
new file mode 100644
index 0000000000..d747e1332f
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/clock.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <linux/errno.h>
+#include <asm/arch/clock.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u32 mxc_get_clock(enum mxc_clock clk)
+{
+	switch (clk) {
+	default:
+		printf("Unsupported mxc_clock %d\n", clk);
+		break;
+	}
+
+	return 0;
+}
-- 
2.14.1

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

* [U-Boot] [PATCH V5 22/32] gpio: mxc_gpio: add support for i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (20 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 21/32] imx8: add dummy clock Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 23/32] pinctrl: Add pinctrl driver " Peng Fan
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8 support, there are 8 GPIO banks.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/gpio.h | 21 +++++++++++++++++++++
 drivers/gpio/mxc_gpio.c               | 30 +++++++++++++++++++++---------
 2 files changed, 42 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-imx8/gpio.h

diff --git a/arch/arm/include/asm/arch-imx8/gpio.h b/arch/arm/include/asm/arch-imx8/gpio.h
new file mode 100644
index 0000000000..24cfde3c29
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/gpio.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __ASM_ARCH_IMX8_GPIO_H
+#define __ASM_ARCH_IMX8_GPIO_H
+
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
+/* GPIO registers */
+struct gpio_regs {
+	u32 gpio_dr;	/* data */
+	u32 gpio_dir;	/* direction */
+	u32 gpio_psr;	/* pad satus */
+};
+#endif
+
+/* IMX8 the GPIO index is from 0 not 1 */
+#define IMX_GPIO_NR(port, index)		(((port) * 32) + ((index) & 31))
+
+#endif /* __ASM_ARCH_IMX8_GPIO_H */
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index d8e72ada19..b820160ae7 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -40,21 +40,27 @@ static unsigned long gpio_ports[] = {
 	[2] = GPIO3_BASE_ADDR,
 #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX51) || \
 		defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX7) || defined(CONFIG_MX8M)
+		defined(CONFIG_MX7) || defined(CONFIG_MX8M) || \
+		defined(CONFIG_ARCH_IMX8)
 	[3] = GPIO4_BASE_ADDR,
 #endif
 #if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX7) || defined(CONFIG_MX8M)
+		defined(CONFIG_MX7) || defined(CONFIG_MX8M) || \
+		defined(CONFIG_ARCH_IMX8)
 	[4] = GPIO5_BASE_ADDR,
 #if !(defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) || defined(CONFIG_MX8M))
 	[5] = GPIO6_BASE_ADDR,
 #endif
 #endif
-#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_MX7)
+#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_MX7) || \
+		defined(CONFIG_ARCH_IMX8)
 #if !(defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL))
 	[6] = GPIO7_BASE_ADDR,
 #endif
 #endif
+#if defined(CONFIG_ARCH_IMX8)
+	[7] = GPIO8_BASE_ADDR,
+#endif
 };
 
 static int mxc_gpio_direction(unsigned int gpio,
@@ -347,19 +353,22 @@ static const struct mxc_gpio_plat mxc_plat[] = {
 	{ 2, (struct gpio_regs *)GPIO3_BASE_ADDR },
 #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX51) || \
 		defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX8M)
+		defined(CONFIG_MX8M) || defined(CONFIG_ARCH_IMX8)
 	{ 3, (struct gpio_regs *)GPIO4_BASE_ADDR },
 #endif
 #if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX8M)
+		defined(CONFIG_MX8M) || defined(CONFIG_ARCH_IMX8)
 	{ 4, (struct gpio_regs *)GPIO5_BASE_ADDR },
 #ifndef CONFIG_MX8M
 	{ 5, (struct gpio_regs *)GPIO6_BASE_ADDR },
 #endif
 #endif
-#if defined(CONFIG_MX53) || defined(CONFIG_MX6)
+#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_ARCH_IMX8)
 	{ 6, (struct gpio_regs *)GPIO7_BASE_ADDR },
 #endif
+#if defined(CONFIG_ARCH_IMX8)
+	{ 7, (struct gpio_regs *)GPIO8_BASE_ADDR },
+#endif
 };
 
 U_BOOT_DEVICES(mxc_gpios) = {
@@ -368,19 +377,22 @@ U_BOOT_DEVICES(mxc_gpios) = {
 	{ "gpio_mxc", &mxc_plat[2] },
 #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX51) || \
 		defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX8M)
+		defined(CONFIG_MX8M) || defined(CONFIG_ARCH_IMX8)
 	{ "gpio_mxc", &mxc_plat[3] },
 #endif
 #if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
-		defined(CONFIG_MX8M)
+		defined(CONFIG_MX8M) || defined(CONFIG_ARCH_IMX8)
 	{ "gpio_mxc", &mxc_plat[4] },
 #ifndef CONFIG_MX8M
 	{ "gpio_mxc", &mxc_plat[5] },
 #endif
 #endif
-#if defined(CONFIG_MX53) || defined(CONFIG_MX6)
+#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_ARCH_IMX8)
 	{ "gpio_mxc", &mxc_plat[6] },
 #endif
+#if defined(CONFIG_ARCH_IMX8)
+	{ "gpio_mxc", &mxc_plat[7] },
+#endif
 };
 #endif
 #endif
-- 
2.14.1

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

* [U-Boot] [PATCH V5 23/32] pinctrl: Add pinctrl driver for i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (21 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 22/32] gpio: mxc_gpio: add support for i.MX8 Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 24/32] power: Add power domain " Peng Fan
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add pinctrl driver for i.MX8. The pads configuration is controlled
by SCU, so need to ask SCU to configure pads through scfw API.
Add pinctrl-scu to invoke sc_pad_set to configue pads.
Add a new flag IMX8_USE_SCU to differentiate i.MX8 from other platforms
which could directly configure pads from Acore side.
Add CONFIG_PINCTRL_IMX8 as the built gate.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/pinctrl/nxp/Kconfig        |  18 ++++
 drivers/pinctrl/nxp/Makefile       |   2 +
 drivers/pinctrl/nxp/pinctrl-imx.c  | 209 ++++++++++++++++++++-----------------
 drivers/pinctrl/nxp/pinctrl-imx.h  |  16 +++
 drivers/pinctrl/nxp/pinctrl-imx8.c |  40 +++++++
 drivers/pinctrl/nxp/pinctrl-scu.c  |  66 ++++++++++++
 6 files changed, 258 insertions(+), 93 deletions(-)
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx8.c
 create mode 100644 drivers/pinctrl/nxp/pinctrl-scu.c

diff --git a/drivers/pinctrl/nxp/Kconfig b/drivers/pinctrl/nxp/Kconfig
index b668359a0b..449ad47ebc 100644
--- a/drivers/pinctrl/nxp/Kconfig
+++ b/drivers/pinctrl/nxp/Kconfig
@@ -1,6 +1,9 @@
 config PINCTRL_IMX
 	bool
 
+config PINCTRL_IMX_SCU
+	bool
+
 config PINCTRL_IMX5
 	bool "IMX5 pinctrl driver"
 	depends on ARCH_MX5 && PINCTRL_FULL
@@ -56,3 +59,18 @@ config PINCTRL_IMX7ULP
 	  is different from the linux one, this is a simple implementation,
 	  only parses the 'fsl,pins' property and configure related
 	  registers.
+
+config PINCTRL_IMX8
+	bool "IMX8 pinctrl driver"
+	depends on ARCH_IMX8 && PINCTRL_FULL
+	select DEVRES
+	select PINCTRL_IMX
+	select PINCTRL_IMX_SCU
+	help
+	  Say Y here to enable the imx8 pinctrl driver
+
+	  This provides a simple pinctrl driver for i.MX8 SoC familiy.
+	  This feature depends on device tree configuration. This driver
+	  is different from the linux one, this is a simple implementation,
+	  only parses the 'fsl,pins' property and configure related
+	  registers.
diff --git a/drivers/pinctrl/nxp/Makefile b/drivers/pinctrl/nxp/Makefile
index c763948376..310b3b3a2e 100644
--- a/drivers/pinctrl/nxp/Makefile
+++ b/drivers/pinctrl/nxp/Makefile
@@ -3,3 +3,5 @@ obj-$(CONFIG_PINCTRL_IMX5)		+= pinctrl-imx5.o
 obj-$(CONFIG_PINCTRL_IMX6)		+= pinctrl-imx6.o
 obj-$(CONFIG_PINCTRL_IMX7)		+= pinctrl-imx7.o
 obj-$(CONFIG_PINCTRL_IMX7ULP)		+= pinctrl-imx7ulp.o
+obj-$(CONFIG_PINCTRL_IMX_SCU)		+= pinctrl-scu.o
+obj-$(CONFIG_PINCTRL_IMX8)		+= pinctrl-imx8.o
diff --git a/drivers/pinctrl/nxp/pinctrl-imx.c b/drivers/pinctrl/nxp/pinctrl-imx.c
index 36e1e8983c..04ea82aba5 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx.c
@@ -28,7 +28,9 @@ static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 
 	dev_dbg(dev, "%s: %s\n", __func__, config->name);
 
-	if (info->flags & SHARE_MUX_CONF_REG)
+	if (info->flags & IMX8_USE_SCU)
+		pin_size = SHARE_IMX8_PIN_SIZE;
+	else if (info->flags & SHARE_MUX_CONF_REG)
 		pin_size = SHARE_FSL_PIN_SIZE;
 	else
 		pin_size = FSL_PIN_SIZE;
@@ -58,112 +60,127 @@ static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 
 	npins = size / pin_size;
 
-	/*
-	 * Refer to linux documentation for details:
-	 * Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
-	 */
-	for (i = 0; i < npins; i++) {
-		mux_reg = pin_data[j++];
-
-		if (!(info->flags & ZERO_OFFSET_VALID) && !mux_reg)
-			mux_reg = -1;
-
-		if (info->flags & SHARE_MUX_CONF_REG) {
-			conf_reg = mux_reg;
-		} else {
-			conf_reg = pin_data[j++];
-			if (!(info->flags & ZERO_OFFSET_VALID) && !conf_reg)
-				conf_reg = -1;
-		}
+	if (info->flags & IMX8_USE_SCU) {
+		imx_pinctrl_scu_conf_pins(info, pin_data, npins);
+	} else {
+		/*
+		 * Refer to linux documentation for details:
+		 * Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
+		 */
+		for (i = 0; i < npins; i++) {
+			mux_reg = pin_data[j++];
 
-		if ((mux_reg == -1) || (conf_reg == -1)) {
-			dev_err(dev, "Error mux_reg or conf_reg\n");
-			devm_kfree(dev, pin_data);
-			return -EINVAL;
-		}
+			if (!(info->flags & ZERO_OFFSET_VALID) && !mux_reg)
+				mux_reg = -1;
 
-		input_reg = pin_data[j++];
-		mux_mode = pin_data[j++];
-		input_val = pin_data[j++];
-		config_val = pin_data[j++];
+			if (info->flags & SHARE_MUX_CONF_REG) {
+				conf_reg = mux_reg;
+			} else {
+				conf_reg = pin_data[j++];
+				if (!(info->flags & ZERO_OFFSET_VALID) &&
+				    !conf_reg)
+					conf_reg = -1;
+			}
 
-		dev_dbg(dev, "mux_reg 0x%x, conf_reg 0x%x, input_reg 0x%x, "
-			"mux_mode 0x%x, input_val 0x%x, config_val 0x%x\n",
-			mux_reg, conf_reg, input_reg, mux_mode, input_val,
-			config_val);
+			if ((mux_reg == -1) || (conf_reg == -1)) {
+				dev_err(dev, "Error mux_reg or conf_reg\n");
+				devm_kfree(dev, pin_data);
+				return -EINVAL;
+			}
 
-		if (config_val & IMX_PAD_SION)
-			mux_mode |= IOMUXC_CONFIG_SION;
+			input_reg = pin_data[j++];
+			mux_mode = pin_data[j++];
+			input_val = pin_data[j++];
+			config_val = pin_data[j++];
 
-		config_val &= ~IMX_PAD_SION;
+			dev_dbg(dev, "mux_reg 0x%x, conf_reg 0x%x, "
+				"input_reg 0x%x, mux_mode 0x%x, "
+				"input_val 0x%x, config_val 0x%x\n",
+				mux_reg, conf_reg, input_reg, mux_mode,
+				input_val, config_val);
 
-		/* Set Mux */
-		if (info->flags & SHARE_MUX_CONF_REG) {
-			clrsetbits_le32(info->base + mux_reg, info->mux_mask,
-					mux_mode << mux_shift);
-		} else {
-			writel(mux_mode, info->base + mux_reg);
-		}
+			if (config_val & IMX_PAD_SION)
+				mux_mode |= IOMUXC_CONFIG_SION;
 
-		dev_dbg(dev, "write mux: offset 0x%x val 0x%x\n", mux_reg,
-			mux_mode);
+			config_val &= ~IMX_PAD_SION;
 
-		/*
-		 * Set select input
-		 *
-		 * If the select input value begins with 0xff, it's a quirky
-		 * select input and the value should be interpreted as below.
-		 *     31     23      15      7        0
-		 *     | 0xff | shift | width | select |
-		 * It's used to work around the problem that the select
-		 * input for some pin is not implemented in the select
-		 * input register but in some general purpose register.
-		 * We encode the select input value, width and shift of
-		 * the bit field into input_val cell of pin function ID
-		 * in device tree, and then decode them here for setting
-		 * up the select input bits in general purpose register.
-		 */
+			/* Set Mux */
+			if (info->flags & SHARE_MUX_CONF_REG) {
+				clrsetbits_le32(info->base + mux_reg,
+						info->mux_mask,
+						mux_mode << mux_shift);
+			} else {
+				writel(mux_mode, info->base + mux_reg);
+			}
+
+			dev_dbg(dev, "write mux: offset 0x%x val 0x%x\n",
+				mux_reg, mux_mode);
 
-		if (input_val >> 24 == 0xff) {
-			u32 val = input_val;
-			u8 select = val & 0xff;
-			u8 width = (val >> 8) & 0xff;
-			u8 shift = (val >> 16) & 0xff;
-			u32 mask = ((1 << width) - 1) << shift;
-			/*
-			 * The input_reg[i] here is actually some IOMUXC general
-			 * purpose register, not regular select input register.
-			 */
-			val = readl(info->base + input_reg);
-			val &= ~mask;
-			val |= select << shift;
-			writel(val, info->base + input_reg);
-		} else if (input_reg) {
 			/*
-			 * Regular select input register can never be at offset
-			 * 0, and we only print register value for regular case.
+			 * Set select input
+			 *
+			 * If the select input value begins with 0xff,
+			 * it's a quirky select input and the value should
+			 * be interpreted as below.
+			 *     31     23      15      7        0
+			 *     | 0xff | shift | width | select |
+			 * It's used to work around the problem that the
+			 * select input for some pin is not implemented in
+			 * the select input register but in some general
+			 * purpose register. We encode the select input
+			 * value, width and shift of the bit field into
+			 * input_val cell of pin function ID in device tree,
+			 * and then decode them here for setting up the select
+			 * input bits in general purpose register.
 			 */
-			if (info->input_sel_base)
-				writel(input_val, info->input_sel_base +
-				       input_reg);
-			else
-				writel(input_val, info->base + input_reg);
-
-			dev_dbg(dev, "select_input: offset 0x%x val 0x%x\n",
-				input_reg, input_val);
-		}
 
-		/* Set config */
-		if (!(config_val & IMX_NO_PAD_CTL)) {
-			if (info->flags & SHARE_MUX_CONF_REG) {
-				clrsetbits_le32(info->base + conf_reg,
-						~info->mux_mask, config_val);
-			} else {
-				writel(config_val, info->base + conf_reg);
+			if (input_val >> 24 == 0xff) {
+				u32 val = input_val;
+				u8 select = val & 0xff;
+				u8 width = (val >> 8) & 0xff;
+				u8 shift = (val >> 16) & 0xff;
+				u32 mask = ((1 << width) - 1) << shift;
+				/*
+				 * The input_reg[i] here is actually some
+				 * IOMUXC general purpose register, not
+				 * regular select input register.
+				 */
+				val = readl(info->base + input_reg);
+				val &= ~mask;
+				val |= select << shift;
+				writel(val, info->base + input_reg);
+			} else if (input_reg) {
+				/*
+				 * Regular select input register can never be
+				 * at offset 0, and we only print register
+				 * value for regular case.
+				 */
+				if (info->input_sel_base)
+					writel(input_val,
+					       info->input_sel_base +
+					       input_reg);
+				else
+					writel(input_val,
+					       info->base + input_reg);
+
+				dev_dbg(dev, "select_input: offset 0x%x val "
+					"0x%x\n", input_reg, input_val);
 			}
 
-			dev_dbg(dev, "write config: offset 0x%x val 0x%x\n",
-				conf_reg, config_val);
+			/* Set config */
+			if (!(config_val & IMX_NO_PAD_CTL)) {
+				if (info->flags & SHARE_MUX_CONF_REG) {
+					clrsetbits_le32(info->base + conf_reg,
+							~info->mux_mask,
+							config_val);
+				} else {
+					writel(config_val,
+					       info->base + conf_reg);
+				}
+
+				dev_dbg(dev, "write config: offset 0x%x val "
+					"0x%x\n", conf_reg, config_val);
+			}
 		}
 	}
 
@@ -193,6 +210,9 @@ int imx_pinctrl_probe(struct udevice *dev,
 	priv->dev = dev;
 	priv->info = info;
 
+	if (info->flags & IMX8_USE_SCU)
+		return 0;
+
 	addr = fdtdec_get_addr_size(gd->fdt_blob, dev_of_offset(dev), "reg",
 				    &size);
 
@@ -238,6 +258,9 @@ int imx_pinctrl_remove(struct udevice *dev)
 	struct imx_pinctrl_priv *priv = dev_get_priv(dev);
 	struct imx_pinctrl_soc_info *info = priv->info;
 
+	if (info->flags & IMX8_USE_SCU)
+		return 0;
+
 	if (info->input_sel_base)
 		unmap_sysmem(info->input_sel_base);
 	if (info->base)
diff --git a/drivers/pinctrl/nxp/pinctrl-imx.h b/drivers/pinctrl/nxp/pinctrl-imx.h
index b0032455b7..947975ee72 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx.h
+++ b/drivers/pinctrl/nxp/pinctrl-imx.h
@@ -40,13 +40,29 @@ extern const struct pinctrl_ops imx_pinctrl_ops;
 #define FSL_PIN_SIZE		24
 #define SHARE_FSL_PIN_SIZE	20
 
+/* Each pin on imx8qm/qxp consists of 2 u32 PIN_FUNC_ID and 1 u32 CONFIG */
+#define SHARE_IMX8_PIN_SIZE	12
+
 #define SHARE_MUX_CONF_REG	0x1
 #define ZERO_OFFSET_VALID	0x2
 #define CONFIG_IBE_OBE		0x4
+#define IMX8_USE_SCU		0x8
 
 #define IOMUXC_CONFIG_SION	(0x1 << 4)
 
 int imx_pinctrl_probe(struct udevice *dev, struct imx_pinctrl_soc_info *info);
 
 int imx_pinctrl_remove(struct udevice *dev);
+
+#ifdef CONFIG_PINCTRL_IMX_SCU
+int imx_pinctrl_scu_conf_pins(struct imx_pinctrl_soc_info *info,
+			      u32 *pin_data, int npins);
+#else
+static inline int imx_pinctrl_scu_conf_pins(struct imx_pinctrl_soc_info *info,
+					    u32 *pin_data, int npins)
+{
+	return 0;
+}
+#endif
+
 #endif /* __DRIVERS_PINCTRL_IMX_H */
diff --git a/drivers/pinctrl/nxp/pinctrl-imx8.c b/drivers/pinctrl/nxp/pinctrl-imx8.c
new file mode 100644
index 0000000000..0738da0ebe
--- /dev/null
+++ b/drivers/pinctrl/nxp/pinctrl-imx8.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <dm/device.h>
+#include <dm/pinctrl.h>
+
+#include "pinctrl-imx.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct imx_pinctrl_soc_info imx8_pinctrl_soc_info = {
+	.flags = IMX8_USE_SCU,
+};
+
+static int imx8_pinctrl_probe(struct udevice *dev)
+{
+	struct imx_pinctrl_soc_info *info =
+		(struct imx_pinctrl_soc_info *)dev_get_driver_data(dev);
+
+	return imx_pinctrl_probe(dev, info);
+}
+
+static const struct udevice_id imx8_pinctrl_match[] = {
+	{ .compatible = "fsl,imx8qxp-iomuxc", .data = (ulong)&imx8_pinctrl_soc_info },
+	{ /* sentinel */ }
+};
+
+U_BOOT_DRIVER(imx8_pinctrl) = {
+	.name = "imx8_pinctrl",
+	.id = UCLASS_PINCTRL,
+	.of_match = of_match_ptr(imx8_pinctrl_match),
+	.probe = imx8_pinctrl_probe,
+	.remove = imx_pinctrl_remove,
+	.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
+	.ops = &imx_pinctrl_ops,
+	.flags = DM_FLAG_PRE_RELOC,
+};
diff --git a/drivers/pinctrl/nxp/pinctrl-scu.c b/drivers/pinctrl/nxp/pinctrl-scu.c
new file mode 100644
index 0000000000..aa11075e0a
--- /dev/null
+++ b/drivers/pinctrl/nxp/pinctrl-scu.c
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <linux/bitops.h>
+#include <asm/io.h>
+#include <asm/arch/sci/sci.h>
+#include <misc.h>
+
+#include "pinctrl-imx.h"
+
+#define PADRING_IFMUX_EN_SHIFT		31
+#define PADRING_IFMUX_EN_MASK		BIT(31)
+#define PADRING_GP_EN_SHIFT		30
+#define PADRING_GP_EN_MASK		BIT(30)
+#define PADRING_IFMUX_SHIFT		27
+#define PADRING_IFMUX_MASK		GENMASK(29, 27)
+
+static int imx_pinconf_scu_set(struct imx_pinctrl_soc_info *info, u32 pad,
+			       u32 mux, u32 val)
+{
+	int ret;
+
+	/*
+	 * Mux should be done in pmx set, but we do not have a good api
+	 * to handle that in scfw, so config it in pad conf func
+	 */
+
+	val |= PADRING_IFMUX_EN_MASK;
+	val |= PADRING_GP_EN_MASK;
+	val |= (mux << PADRING_IFMUX_SHIFT) & PADRING_IFMUX_MASK;
+
+	ret = sc_pad_set(-1, pad, val);
+	if (ret)
+		printf("%s %d\n", __func__, ret);
+
+	return 0;
+}
+
+int imx_pinctrl_scu_conf_pins(struct imx_pinctrl_soc_info *info, u32 *pin_data,
+			      int npins)
+{
+	int pin_id, mux, config_val;
+	int i, j = 0;
+	int ret;
+
+	/*
+	 * Refer to linux documentation for details:
+	 * Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
+	 */
+	for (i = 0; i < npins; i++) {
+		pin_id = pin_data[j++];
+		mux = pin_data[j++];
+		config_val = pin_data[j++];
+
+		ret = imx_pinconf_scu_set(info, pin_id, mux, config_val);
+		if (ret)
+			printf("Set pin %d, mux %d, val %d, error\n", pin_id,
+			       mux, config_val);
+	}
+
+	return 0;
+}
-- 
2.14.1

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

* [U-Boot] [PATCH V5 24/32] power: Add power domain driver for i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (22 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 23/32] pinctrl: Add pinctrl driver " Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 25/32] clk: imx: add clk driver for i.MX8QXP Peng Fan
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add the power domain DM driver for i.MX8, that it depends on the DTB
power domain trees to generate the power domain provider devices. Users
needs add power domain trees with property "compatible = "nxp,imx8-pd";"

When power on one PD device, the driver will power on its ancestor PD
devices in power domain tree.

When power off on PD device, the driver will check its child PD devices
first, only all child PD devices are off, then power off the current PD
device. Then the driver checks sibling PD devices. If sibling PD devices
are off, then it will power off parent PD device.

There is no counter maintained in this driver, but a state to hold current
on/off state. So the request and free functions are empty.

The power domain implementation in i.MX8 DTB set the "#power-domain-cells"
to 0, so there is no ID binding with each PD device. We don't use "id"
variable in struct power_domain. At same time, we have to set of_xlate to
empty to bypass standard of_xlate in uclass driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-imx8/power-domain.h |  15 ++
 drivers/power/domain/Kconfig                  |   8 +-
 drivers/power/domain/Makefile                 |   1 +
 drivers/power/domain/imx8-power-domain.c      | 315 ++++++++++++++++++++++++++
 4 files changed, 338 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-imx8/power-domain.h
 create mode 100644 drivers/power/domain/imx8-power-domain.c

diff --git a/arch/arm/include/asm/arch-imx8/power-domain.h b/arch/arm/include/asm/arch-imx8/power-domain.h
new file mode 100644
index 0000000000..1396008877
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/power-domain.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2017 NXP
+ */
+
+#ifndef _ASM_ARCH_IMX8_POWER_DOMAIN_H
+#define _ASM_ARCH_IMX8_POWER_DOMAIN_H
+
+#include <asm/arch/sci/types.h>
+
+struct imx8_power_domain_platdata {
+	sc_rsrc_t resource_id;
+};
+
+#endif
diff --git a/drivers/power/domain/Kconfig b/drivers/power/domain/Kconfig
index 2c344888ca..a08b4288b4 100644
--- a/drivers/power/domain/Kconfig
+++ b/drivers/power/domain/Kconfig
@@ -16,6 +16,13 @@ config BCM6328_POWER_DOMAIN
 	  Enable support for manipulating BCM6345 power domains via MMIO
 	  mapped registers.
 
+config IMX8_POWER_DOMAIN
+	bool "Enable i.MX8 power domain driver"
+        depends on ARCH_IMX8
+        help
+          Enable support for manipulating NXP i.MX8 on-SoC power domains via IPC
+          requests to the SCU.
+
 config MESON_GX_VPU_POWER_DOMAIN
 	bool "Enable Amlogic Meson GX VPU power domain driver"
 	depends on ARCH_MESON
@@ -44,5 +51,4 @@ config TI_SCI_POWER_DOMAIN
 	help
 	  Generic power domain implementation for TI devices implementing the
 	  TI SCI protocol.
-
 endmenu
diff --git a/drivers/power/domain/Makefile b/drivers/power/domain/Makefile
index 6bdaa175e9..23fb1ecede 100644
--- a/drivers/power/domain/Makefile
+++ b/drivers/power/domain/Makefile
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_$(SPL_)POWER_DOMAIN) += power-domain-uclass.o
 obj-$(CONFIG_BCM6328_POWER_DOMAIN) += bcm6328-power-domain.o
+obj-$(CONFIG_IMX8_POWER_DOMAIN) += imx8-power-domain.o
 obj-$(CONFIG_MESON_GX_VPU_POWER_DOMAIN) += meson-gx-pwrc-vpu.o
 obj-$(CONFIG_SANDBOX_POWER_DOMAIN) += sandbox-power-domain.o
 obj-$(CONFIG_SANDBOX_POWER_DOMAIN) += sandbox-power-domain-test.o
diff --git a/drivers/power/domain/imx8-power-domain.c b/drivers/power/domain/imx8-power-domain.c
new file mode 100644
index 0000000000..d51dbaa6c0
--- /dev/null
+++ b/drivers/power/domain/imx8-power-domain.c
@@ -0,0 +1,315 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2017 NXP
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <power-domain-uclass.h>
+#include <asm/io.h>
+#include <asm/arch/power-domain.h>
+#include <dm/device-internal.h>
+#include <dm/device.h>
+#include <asm/arch/sci/sci.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct imx8_power_domain_priv {
+	bool state_on;
+};
+
+static int imx8_power_domain_request(struct power_domain *power_domain)
+{
+	debug("%s(power_domain=%p)\n", __func__, power_domain);
+
+	return 0;
+}
+
+static int imx8_power_domain_free(struct power_domain *power_domain)
+{
+	debug("%s(power_domain=%p)\n", __func__, power_domain);
+
+	return 0;
+}
+
+static int imx8_power_domain_on(struct power_domain *power_domain)
+{
+	struct udevice *dev = power_domain->dev;
+	struct imx8_power_domain_platdata *pdata;
+	struct imx8_power_domain_priv *ppriv;
+	sc_err_t ret;
+	int err;
+
+	struct power_domain parent_domain;
+	struct udevice *parent = dev_get_parent(dev);
+
+	/* Need to power on parent node first */
+	if (device_get_uclass_id(parent) == UCLASS_POWER_DOMAIN) {
+		parent_domain.dev = parent;
+		err = imx8_power_domain_on(&parent_domain);
+		if (err)
+			return err;
+	}
+
+	pdata = (struct imx8_power_domain_platdata *)dev_get_platdata(dev);
+	ppriv = (struct imx8_power_domain_priv *)dev_get_priv(dev);
+
+	debug("%s(power_domain=%s) resource_id %d\n", __func__, dev->name,
+	      pdata->resource_id);
+
+	/* Already powered on */
+	if (ppriv->state_on)
+		return 0;
+
+	if (pdata->resource_id != SC_R_LAST) {
+		ret = sc_pm_set_resource_power_mode(-1, pdata->resource_id,
+						    SC_PM_PW_MODE_ON);
+		if (ret) {
+			printf("Error: %s Power up failed! (error = %d)\n",
+			       dev->name, ret);
+			return -EIO;
+		}
+	}
+
+	ppriv->state_on = true;
+	debug("%s is powered on\n", dev->name);
+
+	return 0;
+}
+
+static int imx8_power_domain_off_node(struct power_domain *power_domain)
+{
+	struct udevice *dev = power_domain->dev;
+	struct udevice *child;
+	struct imx8_power_domain_priv *ppriv;
+	struct imx8_power_domain_priv *child_ppriv;
+	struct imx8_power_domain_platdata *pdata;
+	sc_err_t ret;
+
+	ppriv = dev_get_priv(dev);
+	pdata = dev_get_platdata(dev);
+
+	debug("%s, %s, state_on %d\n", __func__, dev->name, ppriv->state_on);
+
+	/* Already powered off */
+	if (!ppriv->state_on)
+		return 0;
+
+	/* Check if all subnodes are off */
+	for (device_find_first_child(dev, &child);
+		child;
+		device_find_next_child(&child)) {
+		if (device_active(child)) {
+			child_ppriv =
+			(struct imx8_power_domain_priv *)dev_get_priv(child);
+			if (child_ppriv->state_on)
+				return -EPERM;
+		}
+	}
+
+	if (pdata->resource_id != SC_R_LAST) {
+		if (!sc_rm_is_resource_owned(-1, pdata->resource_id)) {
+			printf("%s not owned by curr partition\n", dev->name);
+			return 0;
+		}
+		ret = sc_pm_set_resource_power_mode(-1, pdata->resource_id,
+						    SC_PM_PW_MODE_OFF);
+		if (ret) {
+			printf("Error: %s Power off failed! (error = %d)\n",
+			       dev->name, ret);
+			return -EIO;
+		}
+	}
+
+	ppriv->state_on = false;
+	debug("%s is powered off\n", dev->name);
+
+	return 0;
+}
+
+static int imx8_power_domain_off_parentnodes(struct power_domain *power_domain)
+{
+	struct udevice *dev = power_domain->dev;
+	struct udevice *parent = dev_get_parent(dev);
+	struct udevice *child;
+	struct imx8_power_domain_priv *ppriv;
+	struct imx8_power_domain_priv *child_ppriv;
+	struct imx8_power_domain_platdata *pdata;
+	sc_err_t ret;
+	struct power_domain parent_pd;
+
+	if (device_get_uclass_id(parent) == UCLASS_POWER_DOMAIN) {
+		pdata =
+		(struct imx8_power_domain_platdata *)dev_get_platdata(parent);
+		ppriv = (struct imx8_power_domain_priv *)dev_get_priv(parent);
+
+		debug("%s, %s, state_on %d\n", __func__, parent->name,
+		      ppriv->state_on);
+
+		/* Already powered off */
+		if (!ppriv->state_on)
+			return 0;
+
+		/*
+		 * Check if all sibling nodes are off. If yes,
+		 * power off parent
+		 */
+		for (device_find_first_child(parent, &child); child;
+		     device_find_next_child(&child)) {
+			if (device_active(child)) {
+				child_ppriv = (struct imx8_power_domain_priv *)
+						dev_get_priv(child);
+				/* Find a power on sibling */
+				if (child_ppriv->state_on) {
+					debug("sibling %s, state_on %d\n",
+					      child->name,
+					      child_ppriv->state_on);
+					return 0;
+				}
+			}
+		}
+
+		/* power off parent */
+		if (pdata->resource_id != SC_R_LAST) {
+			ret = sc_pm_set_resource_power_mode(-1,
+							    pdata->resource_id,
+							    SC_PM_PW_MODE_OFF);
+			if (ret) {
+				printf("%s Power off failed! (error = %d)\n",
+				       parent->name, ret);
+				return -EIO;
+			}
+		}
+
+		ppriv->state_on = false;
+		debug("%s is powered off\n", parent->name);
+
+		parent_pd.dev = parent;
+		imx8_power_domain_off_parentnodes(&parent_pd);
+	}
+
+	return 0;
+}
+
+static int imx8_power_domain_off(struct power_domain *power_domain)
+{
+	int ret;
+
+	debug("%s(power_domain=%p)\n", __func__, power_domain);
+
+	/* Turn off the node */
+	ret = imx8_power_domain_off_node(power_domain);
+	if (ret) {
+		debug("Can't power off the node of dev %s, ret = %d\n",
+		      power_domain->dev->name, ret);
+		return ret;
+	}
+
+	/* Turn off parent nodes, if sibling nodes are all off */
+	ret = imx8_power_domain_off_parentnodes(power_domain);
+	if (ret) {
+		printf("Failed to power off parent nodes of dev %s, ret = %d\n",
+		       power_domain->dev->name, ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static int imx8_power_domain_of_xlate(struct power_domain *power_domain,
+				      struct ofnode_phandle_args *args)
+{
+	debug("%s(power_domain=%p)\n", __func__, power_domain);
+
+	/* Do nothing to the xlate, since we don't have args used */
+
+	return 0;
+}
+
+static int imx8_power_domain_bind(struct udevice *dev)
+{
+	int offset;
+	const char *name;
+	int ret = 0;
+
+	debug("%s(dev=%p)\n", __func__, dev);
+
+	offset = dev_of_offset(dev);
+	for (offset = fdt_first_subnode(gd->fdt_blob, offset); offset > 0;
+	     offset = fdt_next_subnode(gd->fdt_blob, offset)) {
+		/* Bind the subnode to this driver */
+		name = fdt_get_name(gd->fdt_blob, offset, NULL);
+
+		ret = device_bind_with_driver_data(dev, dev->driver, name,
+						   dev->driver_data,
+						   offset_to_ofnode(offset),
+						   NULL);
+
+		if (ret == -ENODEV)
+			printf("Driver '%s' refuses to bind\n",
+			       dev->driver->name);
+
+		if (ret)
+			printf("Error binding driver '%s': %d\n",
+			       dev->driver->name, ret);
+	}
+
+	return 0;
+}
+
+static int imx8_power_domain_probe(struct udevice *dev)
+{
+	struct imx8_power_domain_priv *ppriv;
+
+	debug("%s(dev=%s)\n", __func__, dev->name);
+
+	ppriv = (struct imx8_power_domain_priv *)dev_get_priv(dev);
+
+	/* Set default to power off */
+	if (ppriv)
+		ppriv->state_on = false;
+
+	return 0;
+}
+
+static int imx8_power_domain_ofdata_to_platdata(struct udevice *dev)
+{
+	int reg;
+	struct imx8_power_domain_platdata *pdata = dev_get_platdata(dev);
+
+	reg = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "reg", -1);
+	if (reg == -1) {
+		debug("%s: Invalid resource id %d\n", __func__, reg);
+		return -EINVAL;
+	}
+	pdata->resource_id = (sc_rsrc_t)reg;
+
+	debug("%s resource_id %d\n", __func__, pdata->resource_id);
+
+	return 0;
+}
+
+static const struct udevice_id imx8_power_domain_ids[] = {
+	{ .compatible = "nxp,imx8-pd" },
+	{ }
+};
+
+struct power_domain_ops imx8_power_domain_ops = {
+	.request = imx8_power_domain_request,
+	.free = imx8_power_domain_free,
+	.on = imx8_power_domain_on,
+	.off = imx8_power_domain_off,
+	.of_xlate = imx8_power_domain_of_xlate,
+};
+
+U_BOOT_DRIVER(imx8_power_domain) = {
+	.name = "imx8_power_domain",
+	.id = UCLASS_POWER_DOMAIN,
+	.of_match = imx8_power_domain_ids,
+	.bind = imx8_power_domain_bind,
+	.probe = imx8_power_domain_probe,
+	.ofdata_to_platdata = imx8_power_domain_ofdata_to_platdata,
+	.platdata_auto_alloc_size = sizeof(struct imx8_power_domain_platdata),
+	.priv_auto_alloc_size = sizeof(struct imx8_power_domain_priv),
+	.ops = &imx8_power_domain_ops,
+};
-- 
2.14.1

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

* [U-Boot] [PATCH V5 25/32] clk: imx: add clk driver for i.MX8QXP
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (23 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 24/32] power: Add power domain " Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 26/32] serial_lpuart: Update lpuart driver to support i.MX8 Peng Fan
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add clk driver for i.MX8QXP, support clk
enable/disable/get_rate/set_rate operations.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/clk/Kconfig        |   1 +
 drivers/clk/Makefile       |   1 +
 drivers/clk/imx/Kconfig    |   6 ++
 drivers/clk/imx/Makefile   |   5 ++
 drivers/clk/imx/clk-imx8.c | 212 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 225 insertions(+)
 create mode 100644 drivers/clk/imx/Kconfig
 create mode 100644 drivers/clk/imx/Makefile
 create mode 100644 drivers/clk/imx/clk-imx8.c

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index c996d6574b..ce62ca8771 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -93,6 +93,7 @@ config CLK_STM32MP1
 
 source "drivers/clk/at91/Kconfig"
 source "drivers/clk/exynos/Kconfig"
+source "drivers/clk/imx/Kconfig"
 source "drivers/clk/mvebu/Kconfig"
 source "drivers/clk/owl/Kconfig"
 source "drivers/clk/renesas/Kconfig"
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 11468f2ee6..ef84b068a1 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_$(SPL_TPL_)CLK) += clk-uclass.o clk_fixed_rate.o
 
+obj-y += imx/
 obj-y += tegra/
 obj-$(CONFIG_ARCH_ASPEED) += aspeed/
 obj-$(CONFIG_ARCH_MESON) += clk_meson.o
diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
new file mode 100644
index 0000000000..a6fb58d6cf
--- /dev/null
+++ b/drivers/clk/imx/Kconfig
@@ -0,0 +1,6 @@
+config CLK_IMX8
+	bool "Clock support for i.MX8"
+	depends on ARCH_IMX8
+	select CLK
+	help
+	  This enables support clock driver for i.MX8 platforms.
diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
new file mode 100644
index 0000000000..5505ae52e2
--- /dev/null
+++ b/drivers/clk/imx/Makefile
@@ -0,0 +1,5 @@
+# Copyright 2018 NXP
+#
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_CLK_IMX8) += clk-imx8.o
diff --git a/drivers/clk/imx/clk-imx8.c b/drivers/clk/imx/clk-imx8.c
new file mode 100644
index 0000000000..ba87ad6964
--- /dev/null
+++ b/drivers/clk/imx/clk-imx8.c
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2018 NXP
+ * Peng Fan <peng.fan@nxp.com>
+ */
+
+#include <common.h>
+#include <clk-uclass.h>
+#include <dm.h>
+#include <asm/arch/sci/sci.h>
+#include <asm/arch/clock.h>
+#include <dt-bindings/clock/imx8qxp-clock.h>
+#include <dt-bindings/soc/imx_rsrc.h>
+#include <misc.h>
+
+static ulong imx8_clk_get_rate(struct clk *clk)
+{
+	sc_pm_clk_t pm_clk;
+	ulong rate;
+	u16 resource;
+	int ret;
+
+	debug("%s(#%ld)\n", __func__, clk->id);
+
+	switch (clk->id) {
+	case IMX8QXP_A35_DIV:
+		resource = SC_R_A35;
+		pm_clk = SC_PM_CLK_CPU;
+		break;
+	case IMX8QXP_SDHC0_IPG_CLK:
+	case IMX8QXP_SDHC0_CLK:
+	case IMX8QXP_SDHC0_DIV:
+		resource = SC_R_SDHC_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_SDHC1_IPG_CLK:
+	case IMX8QXP_SDHC1_CLK:
+	case IMX8QXP_SDHC1_DIV:
+		resource = SC_R_SDHC_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART0_IPG_CLK:
+	case IMX8QXP_UART0_CLK:
+		resource = SC_R_UART_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	default:
+		dev_err(dev, "%s(Invalid #%ld)\n", __func__, clk->id);
+		return -EINVAL;
+	};
+
+	ret = sc_pm_get_clock_rate(-1, resource, pm_clk,
+				   (sc_pm_clock_rate_t *)&rate);
+	if (ret)
+		printf("%s err %d\n", __func__, ret);
+
+	return rate;
+}
+
+static ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate)
+{
+	sc_pm_clk_t pm_clk;
+	u32 new_rate = rate;
+	u16 resource;
+	int ret;
+
+	debug("%s(#%ld), rate: %lu\n", __func__, clk->id, rate);
+
+	switch (clk->id) {
+	case IMX8QXP_UART0_CLK:
+		resource = SC_R_UART_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART1_CLK:
+		resource = SC_R_UART_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART2_CLK:
+		resource = SC_R_UART_2;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART3_CLK:
+		resource = SC_R_UART_3;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_SDHC0_IPG_CLK:
+	case IMX8QXP_SDHC0_CLK:
+	case IMX8QXP_SDHC0_DIV:
+		resource = SC_R_SDHC_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_SDHC1_SEL:
+	case IMX8QXP_SDHC0_SEL:
+		return 0;
+	case IMX8QXP_SDHC1_IPG_CLK:
+	case IMX8QXP_SDHC1_CLK:
+	case IMX8QXP_SDHC1_DIV:
+		resource = SC_R_SDHC_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	default:
+		printf("%s %ld\n", __func__, clk->id);
+		return -EINVAL;
+	};
+
+	ret = sc_pm_set_clock_rate(-1, resource, pm_clk, &new_rate);
+	if (ret)
+		printf("%s err %d\n", __func__, ret);
+
+	return new_rate;
+}
+
+static int __imx8_clk_enable(struct clk *clk, bool enable)
+{
+	sc_pm_clk_t pm_clk;
+	u16 resource;
+	int ret;
+
+	debug("%s(#%ld)\n", __func__, clk->id);
+
+	switch (clk->id) {
+	case IMX8QXP_I2C0_CLK:
+		resource = SC_R_I2C_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_I2C1_CLK:
+		resource = SC_R_I2C_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_I2C2_CLK:
+		resource = SC_R_I2C_2;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_I2C3_CLK:
+		resource = SC_R_I2C_3;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART0_CLK:
+		resource = SC_R_UART_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART1_CLK:
+		resource = SC_R_UART_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART2_CLK:
+		resource = SC_R_UART_2;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_UART3_CLK:
+		resource = SC_R_UART_3;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_SDHC0_IPG_CLK:
+	case IMX8QXP_SDHC0_CLK:
+	case IMX8QXP_SDHC0_DIV:
+		resource = SC_R_SDHC_0;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	case IMX8QXP_SDHC1_IPG_CLK:
+	case IMX8QXP_SDHC1_CLK:
+	case IMX8QXP_SDHC1_DIV:
+		resource = SC_R_SDHC_1;
+		pm_clk = SC_PM_CLK_PER;
+		break;
+	default:
+		printf("%s not valid resource\n", __func__);
+		return -EINVAL;
+	}
+
+	ret = sc_pm_clock_enable(-1, resource, pm_clk, enable, 0);
+	if (ret)
+		printf("%s err %d\n", __func__, ret);
+
+	return ret;
+}
+
+static int imx8_clk_disable(struct clk *clk)
+{
+	return __imx8_clk_enable(clk, 0);
+}
+
+static int imx8_clk_enable(struct clk *clk)
+{
+	return __imx8_clk_enable(clk, 1);
+}
+
+static struct clk_ops imx8_clk_ops = {
+	.set_rate = imx8_clk_set_rate,
+	.get_rate = imx8_clk_get_rate,
+	.enable = imx8_clk_enable,
+	.disable = imx8_clk_disable,
+};
+
+static int imx8_clk_probe(struct udevice *dev)
+{
+	return 0;
+}
+
+static const struct udevice_id imx8_clk_ids[] = {
+	{ .compatible = "fsl,imx8qxp-clk" },
+	{ },
+};
+
+U_BOOT_DRIVER(imx8_clk) = {
+	.name = "clk_imx8",
+	.id = UCLASS_CLK,
+	.of_match = imx8_clk_ids,
+	.ops = &imx8_clk_ops,
+	.probe = imx8_clk_probe,
+	.flags = DM_FLAG_PRE_RELOC,
+};
-- 
2.14.1

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

* [U-Boot] [PATCH V5 26/32] serial_lpuart: Update lpuart driver to support i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (24 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 25/32] clk: imx: add clk driver for i.MX8QXP Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 27/32] serial: lpuart: Enable RX and TX FIFO Peng Fan
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8 compatible string and cpu type support to lpuart driver,
to use little endian 32 bits configurations.

Also, accroding to RM, the Receive FIFO Enable (RXFE) field in LPUART
FIFO register is bit 3, so the definition should change to 0x08 not 0x40
for i.MX8, otherwise the Receive FIFO is not disabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/serial/serial_lpuart.c | 15 ++++++++++++---
 include/fsl_lpuart.h           |  2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index 1212b72676..c14a8105c9 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -41,7 +41,11 @@
 #define CTRL_RE		(1 << 18)
 
 #define FIFO_TXFE		0x80
+#ifdef CONFIG_ARCH_IMX8
+#define FIFO_RXFE		0x08
+#else
 #define FIFO_RXFE		0x40
+#endif
 
 #define WATER_TXWATER_OFF	1
 #define WATER_RXWATER_OFF	16
@@ -54,7 +58,8 @@ DECLARE_GLOBAL_DATA_PTR;
 enum lpuart_devtype {
 	DEV_VF610 = 1,
 	DEV_LS1021A,
-	DEV_MX7ULP
+	DEV_MX7ULP,
+	DEV_IMX8
 };
 
 struct lpuart_serial_platdata {
@@ -325,7 +330,7 @@ static int _lpuart32_serial_init(struct lpuart_serial_platdata *plat)
 
 	lpuart_write32(plat->flags, &base->match, 0);
 
-	if (plat->devtype == DEV_MX7ULP) {
+	if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8) {
 		_lpuart32_serial_setbrg_7ulp(plat, gd->baudrate);
 	} else {
 		/* provide data bits, parity, stop bit, etc */
@@ -342,7 +347,7 @@ static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
 	struct lpuart_serial_platdata *plat = dev->platdata;
 
 	if (is_lpuart32(dev)) {
-		if (plat->devtype == DEV_MX7ULP)
+		if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8)
 			_lpuart32_serial_setbrg_7ulp(plat, baudrate);
 		else
 			_lpuart32_serial_setbrg(plat, baudrate);
@@ -427,6 +432,8 @@ static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
 		plat->devtype = DEV_MX7ULP;
 	else if (!fdt_node_check_compatible(blob, node, "fsl,vf610-lpuart"))
 		plat->devtype = DEV_VF610;
+	else if (!fdt_node_check_compatible(blob, node, "fsl,imx8qm-lpuart"))
+		plat->devtype = DEV_IMX8;
 
 	return 0;
 }
@@ -444,6 +451,8 @@ static const struct udevice_id lpuart_serial_ids[] = {
 	{ .compatible = "fsl,imx7ulp-lpuart",
 		.data = LPUART_FLAG_REGMAP_32BIT_REG },
 	{ .compatible = "fsl,vf610-lpuart"},
+	{ .compatible = "fsl,imx8qm-lpuart",
+		.data = LPUART_FLAG_REGMAP_32BIT_REG },
 	{ }
 };
 
diff --git a/include/fsl_lpuart.h b/include/fsl_lpuart.h
index 02ebfefc74..fc517d4b7f 100644
--- a/include/fsl_lpuart.h
+++ b/include/fsl_lpuart.h
@@ -4,7 +4,7 @@
  *
  */
 
-#ifdef CONFIG_ARCH_MX7ULP
+#if defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8)
 struct lpuart_fsl_reg32 {
 	u32 verid;
 	u32 param;
-- 
2.14.1

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

* [U-Boot] [PATCH V5 27/32] serial: lpuart: Enable RX and TX FIFO
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (25 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 26/32] serial_lpuart: Update lpuart driver to support i.MX8 Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 28/32] serial: lpuart: support uclass clk api Peng Fan
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

From: Ye Li <ye.li@nxp.com>

Enable the RX and TX FIFO in LPUART driver to avoid the input lost
during u-boot boot up.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/serial/serial_lpuart.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index c14a8105c9..b28f7cf68d 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -40,6 +40,12 @@
 #define CTRL_TE		(1 << 19)
 #define CTRL_RE		(1 << 18)
 
+#define FIFO_RXFLUSH		BIT(14)
+#define FIFO_TXFLUSH		BIT(15)
+#define FIFO_TXSIZE_MASK	0x70
+#define FIFO_TXSIZE_OFF	4
+#define FIFO_RXSIZE_MASK	0x7
+#define FIFO_RXSIZE_OFF	0
 #define FIFO_TXFE		0x80
 #ifdef CONFIG_ARCH_IMX8
 #define FIFO_RXFE		0x08
@@ -47,7 +53,7 @@
 #define FIFO_RXFE		0x40
 #endif
 
-#define WATER_TXWATER_OFF	1
+#define WATER_TXWATER_OFF	0
 #define WATER_RXWATER_OFF	16
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -318,15 +324,28 @@ static int _lpuart32_serial_tstc(struct lpuart_serial_platdata *plat)
 static int _lpuart32_serial_init(struct lpuart_serial_platdata *plat)
 {
 	struct lpuart_fsl_reg32 *base = (struct lpuart_fsl_reg32 *)plat->reg;
-	u32 ctrl;
+	u32 val, tx_fifo_size;
 
-	lpuart_read32(plat->flags, &base->ctrl, &ctrl);
-	ctrl &= ~CTRL_RE;
-	ctrl &= ~CTRL_TE;
-	lpuart_write32(plat->flags, &base->ctrl, ctrl);
+	lpuart_read32(plat->flags, &base->ctrl, &val);
+	val &= ~CTRL_RE;
+	val &= ~CTRL_TE;
+	lpuart_write32(plat->flags, &base->ctrl, val);
 
 	lpuart_write32(plat->flags, &base->modir, 0);
-	lpuart_write32(plat->flags, &base->fifo, ~(FIFO_TXFE | FIFO_RXFE));
+
+	lpuart_read32(plat->flags, &base->fifo, &val);
+	tx_fifo_size = (val & FIFO_TXSIZE_MASK) >> FIFO_TXSIZE_OFF;
+	/* Set the TX water to half of FIFO size */
+	if (tx_fifo_size > 1)
+		tx_fifo_size = tx_fifo_size >> 1;
+
+	/* Set RX water to 0, to be triggered by any receive data */
+	lpuart_write32(plat->flags, &base->water,
+		       (tx_fifo_size << WATER_TXWATER_OFF));
+
+	/* Enable TX and RX FIFO */
+	val |= (FIFO_TXFE | FIFO_RXFE | FIFO_TXFLUSH | FIFO_RXFLUSH);
+	lpuart_write32(plat->flags, &base->fifo, val);
 
 	lpuart_write32(plat->flags, &base->match, 0);
 
-- 
2.14.1

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

* [U-Boot] [PATCH V5 28/32] serial: lpuart: support uclass clk api
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (26 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 27/32] serial: lpuart: Enable RX and TX FIFO Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 29/32] fsl_esdhc: Update usdhc driver to support i.MX8 Peng Fan
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Modify most APIs to use udevice as the first param, then
it will be easy to get the clk reference by using udevice pointer.
Use uclass api to get lpuart clk when CONFIG_CLK enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/serial/serial_lpuart.c | 78 ++++++++++++++++++++++++++++++++----------
 1 file changed, 59 insertions(+), 19 deletions(-)

diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index b28f7cf68d..3887c3d1c8 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clk.h>
 #include <dm.h>
 #include <fsl_lpuart.h>
 #include <watchdog.h>
@@ -104,6 +105,27 @@ u32 __weak get_lpuart_clk(void)
 	return CONFIG_SYS_CLK_FREQ;
 }
 
+ulong get_lpuart_clk_rate(struct udevice *dev)
+{
+	struct clk per_clk;
+	ulong rate;
+	int ret;
+
+	ret = clk_get_by_name(dev, "per", &per_clk);
+	if (ret) {
+		dev_err(dev, "Failed to get per clk: %d\n", ret);
+		return ret;
+	}
+
+	rate = clk_get_rate(&per_clk);
+	if ((long)rate <= 0) {
+		dev_err(dev, "Failed to get per clk rate: %ld\n", (long)rate);
+		return ret;
+	}
+
+	return  rate;
+}
+
 static bool is_lpuart32(struct udevice *dev)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -111,13 +133,19 @@ static bool is_lpuart32(struct udevice *dev)
 	return plat->flags & LPUART_FLAG_REGMAP_32BIT_REG;
 }
 
-static void _lpuart_serial_setbrg(struct lpuart_serial_platdata *plat,
+static void _lpuart_serial_setbrg(struct udevice *dev,
 				  int baudrate)
 {
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 	struct lpuart_fsl *base = plat->reg;
-	u32 clk = get_lpuart_clk();
+	u32 clk;
 	u16 sbr;
 
+	if (IS_ENABLED(CONFIG_CLK))
+		clk = get_lpuart_clk_rate(dev);
+	else
+		clk = get_lpuart_clk();
+
 	sbr = (u16)(clk / (16 * baudrate));
 
 	/* place adjustment later - n/32 BRFA */
@@ -162,8 +190,9 @@ static int _lpuart_serial_tstc(struct lpuart_serial_platdata *plat)
  * Initialise the serial port with the given baudrate. The settings
  * are always 8 data bits, no parity, 1 stop bit, no start bits.
  */
-static int _lpuart_serial_init(struct lpuart_serial_platdata *plat)
+static int _lpuart_serial_init(struct udevice *dev)
 {
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 	struct lpuart_fsl *base = (struct lpuart_fsl *)plat->reg;
 	u8 ctrl;
 
@@ -182,19 +211,25 @@ static int _lpuart_serial_init(struct lpuart_serial_platdata *plat)
 	__raw_writeb(CFIFO_TXFLUSH | CFIFO_RXFLUSH, &base->ucfifo);
 
 	/* provide data bits, parity, stop bit, etc */
-	_lpuart_serial_setbrg(plat, gd->baudrate);
+	_lpuart_serial_setbrg(dev, gd->baudrate);
 
 	__raw_writeb(UC2_RE | UC2_TE, &base->uc2);
 
 	return 0;
 }
 
-static void _lpuart32_serial_setbrg_7ulp(struct lpuart_serial_platdata *plat,
+static void _lpuart32_serial_setbrg_7ulp(struct udevice *dev,
 					 int baudrate)
 {
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 	struct lpuart_fsl_reg32 *base = plat->reg;
 	u32 sbr, osr, baud_diff, tmp_osr, tmp_sbr, tmp_diff, tmp;
-	u32 clk = get_lpuart_clk();
+	u32 clk;
+
+	if (IS_ENABLED(CONFIG_CLK))
+		clk = get_lpuart_clk_rate(dev);
+	else
+		clk = get_lpuart_clk();
 
 	baud_diff = baudrate;
 	osr = 0;
@@ -248,13 +283,19 @@ static void _lpuart32_serial_setbrg_7ulp(struct lpuart_serial_platdata *plat,
 	out_le32(&base->baud, tmp);
 }
 
-static void _lpuart32_serial_setbrg(struct lpuart_serial_platdata *plat,
+static void _lpuart32_serial_setbrg(struct udevice *dev,
 				    int baudrate)
 {
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 	struct lpuart_fsl_reg32 *base = plat->reg;
-	u32 clk = get_lpuart_clk();
+	u32 clk;
 	u32 sbr;
 
+	if (IS_ENABLED(CONFIG_CLK))
+		clk = get_lpuart_clk_rate(dev);
+	else
+		clk = get_lpuart_clk();
+
 	sbr = (clk / (16 * baudrate));
 
 	/* place adjustment later - n/32 BRFA */
@@ -321,8 +362,9 @@ static int _lpuart32_serial_tstc(struct lpuart_serial_platdata *plat)
  * Initialise the serial port with the given baudrate. The settings
  * are always 8 data bits, no parity, 1 stop bit, no start bits.
  */
-static int _lpuart32_serial_init(struct lpuart_serial_platdata *plat)
+static int _lpuart32_serial_init(struct udevice *dev)
 {
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 	struct lpuart_fsl_reg32 *base = (struct lpuart_fsl_reg32 *)plat->reg;
 	u32 val, tx_fifo_size;
 
@@ -350,10 +392,10 @@ static int _lpuart32_serial_init(struct lpuart_serial_platdata *plat)
 	lpuart_write32(plat->flags, &base->match, 0);
 
 	if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8) {
-		_lpuart32_serial_setbrg_7ulp(plat, gd->baudrate);
+		_lpuart32_serial_setbrg_7ulp(dev, gd->baudrate);
 	} else {
 		/* provide data bits, parity, stop bit, etc */
-		_lpuart32_serial_setbrg(plat, gd->baudrate);
+		_lpuart32_serial_setbrg(dev, gd->baudrate);
 	}
 
 	lpuart_write32(plat->flags, &base->ctrl, CTRL_RE | CTRL_TE);
@@ -363,15 +405,15 @@ static int _lpuart32_serial_init(struct lpuart_serial_platdata *plat)
 
 static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
 {
-	struct lpuart_serial_platdata *plat = dev->platdata;
+	struct lpuart_serial_platdata *plat = dev_get_platdata(dev);
 
 	if (is_lpuart32(dev)) {
 		if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8)
-			_lpuart32_serial_setbrg_7ulp(plat, baudrate);
+			_lpuart32_serial_setbrg_7ulp(dev, baudrate);
 		else
-			_lpuart32_serial_setbrg(plat, baudrate);
+			_lpuart32_serial_setbrg(dev, baudrate);
 	} else {
-		_lpuart_serial_setbrg(plat, baudrate);
+		_lpuart_serial_setbrg(dev, baudrate);
 	}
 
 	return 0;
@@ -423,12 +465,10 @@ static int lpuart_serial_pending(struct udevice *dev, bool input)
 
 static int lpuart_serial_probe(struct udevice *dev)
 {
-	struct lpuart_serial_platdata *plat = dev->platdata;
-
 	if (is_lpuart32(dev))
-		return _lpuart32_serial_init(plat);
+		return _lpuart32_serial_init(dev);
 	else
-		return _lpuart_serial_init(plat);
+		return _lpuart_serial_init(dev);
 }
 
 static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
-- 
2.14.1

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

* [U-Boot] [PATCH V5 29/32] fsl_esdhc: Update usdhc driver to support i.MX8
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (27 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 28/32] serial: lpuart: support uclass clk api Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 30/32] mmc: fsl_esdhc: add uclass clk support Peng Fan
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

From: Ye Li <ye.li@nxp.com>

Add CONFIG_ARCH_IMX8 to use the 64bits support in usdhc driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/fsl_esdhc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 03c6743ae8..220f4f74a8 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -257,7 +257,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 	int timeout;
 	struct fsl_esdhc *regs = priv->esdhc_regs;
 #if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \
-	defined(CONFIG_MX8M)
+	defined(CONFIG_IMX8) || defined(CONFIG_MX8M)
 	dma_addr_t addr;
 #endif
 	uint wml_value;
@@ -271,7 +271,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 		esdhc_clrsetbits32(&regs->wml, WML_RD_WML_MASK, wml_value);
 #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO
 #if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \
-	defined(CONFIG_MX8M)
+	defined(CONFIG_IMX8) || defined(CONFIG_MX8M)
 		addr = virt_to_phys((void *)(data->dest));
 		if (upper_32_bits(addr))
 			printf("Error found for upper 32 bits\n");
@@ -301,7 +301,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 					wml_value << 16);
 #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO
 #if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \
-	defined(CONFIG_MX8M)
+	defined(CONFIG_IMX8) || defined(CONFIG_MX8M)
 		addr = virt_to_phys((void *)(data->src));
 		if (upper_32_bits(addr))
 			printf("Error found for upper 32 bits\n");
@@ -367,7 +367,7 @@ static void check_and_invalidate_dcache_range
 	unsigned size = roundup(ARCH_DMA_MINALIGN,
 				data->blocks*data->blocksize);
 #if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \
-	defined(CONFIG_MX8M)
+	defined(CONFIG_IMX8) || defined(CONFIG_MX8M)
 	dma_addr_t addr;
 
 	addr = virt_to_phys((void *)(data->dest));
-- 
2.14.1

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

* [U-Boot] [PATCH V5 30/32] mmc: fsl_esdhc: add uclass clk support
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (28 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 29/32] fsl_esdhc: Update usdhc driver to support i.MX8 Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 31/32] arm: dts: introduce dtsi for i.MX8QXP Peng Fan
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

When CONIFG_CLK is enabled, use uclass clk api to handle
the clock.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/mmc/fsl_esdhc.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 220f4f74a8..100d58d8f6 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -11,6 +11,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <clk.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
@@ -121,6 +122,7 @@ struct esdhc_soc_data {
 struct fsl_esdhc_priv {
 	struct fsl_esdhc *esdhc_regs;
 	unsigned int sdhc_clk;
+	struct clk per_clk;
 	unsigned int clock;
 	unsigned int mode;
 	unsigned int bus_width;
@@ -1496,10 +1498,22 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
 	init_clk_usdhc(dev->seq);
 
-	priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev->seq);
-	if (priv->sdhc_clk <= 0) {
-		dev_err(dev, "Unable to get clk for %s\n", dev->name);
-		return -EINVAL;
+	if (IS_ENABLED(CONFIG_CLK)) {
+		/* Assigned clock already set clock */
+		ret = clk_get_by_name(dev, "per", &priv->per_clk);
+		if (ret)
+			printf("Failed to get per_clk\n");
+		ret = clk_enable(&priv->per_clk);
+		if (ret)
+			printf("Failed to enable per_clk\n");
+
+		priv->sdhc_clk = clk_get_rate(&priv->per_clk);
+	} else {
+		priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev->seq);
+		if (priv->sdhc_clk <= 0) {
+			dev_err(dev, "Unable to get clk for %s\n", dev->name);
+			return -EINVAL;
+		}
 	}
 
 	ret = fsl_esdhc_init(priv, plat);
-- 
2.14.1

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

* [U-Boot] [PATCH V5 31/32] arm: dts: introduce dtsi for i.MX8QXP
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (29 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 30/32] mmc: fsl_esdhc: add uclass clk support Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support Peng Fan
  2018-10-04  0:56 ` [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Introduce dtsi for i.MX8QXP, since there is other variants i.MX8DX(P),
so add them there, because i.MX8QXP includes the dtsi of them.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/fsl-imx8-ca35.dtsi |  66 ++++++
 arch/arm/dts/fsl-imx8dx.dtsi    | 452 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/dts/fsl-imx8dxp.dtsi   |  11 +
 arch/arm/dts/fsl-imx8qxp.dtsi   |  51 +++++
 4 files changed, 580 insertions(+)
 create mode 100644 arch/arm/dts/fsl-imx8-ca35.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8dx.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8dxp.dtsi
 create mode 100644 arch/arm/dts/fsl-imx8qxp.dtsi

diff --git a/arch/arm/dts/fsl-imx8-ca35.dtsi b/arch/arm/dts/fsl-imx8-ca35.dtsi
new file mode 100644
index 0000000000..28bc32c8b7
--- /dev/null
+++ b/arch/arm/dts/fsl-imx8-ca35.dtsi
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <dt-bindings/clock/imx8qxp-clock.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/{
+	cpus {
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		/* We have 1 clusters having 4 Cortex-A35 cores */
+		A35_0: cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x0>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+
+		A35_1: cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x1>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+
+		A35_2: cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x2>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+
+		A35_3: cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x3>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+
+		A35_L2: l2-cache0 {
+			compatible = "cache";
+		};
+	};
+
+	pmu {
+		compatible = "arm,armv8-pmuv3";
+		interrupts = <GIC_PPI 7
+			(GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>;
+		interrupt-affinity = <&A35_0>, <&A35_1>, <&A35_2>, <&A35_3>;
+	};
+
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+		cpu_suspend   = <0xc4000001>;
+		cpu_off	      = <0xc4000002>;
+		cpu_on	      = <0xc4000003>;
+	};
+};
diff --git a/arch/arm/dts/fsl-imx8dx.dtsi b/arch/arm/dts/fsl-imx8dx.dtsi
new file mode 100644
index 0000000000..885119768a
--- /dev/null
+++ b/arch/arm/dts/fsl-imx8dx.dtsi
@@ -0,0 +1,452 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include "fsl-imx8-ca35.dtsi"
+#include <dt-bindings/soc/imx_rsrc.h>
+#include <dt-bindings/soc/imx8_pd.h>
+#include <dt-bindings/clock/imx8qxp-clock.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/pads-imx8qxp.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Freescale i.MX8DX";
+	compatible = "fsl,imx8dx", "fsl,imx8qxp";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &lpuart0;
+		mmc0 = &usdhc1;
+		mmc1 = &usdhc2;
+		mmc2 = &usdhc3;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x00000000 0x80000000 0 0x40000000>;
+		      /* DRAM space - 1, size : 1 GB DRAM */
+	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/*
+		 * reserved-memory layout
+		 * 0x8800_0000 ~ 0x8FFF_FFFF is reserved for M4
+		 * Shouldn't be used at A core and Linux side.
+		 *
+		 */
+		decoder_boot: decoder_boot at 0x84000000 {
+			no-map;
+			reg = <0 0x84000000 0 0x2000000>;
+		};
+		encoder_boot: encoder_boot at 0x86000000 {
+			no-map;
+			reg = <0 0x86000000 0 0x2000000>;
+		};
+		rpmsg_reserved: rpmsg at 0x90000000 {
+			no-map;
+			reg = <0 0x90000000 0 0x400000>;
+		};
+		decoder_rpc: decoder_rpc at 0x90400000 {
+			no-map;
+			reg = <0 0x90400000 0 0x1000000>;
+		};
+		encoder_rpc: encoder_rpc at 0x91400000 {
+			no-map;
+			reg = <0 0x91400000 0 0x1000000>;
+		};
+		dsp_reserved: dsp at 0x92400000 {
+			no-map;
+			reg = <0 0x92400000 0 0x2000000>;
+		};
+		decoder_str: str at 0x94400000 {
+			no-map;
+			reg = <0 0x94400000 0 0x1800000>;
+		};
+		/* global autoconfigured region for contiguous allocations */
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			size = <0 0x28000000>;
+			alloc-ranges = <0 0x96000000 0 0x28000000>;
+			linux,cma-default;
+		};
+	};
+
+	gic: interrupt-controller at 51a00000 {
+		compatible = "arm,gic-v3";
+		reg = <0x0 0x51a00000 0 0x10000>, /* GIC Dist */
+		      <0x0 0x51b00000 0 0xC0000>; /* GICR (RD_base + SGI_base) */
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		interrupts = <GIC_PPI 9
+			(GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>;
+		interrupt-parent = <&gic>;
+	};
+
+	mu: mu at 5d1c0000 {
+		compatible = "fsl,imx8-mu";
+		reg = <0x0 0x5d1c0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		status = "okay";
+
+		clk: clk {
+			compatible = "fsl,imx8qxp-clk";
+			#clock-cells = <1>;
+		};
+
+		iomuxc: iomuxc {
+			compatible = "fsl,imx8qxp-iomuxc";
+		};
+
+	};
+
+	imx8qx-pm {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pd_lsio: PD_LSIO {
+			compatible = "nxp,imx8-pd";
+			reg = <SC_R_LAST>;
+			#power-domain-cells = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			pd_lsio_gpio0: PD_LSIO_GPIO_0 {
+				reg = <SC_R_GPIO_0>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio1: PD_LSIO_GPIO_1 {
+				reg = <SC_R_GPIO_1>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio2: PD_LSIO_GPIO_2 {
+				reg = <SC_R_GPIO_2>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio3: PD_LSIO_GPIO_3 {
+				reg = <SC_R_GPIO_3>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio4: PD_LSIO_GPIO_4 {
+				reg = <SC_R_GPIO_4>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio5: PD_LSIO_GPIO_5{
+				reg = <SC_R_GPIO_5>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio6: PD_LSIO_GPIO_6 {
+				reg = <SC_R_GPIO_6>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+			pd_lsio_gpio7: PD_LSIO_GPIO_7 {
+				reg = <SC_R_GPIO_7>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_lsio>;
+			};
+		};
+
+		pd_conn: PD_CONN {
+			compatible = "nxp,imx8-pd";
+			reg = <SC_R_LAST>;
+			#power-domain-cells = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			pd_conn_sdch0: PD_CONN_SDHC_0 {
+				reg = <SC_R_SDHC_0>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_conn>;
+			};
+			pd_conn_sdch1: PD_CONN_SDHC_1 {
+				reg = <SC_R_SDHC_1>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_conn>;
+			};
+			pd_conn_sdch2: PD_CONN_SDHC_2 {
+				reg = <SC_R_SDHC_2>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_conn>;
+			};
+		};
+
+		pd_dma: PD_DMA {
+			compatible = "nxp,imx8-pd";
+			reg = <SC_R_LAST>;
+			#power-domain-cells = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			pd_dma_lpi2c0: PD_DMA_I2C_0 {
+				reg = <SC_R_I2C_0>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_dma>;
+			};
+			pd_dma_lpi2c1: PD_DMA_I2C_1 {
+				reg = <SC_R_I2C_1>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_dma>;
+			};
+			pd_dma_lpi2c2:PD_DMA_I2C_2 {
+				reg = <SC_R_I2C_2>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_dma>;
+			};
+			pd_dma_lpi2c3: PD_DMA_I2C_3 {
+				reg = <SC_R_I2C_3>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_dma>;
+			};
+			pd_dma_lpuart0: PD_DMA_UART0 {
+				reg = <SC_R_UART_0>;
+				#power-domain-cells = <0>;
+				power-domains = <&pd_dma>;
+				wakeup-irq = <225>;
+			};
+		};
+	};
+
+	i2c0: i2c at 5a800000 {
+		compatible = "fsl,imx8qm-lpi2c", "fsl,imx7ulp-lpi2c";
+		reg = <0x0 0x5a800000 0x0 0x4000>;
+		interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&clk IMX8QXP_I2C0_CLK>;
+		clock-names = "per";
+		assigned-clocks = <&clk IMX8QXP_I2C0_CLK>;
+		assigned-clock-rates = <24000000>;
+		power-domains = <&pd_dma_lpi2c0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
+	i2c1: i2c at 5a810000 {
+		compatible = "fsl,imx8qm-lpi2c", "fsl,imx7ulp-lpi2c";
+		reg = <0x0 0x5a810000 0x0 0x4000>;
+		interrupts = <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&clk IMX8QXP_I2C1_CLK>,
+			<&clk IMX8QXP_I2C1_IPG_CLK>;
+		clock-names = "per", "ipg";
+		assigned-clocks = <&clk IMX8QXP_I2C1_CLK>;
+		assigned-clock-rates = <24000000>;
+		power-domains = <&pd_dma_lpi2c1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
+	i2c2: i2c at 5a820000 {
+		compatible = "fsl,imx8qm-lpi2c", "fsl,imx7ulp-lpi2c";
+		reg = <0x0 0x5a820000 0x0 0x4000>;
+		interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&clk IMX8QXP_I2C2_CLK>;
+		clock-names = "per";
+		assigned-clocks = <&clk IMX8QXP_I2C2_CLK>;
+		assigned-clock-rates = <24000000>;
+		power-domains = <&pd_dma_lpi2c2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
+	i2c3: i2c at 5a830000 {
+		compatible = "fsl,imx8qm-lpi2c", "fsl,imx7ulp-lpi2c";
+		reg = <0x0 0x5a830000 0x0 0x4000>;
+		interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&clk IMX8QXP_I2C3_CLK>,
+			<&clk IMX8QXP_I2C3_IPG_CLK>;
+		clock-names = "per", "ipg";
+		assigned-clocks = <&clk IMX8QXP_I2C3_CLK>;
+		assigned-clock-rates = <24000000>;
+		power-domains = <&pd_dma_lpi2c3>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
+	gpio0: gpio at 5d080000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d080000 0x0 0x10000>;
+		interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio0>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio1: gpio at 5d090000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d090000 0x0 0x10000>;
+		interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio1>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio2: gpio at 5d0a0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0a0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio2>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio3: gpio at 5d0b0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0b0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio3>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio4: gpio at 5d0c0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0c0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio4>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio5: gpio at 5d0d0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0d0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio5>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio6: gpio at 5d0e0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0e0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio6>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	gpio7: gpio at 5d0f0000 {
+		compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+		reg = <0x0 0x5d0f0000 0x0 0x10000>;
+		interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		power-domains = <&pd_lsio_gpio7>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+
+	lpuart0: serial at 5a060000 {
+		compatible = "fsl,imx8qm-lpuart";
+		reg = <0x0 0x5a060000 0x0 0x1000>;
+		interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clk IMX8QXP_UART0_CLK>,
+			 <&clk IMX8QXP_UART0_IPG_CLK>;
+		clock-names = "per", "ipg";
+		assigned-clocks = <&clk IMX8QXP_UART0_CLK>;
+		assigned-clock-rates = <80000000>;
+		power-domains = <&pd_dma_lpuart0>;
+		status = "disabled";
+	};
+
+	usdhc1: usdhc at 5b010000 {
+		compatible = "fsl,imx8qm-usdhc", "fsl,imx6sl-usdhc";
+		interrupt-parent = <&gic>;
+		interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
+		reg = <0x0 0x5b010000 0x0 0x10000>;
+		clocks = <&clk IMX8QXP_SDHC0_IPG_CLK>,
+			<&clk IMX8QXP_SDHC0_CLK>,
+			<&clk IMX8QXP_CLK_DUMMY>;
+		clock-names = "ipg", "per", "ahb";
+		assigned-clocks = <&clk IMX8QXP_SDHC0_SEL>, <&clk IMX8QXP_SDHC0_DIV>;
+		assigned-clock-parents = <&clk IMX8QXP_CONN_PLL0_CLK>;
+		assigned-clock-rates = <0>, <400000000>;
+		power-domains = <&pd_conn_sdch0>;
+		fsl,tuning-start-tap = <20>;
+		fsl,tuning-step= <2>;
+		status = "disabled";
+	};
+
+	usdhc2: usdhc at 5b020000 {
+		compatible = "fsl,imx8qm-usdhc", "fsl,imx6sl-usdhc";
+		interrupt-parent = <&gic>;
+		interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
+		reg = <0x0 0x5b020000 0x0 0x10000>;
+		clocks = <&clk IMX8QXP_SDHC1_IPG_CLK>,
+			<&clk IMX8QXP_SDHC1_CLK>,
+			<&clk IMX8QXP_CLK_DUMMY>;
+		clock-names = "ipg", "per", "ahb";
+		assigned-clocks = <&clk IMX8QXP_SDHC1_SEL>, <&clk IMX8QXP_SDHC1_DIV>;
+		assigned-clock-parents = <&clk IMX8QXP_CONN_PLL0_CLK>;
+		assigned-clock-rates = <0>, <200000000>;
+		power-domains = <&pd_conn_sdch1>;
+		fsl,tuning-start-tap = <20>;
+		fsl,tuning-step= <2>;
+		status = "disabled";
+	};
+
+	usdhc3: usdhc at 5b030000 {
+		compatible = "fsl,imx8qm-usdhc", "fsl,imx6sl-usdhc";
+		interrupt-parent = <&gic>;
+		interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
+		reg = <0x0 0x5b030000 0x0 0x10000>;
+		clocks = <&clk IMX8QXP_SDHC2_IPG_CLK>,
+			<&clk IMX8QXP_SDHC2_CLK>,
+			<&clk IMX8QXP_CLK_DUMMY>;
+		clock-names = "ipg", "per", "ahb";
+		assigned-clocks = <&clk IMX8QXP_SDHC2_SEL>, <&clk IMX8QXP_SDHC2_DIV>;
+		assigned-clock-parents = <&clk IMX8QXP_CONN_PLL0_CLK>;
+		assigned-clock-rates = <0>, <200000000>;
+		power-domains = <&pd_conn_sdch2>;
+		status = "disabled";
+	};
+};
+
+&A35_0 {
+	clocks = <&clk IMX8QXP_A35_DIV>;
+};
+
+/delete-node/ &A35_2;
+/delete-node/ &A35_3;
diff --git a/arch/arm/dts/fsl-imx8dxp.dtsi b/arch/arm/dts/fsl-imx8dxp.dtsi
new file mode 100644
index 0000000000..cc688f4469
--- /dev/null
+++ b/arch/arm/dts/fsl-imx8dxp.dtsi
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include "fsl-imx8dx.dtsi"
+
+/ {
+	model = "Freescale i.MX8DXP";
+	compatible = "fsl,imx8dxp", "fsl,imx8qxp";
+};
diff --git a/arch/arm/dts/fsl-imx8qxp.dtsi b/arch/arm/dts/fsl-imx8qxp.dtsi
new file mode 100644
index 0000000000..1bffff1314
--- /dev/null
+++ b/arch/arm/dts/fsl-imx8qxp.dtsi
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include "fsl-imx8dxp.dtsi"
+
+/ {
+	model = "Freescale i.MX8QXP";
+	compatible = "fsl,imx8qxp";
+
+	cpus {
+		A35_2: cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x2>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+
+		A35_3: cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a35";
+			reg = <0x0 0x3>;
+			enable-method = "psci";
+			next-level-cache = <&A35_L2>;
+		};
+	};
+
+	pmu {
+		interrupt-affinity = <&A35_0>, <&A35_1>, <&A35_2>, <&A35_3>;
+	};
+};
+
+&A35_2 {
+	device_type = "cpu";
+};
+
+&A35_3 {
+	device_type = "cpu";
+};
-- 
2.14.1

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

* [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (30 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 31/32] arm: dts: introduce dtsi for i.MX8QXP Peng Fan
@ 2018-09-26 13:52 ` Peng Fan
  2018-10-05 10:53   ` Stefano Babic
  2018-10-04  0:56 ` [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
  32 siblings, 1 reply; 39+ messages in thread
From: Peng Fan @ 2018-09-26 13:52 UTC (permalink / raw)
  To: u-boot

Add i.MX8QXP MEK board support
Enabled pinctrl/clk/power domain/mmc/i2c driver.
Added README file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Anatolij Gustschin <agust@denx.de>
---
 arch/arm/dts/Makefile                     |   2 +
 arch/arm/dts/fsl-imx8qxp-mek.dts          | 136 ++++++++++++++++++++++++++
 arch/arm/mach-imx/imx8/Kconfig            |  13 +++
 board/freescale/imx8qxp_mek/Kconfig       |  14 +++
 board/freescale/imx8qxp_mek/MAINTAINERS   |   6 ++
 board/freescale/imx8qxp_mek/Makefile      |   7 ++
 board/freescale/imx8qxp_mek/README        |  72 ++++++++++++++
 board/freescale/imx8qxp_mek/imx8qxp_mek.c | 152 +++++++++++++++++++++++++++++
 board/freescale/mx8mq_evk/README          |  81 ++++++++++++++++
 configs/imx8qxp_mek_defconfig             |  38 ++++++++
 include/configs/imx8qxp_mek.h             | 156 ++++++++++++++++++++++++++++++
 11 files changed, 677 insertions(+)
 create mode 100644 arch/arm/dts/fsl-imx8qxp-mek.dts
 create mode 100644 board/freescale/imx8qxp_mek/Kconfig
 create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
 create mode 100644 board/freescale/imx8qxp_mek/Makefile
 create mode 100644 board/freescale/imx8qxp_mek/README
 create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
 create mode 100644 board/freescale/mx8mq_evk/README
 create mode 100644 configs/imx8qxp_mek_defconfig
 create mode 100644 include/configs/imx8qxp_mek.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 44ebc50bfa..61598bdfeb 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -452,6 +452,8 @@ dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
 
 dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
 
+dtb-$(CONFIG_ARCH_IMX8) += fsl-imx8qxp-mek.dtb
+
 dtb-$(CONFIG_RCAR_GEN3) += \
 	r8a7795-h3ulcb.dtb \
 	r8a7795-salvator-x.dtb \
diff --git a/arch/arm/dts/fsl-imx8qxp-mek.dts b/arch/arm/dts/fsl-imx8qxp-mek.dts
new file mode 100644
index 0000000000..6c3bc1dc4d
--- /dev/null
+++ b/arch/arm/dts/fsl-imx8qxp-mek.dts
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2017-2018 NXP
+ */
+
+/dts-v1/;
+
+#include "fsl-imx8qxp.dtsi"
+
+/ {
+	model = "Freescale i.MX8QXP MEK";
+	compatible = "fsl,imx8qxp-mek", "fsl,imx8qxp";
+
+	chosen {
+		bootargs = "console=ttyLP0,115200 earlycon=lpuart32,0x5a060000,115200";
+		stdout-path = &lpuart0;
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reg_usdhc2_vmmc: usdhc2-vmmc {
+			compatible = "regulator-fixed";
+			regulator-name = "SD1_SPWR";
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+			gpio = <&gpio4 19 GPIO_ACTIVE_HIGH>;
+			off-on-delay = <3480>;
+			enable-active-high;
+		};
+	};
+};
+
+&iomuxc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hog>;
+
+	imx8qxp-mek {
+		pinctrl_hog: hoggrp {
+			fsl,pins = <
+				SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0	0x0600004c
+				SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD	0x000514a0
+			>;
+		};
+
+		pinctrl_ioexp_rst: ioexp-rst-grp {
+			fsl,pins = <
+				SC_P_SPI2_SDO_LSIO_GPIO1_IO01	0x06000021
+			>;
+		};
+
+		pinctrl_lpi2c1: lpi1cgrp {
+			fsl,pins = <
+				SC_P_USB_SS3_TC1_ADMA_I2C1_SCL	0x06000021
+				SC_P_USB_SS3_TC3_ADMA_I2C1_SDA	0x06000021
+			>;
+		};
+
+		pinctrl_lpuart0: lpuart0grp {
+			fsl,pins = <
+				SC_P_UART0_RX_ADMA_UART0_RX	0x06000020
+				SC_P_UART0_TX_ADMA_UART0_TX	0x06000020
+			>;
+		};
+
+		pinctrl_usdhc1: usdhc1grp {
+			fsl,pins = <
+				SC_P_EMMC0_CLK_CONN_EMMC0_CLK		0x06000041
+				SC_P_EMMC0_CMD_CONN_EMMC0_CMD		0x00000021
+				SC_P_EMMC0_DATA0_CONN_EMMC0_DATA0	0x00000021
+				SC_P_EMMC0_DATA1_CONN_EMMC0_DATA1	0x00000021
+				SC_P_EMMC0_DATA2_CONN_EMMC0_DATA2	0x00000021
+				SC_P_EMMC0_DATA3_CONN_EMMC0_DATA3	0x00000021
+				SC_P_EMMC0_DATA4_CONN_EMMC0_DATA4	0x00000021
+				SC_P_EMMC0_DATA5_CONN_EMMC0_DATA5	0x00000021
+				SC_P_EMMC0_DATA6_CONN_EMMC0_DATA6	0x00000021
+				SC_P_EMMC0_DATA7_CONN_EMMC0_DATA7	0x00000021
+				SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE	0x00000041
+			>;
+		};
+
+		pinctrl_usdhc2_gpio: usdhc2gpiogrp {
+			fsl,pins = <
+				SC_P_USDHC1_RESET_B_LSIO_GPIO4_IO19	0x00000021
+				SC_P_USDHC1_WP_LSIO_GPIO4_IO21		0x00000021
+				SC_P_USDHC1_CD_B_LSIO_GPIO4_IO22	0x00000021
+			>;
+		};
+
+		pinctrl_usdhc2: usdhc2grp {
+			fsl,pins = <
+				SC_P_USDHC1_CLK_CONN_USDHC1_CLK		0x06000041
+				SC_P_USDHC1_CMD_CONN_USDHC1_CMD		0x00000021
+				SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0	0x00000021
+				SC_P_USDHC1_DATA1_CONN_USDHC1_DATA1	0x00000021
+				SC_P_USDHC1_DATA2_CONN_USDHC1_DATA2	0x00000021
+				SC_P_USDHC1_DATA3_CONN_USDHC1_DATA3	0x00000021
+				SC_P_USDHC1_VSELECT_CONN_USDHC1_VSELECT	0x00000021
+			>;
+		};
+	};
+};
+
+&lpuart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_lpuart0>;
+	status = "okay";
+};
+
+&i2c1 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>;
+	pinctrl-assert-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+};
+
+&usdhc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc1>;
+	bus-width = <8>;
+	non-removable;
+	status = "okay";
+};
+
+&usdhc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+	bus-width = <4>;
+	cd-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
+	wp-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
+	vmmc-supply = <&reg_usdhc2_vmmc>;
+	status = "okay";
+};
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index 28910c1509..0d3a87cd74 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -10,4 +10,17 @@ config IMX8QXP
 config SYS_SOC
 	default "imx8"
 
+choice
+	prompt "i.MX8 board select"
+	optional
+
+config TARGET_IMX8QXP_MEK
+	bool "Support i.MX8QXP MEK board"
+	select BOARD_LATE_INIT
+	select IMX8QXP
+
+endchoice
+
+source "board/freescale/imx8qxp_mek/Kconfig"
+
 endif
diff --git a/board/freescale/imx8qxp_mek/Kconfig b/board/freescale/imx8qxp_mek/Kconfig
new file mode 100644
index 0000000000..b67300d816
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/Kconfig
@@ -0,0 +1,14 @@
+if TARGET_IMX8QXP_MEK
+
+config SYS_BOARD
+	default "imx8qxp_mek"
+
+config SYS_VENDOR
+	default "freescale"
+
+config SYS_CONFIG_NAME
+	default "imx8qxp_mek"
+
+source "board/freescale/common/Kconfig"
+
+endif
diff --git a/board/freescale/imx8qxp_mek/MAINTAINERS b/board/freescale/imx8qxp_mek/MAINTAINERS
new file mode 100644
index 0000000000..e9bf0b35a3
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/MAINTAINERS
@@ -0,0 +1,6 @@
+i.MX8QXP MEK BOARD
+M:	Peng Fan <peng.fan@nxp.com>
+S:	Maintained
+F:	board/freescale/imx8qxp_mek/
+F:	include/configs/imx8qxp_mek.h
+F:	configs/imx8qxp_mek_defconfig
diff --git a/board/freescale/imx8qxp_mek/Makefile b/board/freescale/imx8qxp_mek/Makefile
new file mode 100644
index 0000000000..f9ee8aeff3
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += imx8qxp_mek.o
diff --git a/board/freescale/imx8qxp_mek/README b/board/freescale/imx8qxp_mek/README
new file mode 100644
index 0000000000..7f740894b2
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/README
@@ -0,0 +1,72 @@
+U-Boot for the NXP i.MX8QXP EVK board
+
+Quick Start
+===========
+
+- Build U-Boot
+- Build the ARM Trusted firmware binary
+- Get scfw_tcm.bin and ahab-container.img
+- Get mkimage tool
+- Generate flash.bin using imx-mkimage
+- Flash the binary into the SD card
+- Boot
+
+Build U-Boot
+============
+
+$ make imx8qxp_mek_defconfig
+$ make
+
+Get and Build the ARM Trusted firmware
+======================================
+
+$ git clone https://source.codeaurora.org/external/imx/imx-atf
+$ cd imx-atf/
+$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b imx_4.9.88_imx8qxp_beta2
+$ make PLAT=imx8qxp bl31
+
+Get scfw_tcm.bin and ahab-container.img
+==============================
+
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-sc-firmware-0.7.bin
+$ chmod +x imx-sc-firmware-0.7.bin
+$ ./imx-sc-firmware-0.7.bin
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.6.bin
+$ chmod +x firmware-imx-7.6.bin
+$ ./firmware-imx-7.6.bin
+
+Get imx-mkimage tool
+==============================
+Download the imx-mkimage tool:
+
+$ git clone https://source.codeaurora.org/external/imx/imx-mkimage/
+$ cd imx-mkimage/
+$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b imx_4.9.88_imx8qxp_beta2
+
+
+Generate flash.bin using imx-mkimage
+====================================
+
+Copy the following binaries to imx-mkimage/iMX8M folder:
+
+$ cp imx-atf/build/imx8qxp/release/bl31.bin imx-mkimage/iMX8QX/
+$ cp u-boot/u-boot.bin imx-mkimage/iMX8QX/
+
+Copy the following firmwares to imx-mkimage/iMX8 folder :
+
+$ cp firmware-imx-7.6/firmware/seco/ahab-container.img imx-mkimage/iMX8QX/
+$ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin imx-mkimage/iMX8QX/scfw_tcm.bin
+
+$ cd imx-mkimage/
+$ make SOC=iMX8QX flash
+
+Flash the binary into the SD card
+=================================
+
+Burn the flash.bin binary to SD card offset 32KB:
+
+$ sudo dd if=iMX8QX/flash.bin of=/dev/sd[x] bs=1024 seek=32
+
+Boot
+====
+Set Boot switch SW2: 1100.
diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
new file mode 100644
index 0000000000..051c852c5d
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
@@ -0,0 +1,152 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <linux/libfdt.h>
+#include <environment.h>
+#include <fsl_esdhc.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sci/sci.h>
+#include <asm/arch/imx8-pins.h>
+#include <asm/arch/iomux.h>
+#include <asm/arch/sys_proto.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define GPIO_PAD_CTRL	((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
+			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
+			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
+			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
+
+#define UART_PAD_CTRL	((SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
+			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
+			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
+			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
+
+static iomux_cfg_t uart0_pads[] = {
+	SC_P_UART0_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+	SC_P_UART0_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+static void setup_iomux_uart(void)
+{
+	imx8_iomux_setup_multiple_pads(uart0_pads, ARRAY_SIZE(uart0_pads));
+}
+
+int board_early_init_f(void)
+{
+	int ret;
+	/* Set UART0 clock root to 80 MHz */
+	sc_pm_clock_rate_t rate = 80000000;
+
+	/* Power up UART0 */
+	ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0, SC_PM_PW_MODE_ON);
+	if (ret)
+		return ret;
+
+	ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
+	if (ret)
+		return ret;
+
+	/* Enable UART0 clock root */
+	ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
+	if (ret)
+		return ret;
+
+	setup_iomux_uart();
+
+	return 0;
+}
+
+#ifdef CONFIG_MXC_GPIO
+#define IOEXP_RESET IMX_GPIO_NR(1, 1)
+
+static iomux_cfg_t board_gpios[] = {
+	SC_P_SPI2_SDO | MUX_MODE_ALT(4) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
+	SC_P_ENET0_REFCLK_125M_25M | MUX_MODE_ALT(4) |
+		MUX_PAD_CTRL(GPIO_PAD_CTRL),
+};
+
+static void board_gpio_init(void)
+{
+	int ret;
+	struct gpio_desc desc;
+
+	ret = dm_gpio_lookup_name("gpio@1a_3", &desc);
+	if (ret)
+		return;
+
+	ret = dm_gpio_request(&desc, "bb_per_rst_b");
+	if (ret)
+		return;
+
+	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
+	dm_gpio_set_value(&desc, 0);
+	udelay(50);
+	dm_gpio_set_value(&desc, 1);
+
+	imx8_iomux_setup_multiple_pads(board_gpios, ARRAY_SIZE(board_gpios));
+
+	/* enable i2c port expander assert reset line */
+	gpio_request(IOEXP_RESET, "ioexp_rst");
+	gpio_direction_output(IOEXP_RESET, 1);
+}
+#endif
+
+int checkboard(void)
+{
+	puts("Board: iMX8QXP MEK\n");
+
+	print_bootinfo();
+
+	return 0;
+}
+
+int board_init(void)
+{
+#ifdef CONFIG_MXC_GPIO
+	board_gpio_init();
+#endif
+
+	return 0;
+}
+
+void detail_board_ddr_info(void)
+{
+	puts("\nDDR    ");
+}
+
+/*
+ * Board specific reset that is system reset.
+ */
+void reset_cpu(ulong addr)
+{
+	/* TODO */
+}
+
+#ifdef CONFIG_OF_BOARD_SETUP
+int ft_board_setup(void *blob, bd_t *bd)
+{
+	return 0;
+}
+#endif
+
+int board_mmc_get_env_dev(int devno)
+{
+	return devno;
+}
+
+int board_late_init(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	env_set("board_name", "MEK");
+	env_set("board_rev", "iMX8QXP");
+#endif
+
+	return 0;
+}
diff --git a/board/freescale/mx8mq_evk/README b/board/freescale/mx8mq_evk/README
new file mode 100644
index 0000000000..cd7e67eec5
--- /dev/null
+++ b/board/freescale/mx8mq_evk/README
@@ -0,0 +1,81 @@
+U-Boot for the NXP i.MX8MQ EVK board
+
+Quick Start
+===========
+
+- Build U-Boot
+- Build the ARM Trusted firmware binary
+- Get DDR firmware and mkimage tool
+- Generate flash.bin using imx-mkimage
+- Flash the binary into the SD card
+- Boot
+
+Build U-Boot
+============
+
+$ make mx8mq_evk_defconfig
+$ make
+
+Get and Build the ARM Trusted firmware
+======================================
+
+$ git clone https://source.codeaurora.org/external/imx/imx-atf
+$ cd imx-atf/
+$ git checkout origin/imx_4.9.51_imx8m_beta
+$ make PLAT=imx8mq bl31
+
+Get the DDR firmware and mkimage tool
+==============================
+
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.2.bin
+$ chmod +x firmware-imx-7.2.bin
+$ ./firmware-imx-7.2.bin
+
+Download the imx-mkimage tool:
+
+$ git clone https://source.codeaurora.org/external/imx/imx-mkimage/
+$ cd imx-mkimage/
+$ git checkout origin/imx_4.9.51_imx8m_beta
+
+
+Generate flash.bin using imx-mkimage
+====================================
+
+Copy the following binaries to imx-mkimage/iMX8M folder:
+
+$ cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/
+$ cp u-boot/u-boot-nodtb.bin imx-mkimage/iMX8M/
+$ cp u-boot/spl/u-boot-spl.bin imx-mkimage/iMX8M/
+$ cp u-boot/arch/arm/dts/fsl-imx8mq-evk.dtb imx-mkimage/iMX8M/
+
+Copy the following firmwares to imx-mkimage/iMX8 folder :
+
+$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin imx-mkimage/iMX8M/
+$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin imx-mkimage/iMX8M/
+$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin imx-mkimage/iMX8M/
+$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin imx-mkimage/iMX8M/
+
+If you want to run with HDMI, copy signed_hdmi_imx8m.bin to imx-mkimage/iMX8M.
+
+Before generating the flash.bin, transfer the mkimage generated by U-Boot to iMX8M folder:
+
+$ cp u-boot/tools/mkimage imx-mkimage/iMX8M/
+$ mv imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot
+
+$ cd imx-mkimage/
+$ make SOC=iMX8M flash_spl_uboot
+
+Or for using HDMI:
+
+$ make SOC=iMX8M flash_hdmi_spl_uboot
+
+Flash the binary into the SD card
+=================================
+
+Burn the flash.bin binary to SD card offset 33KB:
+
+$ sudo dd if=iMX8M/flash.bin of=/dev/sd[x] bs=1024 seek=33
+
+Boot
+====
+Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig
new file mode 100644
index 0000000000..873f30c9c5
--- /dev/null
+++ b/configs/imx8qxp_mek_defconfig
@@ -0,0 +1,38 @@
+CONFIG_ARM=y
+CONFIG_ARCH_IMX8=y
+CONFIG_SYS_TEXT_BASE=0x80020000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_TARGET_IMX8QXP_MEK=y
+CONFIG_NR_DRAM_BANKS=3
+CONFIG_BOOTDELAY=3
+# CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_FAT=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-mek"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_CLK_IMX8=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_PCA953X=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_IMX_LPI2C=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_MISC=y
+CONFIG_DM_MMC=y
+CONFIG_DM_ETH=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX8=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_IMX8_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
+CONFIG_FSL_LPUART=y
+# CONFIG_EFI_LOADER is not set
diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
new file mode 100644
index 0000000000..82553ce790
--- /dev/null
+++ b/include/configs/imx8qxp_mek.h
@@ -0,0 +1,156 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __IMX8QXP_MEK_H
+#define __IMX8QXP_MEK_H
+
+#include <linux/sizes.h>
+#include <asm/arch/imx-regs.h>
+
+#define CONFIG_REMAKE_ELF
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* Flat Device Tree Definitions */
+#define CONFIG_OF_BOARD_SETUP
+
+#undef CONFIG_CMD_EXPORTENV
+#undef CONFIG_CMD_IMPORTENV
+#undef CONFIG_CMD_IMLS
+
+#undef CONFIG_CMD_CRC32
+#undef CONFIG_BOOTM_NETBSD
+
+#define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_USDHC
+#define CONFIG_SYS_FSL_ESDHC_ADDR       0
+#define USDHC1_BASE_ADDR                0x5B010000
+#define USDHC2_BASE_ADDR                0x5B020000
+#define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
+
+#define CONFIG_ENV_OVERWRITE
+
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+/* GPIO configs */
+#define CONFIG_MXC_GPIO
+
+/* Initial environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS		\
+	"script=boot.scr\0" \
+	"image=Image\0" \
+	"panel=NULL\0" \
+	"console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
+	"fdt_addr=0x83000000\0"			\
+	"fdt_high=0xffffffffffffffff\0"		\
+	"boot_fdt=try\0" \
+	"fdt_file=fsl-imx8qxp-mek.dtb\0" \
+	"initrd_addr=0x83800000\0"		\
+	"initrd_high=0xffffffffffffffff\0" \
+	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
+	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
+	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
+	"mmcautodetect=yes\0" \
+	"mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
+	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source\0" \
+	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+			"if run loadfdt; then " \
+				"booti ${loadaddr} - ${fdt_addr}; " \
+			"else " \
+				"echo WARN: Cannot load the DT; " \
+			"fi; " \
+		"else " \
+			"echo wait for boot; " \
+		"fi;\0" \
+	"netargs=setenv bootargs console=${console} " \
+		"root=/dev/nfs " \
+		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+	"netboot=echo Booting from net ...; " \
+		"run netargs;  " \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"${get_cmd} ${loadaddr} ${image}; " \
+		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+				"booti ${loadaddr} - ${fdt_addr}; " \
+			"else " \
+				"echo WARN: Cannot load the DT; " \
+			"fi; " \
+		"else " \
+			"booti; " \
+		"fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+	   "mmc dev ${mmcdev}; if mmc rescan; then " \
+		   "if run loadbootscript; then " \
+			   "run bootscript; " \
+		   "else " \
+			   "if run loadimage; then " \
+				   "run mmcboot; " \
+			   "else run netboot; " \
+			   "fi; " \
+		   "fi; " \
+	   "else booti ${loadaddr} - ${fdt_addr}; fi"
+
+/* Link Definitions */
+#define CONFIG_LOADADDR			0x80280000
+
+#define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
+
+#define CONFIG_SYS_INIT_SP_ADDR         0x80200000
+
+/* Default environment is in SD */
+#define CONFIG_ENV_SIZE			0x1000
+#define CONFIG_ENV_OFFSET		(64 * SZ_64K)
+#define CONFIG_SYS_MMC_ENV_PART		0	/* user area */
+
+#define CONFIG_SYS_MMC_IMG_LOAD_PART	1
+
+/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
+#define CONFIG_SYS_MMC_ENV_DEV		1   /* USDHC2 */
+#define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2 */
+#define CONFIG_SYS_FSL_USDHC_NUM	2
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN		((CONFIG_ENV_SIZE + (32 * 1024)) * 1024)
+
+#define CONFIG_SYS_SDRAM_BASE		0x80000000
+#define PHYS_SDRAM_1			0x80000000
+#define PHYS_SDRAM_2			0x880000000
+#define PHYS_SDRAM_1_SIZE		0x80000000	/* 2 GB */
+/* LPDDR4 board total DDR is 3GB */
+#define PHYS_SDRAM_2_SIZE		0x40000000	/* 1 GB */
+
+/* Serial */
+#define CONFIG_BAUDRATE			115200
+
+/* Monitor Command Prompt */
+#define CONFIG_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_CBSIZE              2048
+#define CONFIG_SYS_MAXARGS             64
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + 16)
+
+/* Generic Timer Definitions */
+#define COUNTER_FREQUENCY		8000000	/* 8MHz */
+
+#ifndef CONFIG_DM_PCA953X
+#define CONFIG_PCA953X
+#define CONFIG_CMD_PCA953X
+#define CONFIG_CMD_PCA953X_INFO
+#endif
+
+#endif /* __IMX8QXP_MEK_H */
-- 
2.14.1

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

* [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support
  2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
                   ` (31 preceding siblings ...)
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support Peng Fan
@ 2018-10-04  0:56 ` Peng Fan
  32 siblings, 0 replies; 39+ messages in thread
From: Peng Fan @ 2018-10-04  0:56 UTC (permalink / raw)
  To: u-boot

Gentle ping..

Thanks,
Peng

> -----Original Message-----
> From: Peng Fan
> Sent: 2018年9月26日 21:52
> To: sbabic at denx.de; agust at denx.de
> Cc: u-boot at lists.denx.de; Peng Fan <peng.fan@nxp.com>
> Subject: [PATCH V5 00/32] i.MX: Add i.MX8QXP support
> 
> This patchset is to upstream i.MX8QXP and mek board support, with some
> drivers update to support i.MX8QXP. The information about the processor could
> be found
> https://www.nxp.com/products/processors-and-microcontrollers/applications-p
> rocessors/i.mx-applications-processors/i.mx-8-processors/i.mx-8x-family-arm-co
> rtex-a35-3d-graphics-4k-video-dsp-error-correcting-code-on-ddr:i.MX8X
> 
> The architecture of i.MX8QXP is different from i.MX6/7/8M, inside i.MX8QXP,
> there is a dedicated processor(SCU) used for power/clock/pin/ pad/resource
> management/thermal and etc.
> 
> 
> V5:
> Addressed Lothar Waßmann's comments for patch 24 and 32.
> Rebased on master.
> 
> V4:
> Add reviewed tag from Anatolij Gustschin Addressed comments from Anatolig
> for patch "misc: add i.MX8 misc driver"
> Addressed comments from Anatolig for patch "misc: imx8: add scfw api
> impementation"
>  Merged the files into one
>  Moved one error handle to patch 4
> Moved patch "arm: global_data: add scu_dev for i.MX8" to patch 7 For Fabio's
> comments to imx-mkimage, I'll start the porting work, but needs more time, it
> will be not be in this patchset.
> 
> V3:
> 
> patch 7: use CONFIG_IMX8
> patch 29: use CONFIG_IMX8
> patch 32: Added README with scfw_tcm.bin link added
> misc: remove sc_rpc_msg_t typedef, use struct sc_rpc_msg_s in patchset.
> 
> V2:
> In this V2 patchset, the SCFW API is replaced by uclass driver implementation,
> but the api name is not changed from scfw api.
> The related macro definitions are kept in different api.h file following SCFW API
> file structure.
> 
> Impelemnted scu misc driver to handle the low level communication between
> Acore and SCU.
> Implemented rm/pm/pad/misc protocol code to invoke misc_call for different
> functionality.
> The dm clk/pinctrl/power and others will invokde the protocol api to
> communicate with SCU.
> 
> The arch/arm/mach-imx/imx8/clock.c currently is only a dummy file to avoid
> build break for mxc_get_clock.
> 
> The i2c patch and common power domain patches are removed from this
> patchset.
> 
> The imx8 name still kept, this is because NXP marketing requires to use this
> name for i.MX branding.
> 
> 
> Peng Fan (30):
>   dt-bindings: pinctrl: add i.MX8QXP pads definition
>   dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks
>     definition
>   dt-bindings: soc: add i.MX8QXP pm and rsrc definition
>   imx8: add scfw macro definition
>   imx: add Kconfig entry for i.MX8QXP
>   arm: build mach-imx for i.MX8
>   arm: global_data: add scu_dev for i.MX8
>   misc: add i.MX8 misc driver
>   misc: imx8: add scfw api impementation
>   imx: boot_mode: Add FLEXSPI boot entry
>   imx8: add imx-regs header file
>   imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined
>   imx: add i.MX8 cpu type
>   armv8: add cpu core helper functions
>   imx8: add basic cpu support
>   imx8: add boot device detection
>   imx8: implement mmc_get_env_dev
>   imx8: add mmu and dram related functiions
>   imx8: add arch_cpu_init arch_cpu_init_dm
>   imx8: add iomux configuration api
>   imx8: add dummy clock
>   gpio: mxc_gpio: add support for i.MX8
>   pinctrl: Add pinctrl driver for i.MX8
>   power: Add power domain driver for i.MX8
>   clk: imx: add clk driver for i.MX8QXP
>   serial_lpuart: Update lpuart driver to support i.MX8
>   serial: lpuart: support uclass clk api
>   mmc: fsl_esdhc: add uclass clk support
>   arm: dts: introduce dtsi for i.MX8QXP
>   imx: add i.MX8QXP MEK board support
> 
> Ye Li (2):
>   serial: lpuart: Enable RX and TX FIFO
>   fsl_esdhc: Update usdhc driver to support i.MX8
> 
>  arch/arm/Kconfig                                  |   8 +
>  arch/arm/Makefile                                 |   2 +-
>  arch/arm/dts/Makefile                             |   2 +
>  arch/arm/dts/fsl-imx8-ca35.dtsi                   |  66 ++
>  arch/arm/dts/fsl-imx8dx.dtsi                      | 452 +++++++++++++
>  arch/arm/dts/fsl-imx8dxp.dtsi                     |  11 +
>  arch/arm/dts/fsl-imx8qxp-mek.dts                  | 136 ++++
>  arch/arm/dts/fsl-imx8qxp.dtsi                     |  51 ++
>  arch/arm/include/asm/arch-imx/cpu.h               |   5 +
>  arch/arm/include/asm/arch-imx8/clock.h            |  27 +
>  arch/arm/include/asm/arch-imx8/gpio.h             |  21 +
>  arch/arm/include/asm/arch-imx8/imx-regs.h         |  46 ++
>  arch/arm/include/asm/arch-imx8/imx8-pins.h        |  15 +
>  arch/arm/include/asm/arch-imx8/iomux.h            |  40 ++
>  arch/arm/include/asm/arch-imx8/power-domain.h     |  15 +
>  arch/arm/include/asm/arch-imx8/sci/rpc.h          | 158 +++++
>  arch/arm/include/asm/arch-imx8/sci/sci.h          |  86 +++
>  arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h |  30 +
> arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h  |  57 ++
>  arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h   |  44 ++
>  arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h   |  69 ++
>  arch/arm/include/asm/arch-imx8/sci/types.h        | 220 +++++++
>  arch/arm/include/asm/arch-imx8/sys_proto.h        |  19 +
>  arch/arm/include/asm/armv8/cpu.h                  |  26 +
>  arch/arm/include/asm/global_data.h                |   4 +
>  arch/arm/include/asm/mach-imx/boot_mode.h         |   1 +
>  arch/arm/include/asm/mach-imx/sys_proto.h         |   3 +
>  arch/arm/mach-imx/Makefile                        |   1 +
>  arch/arm/mach-imx/imx8/Kconfig                    |  26 +
>  arch/arm/mach-imx/imx8/Makefile                   |   7 +
>  arch/arm/mach-imx/imx8/clock.c                    |  21 +
>  arch/arm/mach-imx/imx8/cpu.c                      | 544
> ++++++++++++++++
>  arch/arm/mach-imx/imx8/iomux.c                    |  43 ++
>  board/freescale/imx8qxp_mek/Kconfig               |  14 +
>  board/freescale/imx8qxp_mek/MAINTAINERS           |   6 +
>  board/freescale/imx8qxp_mek/Makefile              |   7 +
>  board/freescale/imx8qxp_mek/README                |  72 ++
>  board/freescale/imx8qxp_mek/imx8qxp_mek.c         | 152 +++++
>  board/freescale/mx8mq_evk/README                  |  81 +++
>  configs/imx8qxp_mek_defconfig                     |  38 ++
>  drivers/clk/Kconfig                               |   1 +
>  drivers/clk/Makefile                              |   1 +
>  drivers/clk/imx/Kconfig                           |   6 +
>  drivers/clk/imx/Makefile                          |   5 +
>  drivers/clk/imx/clk-imx8.c                        | 212 ++++++
>  drivers/gpio/mxc_gpio.c                           |  30 +-
>  drivers/misc/Makefile                             |   1 +
>  drivers/misc/imx8/Makefile                        |   3 +
>  drivers/misc/imx8/scu.c                           | 266 ++++++++
>  drivers/misc/imx8/scu_api.c                       | 316 +++++++++
>  drivers/mmc/fsl_esdhc.c                           |  30 +-
>  drivers/pinctrl/nxp/Kconfig                       |  18 +
>  drivers/pinctrl/nxp/Makefile                      |   2 +
>  drivers/pinctrl/nxp/pinctrl-imx.c                 | 209 +++---
>  drivers/pinctrl/nxp/pinctrl-imx.h                 |  16 +
>  drivers/pinctrl/nxp/pinctrl-imx8.c                |  40 ++
>  drivers/pinctrl/nxp/pinctrl-scu.c                 |  66 ++
>  drivers/power/domain/Kconfig                      |   8 +-
>  drivers/power/domain/Makefile                     |   1 +
>  drivers/power/domain/imx8-power-domain.c          | 315 +++++++++
>  drivers/serial/serial_lpuart.c                    | 126 +++-
>  include/configs/imx8qxp_mek.h                     | 156 +++++
>  include/dt-bindings/clock/imx8qxp-clock.h         | 583
> +++++++++++++++++
>  include/dt-bindings/pinctrl/pads-imx8qxp.h        | 757
> ++++++++++++++++++++++
>  include/dt-bindings/soc/imx8_pd.h                 | 188 ++++++
>  include/dt-bindings/soc/imx_rsrc.h                | 557
> ++++++++++++++++
>  include/fsl_lpuart.h                              |   2 +-
>  67 files changed, 6399 insertions(+), 142 deletions(-)  create mode 100644
> arch/arm/dts/fsl-imx8-ca35.dtsi  create mode 100644
> arch/arm/dts/fsl-imx8dx.dtsi  create mode 100644
> arch/arm/dts/fsl-imx8dxp.dtsi  create mode 100644
> arch/arm/dts/fsl-imx8qxp-mek.dts  create mode 100644
> arch/arm/dts/fsl-imx8qxp.dtsi  create mode 100644
> arch/arm/include/asm/arch-imx8/clock.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/gpio.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/imx-regs.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/imx8-pins.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/iomux.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/power-domain.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/rpc.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/sci.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/misc/api.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/pm/api.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/svc/rm/api.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sci/types.h
>  create mode 100644 arch/arm/include/asm/arch-imx8/sys_proto.h
>  create mode 100644 arch/arm/include/asm/armv8/cpu.h  create mode
> 100644 arch/arm/mach-imx/imx8/Kconfig  create mode 100644
> arch/arm/mach-imx/imx8/Makefile  create mode 100644
> arch/arm/mach-imx/imx8/clock.c  create mode 100644
> arch/arm/mach-imx/imx8/cpu.c  create mode 100644
> arch/arm/mach-imx/imx8/iomux.c  create mode 100644
> board/freescale/imx8qxp_mek/Kconfig
>  create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
>  create mode 100644 board/freescale/imx8qxp_mek/Makefile
>  create mode 100644 board/freescale/imx8qxp_mek/README
>  create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
>  create mode 100644 board/freescale/mx8mq_evk/README  create mode
> 100644 configs/imx8qxp_mek_defconfig  create mode 100644
> drivers/clk/imx/Kconfig  create mode 100644 drivers/clk/imx/Makefile
> create mode 100644 drivers/clk/imx/clk-imx8.c  create mode 100644
> drivers/misc/imx8/Makefile  create mode 100644 drivers/misc/imx8/scu.c
> create mode 100644 drivers/misc/imx8/scu_api.c  create mode 100644
> drivers/pinctrl/nxp/pinctrl-imx8.c
>  create mode 100644 drivers/pinctrl/nxp/pinctrl-scu.c  create mode 100644
> drivers/power/domain/imx8-power-domain.c
>  create mode 100644 include/configs/imx8qxp_mek.h  create mode 100644
> include/dt-bindings/clock/imx8qxp-clock.h
>  create mode 100644 include/dt-bindings/pinctrl/pads-imx8qxp.h
>  create mode 100644 include/dt-bindings/soc/imx8_pd.h  create mode
> 100644 include/dt-bindings/soc/imx_rsrc.h
> 
> --
> 2.14.1

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

* [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support Peng Fan
@ 2018-10-05 10:53   ` Stefano Babic
  2018-10-05 10:57     ` Peng Fan
  0 siblings, 1 reply; 39+ messages in thread
From: Stefano Babic @ 2018-10-05 10:53 UTC (permalink / raw)
  To: u-boot

Hi Peng,

I am fine with most patches of this series. Anyway, I see that to build
the image you are using a "fork" of mkimage...


On 26/09/2018 15:52, Peng Fan wrote:
> Add i.MX8QXP MEK board support
> Enabled pinctrl/clk/power domain/mmc/i2c driver.
> Added README file.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>  arch/arm/dts/Makefile                     |   2 +
>  arch/arm/dts/fsl-imx8qxp-mek.dts          | 136 ++++++++++++++++++++++++++
>  arch/arm/mach-imx/imx8/Kconfig            |  13 +++
>  board/freescale/imx8qxp_mek/Kconfig       |  14 +++
>  board/freescale/imx8qxp_mek/MAINTAINERS   |   6 ++
>  board/freescale/imx8qxp_mek/Makefile      |   7 ++
>  board/freescale/imx8qxp_mek/README        |  72 ++++++++++++++
>  board/freescale/imx8qxp_mek/imx8qxp_mek.c | 152 +++++++++++++++++++++++++++++
>  board/freescale/mx8mq_evk/README          |  81 ++++++++++++++++
>  configs/imx8qxp_mek_defconfig             |  38 ++++++++
>  include/configs/imx8qxp_mek.h             | 156 ++++++++++++++++++++++++++++++
>  11 files changed, 677 insertions(+)
>  create mode 100644 arch/arm/dts/fsl-imx8qxp-mek.dts
>  create mode 100644 board/freescale/imx8qxp_mek/Kconfig
>  create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
>  create mode 100644 board/freescale/imx8qxp_mek/Makefile
>  create mode 100644 board/freescale/imx8qxp_mek/README
>  create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
>  create mode 100644 board/freescale/mx8mq_evk/README
>  create mode 100644 configs/imx8qxp_mek_defconfig
>  create mode 100644 include/configs/imx8qxp_mek.h
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 44ebc50bfa..61598bdfeb 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -452,6 +452,8 @@ dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
>  
>  dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
>  
> +dtb-$(CONFIG_ARCH_IMX8) += fsl-imx8qxp-mek.dtb
> +
>  dtb-$(CONFIG_RCAR_GEN3) += \
>  	r8a7795-h3ulcb.dtb \
>  	r8a7795-salvator-x.dtb \
> diff --git a/arch/arm/dts/fsl-imx8qxp-mek.dts b/arch/arm/dts/fsl-imx8qxp-mek.dts
> new file mode 100644
> index 0000000000..6c3bc1dc4d
> --- /dev/null
> +++ b/arch/arm/dts/fsl-imx8qxp-mek.dts
> @@ -0,0 +1,136 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2017-2018 NXP
> + */
> +
> +/dts-v1/;
> +
> +#include "fsl-imx8qxp.dtsi"
> +
> +/ {
> +	model = "Freescale i.MX8QXP MEK";
> +	compatible = "fsl,imx8qxp-mek", "fsl,imx8qxp";
> +
> +	chosen {
> +		bootargs = "console=ttyLP0,115200 earlycon=lpuart32,0x5a060000,115200";
> +		stdout-path = &lpuart0;
> +	};
> +
> +	regulators {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		reg_usdhc2_vmmc: usdhc2-vmmc {
> +			compatible = "regulator-fixed";
> +			regulator-name = "SD1_SPWR";
> +			regulator-min-microvolt = <3000000>;
> +			regulator-max-microvolt = <3000000>;
> +			gpio = <&gpio4 19 GPIO_ACTIVE_HIGH>;
> +			off-on-delay = <3480>;
> +			enable-active-high;
> +		};
> +	};
> +};
> +
> +&iomuxc {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_hog>;
> +
> +	imx8qxp-mek {
> +		pinctrl_hog: hoggrp {
> +			fsl,pins = <
> +				SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0	0x0600004c
> +				SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD	0x000514a0
> +			>;
> +		};
> +
> +		pinctrl_ioexp_rst: ioexp-rst-grp {
> +			fsl,pins = <
> +				SC_P_SPI2_SDO_LSIO_GPIO1_IO01	0x06000021
> +			>;
> +		};
> +
> +		pinctrl_lpi2c1: lpi1cgrp {
> +			fsl,pins = <
> +				SC_P_USB_SS3_TC1_ADMA_I2C1_SCL	0x06000021
> +				SC_P_USB_SS3_TC3_ADMA_I2C1_SDA	0x06000021
> +			>;
> +		};
> +
> +		pinctrl_lpuart0: lpuart0grp {
> +			fsl,pins = <
> +				SC_P_UART0_RX_ADMA_UART0_RX	0x06000020
> +				SC_P_UART0_TX_ADMA_UART0_TX	0x06000020
> +			>;
> +		};
> +
> +		pinctrl_usdhc1: usdhc1grp {
> +			fsl,pins = <
> +				SC_P_EMMC0_CLK_CONN_EMMC0_CLK		0x06000041
> +				SC_P_EMMC0_CMD_CONN_EMMC0_CMD		0x00000021
> +				SC_P_EMMC0_DATA0_CONN_EMMC0_DATA0	0x00000021
> +				SC_P_EMMC0_DATA1_CONN_EMMC0_DATA1	0x00000021
> +				SC_P_EMMC0_DATA2_CONN_EMMC0_DATA2	0x00000021
> +				SC_P_EMMC0_DATA3_CONN_EMMC0_DATA3	0x00000021
> +				SC_P_EMMC0_DATA4_CONN_EMMC0_DATA4	0x00000021
> +				SC_P_EMMC0_DATA5_CONN_EMMC0_DATA5	0x00000021
> +				SC_P_EMMC0_DATA6_CONN_EMMC0_DATA6	0x00000021
> +				SC_P_EMMC0_DATA7_CONN_EMMC0_DATA7	0x00000021
> +				SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE	0x00000041
> +			>;
> +		};
> +
> +		pinctrl_usdhc2_gpio: usdhc2gpiogrp {
> +			fsl,pins = <
> +				SC_P_USDHC1_RESET_B_LSIO_GPIO4_IO19	0x00000021
> +				SC_P_USDHC1_WP_LSIO_GPIO4_IO21		0x00000021
> +				SC_P_USDHC1_CD_B_LSIO_GPIO4_IO22	0x00000021
> +			>;
> +		};
> +
> +		pinctrl_usdhc2: usdhc2grp {
> +			fsl,pins = <
> +				SC_P_USDHC1_CLK_CONN_USDHC1_CLK		0x06000041
> +				SC_P_USDHC1_CMD_CONN_USDHC1_CMD		0x00000021
> +				SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0	0x00000021
> +				SC_P_USDHC1_DATA1_CONN_USDHC1_DATA1	0x00000021
> +				SC_P_USDHC1_DATA2_CONN_USDHC1_DATA2	0x00000021
> +				SC_P_USDHC1_DATA3_CONN_USDHC1_DATA3	0x00000021
> +				SC_P_USDHC1_VSELECT_CONN_USDHC1_VSELECT	0x00000021
> +			>;
> +		};
> +	};
> +};
> +
> +&lpuart0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_lpuart0>;
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	clock-frequency = <100000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>;
> +	pinctrl-assert-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
> +	status = "okay";
> +};
> +
> +&usdhc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc1>;
> +	bus-width = <8>;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&usdhc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
> +	wp-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
> +	vmmc-supply = <&reg_usdhc2_vmmc>;
> +	status = "okay";
> +};
> diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
> index 28910c1509..0d3a87cd74 100644
> --- a/arch/arm/mach-imx/imx8/Kconfig
> +++ b/arch/arm/mach-imx/imx8/Kconfig
> @@ -10,4 +10,17 @@ config IMX8QXP
>  config SYS_SOC
>  	default "imx8"
>  
> +choice
> +	prompt "i.MX8 board select"
> +	optional
> +
> +config TARGET_IMX8QXP_MEK
> +	bool "Support i.MX8QXP MEK board"
> +	select BOARD_LATE_INIT
> +	select IMX8QXP
> +
> +endchoice
> +
> +source "board/freescale/imx8qxp_mek/Kconfig"
> +
>  endif
> diff --git a/board/freescale/imx8qxp_mek/Kconfig b/board/freescale/imx8qxp_mek/Kconfig
> new file mode 100644
> index 0000000000..b67300d816
> --- /dev/null
> +++ b/board/freescale/imx8qxp_mek/Kconfig
> @@ -0,0 +1,14 @@
> +if TARGET_IMX8QXP_MEK
> +
> +config SYS_BOARD
> +	default "imx8qxp_mek"
> +
> +config SYS_VENDOR
> +	default "freescale"
> +
> +config SYS_CONFIG_NAME
> +	default "imx8qxp_mek"
> +
> +source "board/freescale/common/Kconfig"
> +
> +endif
> diff --git a/board/freescale/imx8qxp_mek/MAINTAINERS b/board/freescale/imx8qxp_mek/MAINTAINERS
> new file mode 100644
> index 0000000000..e9bf0b35a3
> --- /dev/null
> +++ b/board/freescale/imx8qxp_mek/MAINTAINERS
> @@ -0,0 +1,6 @@
> +i.MX8QXP MEK BOARD
> +M:	Peng Fan <peng.fan@nxp.com>
> +S:	Maintained
> +F:	board/freescale/imx8qxp_mek/
> +F:	include/configs/imx8qxp_mek.h
> +F:	configs/imx8qxp_mek_defconfig
> diff --git a/board/freescale/imx8qxp_mek/Makefile b/board/freescale/imx8qxp_mek/Makefile
> new file mode 100644
> index 0000000000..f9ee8aeff3
> --- /dev/null
> +++ b/board/freescale/imx8qxp_mek/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Copyright 2017 NXP
> +#
> +# SPDX-License-Identifier:	GPL-2.0+
> +#
> +
> +obj-y += imx8qxp_mek.o
> diff --git a/board/freescale/imx8qxp_mek/README b/board/freescale/imx8qxp_mek/README
> new file mode 100644
> index 0000000000..7f740894b2
> --- /dev/null
> +++ b/board/freescale/imx8qxp_mek/README
> @@ -0,0 +1,72 @@
> +U-Boot for the NXP i.MX8QXP EVK board
> +
> +Quick Start
> +===========
> +
> +- Build U-Boot
> +- Build the ARM Trusted firmware binary
> +- Get scfw_tcm.bin and ahab-container.img
> +- Get mkimage tool
> +- Generate flash.bin using imx-mkimage
> +- Flash the binary into the SD card
> +- Boot
> +
> +Build U-Boot
> +============
> +
> +$ make imx8qxp_mek_defconfig
> +$ make
> +
> +Get and Build the ARM Trusted firmware
> +======================================
> +
> +$ git clone https://source.codeaurora.org/external/imx/imx-atf
> +$ cd imx-atf/
> +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b imx_4.9.88_imx8qxp_beta2
> +$ make PLAT=imx8qxp bl31
> +
> +Get scfw_tcm.bin and ahab-container.img
> +==============================
> +
> +$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-sc-firmware-0.7.bin
> +$ chmod +x imx-sc-firmware-0.7.bin
> +$ ./imx-sc-firmware-0.7.bin
> +$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.6.bin
> +$ chmod +x firmware-imx-7.6.bin
> +$ ./firmware-imx-7.6.bin
> +
> +Get imx-mkimage tool
> +==============================
> +Download the imx-mkimage tool:
> +
> +$ git clone https://source.codeaurora.org/external/imx/imx-mkimage/
> +$ cd imx-mkimage/
> +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b imx_4.9.88_imx8qxp_beta2

I took a look at the source code. We cannot even say that this was
started by NXP, because it is clearly based on the original U-Boot
mainline code. Having forked it, it is quite bad. We tried in the past
to include tools (see i.MX / Atmel / TI ..) into U-Boot code instead of
using external tools, and it is a pity to revert this back with i.MX8.

This is generally not accepted in mainline - can we revert and integrate
this imx-mkimage into U-Boot's mkimage tool ?

Best regards,
Stefano

> +
> +
> +Generate flash.bin using imx-mkimage
> +====================================
> +
> +Copy the following binaries to imx-mkimage/iMX8M folder:
> +
> +$ cp imx-atf/build/imx8qxp/release/bl31.bin imx-mkimage/iMX8QX/
> +$ cp u-boot/u-boot.bin imx-mkimage/iMX8QX/
> +
> +Copy the following firmwares to imx-mkimage/iMX8 folder :
> +
> +$ cp firmware-imx-7.6/firmware/seco/ahab-container.img imx-mkimage/iMX8QX/
> +$ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin imx-mkimage/iMX8QX/scfw_tcm.bin
> +
> +$ cd imx-mkimage/
> +$ make SOC=iMX8QX flash
> +
> +Flash the binary into the SD card
> +=================================
> +
> +Burn the flash.bin binary to SD card offset 32KB:
> +
> +$ sudo dd if=iMX8QX/flash.bin of=/dev/sd[x] bs=1024 seek=32
> +
> +Boot
> +====
> +Set Boot switch SW2: 1100.
> diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
> new file mode 100644
> index 0000000000..051c852c5d
> --- /dev/null
> +++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
> @@ -0,0 +1,152 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2018 NXP
> + */
> +
> +#include <common.h>
> +#include <errno.h>
> +#include <linux/libfdt.h>
> +#include <environment.h>
> +#include <fsl_esdhc.h>
> +#include <asm/io.h>
> +#include <asm/gpio.h>
> +#include <asm/arch/clock.h>
> +#include <asm/arch/sci/sci.h>
> +#include <asm/arch/imx8-pins.h>
> +#include <asm/arch/iomux.h>
> +#include <asm/arch/sys_proto.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define GPIO_PAD_CTRL	((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
> +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
> +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
> +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
> +
> +#define UART_PAD_CTRL	((SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
> +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
> +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
> +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
> +
> +static iomux_cfg_t uart0_pads[] = {
> +	SC_P_UART0_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
> +	SC_P_UART0_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
> +};
> +
> +static void setup_iomux_uart(void)
> +{
> +	imx8_iomux_setup_multiple_pads(uart0_pads, ARRAY_SIZE(uart0_pads));
> +}
> +
> +int board_early_init_f(void)
> +{
> +	int ret;
> +	/* Set UART0 clock root to 80 MHz */
> +	sc_pm_clock_rate_t rate = 80000000;
> +
> +	/* Power up UART0 */
> +	ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0, SC_PM_PW_MODE_ON);
> +	if (ret)
> +		return ret;
> +
> +	ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
> +	if (ret)
> +		return ret;
> +
> +	/* Enable UART0 clock root */
> +	ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
> +	if (ret)
> +		return ret;
> +
> +	setup_iomux_uart();
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_MXC_GPIO
> +#define IOEXP_RESET IMX_GPIO_NR(1, 1)
> +
> +static iomux_cfg_t board_gpios[] = {
> +	SC_P_SPI2_SDO | MUX_MODE_ALT(4) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
> +	SC_P_ENET0_REFCLK_125M_25M | MUX_MODE_ALT(4) |
> +		MUX_PAD_CTRL(GPIO_PAD_CTRL),
> +};
> +
> +static void board_gpio_init(void)
> +{
> +	int ret;
> +	struct gpio_desc desc;
> +
> +	ret = dm_gpio_lookup_name("gpio at 1a_3", &desc);
> +	if (ret)
> +		return;
> +
> +	ret = dm_gpio_request(&desc, "bb_per_rst_b");
> +	if (ret)
> +		return;
> +
> +	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
> +	dm_gpio_set_value(&desc, 0);
> +	udelay(50);
> +	dm_gpio_set_value(&desc, 1);
> +
> +	imx8_iomux_setup_multiple_pads(board_gpios, ARRAY_SIZE(board_gpios));
> +
> +	/* enable i2c port expander assert reset line */
> +	gpio_request(IOEXP_RESET, "ioexp_rst");
> +	gpio_direction_output(IOEXP_RESET, 1);
> +}
> +#endif
> +
> +int checkboard(void)
> +{
> +	puts("Board: iMX8QXP MEK\n");
> +
> +	print_bootinfo();
> +
> +	return 0;
> +}
> +
> +int board_init(void)
> +{
> +#ifdef CONFIG_MXC_GPIO
> +	board_gpio_init();
> +#endif
> +
> +	return 0;
> +}
> +
> +void detail_board_ddr_info(void)
> +{
> +	puts("\nDDR    ");
> +}
> +
> +/*
> + * Board specific reset that is system reset.
> + */
> +void reset_cpu(ulong addr)
> +{
> +	/* TODO */
> +}
> +
> +#ifdef CONFIG_OF_BOARD_SETUP
> +int ft_board_setup(void *blob, bd_t *bd)
> +{
> +	return 0;
> +}
> +#endif
> +
> +int board_mmc_get_env_dev(int devno)
> +{
> +	return devno;
> +}
> +
> +int board_late_init(void)
> +{
> +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> +	env_set("board_name", "MEK");
> +	env_set("board_rev", "iMX8QXP");
> +#endif
> +
> +	return 0;
> +}
> diff --git a/board/freescale/mx8mq_evk/README b/board/freescale/mx8mq_evk/README
> new file mode 100644
> index 0000000000..cd7e67eec5
> --- /dev/null
> +++ b/board/freescale/mx8mq_evk/README
> @@ -0,0 +1,81 @@
> +U-Boot for the NXP i.MX8MQ EVK board
> +
> +Quick Start
> +===========
> +
> +- Build U-Boot
> +- Build the ARM Trusted firmware binary
> +- Get DDR firmware and mkimage tool
> +- Generate flash.bin using imx-mkimage
> +- Flash the binary into the SD card
> +- Boot
> +
> +Build U-Boot
> +============
> +
> +$ make mx8mq_evk_defconfig
> +$ make
> +
> +Get and Build the ARM Trusted firmware
> +======================================
> +
> +$ git clone https://source.codeaurora.org/external/imx/imx-atf
> +$ cd imx-atf/
> +$ git checkout origin/imx_4.9.51_imx8m_beta
> +$ make PLAT=imx8mq bl31
> +
> +Get the DDR firmware and mkimage tool
> +==============================
> +
> +$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.2.bin
> +$ chmod +x firmware-imx-7.2.bin
> +$ ./firmware-imx-7.2.bin
> +
> +Download the imx-mkimage tool:
> +
> +$ git clone https://source.codeaurora.org/external/imx/imx-mkimage/
> +$ cd imx-mkimage/
> +$ git checkout origin/imx_4.9.51_imx8m_beta
> +
> +
> +Generate flash.bin using imx-mkimage
> +====================================
> +
> +Copy the following binaries to imx-mkimage/iMX8M folder:
> +
> +$ cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/
> +$ cp u-boot/u-boot-nodtb.bin imx-mkimage/iMX8M/
> +$ cp u-boot/spl/u-boot-spl.bin imx-mkimage/iMX8M/
> +$ cp u-boot/arch/arm/dts/fsl-imx8mq-evk.dtb imx-mkimage/iMX8M/
> +
> +Copy the following firmwares to imx-mkimage/iMX8 folder :
> +
> +$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin imx-mkimage/iMX8M/
> +$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin imx-mkimage/iMX8M/
> +$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin imx-mkimage/iMX8M/
> +$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin imx-mkimage/iMX8M/
> +
> +If you want to run with HDMI, copy signed_hdmi_imx8m.bin to imx-mkimage/iMX8M.
> +
> +Before generating the flash.bin, transfer the mkimage generated by U-Boot to iMX8M folder:
> +
> +$ cp u-boot/tools/mkimage imx-mkimage/iMX8M/
> +$ mv imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot
> +
> +$ cd imx-mkimage/
> +$ make SOC=iMX8M flash_spl_uboot
> +
> +Or for using HDMI:
> +
> +$ make SOC=iMX8M flash_hdmi_spl_uboot
> +
> +Flash the binary into the SD card
> +=================================
> +
> +Burn the flash.bin binary to SD card offset 33KB:
> +
> +$ sudo dd if=iMX8M/flash.bin of=/dev/sd[x] bs=1024 seek=33
> +
> +Boot
> +====
> +Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
> diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig
> new file mode 100644
> index 0000000000..873f30c9c5
> --- /dev/null
> +++ b/configs/imx8qxp_mek_defconfig
> @@ -0,0 +1,38 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_IMX8=y
> +CONFIG_SYS_TEXT_BASE=0x80020000
> +CONFIG_SYS_MALLOC_F_LEN=0x2000
> +CONFIG_TARGET_IMX8QXP_MEK=y
> +CONFIG_NR_DRAM_BANKS=3
> +CONFIG_BOOTDELAY=3
> +# CONFIG_CMD_IMPORTENV is not set
> +CONFIG_CMD_GPIO=y
> +CONFIG_CMD_I2C=y
> +CONFIG_CMD_MMC=y
> +CONFIG_CMD_DHCP=y
> +CONFIG_CMD_MII=y
> +CONFIG_CMD_PING=y
> +CONFIG_CMD_CACHE=y
> +CONFIG_CMD_FAT=y
> +CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-mek"
> +CONFIG_ENV_IS_IN_MMC=y
> +CONFIG_CLK_IMX8=y
> +CONFIG_DM_GPIO=y
> +CONFIG_DM_PCA953X=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_IMX_LPI2C=y
> +CONFIG_I2C_MUX=y
> +CONFIG_I2C_MUX_PCA954x=y
> +CONFIG_MISC=y
> +CONFIG_DM_MMC=y
> +CONFIG_DM_ETH=y
> +CONFIG_PINCTRL=y
> +CONFIG_PINCTRL_IMX8=y
> +CONFIG_POWER_DOMAIN=y
> +CONFIG_IMX8_POWER_DOMAIN=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_DM_REGULATOR_GPIO=y
> +CONFIG_DM_SERIAL=y
> +CONFIG_FSL_LPUART=y
> +# CONFIG_EFI_LOADER is not set
> diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
> new file mode 100644
> index 0000000000..82553ce790
> --- /dev/null
> +++ b/include/configs/imx8qxp_mek.h
> @@ -0,0 +1,156 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright 2018 NXP
> + */
> +
> +#ifndef __IMX8QXP_MEK_H
> +#define __IMX8QXP_MEK_H
> +
> +#include <linux/sizes.h>
> +#include <asm/arch/imx-regs.h>
> +
> +#define CONFIG_REMAKE_ELF
> +
> +#define CONFIG_BOARD_EARLY_INIT_F
> +
> +/* Flat Device Tree Definitions */
> +#define CONFIG_OF_BOARD_SETUP
> +
> +#undef CONFIG_CMD_EXPORTENV
> +#undef CONFIG_CMD_IMPORTENV
> +#undef CONFIG_CMD_IMLS
> +
> +#undef CONFIG_CMD_CRC32
> +#undef CONFIG_BOOTM_NETBSD
> +
> +#define CONFIG_FSL_ESDHC
> +#define CONFIG_FSL_USDHC
> +#define CONFIG_SYS_FSL_ESDHC_ADDR       0
> +#define USDHC1_BASE_ADDR                0x5B010000
> +#define USDHC2_BASE_ADDR                0x5B020000
> +#define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
> +
> +#define CONFIG_ENV_OVERWRITE
> +
> +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> +
> +/* GPIO configs */
> +#define CONFIG_MXC_GPIO
> +
> +/* Initial environment variables */
> +#define CONFIG_EXTRA_ENV_SETTINGS		\
> +	"script=boot.scr\0" \
> +	"image=Image\0" \
> +	"panel=NULL\0" \
> +	"console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
> +	"fdt_addr=0x83000000\0"			\
> +	"fdt_high=0xffffffffffffffff\0"		\
> +	"boot_fdt=try\0" \
> +	"fdt_file=fsl-imx8qxp-mek.dtb\0" \
> +	"initrd_addr=0x83800000\0"		\
> +	"initrd_high=0xffffffffffffffff\0" \
> +	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
> +	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
> +	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
> +	"mmcautodetect=yes\0" \
> +	"mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
> +	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> +	"bootscript=echo Running bootscript from mmc ...; " \
> +		"source\0" \
> +	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
> +	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
> +	"mmcboot=echo Booting from mmc ...; " \
> +		"run mmcargs; " \
> +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> +			"if run loadfdt; then " \
> +				"booti ${loadaddr} - ${fdt_addr}; " \
> +			"else " \
> +				"echo WARN: Cannot load the DT; " \
> +			"fi; " \
> +		"else " \
> +			"echo wait for boot; " \
> +		"fi;\0" \
> +	"netargs=setenv bootargs console=${console} " \
> +		"root=/dev/nfs " \
> +		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
> +	"netboot=echo Booting from net ...; " \
> +		"run netargs;  " \
> +		"if test ${ip_dyn} = yes; then " \
> +			"setenv get_cmd dhcp; " \
> +		"else " \
> +			"setenv get_cmd tftp; " \
> +		"fi; " \
> +		"${get_cmd} ${loadaddr} ${image}; " \
> +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> +			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
> +				"booti ${loadaddr} - ${fdt_addr}; " \
> +			"else " \
> +				"echo WARN: Cannot load the DT; " \
> +			"fi; " \
> +		"else " \
> +			"booti; " \
> +		"fi;\0"
> +
> +#define CONFIG_BOOTCOMMAND \
> +	   "mmc dev ${mmcdev}; if mmc rescan; then " \
> +		   "if run loadbootscript; then " \
> +			   "run bootscript; " \
> +		   "else " \
> +			   "if run loadimage; then " \
> +				   "run mmcboot; " \
> +			   "else run netboot; " \
> +			   "fi; " \
> +		   "fi; " \
> +	   "else booti ${loadaddr} - ${fdt_addr}; fi"
> +
> +/* Link Definitions */
> +#define CONFIG_LOADADDR			0x80280000
> +
> +#define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
> +
> +#define CONFIG_SYS_INIT_SP_ADDR         0x80200000
> +
> +/* Default environment is in SD */
> +#define CONFIG_ENV_SIZE			0x1000
> +#define CONFIG_ENV_OFFSET		(64 * SZ_64K)
> +#define CONFIG_SYS_MMC_ENV_PART		0	/* user area */
> +
> +#define CONFIG_SYS_MMC_IMG_LOAD_PART	1
> +
> +/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
> +#define CONFIG_SYS_MMC_ENV_DEV		1   /* USDHC2 */
> +#define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2 */
> +#define CONFIG_SYS_FSL_USDHC_NUM	2
> +
> +/* Size of malloc() pool */
> +#define CONFIG_SYS_MALLOC_LEN		((CONFIG_ENV_SIZE + (32 * 1024)) * 1024)
> +
> +#define CONFIG_SYS_SDRAM_BASE		0x80000000
> +#define PHYS_SDRAM_1			0x80000000
> +#define PHYS_SDRAM_2			0x880000000
> +#define PHYS_SDRAM_1_SIZE		0x80000000	/* 2 GB */
> +/* LPDDR4 board total DDR is 3GB */
> +#define PHYS_SDRAM_2_SIZE		0x40000000	/* 1 GB */
> +
> +/* Serial */
> +#define CONFIG_BAUDRATE			115200
> +
> +/* Monitor Command Prompt */
> +#define CONFIG_HUSH_PARSER
> +#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
> +#define CONFIG_SYS_CBSIZE              2048
> +#define CONFIG_SYS_MAXARGS             64
> +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
> +#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
> +					sizeof(CONFIG_SYS_PROMPT) + 16)
> +
> +/* Generic Timer Definitions */
> +#define COUNTER_FREQUENCY		8000000	/* 8MHz */
> +
> +#ifndef CONFIG_DM_PCA953X
> +#define CONFIG_PCA953X
> +#define CONFIG_CMD_PCA953X
> +#define CONFIG_CMD_PCA953X_INFO
> +#endif
> +
> +#endif /* __IMX8QXP_MEK_H */
> 


-- 
=====================================================================
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] 39+ messages in thread

* [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
  2018-10-05 10:53   ` Stefano Babic
@ 2018-10-05 10:57     ` Peng Fan
  2018-10-05 11:29       ` Stefano Babic
  0 siblings, 1 reply; 39+ messages in thread
From: Peng Fan @ 2018-10-05 10:57 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

> -----Original Message-----
> From: Stefano Babic [mailto:sbabic at denx.de]
> Sent: 2018年10月5日 18:54
> To: Peng Fan <peng.fan@nxp.com>; sbabic at denx.de; agust at denx.de
> Cc: u-boot at lists.denx.de; Fabio Estevam <fabio.estevam@nxp.com>
> Subject: Re: [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
> 
> Hi Peng,
> 
> I am fine with most patches of this series. 

Thanks.

Anyway, I see that to build the image
> you are using a "fork" of mkimage...

Yes. I am developing the i.MX8X mkimage support in U-Boot.
I think It could catch up next release.

Thanks,
Peng.

> 
> 
> On 26/09/2018 15:52, Peng Fan wrote:
> > Add i.MX8QXP MEK board support
> > Enabled pinctrl/clk/power domain/mmc/i2c driver.
> > Added README file.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > Cc: Fabio Estevam <fabio.estevam@nxp.com>
> > Cc: Anatolij Gustschin <agust@denx.de>
> > ---
> >  arch/arm/dts/Makefile                     |   2 +
> >  arch/arm/dts/fsl-imx8qxp-mek.dts          | 136
> ++++++++++++++++++++++++++
> >  arch/arm/mach-imx/imx8/Kconfig            |  13 +++
> >  board/freescale/imx8qxp_mek/Kconfig       |  14 +++
> >  board/freescale/imx8qxp_mek/MAINTAINERS   |   6 ++
> >  board/freescale/imx8qxp_mek/Makefile      |   7 ++
> >  board/freescale/imx8qxp_mek/README        |  72 ++++++++++++++
> >  board/freescale/imx8qxp_mek/imx8qxp_mek.c | 152
> +++++++++++++++++++++++++++++
> >  board/freescale/mx8mq_evk/README          |  81
> ++++++++++++++++
> >  configs/imx8qxp_mek_defconfig             |  38 ++++++++
> >  include/configs/imx8qxp_mek.h             | 156
> ++++++++++++++++++++++++++++++
> >  11 files changed, 677 insertions(+)
> >  create mode 100644 arch/arm/dts/fsl-imx8qxp-mek.dts  create mode
> > 100644 board/freescale/imx8qxp_mek/Kconfig
> >  create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
> >  create mode 100644 board/freescale/imx8qxp_mek/Makefile
> >  create mode 100644 board/freescale/imx8qxp_mek/README
> >  create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
> >  create mode 100644 board/freescale/mx8mq_evk/README  create mode
> > 100644 configs/imx8qxp_mek_defconfig  create mode 100644
> > include/configs/imx8qxp_mek.h
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
> > 44ebc50bfa..61598bdfeb 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -452,6 +452,8 @@ dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
> >
> >  dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
> >
> > +dtb-$(CONFIG_ARCH_IMX8) += fsl-imx8qxp-mek.dtb
> > +
> >  dtb-$(CONFIG_RCAR_GEN3) += \
> >  	r8a7795-h3ulcb.dtb \
> >  	r8a7795-salvator-x.dtb \
> > diff --git a/arch/arm/dts/fsl-imx8qxp-mek.dts
> > b/arch/arm/dts/fsl-imx8qxp-mek.dts
> > new file mode 100644
> > index 0000000000..6c3bc1dc4d
> > --- /dev/null
> > +++ b/arch/arm/dts/fsl-imx8qxp-mek.dts
> > @@ -0,0 +1,136 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright 2017-2018 NXP
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "fsl-imx8qxp.dtsi"
> > +
> > +/ {
> > +	model = "Freescale i.MX8QXP MEK";
> > +	compatible = "fsl,imx8qxp-mek", "fsl,imx8qxp";
> > +
> > +	chosen {
> > +		bootargs = "console=ttyLP0,115200
> earlycon=lpuart32,0x5a060000,115200";
> > +		stdout-path = &lpuart0;
> > +	};
> > +
> > +	regulators {
> > +		compatible = "simple-bus";
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +
> > +		reg_usdhc2_vmmc: usdhc2-vmmc {
> > +			compatible = "regulator-fixed";
> > +			regulator-name = "SD1_SPWR";
> > +			regulator-min-microvolt = <3000000>;
> > +			regulator-max-microvolt = <3000000>;
> > +			gpio = <&gpio4 19 GPIO_ACTIVE_HIGH>;
> > +			off-on-delay = <3480>;
> > +			enable-active-high;
> > +		};
> > +	};
> > +};
> > +
> > +&iomuxc {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_hog>;
> > +
> > +	imx8qxp-mek {
> > +		pinctrl_hog: hoggrp {
> > +			fsl,pins = <
> > +				SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0
> 	0x0600004c
> > +				SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD
> 	0x000514a0
> > +			>;
> > +		};
> > +
> > +		pinctrl_ioexp_rst: ioexp-rst-grp {
> > +			fsl,pins = <
> > +				SC_P_SPI2_SDO_LSIO_GPIO1_IO01	0x06000021
> > +			>;
> > +		};
> > +
> > +		pinctrl_lpi2c1: lpi1cgrp {
> > +			fsl,pins = <
> > +				SC_P_USB_SS3_TC1_ADMA_I2C1_SCL	0x06000021
> > +				SC_P_USB_SS3_TC3_ADMA_I2C1_SDA	0x06000021
> > +			>;
> > +		};
> > +
> > +		pinctrl_lpuart0: lpuart0grp {
> > +			fsl,pins = <
> > +				SC_P_UART0_RX_ADMA_UART0_RX	0x06000020
> > +				SC_P_UART0_TX_ADMA_UART0_TX	0x06000020
> > +			>;
> > +		};
> > +
> > +		pinctrl_usdhc1: usdhc1grp {
> > +			fsl,pins = <
> > +				SC_P_EMMC0_CLK_CONN_EMMC0_CLK
> 	0x06000041
> > +				SC_P_EMMC0_CMD_CONN_EMMC0_CMD
> 	0x00000021
> > +				SC_P_EMMC0_DATA0_CONN_EMMC0_DATA0
> 	0x00000021
> > +				SC_P_EMMC0_DATA1_CONN_EMMC0_DATA1
> 	0x00000021
> > +				SC_P_EMMC0_DATA2_CONN_EMMC0_DATA2
> 	0x00000021
> > +				SC_P_EMMC0_DATA3_CONN_EMMC0_DATA3
> 	0x00000021
> > +				SC_P_EMMC0_DATA4_CONN_EMMC0_DATA4
> 	0x00000021
> > +				SC_P_EMMC0_DATA5_CONN_EMMC0_DATA5
> 	0x00000021
> > +				SC_P_EMMC0_DATA6_CONN_EMMC0_DATA6
> 	0x00000021
> > +				SC_P_EMMC0_DATA7_CONN_EMMC0_DATA7
> 	0x00000021
> > +				SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE
> 	0x00000041
> > +			>;
> > +		};
> > +
> > +		pinctrl_usdhc2_gpio: usdhc2gpiogrp {
> > +			fsl,pins = <
> > +				SC_P_USDHC1_RESET_B_LSIO_GPIO4_IO19	0x00000021
> > +				SC_P_USDHC1_WP_LSIO_GPIO4_IO21		0x00000021
> > +				SC_P_USDHC1_CD_B_LSIO_GPIO4_IO22	0x00000021
> > +			>;
> > +		};
> > +
> > +		pinctrl_usdhc2: usdhc2grp {
> > +			fsl,pins = <
> > +				SC_P_USDHC1_CLK_CONN_USDHC1_CLK
> 	0x06000041
> > +				SC_P_USDHC1_CMD_CONN_USDHC1_CMD
> 	0x00000021
> > +				SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0
> 	0x00000021
> > +				SC_P_USDHC1_DATA1_CONN_USDHC1_DATA1
> 	0x00000021
> > +				SC_P_USDHC1_DATA2_CONN_USDHC1_DATA2
> 	0x00000021
> > +				SC_P_USDHC1_DATA3_CONN_USDHC1_DATA3
> 	0x00000021
> > +				SC_P_USDHC1_VSELECT_CONN_USDHC1_VSELECT
> 	0x00000021
> > +			>;
> > +		};
> > +	};
> > +};
> > +
> > +&lpuart0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_lpuart0>;
> > +	status = "okay";
> > +};
> > +
> > +&i2c1 {
> > +	clock-frequency = <100000>;
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>;
> > +	pinctrl-assert-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
> > +	status = "okay";
> > +};
> > +
> > +&usdhc1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_usdhc1>;
> > +	bus-width = <8>;
> > +	non-removable;
> > +	status = "okay";
> > +};
> > +
> > +&usdhc2 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
> > +	bus-width = <4>;
> > +	cd-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
> > +	wp-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
> > +	vmmc-supply = <&reg_usdhc2_vmmc>;
> > +	status = "okay";
> > +};
> > diff --git a/arch/arm/mach-imx/imx8/Kconfig
> > b/arch/arm/mach-imx/imx8/Kconfig index 28910c1509..0d3a87cd74 100644
> > --- a/arch/arm/mach-imx/imx8/Kconfig
> > +++ b/arch/arm/mach-imx/imx8/Kconfig
> > @@ -10,4 +10,17 @@ config IMX8QXP
> >  config SYS_SOC
> >  	default "imx8"
> >
> > +choice
> > +	prompt "i.MX8 board select"
> > +	optional
> > +
> > +config TARGET_IMX8QXP_MEK
> > +	bool "Support i.MX8QXP MEK board"
> > +	select BOARD_LATE_INIT
> > +	select IMX8QXP
> > +
> > +endchoice
> > +
> > +source "board/freescale/imx8qxp_mek/Kconfig"
> > +
> >  endif
> > diff --git a/board/freescale/imx8qxp_mek/Kconfig
> > b/board/freescale/imx8qxp_mek/Kconfig
> > new file mode 100644
> > index 0000000000..b67300d816
> > --- /dev/null
> > +++ b/board/freescale/imx8qxp_mek/Kconfig
> > @@ -0,0 +1,14 @@
> > +if TARGET_IMX8QXP_MEK
> > +
> > +config SYS_BOARD
> > +	default "imx8qxp_mek"
> > +
> > +config SYS_VENDOR
> > +	default "freescale"
> > +
> > +config SYS_CONFIG_NAME
> > +	default "imx8qxp_mek"
> > +
> > +source "board/freescale/common/Kconfig"
> > +
> > +endif
> > diff --git a/board/freescale/imx8qxp_mek/MAINTAINERS
> > b/board/freescale/imx8qxp_mek/MAINTAINERS
> > new file mode 100644
> > index 0000000000..e9bf0b35a3
> > --- /dev/null
> > +++ b/board/freescale/imx8qxp_mek/MAINTAINERS
> > @@ -0,0 +1,6 @@
> > +i.MX8QXP MEK BOARD
> > +M:	Peng Fan <peng.fan@nxp.com>
> > +S:	Maintained
> > +F:	board/freescale/imx8qxp_mek/
> > +F:	include/configs/imx8qxp_mek.h
> > +F:	configs/imx8qxp_mek_defconfig
> > diff --git a/board/freescale/imx8qxp_mek/Makefile
> > b/board/freescale/imx8qxp_mek/Makefile
> > new file mode 100644
> > index 0000000000..f9ee8aeff3
> > --- /dev/null
> > +++ b/board/freescale/imx8qxp_mek/Makefile
> > @@ -0,0 +1,7 @@
> > +#
> > +# Copyright 2017 NXP
> > +#
> > +# SPDX-License-Identifier:	GPL-2.0+
> > +#
> > +
> > +obj-y += imx8qxp_mek.o
> > diff --git a/board/freescale/imx8qxp_mek/README
> > b/board/freescale/imx8qxp_mek/README
> > new file mode 100644
> > index 0000000000..7f740894b2
> > --- /dev/null
> > +++ b/board/freescale/imx8qxp_mek/README
> > @@ -0,0 +1,72 @@
> > +U-Boot for the NXP i.MX8QXP EVK board
> > +
> > +Quick Start
> > +===========
> > +
> > +- Build U-Boot
> > +- Build the ARM Trusted firmware binary
> > +- Get scfw_tcm.bin and ahab-container.img
> > +- Get mkimage tool
> > +- Generate flash.bin using imx-mkimage
> > +- Flash the binary into the SD card
> > +- Boot
> > +
> > +Build U-Boot
> > +============
> > +
> > +$ make imx8qxp_mek_defconfig
> > +$ make
> > +
> > +Get and Build the ARM Trusted firmware
> > +======================================
> > +
> > +$ git clone
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
> >
> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-atf&amp;data=02%7C01%7C
> pen
> >
> +g.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C686ea1d3bc
> 2b4c6f
> >
> +a92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=IGY1gR
> Mq6v3qs
> > +a5SQQTlMeyPSstvbethL9x%2FfOolL4c%3D&amp;reserved=0
> > +$ cd imx-atf/
> > +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b
> > +imx_4.9.88_imx8qxp_beta2 $ make PLAT=imx8qxp bl31
> > +
> > +Get scfw_tcm.bin and ahab-container.img
> > +==============================
> > +
> > +$ wget
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
> >
> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Fimx-sc-firmware-0.7.bin
> &amp
> >
> +;data=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62a
> b0de42
> >
> +%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6367433364698049
> 02&amp;
> >
> +sdata=KKPP3UvcGXjgGYEyqMfyXfnJ8xCqCMyEzAtW%2FtLfM5I%3D&amp;rese
> rved=0
> > +$ chmod +x imx-sc-firmware-0.7.bin
> > +$ ./imx-sc-firmware-0.7.bin
> > +$ wget
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
> >
> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Ffirmware-imx-7.6.bin&a
> mp;da
> >
> +ta=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0
> de42%7C
> >
> +686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&
> amp;sda
> >
> +ta=wrb3TqG9ETCnEAFp4PBBal5BNOuS9tCBbgs2pTpKAnM%3D&amp;reserved
> =0
> > +$ chmod +x firmware-imx-7.6.bin
> > +$ ./firmware-imx-7.6.bin
> > +
> > +Get imx-mkimage tool
> > +==============================
> > +Download the imx-mkimage tool:
> > +
> > +$ git clone
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
> >
> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-mkimage%2F&amp;data=02
> %7C0
> >
> +1%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C68
> 6ea1d3b
> >
> +c2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=
> R3IioX
> > +Srr0lUpsB%2BLgniD2NakzUHfEoGofBWm321Lb8%3D&amp;reserved=0
> > +$ cd imx-mkimage/
> > +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b
> > +imx_4.9.88_imx8qxp_beta2
> 
> I took a look at the source code. We cannot even say that this was started by
> NXP, because it is clearly based on the original U-Boot mainline code. Having
> forked it, it is quite bad. We tried in the past to include tools (see i.MX / Atmel /
> TI ..) into U-Boot code instead of using external tools, and it is a pity to revert
> this back with i.MX8.
> 
> This is generally not accepted in mainline - can we revert and integrate this
> imx-mkimage into U-Boot's mkimage tool ?
> 
> Best regards,
> Stefano
> 
> > +
> > +
> > +Generate flash.bin using imx-mkimage
> > +====================================
> > +
> > +Copy the following binaries to imx-mkimage/iMX8M folder:
> > +
> > +$ cp imx-atf/build/imx8qxp/release/bl31.bin imx-mkimage/iMX8QX/ $ cp
> > +u-boot/u-boot.bin imx-mkimage/iMX8QX/
> > +
> > +Copy the following firmwares to imx-mkimage/iMX8 folder :
> > +
> > +$ cp firmware-imx-7.6/firmware/seco/ahab-container.img
> > +imx-mkimage/iMX8QX/ $ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin
> > +imx-mkimage/iMX8QX/scfw_tcm.bin
> > +
> > +$ cd imx-mkimage/
> > +$ make SOC=iMX8QX flash
> > +
> > +Flash the binary into the SD card
> > +=================================
> > +
> > +Burn the flash.bin binary to SD card offset 32KB:
> > +
> > +$ sudo dd if=iMX8QX/flash.bin of=/dev/sd[x] bs=1024 seek=32
> > +
> > +Boot
> > +====
> > +Set Boot switch SW2: 1100.
> > diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c
> > b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
> > new file mode 100644
> > index 0000000000..051c852c5d
> > --- /dev/null
> > +++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
> > @@ -0,0 +1,152 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright 2018 NXP
> > + */
> > +
> > +#include <common.h>
> > +#include <errno.h>
> > +#include <linux/libfdt.h>
> > +#include <environment.h>
> > +#include <fsl_esdhc.h>
> > +#include <asm/io.h>
> > +#include <asm/gpio.h>
> > +#include <asm/arch/clock.h>
> > +#include <asm/arch/sci/sci.h>
> > +#include <asm/arch/imx8-pins.h>
> > +#include <asm/arch/iomux.h>
> > +#include <asm/arch/sys_proto.h>
> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> > +#define GPIO_PAD_CTRL	((SC_PAD_CONFIG_NORMAL <<
> PADRING_CONFIG_SHIFT) | \
> > +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
> > +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
> > +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
> > +
> > +#define UART_PAD_CTRL	((SC_PAD_CONFIG_OUT_IN <<
> PADRING_CONFIG_SHIFT) | \
> > +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
> > +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
> > +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
> > +
> > +static iomux_cfg_t uart0_pads[] = {
> > +	SC_P_UART0_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
> > +	SC_P_UART0_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };
> > +
> > +static void setup_iomux_uart(void)
> > +{
> > +	imx8_iomux_setup_multiple_pads(uart0_pads, ARRAY_SIZE(uart0_pads));
> > +}
> > +
> > +int board_early_init_f(void)
> > +{
> > +	int ret;
> > +	/* Set UART0 clock root to 80 MHz */
> > +	sc_pm_clock_rate_t rate = 80000000;
> > +
> > +	/* Power up UART0 */
> > +	ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0,
> SC_PM_PW_MODE_ON);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
> > +	if (ret)
> > +		return ret;
> > +
> > +	/* Enable UART0 clock root */
> > +	ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
> > +	if (ret)
> > +		return ret;
> > +
> > +	setup_iomux_uart();
> > +
> > +	return 0;
> > +}
> > +
> > +#ifdef CONFIG_MXC_GPIO
> > +#define IOEXP_RESET IMX_GPIO_NR(1, 1)
> > +
> > +static iomux_cfg_t board_gpios[] = {
> > +	SC_P_SPI2_SDO | MUX_MODE_ALT(4) |
> MUX_PAD_CTRL(GPIO_PAD_CTRL),
> > +	SC_P_ENET0_REFCLK_125M_25M | MUX_MODE_ALT(4) |
> > +		MUX_PAD_CTRL(GPIO_PAD_CTRL),
> > +};
> > +
> > +static void board_gpio_init(void)
> > +{
> > +	int ret;
> > +	struct gpio_desc desc;
> > +
> > +	ret = dm_gpio_lookup_name("gpio at 1a_3", &desc);
> > +	if (ret)
> > +		return;
> > +
> > +	ret = dm_gpio_request(&desc, "bb_per_rst_b");
> > +	if (ret)
> > +		return;
> > +
> > +	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
> > +	dm_gpio_set_value(&desc, 0);
> > +	udelay(50);
> > +	dm_gpio_set_value(&desc, 1);
> > +
> > +	imx8_iomux_setup_multiple_pads(board_gpios,
> > +ARRAY_SIZE(board_gpios));
> > +
> > +	/* enable i2c port expander assert reset line */
> > +	gpio_request(IOEXP_RESET, "ioexp_rst");
> > +	gpio_direction_output(IOEXP_RESET, 1); } #endif
> > +
> > +int checkboard(void)
> > +{
> > +	puts("Board: iMX8QXP MEK\n");
> > +
> > +	print_bootinfo();
> > +
> > +	return 0;
> > +}
> > +
> > +int board_init(void)
> > +{
> > +#ifdef CONFIG_MXC_GPIO
> > +	board_gpio_init();
> > +#endif
> > +
> > +	return 0;
> > +}
> > +
> > +void detail_board_ddr_info(void)
> > +{
> > +	puts("\nDDR    ");
> > +}
> > +
> > +/*
> > + * Board specific reset that is system reset.
> > + */
> > +void reset_cpu(ulong addr)
> > +{
> > +	/* TODO */
> > +}
> > +
> > +#ifdef CONFIG_OF_BOARD_SETUP
> > +int ft_board_setup(void *blob, bd_t *bd) {
> > +	return 0;
> > +}
> > +#endif
> > +
> > +int board_mmc_get_env_dev(int devno)
> > +{
> > +	return devno;
> > +}
> > +
> > +int board_late_init(void)
> > +{
> > +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> > +	env_set("board_name", "MEK");
> > +	env_set("board_rev", "iMX8QXP");
> > +#endif
> > +
> > +	return 0;
> > +}
> > diff --git a/board/freescale/mx8mq_evk/README
> > b/board/freescale/mx8mq_evk/README
> > new file mode 100644
> > index 0000000000..cd7e67eec5
> > --- /dev/null
> > +++ b/board/freescale/mx8mq_evk/README
> > @@ -0,0 +1,81 @@
> > +U-Boot for the NXP i.MX8MQ EVK board
> > +
> > +Quick Start
> > +===========
> > +
> > +- Build U-Boot
> > +- Build the ARM Trusted firmware binary
> > +- Get DDR firmware and mkimage tool
> > +- Generate flash.bin using imx-mkimage
> > +- Flash the binary into the SD card
> > +- Boot
> > +
> > +Build U-Boot
> > +============
> > +
> > +$ make mx8mq_evk_defconfig
> > +$ make
> > +
> > +Get and Build the ARM Trusted firmware
> > +======================================
> > +
> > +$ git clone
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
> >
> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-atf&amp;data=02%7C01%7C
> pen
> >
> +g.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C686ea1d3bc
> 2b4c6f
> >
> +a92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=IGY1gR
> Mq6v3qs
> > +a5SQQTlMeyPSstvbethL9x%2FfOolL4c%3D&amp;reserved=0
> > +$ cd imx-atf/
> > +$ git checkout origin/imx_4.9.51_imx8m_beta $ make PLAT=imx8mq bl31
> > +
> > +Get the DDR firmware and mkimage tool
> ==============================
> > +
> > +$ wget
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
> >
> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Ffirmware-imx-7.2.bin&a
> mp;da
> >
> +ta=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0
> de42%7C
> >
> +686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&
> amp;sda
> >
> +ta=OExVnUkK7Wn70OaZdd0DL1wijv3b%2F5UWyCarxw3fRcA%3D&amp;reser
> ved=0
> > +$ chmod +x firmware-imx-7.2.bin
> > +$ ./firmware-imx-7.2.bin
> > +
> > +Download the imx-mkimage tool:
> > +
> > +$ git clone
> > +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
> >
> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-mkimage%2F&amp;data=02
> %7C0
> >
> +1%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C68
> 6ea1d3b
> >
> +c2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=
> R3IioX
> > +Srr0lUpsB%2BLgniD2NakzUHfEoGofBWm321Lb8%3D&amp;reserved=0
> > +$ cd imx-mkimage/
> > +$ git checkout origin/imx_4.9.51_imx8m_beta
> > +
> > +
> > +Generate flash.bin using imx-mkimage
> > +====================================
> > +
> > +Copy the following binaries to imx-mkimage/iMX8M folder:
> > +
> > +$ cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/ $ cp
> > +u-boot/u-boot-nodtb.bin imx-mkimage/iMX8M/ $ cp
> > +u-boot/spl/u-boot-spl.bin imx-mkimage/iMX8M/ $ cp
> > +u-boot/arch/arm/dts/fsl-imx8mq-evk.dtb imx-mkimage/iMX8M/
> > +
> > +Copy the following firmwares to imx-mkimage/iMX8 folder :
> > +
> > +$ cp
> > +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin
> > +imx-mkimage/iMX8M/ $ cp
> > +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin
> > +imx-mkimage/iMX8M/ $ cp
> > +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin
> > +imx-mkimage/iMX8M/ $ cp
> > +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin
> > +imx-mkimage/iMX8M/
> > +
> > +If you want to run with HDMI, copy signed_hdmi_imx8m.bin to
> imx-mkimage/iMX8M.
> > +
> > +Before generating the flash.bin, transfer the mkimage generated by U-Boot
> to iMX8M folder:
> > +
> > +$ cp u-boot/tools/mkimage imx-mkimage/iMX8M/ $ mv
> > +imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot
> > +
> > +$ cd imx-mkimage/
> > +$ make SOC=iMX8M flash_spl_uboot
> > +
> > +Or for using HDMI:
> > +
> > +$ make SOC=iMX8M flash_hdmi_spl_uboot
> > +
> > +Flash the binary into the SD card
> > +=================================
> > +
> > +Burn the flash.bin binary to SD card offset 33KB:
> > +
> > +$ sudo dd if=iMX8M/flash.bin of=/dev/sd[x] bs=1024 seek=33
> > +
> > +Boot
> > +====
> > +Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
> > diff --git a/configs/imx8qxp_mek_defconfig
> > b/configs/imx8qxp_mek_defconfig new file mode 100644 index
> > 0000000000..873f30c9c5
> > --- /dev/null
> > +++ b/configs/imx8qxp_mek_defconfig
> > @@ -0,0 +1,38 @@
> > +CONFIG_ARM=y
> > +CONFIG_ARCH_IMX8=y
> > +CONFIG_SYS_TEXT_BASE=0x80020000
> > +CONFIG_SYS_MALLOC_F_LEN=0x2000
> > +CONFIG_TARGET_IMX8QXP_MEK=y
> > +CONFIG_NR_DRAM_BANKS=3
> > +CONFIG_BOOTDELAY=3
> > +# CONFIG_CMD_IMPORTENV is not set
> > +CONFIG_CMD_GPIO=y
> > +CONFIG_CMD_I2C=y
> > +CONFIG_CMD_MMC=y
> > +CONFIG_CMD_DHCP=y
> > +CONFIG_CMD_MII=y
> > +CONFIG_CMD_PING=y
> > +CONFIG_CMD_CACHE=y
> > +CONFIG_CMD_FAT=y
> > +CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-mek"
> > +CONFIG_ENV_IS_IN_MMC=y
> > +CONFIG_CLK_IMX8=y
> > +CONFIG_DM_GPIO=y
> > +CONFIG_DM_PCA953X=y
> > +CONFIG_DM_I2C=y
> > +CONFIG_SYS_I2C_IMX_LPI2C=y
> > +CONFIG_I2C_MUX=y
> > +CONFIG_I2C_MUX_PCA954x=y
> > +CONFIG_MISC=y
> > +CONFIG_DM_MMC=y
> > +CONFIG_DM_ETH=y
> > +CONFIG_PINCTRL=y
> > +CONFIG_PINCTRL_IMX8=y
> > +CONFIG_POWER_DOMAIN=y
> > +CONFIG_IMX8_POWER_DOMAIN=y
> > +CONFIG_DM_REGULATOR=y
> > +CONFIG_DM_REGULATOR_FIXED=y
> > +CONFIG_DM_REGULATOR_GPIO=y
> > +CONFIG_DM_SERIAL=y
> > +CONFIG_FSL_LPUART=y
> > +# CONFIG_EFI_LOADER is not set
> > diff --git a/include/configs/imx8qxp_mek.h
> > b/include/configs/imx8qxp_mek.h new file mode 100644 index
> > 0000000000..82553ce790
> > --- /dev/null
> > +++ b/include/configs/imx8qxp_mek.h
> > @@ -0,0 +1,156 @@
> > +/* SPDX-License-Identifier: GPL-2.0+ */
> > +/*
> > + * Copyright 2018 NXP
> > + */
> > +
> > +#ifndef __IMX8QXP_MEK_H
> > +#define __IMX8QXP_MEK_H
> > +
> > +#include <linux/sizes.h>
> > +#include <asm/arch/imx-regs.h>
> > +
> > +#define CONFIG_REMAKE_ELF
> > +
> > +#define CONFIG_BOARD_EARLY_INIT_F
> > +
> > +/* Flat Device Tree Definitions */
> > +#define CONFIG_OF_BOARD_SETUP
> > +
> > +#undef CONFIG_CMD_EXPORTENV
> > +#undef CONFIG_CMD_IMPORTENV
> > +#undef CONFIG_CMD_IMLS
> > +
> > +#undef CONFIG_CMD_CRC32
> > +#undef CONFIG_BOOTM_NETBSD
> > +
> > +#define CONFIG_FSL_ESDHC
> > +#define CONFIG_FSL_USDHC
> > +#define CONFIG_SYS_FSL_ESDHC_ADDR       0
> > +#define USDHC1_BASE_ADDR                0x5B010000
> > +#define USDHC2_BASE_ADDR                0x5B020000
> > +#define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
> > +
> > +#define CONFIG_ENV_OVERWRITE
> > +
> > +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> > +
> > +/* GPIO configs */
> > +#define CONFIG_MXC_GPIO
> > +
> > +/* Initial environment variables */
> > +#define CONFIG_EXTRA_ENV_SETTINGS		\
> > +	"script=boot.scr\0" \
> > +	"image=Image\0" \
> > +	"panel=NULL\0" \
> > +	"console=ttyLP0,${baudrate}
> earlycon=lpuart32,0x5a060000,${baudrate}\0" \
> > +	"fdt_addr=0x83000000\0"			\
> > +	"fdt_high=0xffffffffffffffff\0"		\
> > +	"boot_fdt=try\0" \
> > +	"fdt_file=fsl-imx8qxp-mek.dtb\0" \
> > +	"initrd_addr=0x83800000\0"		\
> > +	"initrd_high=0xffffffffffffffff\0" \
> > +	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
> > +	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
> > +	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
> > +	"mmcautodetect=yes\0" \
> > +	"mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
> > +	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr}
> ${script};\0" \
> > +	"bootscript=echo Running bootscript from mmc ...; " \
> > +		"source\0" \
> > +	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0"
> \
> > +	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
> > +	"mmcboot=echo Booting from mmc ...; " \
> > +		"run mmcargs; " \
> > +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> > +			"if run loadfdt; then " \
> > +				"booti ${loadaddr} - ${fdt_addr}; " \
> > +			"else " \
> > +				"echo WARN: Cannot load the DT; " \
> > +			"fi; " \
> > +		"else " \
> > +			"echo wait for boot; " \
> > +		"fi;\0" \
> > +	"netargs=setenv bootargs console=${console} " \
> > +		"root=/dev/nfs " \
> > +		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
> > +	"netboot=echo Booting from net ...; " \
> > +		"run netargs;  " \
> > +		"if test ${ip_dyn} = yes; then " \
> > +			"setenv get_cmd dhcp; " \
> > +		"else " \
> > +			"setenv get_cmd tftp; " \
> > +		"fi; " \
> > +		"${get_cmd} ${loadaddr} ${image}; " \
> > +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> > +			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
> > +				"booti ${loadaddr} - ${fdt_addr}; " \
> > +			"else " \
> > +				"echo WARN: Cannot load the DT; " \
> > +			"fi; " \
> > +		"else " \
> > +			"booti; " \
> > +		"fi;\0"
> > +
> > +#define CONFIG_BOOTCOMMAND \
> > +	   "mmc dev ${mmcdev}; if mmc rescan; then " \
> > +		   "if run loadbootscript; then " \
> > +			   "run bootscript; " \
> > +		   "else " \
> > +			   "if run loadimage; then " \
> > +				   "run mmcboot; " \
> > +			   "else run netboot; " \
> > +			   "fi; " \
> > +		   "fi; " \
> > +	   "else booti ${loadaddr} - ${fdt_addr}; fi"
> > +
> > +/* Link Definitions */
> > +#define CONFIG_LOADADDR			0x80280000
> > +
> > +#define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
> > +
> > +#define CONFIG_SYS_INIT_SP_ADDR         0x80200000
> > +
> > +/* Default environment is in SD */
> > +#define CONFIG_ENV_SIZE			0x1000
> > +#define CONFIG_ENV_OFFSET		(64 * SZ_64K)
> > +#define CONFIG_SYS_MMC_ENV_PART		0	/* user area */
> > +
> > +#define CONFIG_SYS_MMC_IMG_LOAD_PART	1
> > +
> > +/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board
> */
> > +#define CONFIG_SYS_MMC_ENV_DEV		1   /* USDHC2 */
> > +#define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2
> */
> > +#define CONFIG_SYS_FSL_USDHC_NUM	2
> > +
> > +/* Size of malloc() pool */
> > +#define CONFIG_SYS_MALLOC_LEN		((CONFIG_ENV_SIZE + (32 * 1024))
> * 1024)
> > +
> > +#define CONFIG_SYS_SDRAM_BASE		0x80000000
> > +#define PHYS_SDRAM_1			0x80000000
> > +#define PHYS_SDRAM_2			0x880000000
> > +#define PHYS_SDRAM_1_SIZE		0x80000000	/* 2 GB */
> > +/* LPDDR4 board total DDR is 3GB */
> > +#define PHYS_SDRAM_2_SIZE		0x40000000	/* 1 GB */
> > +
> > +/* Serial */
> > +#define CONFIG_BAUDRATE			115200
> > +
> > +/* Monitor Command Prompt */
> > +#define CONFIG_HUSH_PARSER
> > +#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
> > +#define CONFIG_SYS_CBSIZE              2048
> > +#define CONFIG_SYS_MAXARGS             64
> > +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
> > +#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
> > +					sizeof(CONFIG_SYS_PROMPT) + 16)
> > +
> > +/* Generic Timer Definitions */
> > +#define COUNTER_FREQUENCY		8000000	/* 8MHz */
> > +
> > +#ifndef CONFIG_DM_PCA953X
> > +#define CONFIG_PCA953X
> > +#define CONFIG_CMD_PCA953X
> > +#define CONFIG_CMD_PCA953X_INFO
> > +#endif
> > +
> > +#endif /* __IMX8QXP_MEK_H */
> >
> 
> 
> --
> ================================================================
> =====
> 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] 39+ messages in thread

* [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
  2018-10-05 10:57     ` Peng Fan
@ 2018-10-05 11:29       ` Stefano Babic
  0 siblings, 0 replies; 39+ messages in thread
From: Stefano Babic @ 2018-10-05 11:29 UTC (permalink / raw)
  To: u-boot

On 05/10/2018 12:57, Peng Fan wrote:
> Hi Stefano,
> 
>> -----Original Message-----
>> From: Stefano Babic [mailto:sbabic at denx.de]
>> Sent: 2018年10月5日 18:54
>> To: Peng Fan <peng.fan@nxp.com>; sbabic at denx.de; agust at denx.de
>> Cc: u-boot at lists.denx.de; Fabio Estevam <fabio.estevam@nxp.com>
>> Subject: Re: [PATCH V5 32/32] imx: add i.MX8QXP MEK board support
>>
>> Hi Peng,
>>
>> I am fine with most patches of this series. 
> 
> Thanks.
> 
> Anyway, I see that to build the image
>> you are using a "fork" of mkimage...
> 
> Yes. I am developing the i.MX8X mkimage support in U-Boot.
> I think It could catch up next release.

ok - thanks !

Best regards,
Stefano

> 
> Thanks,
> Peng.
> 
>>
>>
>> On 26/09/2018 15:52, Peng Fan wrote:
>>> Add i.MX8QXP MEK board support
>>> Enabled pinctrl/clk/power domain/mmc/i2c driver.
>>> Added README file.
>>>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> Cc: Stefano Babic <sbabic@denx.de>
>>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>>> Cc: Anatolij Gustschin <agust@denx.de>
>>> ---
>>>  arch/arm/dts/Makefile                     |   2 +
>>>  arch/arm/dts/fsl-imx8qxp-mek.dts          | 136
>> ++++++++++++++++++++++++++
>>>  arch/arm/mach-imx/imx8/Kconfig            |  13 +++
>>>  board/freescale/imx8qxp_mek/Kconfig       |  14 +++
>>>  board/freescale/imx8qxp_mek/MAINTAINERS   |   6 ++
>>>  board/freescale/imx8qxp_mek/Makefile      |   7 ++
>>>  board/freescale/imx8qxp_mek/README        |  72 ++++++++++++++
>>>  board/freescale/imx8qxp_mek/imx8qxp_mek.c | 152
>> +++++++++++++++++++++++++++++
>>>  board/freescale/mx8mq_evk/README          |  81
>> ++++++++++++++++
>>>  configs/imx8qxp_mek_defconfig             |  38 ++++++++
>>>  include/configs/imx8qxp_mek.h             | 156
>> ++++++++++++++++++++++++++++++
>>>  11 files changed, 677 insertions(+)
>>>  create mode 100644 arch/arm/dts/fsl-imx8qxp-mek.dts  create mode
>>> 100644 board/freescale/imx8qxp_mek/Kconfig
>>>  create mode 100644 board/freescale/imx8qxp_mek/MAINTAINERS
>>>  create mode 100644 board/freescale/imx8qxp_mek/Makefile
>>>  create mode 100644 board/freescale/imx8qxp_mek/README
>>>  create mode 100644 board/freescale/imx8qxp_mek/imx8qxp_mek.c
>>>  create mode 100644 board/freescale/mx8mq_evk/README  create mode
>>> 100644 configs/imx8qxp_mek_defconfig  create mode 100644
>>> include/configs/imx8qxp_mek.h
>>>
>>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
>>> 44ebc50bfa..61598bdfeb 100644
>>> --- a/arch/arm/dts/Makefile
>>> +++ b/arch/arm/dts/Makefile
>>> @@ -452,6 +452,8 @@ dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
>>>
>>>  dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
>>>
>>> +dtb-$(CONFIG_ARCH_IMX8) += fsl-imx8qxp-mek.dtb
>>> +
>>>  dtb-$(CONFIG_RCAR_GEN3) += \
>>>  	r8a7795-h3ulcb.dtb \
>>>  	r8a7795-salvator-x.dtb \
>>> diff --git a/arch/arm/dts/fsl-imx8qxp-mek.dts
>>> b/arch/arm/dts/fsl-imx8qxp-mek.dts
>>> new file mode 100644
>>> index 0000000000..6c3bc1dc4d
>>> --- /dev/null
>>> +++ b/arch/arm/dts/fsl-imx8qxp-mek.dts
>>> @@ -0,0 +1,136 @@
>>> +// SPDX-License-Identifier: GPL-2.0+
>>> +/*
>>> + * Copyright 2017-2018 NXP
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "fsl-imx8qxp.dtsi"
>>> +
>>> +/ {
>>> +	model = "Freescale i.MX8QXP MEK";
>>> +	compatible = "fsl,imx8qxp-mek", "fsl,imx8qxp";
>>> +
>>> +	chosen {
>>> +		bootargs = "console=ttyLP0,115200
>> earlycon=lpuart32,0x5a060000,115200";
>>> +		stdout-path = &lpuart0;
>>> +	};
>>> +
>>> +	regulators {
>>> +		compatible = "simple-bus";
>>> +		#address-cells = <1>;
>>> +		#size-cells = <0>;
>>> +
>>> +		reg_usdhc2_vmmc: usdhc2-vmmc {
>>> +			compatible = "regulator-fixed";
>>> +			regulator-name = "SD1_SPWR";
>>> +			regulator-min-microvolt = <3000000>;
>>> +			regulator-max-microvolt = <3000000>;
>>> +			gpio = <&gpio4 19 GPIO_ACTIVE_HIGH>;
>>> +			off-on-delay = <3480>;
>>> +			enable-active-high;
>>> +		};
>>> +	};
>>> +};
>>> +
>>> +&iomuxc {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&pinctrl_hog>;
>>> +
>>> +	imx8qxp-mek {
>>> +		pinctrl_hog: hoggrp {
>>> +			fsl,pins = <
>>> +				SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0
>> 	0x0600004c
>>> +				SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD
>> 	0x000514a0
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_ioexp_rst: ioexp-rst-grp {
>>> +			fsl,pins = <
>>> +				SC_P_SPI2_SDO_LSIO_GPIO1_IO01	0x06000021
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_lpi2c1: lpi1cgrp {
>>> +			fsl,pins = <
>>> +				SC_P_USB_SS3_TC1_ADMA_I2C1_SCL	0x06000021
>>> +				SC_P_USB_SS3_TC3_ADMA_I2C1_SDA	0x06000021
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_lpuart0: lpuart0grp {
>>> +			fsl,pins = <
>>> +				SC_P_UART0_RX_ADMA_UART0_RX	0x06000020
>>> +				SC_P_UART0_TX_ADMA_UART0_TX	0x06000020
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_usdhc1: usdhc1grp {
>>> +			fsl,pins = <
>>> +				SC_P_EMMC0_CLK_CONN_EMMC0_CLK
>> 	0x06000041
>>> +				SC_P_EMMC0_CMD_CONN_EMMC0_CMD
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA0_CONN_EMMC0_DATA0
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA1_CONN_EMMC0_DATA1
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA2_CONN_EMMC0_DATA2
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA3_CONN_EMMC0_DATA3
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA4_CONN_EMMC0_DATA4
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA5_CONN_EMMC0_DATA5
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA6_CONN_EMMC0_DATA6
>> 	0x00000021
>>> +				SC_P_EMMC0_DATA7_CONN_EMMC0_DATA7
>> 	0x00000021
>>> +				SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE
>> 	0x00000041
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_usdhc2_gpio: usdhc2gpiogrp {
>>> +			fsl,pins = <
>>> +				SC_P_USDHC1_RESET_B_LSIO_GPIO4_IO19	0x00000021
>>> +				SC_P_USDHC1_WP_LSIO_GPIO4_IO21		0x00000021
>>> +				SC_P_USDHC1_CD_B_LSIO_GPIO4_IO22	0x00000021
>>> +			>;
>>> +		};
>>> +
>>> +		pinctrl_usdhc2: usdhc2grp {
>>> +			fsl,pins = <
>>> +				SC_P_USDHC1_CLK_CONN_USDHC1_CLK
>> 	0x06000041
>>> +				SC_P_USDHC1_CMD_CONN_USDHC1_CMD
>> 	0x00000021
>>> +				SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0
>> 	0x00000021
>>> +				SC_P_USDHC1_DATA1_CONN_USDHC1_DATA1
>> 	0x00000021
>>> +				SC_P_USDHC1_DATA2_CONN_USDHC1_DATA2
>> 	0x00000021
>>> +				SC_P_USDHC1_DATA3_CONN_USDHC1_DATA3
>> 	0x00000021
>>> +				SC_P_USDHC1_VSELECT_CONN_USDHC1_VSELECT
>> 	0x00000021
>>> +			>;
>>> +		};
>>> +	};
>>> +};
>>> +
>>> +&lpuart0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&pinctrl_lpuart0>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&i2c1 {
>>> +	clock-frequency = <100000>;
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>;
>>> +	pinctrl-assert-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&usdhc1 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&pinctrl_usdhc1>;
>>> +	bus-width = <8>;
>>> +	non-removable;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&usdhc2 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
>>> +	bus-width = <4>;
>>> +	cd-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
>>> +	wp-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
>>> +	vmmc-supply = <&reg_usdhc2_vmmc>;
>>> +	status = "okay";
>>> +};
>>> diff --git a/arch/arm/mach-imx/imx8/Kconfig
>>> b/arch/arm/mach-imx/imx8/Kconfig index 28910c1509..0d3a87cd74 100644
>>> --- a/arch/arm/mach-imx/imx8/Kconfig
>>> +++ b/arch/arm/mach-imx/imx8/Kconfig
>>> @@ -10,4 +10,17 @@ config IMX8QXP
>>>  config SYS_SOC
>>>  	default "imx8"
>>>
>>> +choice
>>> +	prompt "i.MX8 board select"
>>> +	optional
>>> +
>>> +config TARGET_IMX8QXP_MEK
>>> +	bool "Support i.MX8QXP MEK board"
>>> +	select BOARD_LATE_INIT
>>> +	select IMX8QXP
>>> +
>>> +endchoice
>>> +
>>> +source "board/freescale/imx8qxp_mek/Kconfig"
>>> +
>>>  endif
>>> diff --git a/board/freescale/imx8qxp_mek/Kconfig
>>> b/board/freescale/imx8qxp_mek/Kconfig
>>> new file mode 100644
>>> index 0000000000..b67300d816
>>> --- /dev/null
>>> +++ b/board/freescale/imx8qxp_mek/Kconfig
>>> @@ -0,0 +1,14 @@
>>> +if TARGET_IMX8QXP_MEK
>>> +
>>> +config SYS_BOARD
>>> +	default "imx8qxp_mek"
>>> +
>>> +config SYS_VENDOR
>>> +	default "freescale"
>>> +
>>> +config SYS_CONFIG_NAME
>>> +	default "imx8qxp_mek"
>>> +
>>> +source "board/freescale/common/Kconfig"
>>> +
>>> +endif
>>> diff --git a/board/freescale/imx8qxp_mek/MAINTAINERS
>>> b/board/freescale/imx8qxp_mek/MAINTAINERS
>>> new file mode 100644
>>> index 0000000000..e9bf0b35a3
>>> --- /dev/null
>>> +++ b/board/freescale/imx8qxp_mek/MAINTAINERS
>>> @@ -0,0 +1,6 @@
>>> +i.MX8QXP MEK BOARD
>>> +M:	Peng Fan <peng.fan@nxp.com>
>>> +S:	Maintained
>>> +F:	board/freescale/imx8qxp_mek/
>>> +F:	include/configs/imx8qxp_mek.h
>>> +F:	configs/imx8qxp_mek_defconfig
>>> diff --git a/board/freescale/imx8qxp_mek/Makefile
>>> b/board/freescale/imx8qxp_mek/Makefile
>>> new file mode 100644
>>> index 0000000000..f9ee8aeff3
>>> --- /dev/null
>>> +++ b/board/freescale/imx8qxp_mek/Makefile
>>> @@ -0,0 +1,7 @@
>>> +#
>>> +# Copyright 2017 NXP
>>> +#
>>> +# SPDX-License-Identifier:	GPL-2.0+
>>> +#
>>> +
>>> +obj-y += imx8qxp_mek.o
>>> diff --git a/board/freescale/imx8qxp_mek/README
>>> b/board/freescale/imx8qxp_mek/README
>>> new file mode 100644
>>> index 0000000000..7f740894b2
>>> --- /dev/null
>>> +++ b/board/freescale/imx8qxp_mek/README
>>> @@ -0,0 +1,72 @@
>>> +U-Boot for the NXP i.MX8QXP EVK board
>>> +
>>> +Quick Start
>>> +===========
>>> +
>>> +- Build U-Boot
>>> +- Build the ARM Trusted firmware binary
>>> +- Get scfw_tcm.bin and ahab-container.img
>>> +- Get mkimage tool
>>> +- Generate flash.bin using imx-mkimage
>>> +- Flash the binary into the SD card
>>> +- Boot
>>> +
>>> +Build U-Boot
>>> +============
>>> +
>>> +$ make imx8qxp_mek_defconfig
>>> +$ make
>>> +
>>> +Get and Build the ARM Trusted firmware
>>> +======================================
>>> +
>>> +$ git clone
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
>>>
>> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-atf&amp;data=02%7C01%7C
>> pen
>>>
>> +g.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C686ea1d3bc
>> 2b4c6f
>>>
>> +a92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=IGY1gR
>> Mq6v3qs
>>> +a5SQQTlMeyPSstvbethL9x%2FfOolL4c%3D&amp;reserved=0
>>> +$ cd imx-atf/
>>> +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b
>>> +imx_4.9.88_imx8qxp_beta2 $ make PLAT=imx8qxp bl31
>>> +
>>> +Get scfw_tcm.bin and ahab-container.img
>>> +==============================
>>> +
>>> +$ wget
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
>>>
>> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Fimx-sc-firmware-0.7.bin
>> &amp
>>>
>> +;data=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62a
>> b0de42
>>>
>> +%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6367433364698049
>> 02&amp;
>>>
>> +sdata=KKPP3UvcGXjgGYEyqMfyXfnJ8xCqCMyEzAtW%2FtLfM5I%3D&amp;rese
>> rved=0
>>> +$ chmod +x imx-sc-firmware-0.7.bin
>>> +$ ./imx-sc-firmware-0.7.bin
>>> +$ wget
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
>>>
>> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Ffirmware-imx-7.6.bin&a
>> mp;da
>>>
>> +ta=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0
>> de42%7C
>>>
>> +686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&
>> amp;sda
>>>
>> +ta=wrb3TqG9ETCnEAFp4PBBal5BNOuS9tCBbgs2pTpKAnM%3D&amp;reserved
>> =0
>>> +$ chmod +x firmware-imx-7.6.bin
>>> +$ ./firmware-imx-7.6.bin
>>> +
>>> +Get imx-mkimage tool
>>> +==============================
>>> +Download the imx-mkimage tool:
>>> +
>>> +$ git clone
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
>>>
>> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-mkimage%2F&amp;data=02
>> %7C0
>>>
>> +1%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C68
>> 6ea1d3b
>>>
>> +c2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=
>> R3IioX
>>> +Srr0lUpsB%2BLgniD2NakzUHfEoGofBWm321Lb8%3D&amp;reserved=0
>>> +$ cd imx-mkimage/
>>> +$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b
>>> +imx_4.9.88_imx8qxp_beta2
>>
>> I took a look at the source code. We cannot even say that this was started by
>> NXP, because it is clearly based on the original U-Boot mainline code. Having
>> forked it, it is quite bad. We tried in the past to include tools (see i.MX / Atmel /
>> TI ..) into U-Boot code instead of using external tools, and it is a pity to revert
>> this back with i.MX8.
>>
>> This is generally not accepted in mainline - can we revert and integrate this
>> imx-mkimage into U-Boot's mkimage tool ?
>>
>> Best regards,
>> Stefano
>>
>>> +
>>> +
>>> +Generate flash.bin using imx-mkimage
>>> +====================================
>>> +
>>> +Copy the following binaries to imx-mkimage/iMX8M folder:
>>> +
>>> +$ cp imx-atf/build/imx8qxp/release/bl31.bin imx-mkimage/iMX8QX/ $ cp
>>> +u-boot/u-boot.bin imx-mkimage/iMX8QX/
>>> +
>>> +Copy the following firmwares to imx-mkimage/iMX8 folder :
>>> +
>>> +$ cp firmware-imx-7.6/firmware/seco/ahab-container.img
>>> +imx-mkimage/iMX8QX/ $ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin
>>> +imx-mkimage/iMX8QX/scfw_tcm.bin
>>> +
>>> +$ cd imx-mkimage/
>>> +$ make SOC=iMX8QX flash
>>> +
>>> +Flash the binary into the SD card
>>> +=================================
>>> +
>>> +Burn the flash.bin binary to SD card offset 32KB:
>>> +
>>> +$ sudo dd if=iMX8QX/flash.bin of=/dev/sd[x] bs=1024 seek=32
>>> +
>>> +Boot
>>> +====
>>> +Set Boot switch SW2: 1100.
>>> diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c
>>> b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
>>> new file mode 100644
>>> index 0000000000..051c852c5d
>>> --- /dev/null
>>> +++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
>>> @@ -0,0 +1,152 @@
>>> +// SPDX-License-Identifier: GPL-2.0+
>>> +/*
>>> + * Copyright 2018 NXP
>>> + */
>>> +
>>> +#include <common.h>
>>> +#include <errno.h>
>>> +#include <linux/libfdt.h>
>>> +#include <environment.h>
>>> +#include <fsl_esdhc.h>
>>> +#include <asm/io.h>
>>> +#include <asm/gpio.h>
>>> +#include <asm/arch/clock.h>
>>> +#include <asm/arch/sci/sci.h>
>>> +#include <asm/arch/imx8-pins.h>
>>> +#include <asm/arch/iomux.h>
>>> +#include <asm/arch/sys_proto.h>
>>> +
>>> +DECLARE_GLOBAL_DATA_PTR;
>>> +
>>> +#define GPIO_PAD_CTRL	((SC_PAD_CONFIG_NORMAL <<
>> PADRING_CONFIG_SHIFT) | \
>>> +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
>>> +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
>>> +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
>>> +
>>> +#define UART_PAD_CTRL	((SC_PAD_CONFIG_OUT_IN <<
>> PADRING_CONFIG_SHIFT) | \
>>> +			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
>>> +			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
>>> +			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
>>> +
>>> +static iomux_cfg_t uart0_pads[] = {
>>> +	SC_P_UART0_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
>>> +	SC_P_UART0_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };
>>> +
>>> +static void setup_iomux_uart(void)
>>> +{
>>> +	imx8_iomux_setup_multiple_pads(uart0_pads, ARRAY_SIZE(uart0_pads));
>>> +}
>>> +
>>> +int board_early_init_f(void)
>>> +{
>>> +	int ret;
>>> +	/* Set UART0 clock root to 80 MHz */
>>> +	sc_pm_clock_rate_t rate = 80000000;
>>> +
>>> +	/* Power up UART0 */
>>> +	ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0,
>> SC_PM_PW_MODE_ON);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	/* Enable UART0 clock root */
>>> +	ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	setup_iomux_uart();
>>> +
>>> +	return 0;
>>> +}
>>> +
>>> +#ifdef CONFIG_MXC_GPIO
>>> +#define IOEXP_RESET IMX_GPIO_NR(1, 1)
>>> +
>>> +static iomux_cfg_t board_gpios[] = {
>>> +	SC_P_SPI2_SDO | MUX_MODE_ALT(4) |
>> MUX_PAD_CTRL(GPIO_PAD_CTRL),
>>> +	SC_P_ENET0_REFCLK_125M_25M | MUX_MODE_ALT(4) |
>>> +		MUX_PAD_CTRL(GPIO_PAD_CTRL),
>>> +};
>>> +
>>> +static void board_gpio_init(void)
>>> +{
>>> +	int ret;
>>> +	struct gpio_desc desc;
>>> +
>>> +	ret = dm_gpio_lookup_name("gpio at 1a_3", &desc);
>>> +	if (ret)
>>> +		return;
>>> +
>>> +	ret = dm_gpio_request(&desc, "bb_per_rst_b");
>>> +	if (ret)
>>> +		return;
>>> +
>>> +	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
>>> +	dm_gpio_set_value(&desc, 0);
>>> +	udelay(50);
>>> +	dm_gpio_set_value(&desc, 1);
>>> +
>>> +	imx8_iomux_setup_multiple_pads(board_gpios,
>>> +ARRAY_SIZE(board_gpios));
>>> +
>>> +	/* enable i2c port expander assert reset line */
>>> +	gpio_request(IOEXP_RESET, "ioexp_rst");
>>> +	gpio_direction_output(IOEXP_RESET, 1); } #endif
>>> +
>>> +int checkboard(void)
>>> +{
>>> +	puts("Board: iMX8QXP MEK\n");
>>> +
>>> +	print_bootinfo();
>>> +
>>> +	return 0;
>>> +}
>>> +
>>> +int board_init(void)
>>> +{
>>> +#ifdef CONFIG_MXC_GPIO
>>> +	board_gpio_init();
>>> +#endif
>>> +
>>> +	return 0;
>>> +}
>>> +
>>> +void detail_board_ddr_info(void)
>>> +{
>>> +	puts("\nDDR    ");
>>> +}
>>> +
>>> +/*
>>> + * Board specific reset that is system reset.
>>> + */
>>> +void reset_cpu(ulong addr)
>>> +{
>>> +	/* TODO */
>>> +}
>>> +
>>> +#ifdef CONFIG_OF_BOARD_SETUP
>>> +int ft_board_setup(void *blob, bd_t *bd) {
>>> +	return 0;
>>> +}
>>> +#endif
>>> +
>>> +int board_mmc_get_env_dev(int devno)
>>> +{
>>> +	return devno;
>>> +}
>>> +
>>> +int board_late_init(void)
>>> +{
>>> +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
>>> +	env_set("board_name", "MEK");
>>> +	env_set("board_rev", "iMX8QXP");
>>> +#endif
>>> +
>>> +	return 0;
>>> +}
>>> diff --git a/board/freescale/mx8mq_evk/README
>>> b/board/freescale/mx8mq_evk/README
>>> new file mode 100644
>>> index 0000000000..cd7e67eec5
>>> --- /dev/null
>>> +++ b/board/freescale/mx8mq_evk/README
>>> @@ -0,0 +1,81 @@
>>> +U-Boot for the NXP i.MX8MQ EVK board
>>> +
>>> +Quick Start
>>> +===========
>>> +
>>> +- Build U-Boot
>>> +- Build the ARM Trusted firmware binary
>>> +- Get DDR firmware and mkimage tool
>>> +- Generate flash.bin using imx-mkimage
>>> +- Flash the binary into the SD card
>>> +- Boot
>>> +
>>> +Build U-Boot
>>> +============
>>> +
>>> +$ make mx8mq_evk_defconfig
>>> +$ make
>>> +
>>> +Get and Build the ARM Trusted firmware
>>> +======================================
>>> +
>>> +$ git clone
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
>>>
>> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-atf&amp;data=02%7C01%7C
>> pen
>>>
>> +g.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C686ea1d3bc
>> 2b4c6f
>>>
>> +a92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=IGY1gR
>> Mq6v3qs
>>> +a5SQQTlMeyPSstvbethL9x%2FfOolL4c%3D&amp;reserved=0
>>> +$ cd imx-atf/
>>> +$ git checkout origin/imx_4.9.51_imx8m_beta $ make PLAT=imx8mq bl31
>>> +
>>> +Get the DDR firmware and mkimage tool
>> ==============================
>>> +
>>> +$ wget
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
>>>
>> +w.nxp.com%2Flgfiles%2FNMG%2FMAD%2FYOCTO%2Ffirmware-imx-7.2.bin&a
>> mp;da
>>>
>> +ta=02%7C01%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0
>> de42%7C
>>>
>> +686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&
>> amp;sda
>>>
>> +ta=OExVnUkK7Wn70OaZdd0DL1wijv3b%2F5UWyCarxw3fRcA%3D&amp;reser
>> ved=0
>>> +$ chmod +x firmware-imx-7.2.bin
>>> +$ ./firmware-imx-7.2.bin
>>> +
>>> +Download the imx-mkimage tool:
>>> +
>>> +$ git clone
>>> +https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fso
>>>
>> +urce.codeaurora.org%2Fexternal%2Fimx%2Fimx-mkimage%2F&amp;data=02
>> %7C0
>>>
>> +1%7Cpeng.fan%40nxp.com%7C16559bddb09241959d1d08d62ab0de42%7C68
>> 6ea1d3b
>>>
>> +c2b4c6fa92cd99c5c301635%7C0%7C0%7C636743336469804902&amp;sdata=
>> R3IioX
>>> +Srr0lUpsB%2BLgniD2NakzUHfEoGofBWm321Lb8%3D&amp;reserved=0
>>> +$ cd imx-mkimage/
>>> +$ git checkout origin/imx_4.9.51_imx8m_beta
>>> +
>>> +
>>> +Generate flash.bin using imx-mkimage
>>> +====================================
>>> +
>>> +Copy the following binaries to imx-mkimage/iMX8M folder:
>>> +
>>> +$ cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/ $ cp
>>> +u-boot/u-boot-nodtb.bin imx-mkimage/iMX8M/ $ cp
>>> +u-boot/spl/u-boot-spl.bin imx-mkimage/iMX8M/ $ cp
>>> +u-boot/arch/arm/dts/fsl-imx8mq-evk.dtb imx-mkimage/iMX8M/
>>> +
>>> +Copy the following firmwares to imx-mkimage/iMX8 folder :
>>> +
>>> +$ cp
>>> +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin
>>> +imx-mkimage/iMX8M/ $ cp
>>> +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin
>>> +imx-mkimage/iMX8M/ $ cp
>>> +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin
>>> +imx-mkimage/iMX8M/ $ cp
>>> +firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin
>>> +imx-mkimage/iMX8M/
>>> +
>>> +If you want to run with HDMI, copy signed_hdmi_imx8m.bin to
>> imx-mkimage/iMX8M.
>>> +
>>> +Before generating the flash.bin, transfer the mkimage generated by U-Boot
>> to iMX8M folder:
>>> +
>>> +$ cp u-boot/tools/mkimage imx-mkimage/iMX8M/ $ mv
>>> +imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot
>>> +
>>> +$ cd imx-mkimage/
>>> +$ make SOC=iMX8M flash_spl_uboot
>>> +
>>> +Or for using HDMI:
>>> +
>>> +$ make SOC=iMX8M flash_hdmi_spl_uboot
>>> +
>>> +Flash the binary into the SD card
>>> +=================================
>>> +
>>> +Burn the flash.bin binary to SD card offset 33KB:
>>> +
>>> +$ sudo dd if=iMX8M/flash.bin of=/dev/sd[x] bs=1024 seek=33
>>> +
>>> +Boot
>>> +====
>>> +Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
>>> diff --git a/configs/imx8qxp_mek_defconfig
>>> b/configs/imx8qxp_mek_defconfig new file mode 100644 index
>>> 0000000000..873f30c9c5
>>> --- /dev/null
>>> +++ b/configs/imx8qxp_mek_defconfig
>>> @@ -0,0 +1,38 @@
>>> +CONFIG_ARM=y
>>> +CONFIG_ARCH_IMX8=y
>>> +CONFIG_SYS_TEXT_BASE=0x80020000
>>> +CONFIG_SYS_MALLOC_F_LEN=0x2000
>>> +CONFIG_TARGET_IMX8QXP_MEK=y
>>> +CONFIG_NR_DRAM_BANKS=3
>>> +CONFIG_BOOTDELAY=3
>>> +# CONFIG_CMD_IMPORTENV is not set
>>> +CONFIG_CMD_GPIO=y
>>> +CONFIG_CMD_I2C=y
>>> +CONFIG_CMD_MMC=y
>>> +CONFIG_CMD_DHCP=y
>>> +CONFIG_CMD_MII=y
>>> +CONFIG_CMD_PING=y
>>> +CONFIG_CMD_CACHE=y
>>> +CONFIG_CMD_FAT=y
>>> +CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-mek"
>>> +CONFIG_ENV_IS_IN_MMC=y
>>> +CONFIG_CLK_IMX8=y
>>> +CONFIG_DM_GPIO=y
>>> +CONFIG_DM_PCA953X=y
>>> +CONFIG_DM_I2C=y
>>> +CONFIG_SYS_I2C_IMX_LPI2C=y
>>> +CONFIG_I2C_MUX=y
>>> +CONFIG_I2C_MUX_PCA954x=y
>>> +CONFIG_MISC=y
>>> +CONFIG_DM_MMC=y
>>> +CONFIG_DM_ETH=y
>>> +CONFIG_PINCTRL=y
>>> +CONFIG_PINCTRL_IMX8=y
>>> +CONFIG_POWER_DOMAIN=y
>>> +CONFIG_IMX8_POWER_DOMAIN=y
>>> +CONFIG_DM_REGULATOR=y
>>> +CONFIG_DM_REGULATOR_FIXED=y
>>> +CONFIG_DM_REGULATOR_GPIO=y
>>> +CONFIG_DM_SERIAL=y
>>> +CONFIG_FSL_LPUART=y
>>> +# CONFIG_EFI_LOADER is not set
>>> diff --git a/include/configs/imx8qxp_mek.h
>>> b/include/configs/imx8qxp_mek.h new file mode 100644 index
>>> 0000000000..82553ce790
>>> --- /dev/null
>>> +++ b/include/configs/imx8qxp_mek.h
>>> @@ -0,0 +1,156 @@
>>> +/* SPDX-License-Identifier: GPL-2.0+ */
>>> +/*
>>> + * Copyright 2018 NXP
>>> + */
>>> +
>>> +#ifndef __IMX8QXP_MEK_H
>>> +#define __IMX8QXP_MEK_H
>>> +
>>> +#include <linux/sizes.h>
>>> +#include <asm/arch/imx-regs.h>
>>> +
>>> +#define CONFIG_REMAKE_ELF
>>> +
>>> +#define CONFIG_BOARD_EARLY_INIT_F
>>> +
>>> +/* Flat Device Tree Definitions */
>>> +#define CONFIG_OF_BOARD_SETUP
>>> +
>>> +#undef CONFIG_CMD_EXPORTENV
>>> +#undef CONFIG_CMD_IMPORTENV
>>> +#undef CONFIG_CMD_IMLS
>>> +
>>> +#undef CONFIG_CMD_CRC32
>>> +#undef CONFIG_BOOTM_NETBSD
>>> +
>>> +#define CONFIG_FSL_ESDHC
>>> +#define CONFIG_FSL_USDHC
>>> +#define CONFIG_SYS_FSL_ESDHC_ADDR       0
>>> +#define USDHC1_BASE_ADDR                0x5B010000
>>> +#define USDHC2_BASE_ADDR                0x5B020000
>>> +#define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
>>> +
>>> +#define CONFIG_ENV_OVERWRITE
>>> +
>>> +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
>>> +
>>> +/* GPIO configs */
>>> +#define CONFIG_MXC_GPIO
>>> +
>>> +/* Initial environment variables */
>>> +#define CONFIG_EXTRA_ENV_SETTINGS		\
>>> +	"script=boot.scr\0" \
>>> +	"image=Image\0" \
>>> +	"panel=NULL\0" \
>>> +	"console=ttyLP0,${baudrate}
>> earlycon=lpuart32,0x5a060000,${baudrate}\0" \
>>> +	"fdt_addr=0x83000000\0"			\
>>> +	"fdt_high=0xffffffffffffffff\0"		\
>>> +	"boot_fdt=try\0" \
>>> +	"fdt_file=fsl-imx8qxp-mek.dtb\0" \
>>> +	"initrd_addr=0x83800000\0"		\
>>> +	"initrd_high=0xffffffffffffffff\0" \
>>> +	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
>>> +	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
>>> +	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
>>> +	"mmcautodetect=yes\0" \
>>> +	"mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
>>> +	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr}
>> ${script};\0" \
>>> +	"bootscript=echo Running bootscript from mmc ...; " \
>>> +		"source\0" \
>>> +	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0"
>> \
>>> +	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
>>> +	"mmcboot=echo Booting from mmc ...; " \
>>> +		"run mmcargs; " \
>>> +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
>>> +			"if run loadfdt; then " \
>>> +				"booti ${loadaddr} - ${fdt_addr}; " \
>>> +			"else " \
>>> +				"echo WARN: Cannot load the DT; " \
>>> +			"fi; " \
>>> +		"else " \
>>> +			"echo wait for boot; " \
>>> +		"fi;\0" \
>>> +	"netargs=setenv bootargs console=${console} " \
>>> +		"root=/dev/nfs " \
>>> +		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
>>> +	"netboot=echo Booting from net ...; " \
>>> +		"run netargs;  " \
>>> +		"if test ${ip_dyn} = yes; then " \
>>> +			"setenv get_cmd dhcp; " \
>>> +		"else " \
>>> +			"setenv get_cmd tftp; " \
>>> +		"fi; " \
>>> +		"${get_cmd} ${loadaddr} ${image}; " \
>>> +		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
>>> +			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
>>> +				"booti ${loadaddr} - ${fdt_addr}; " \
>>> +			"else " \
>>> +				"echo WARN: Cannot load the DT; " \
>>> +			"fi; " \
>>> +		"else " \
>>> +			"booti; " \
>>> +		"fi;\0"
>>> +
>>> +#define CONFIG_BOOTCOMMAND \
>>> +	   "mmc dev ${mmcdev}; if mmc rescan; then " \
>>> +		   "if run loadbootscript; then " \
>>> +			   "run bootscript; " \
>>> +		   "else " \
>>> +			   "if run loadimage; then " \
>>> +				   "run mmcboot; " \
>>> +			   "else run netboot; " \
>>> +			   "fi; " \
>>> +		   "fi; " \
>>> +	   "else booti ${loadaddr} - ${fdt_addr}; fi"
>>> +
>>> +/* Link Definitions */
>>> +#define CONFIG_LOADADDR			0x80280000
>>> +
>>> +#define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
>>> +
>>> +#define CONFIG_SYS_INIT_SP_ADDR         0x80200000
>>> +
>>> +/* Default environment is in SD */
>>> +#define CONFIG_ENV_SIZE			0x1000
>>> +#define CONFIG_ENV_OFFSET		(64 * SZ_64K)
>>> +#define CONFIG_SYS_MMC_ENV_PART		0	/* user area */
>>> +
>>> +#define CONFIG_SYS_MMC_IMG_LOAD_PART	1
>>> +
>>> +/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board
>> */
>>> +#define CONFIG_SYS_MMC_ENV_DEV		1   /* USDHC2 */
>>> +#define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2
>> */
>>> +#define CONFIG_SYS_FSL_USDHC_NUM	2
>>> +
>>> +/* Size of malloc() pool */
>>> +#define CONFIG_SYS_MALLOC_LEN		((CONFIG_ENV_SIZE + (32 * 1024))
>> * 1024)
>>> +
>>> +#define CONFIG_SYS_SDRAM_BASE		0x80000000
>>> +#define PHYS_SDRAM_1			0x80000000
>>> +#define PHYS_SDRAM_2			0x880000000
>>> +#define PHYS_SDRAM_1_SIZE		0x80000000	/* 2 GB */
>>> +/* LPDDR4 board total DDR is 3GB */
>>> +#define PHYS_SDRAM_2_SIZE		0x40000000	/* 1 GB */
>>> +
>>> +/* Serial */
>>> +#define CONFIG_BAUDRATE			115200
>>> +
>>> +/* Monitor Command Prompt */
>>> +#define CONFIG_HUSH_PARSER
>>> +#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
>>> +#define CONFIG_SYS_CBSIZE              2048
>>> +#define CONFIG_SYS_MAXARGS             64
>>> +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
>>> +#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
>>> +					sizeof(CONFIG_SYS_PROMPT) + 16)
>>> +
>>> +/* Generic Timer Definitions */
>>> +#define COUNTER_FREQUENCY		8000000	/* 8MHz */
>>> +
>>> +#ifndef CONFIG_DM_PCA953X
>>> +#define CONFIG_PCA953X
>>> +#define CONFIG_CMD_PCA953X
>>> +#define CONFIG_CMD_PCA953X_INFO
>>> +#endif
>>> +
>>> +#endif /* __IMX8QXP_MEK_H */
>>>
>>
>>
>> --
>> ================================================================
>> =====
>> 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
>> ================================================================
>> =====


-- 
=====================================================================
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] 39+ messages in thread

* [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev for i.MX8
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev " Peng Fan
@ 2018-10-14  8:26   ` Anatolij Gustschin
  0 siblings, 0 replies; 39+ messages in thread
From: Anatolij Gustschin @ 2018-10-14  8:26 UTC (permalink / raw)
  To: u-boot

On Wed, 26 Sep 2018 21:52:31 +0800
Peng Fan peng.fan at nxp.com wrote:

> Add scu_dev for i.MX8, this will be used as a handle
> to communite with SCU from A35.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>

Reviewed-by: Anatolij Gustschin <agust@denx.de>

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

* [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver
  2018-09-26 13:52 ` [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver Peng Fan
@ 2018-10-14  8:44   ` Anatolij Gustschin
  0 siblings, 0 replies; 39+ messages in thread
From: Anatolij Gustschin @ 2018-10-14  8:44 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Wed, 26 Sep 2018 21:52:32 +0800
Peng Fan peng.fan at nxp.com wrote:

> Add i.MX8 MISC driver to handle the communication between
> A35 Core and SCU.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Reviewed-by: Anatolij Gustschin <agust@denx.de>

Looks good, please see some minor comment below.

...
> +static int imx8_scu_bind(struct udevice *dev)
> +{
> +	struct imx8_scu *priv = dev_get_priv(dev);
> +	int ret;
> +	struct udevice *child;
> +	int node;
> +
> +	debug("%s(dev=%p)\n", __func__, dev);
> +
> +	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
> +					     "fsl,imx8qxp-clk");
> +	if (node < 0)
> +		panic("No clk node found\n");
> +
> +	ret = lists_bind_fdt(dev, offset_to_ofnode(node), &child);
> +	if (ret)
> +		return ret;
> +
> +	priv->clk = child;
> +
> +	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
> +					     "fsl,imx8qxp-iomuxc");
> +	if (node < 0)
> +		panic("No clk node found\n");

"No clk ..." is wrong here, a copy-paste reminder, it seems.
Please add "No iomuxc ..." here.

Thanks,

Anatolij

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

end of thread, other threads:[~2018-10-14  8:44 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 13:52 [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 01/32] dt-bindings: pinctrl: add i.MX8QXP pads definition Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 02/32] dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 03/32] dt-bindings: soc: add i.MX8QXP pm and rsrc definition Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 04/32] imx8: add scfw macro definition Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 05/32] imx: add Kconfig entry for i.MX8QXP Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 06/32] arm: build mach-imx for i.MX8 Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 07/32] arm: global_data: add scu_dev " Peng Fan
2018-10-14  8:26   ` Anatolij Gustschin
2018-09-26 13:52 ` [U-Boot] [PATCH V5 08/32] misc: add i.MX8 misc driver Peng Fan
2018-10-14  8:44   ` Anatolij Gustschin
2018-09-26 13:52 ` [U-Boot] [PATCH V5 09/32] misc: imx8: add scfw api impementation Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 10/32] imx: boot_mode: Add FLEXSPI boot entry Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 11/32] imx8: add imx-regs header file Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 12/32] imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 13/32] imx: add i.MX8 cpu type Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 14/32] armv8: add cpu core helper functions Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 15/32] imx8: add basic cpu support Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 16/32] imx8: add boot device detection Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 17/32] imx8: implement mmc_get_env_dev Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 18/32] imx8: add mmu and dram related functiions Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 19/32] imx8: add arch_cpu_init arch_cpu_init_dm Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 20/32] imx8: add iomux configuration api Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 21/32] imx8: add dummy clock Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 22/32] gpio: mxc_gpio: add support for i.MX8 Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 23/32] pinctrl: Add pinctrl driver " Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 24/32] power: Add power domain " Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 25/32] clk: imx: add clk driver for i.MX8QXP Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 26/32] serial_lpuart: Update lpuart driver to support i.MX8 Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 27/32] serial: lpuart: Enable RX and TX FIFO Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 28/32] serial: lpuart: support uclass clk api Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 29/32] fsl_esdhc: Update usdhc driver to support i.MX8 Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 30/32] mmc: fsl_esdhc: add uclass clk support Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 31/32] arm: dts: introduce dtsi for i.MX8QXP Peng Fan
2018-09-26 13:52 ` [U-Boot] [PATCH V5 32/32] imx: add i.MX8QXP MEK board support Peng Fan
2018-10-05 10:53   ` Stefano Babic
2018-10-05 10:57     ` Peng Fan
2018-10-05 11:29       ` Stefano Babic
2018-10-04  0:56 ` [U-Boot] [PATCH V5 00/32] i.MX: Add i.MX8QXP support 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.