Skip to contentSkip to conversation

imx: add i.MX6UL and basic board support

PATCH Superseded Peng Fan 4 participants 30 messages Jul 2, 2015 – Jul 3, 2015

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

cover imx: add i.MX6UL and basic board support

Add i.MX 6UltraLite support and include mx6ul_14x14_evk basic board support i.MX 6UltraLite is a high performance, ultra-efficient processor family featuring an advanced implementation of a single Cortex-A7 core.

This patch set is based on:
https://patchwork.ozlabs.org/patch/489977/
https://patchwork.ozlabs.org/patch/489976/

i.MX6QP patch set:
https://patchwork.ozlabs.org/patch/489464/
https://patchwork.ozlabs.org/patch/489465/
https://patchwork.ozlabs.org/patch/489466/
https://patchwork.ozlabs.org/patch/489467/
https://patchwork.ozlabs.org/patch/489468/
https://patchwork.ozlabs.org/patch/489469/

Peng Fan (11):
imx: mx6ul: Add i.MX6UL CPU type
imx: mx6ul: Add pins IOMUX head file
imx: mx6ul: Update imx registers head file
imx-common: add syscounter driver
imx: mx6ul remove errata for i.MX6UL and use syscounter imx:mx6ul add clock support
imx: mx6ul update soc related settings
imx: mx6 add PAD_CTL_SPEED_LOW for i.MX6SX/UL
mxc: gpio add i.MX6UL support
mx6_common: Fix LOADADDR and SYS_TEXT_BASE for i.MX6UL
imx: mx6ul_14x14_evk add basic board support

 arch/arm/Kconfig                                  |    7 +
 arch/arm/cpu/armv7/mx6/Kconfig                    |    4 +
 arch/arm/cpu/armv7/mx6/clock.c                    |  151 +--
 arch/arm/cpu/armv7/mx6/soc.c                      |    4 +-
 arch/arm/imx-common/Makefile                      |    7 +-
 arch/arm/imx-common/cpu.c                         |    2 +
 arch/arm/imx-common/syscounter.c                  |  124 +++
 arch/arm/imx-common/timer.c                       |    8 +-
 arch/arm/include/asm/arch-imx/cpu.h               |    3 +-
 arch/arm/include/asm/arch-mx6/crm_regs.h          |   79 +-
 arch/arm/include/asm/arch-mx6/imx-regs.h          |   60 +-
 arch/arm/include/asm/arch-mx6/mx6-pins.h          |    2 +
 arch/arm/include/asm/arch-mx6/mx6ul_pins.h        | 1065 +++++++++++++++++++++
 arch/arm/include/asm/imx-common/iomux-v3.h        |    4 +
 arch/arm/include/asm/imx-common/syscounter.h      |   29 +
 board/freescale/mx6ul_14x14_evk/Kconfig           |   15 +
 board/freescale/mx6ul_14x14_evk/MAINTAINERS       |    6 +
 board/freescale/mx6ul_14x14_evk/Makefile          |    6 +
 board/freescale/mx6ul_14x14_evk/imximage.cfg      |   99 ++
 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c |  502 ++++++++++
 configs/mx6ul_14x14_evk_defconfig                 |    3 +
 drivers/gpio/mxc_gpio.c                           |    4 +
 include/configs/mx6_common.h                      |   10 +-
 include/configs/mx6ul_14x14_evk.h                 |  221 +++++
 24 files changed, 2300 insertions(+), 115 deletions(-)
 create mode 100644 arch/arm/imx-common/syscounter.c
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6ul_pins.h
 create mode 100644 arch/arm/include/asm/imx-common/syscounter.h
 create mode 100644 board/freescale/mx6ul_14x14_evk/Kconfig
 create mode 100644 board/freescale/mx6ul_14x14_evk/MAINTAINERS
 create mode 100644 board/freescale/mx6ul_14x14_evk/Makefile
 create mode 100644 board/freescale/mx6ul_14x14_evk/imximage.cfg
 create mode 100644 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
 create mode 100644 configs/mx6ul_14x14_evk_defconfig
 create mode 100644 include/configs/mx6ul_14x14_evk.h
Signature · 1 line
1.8.4
author
#1 lore raw

PATCH 1/11 imx: mx6ul: Add i.MX6UL CPU type

Add MXC_CPU_MX6UL for i.MX6UL CPU type which is got at runtime. The 0x64 is defined as i.MX6UL CPU type value in Reference mannual, but the value has been occupied by i.MX6D as a dummy CPU type. So we also change i.MX6D to value 0x67.

---
 arch/arm/imx-common/cpu.c           | 2 ++
 arch/arm/include/asm/arch-imx/cpu.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/imx-common/cpu.c +2 -0
index 096d22e..e27546c 100644
@@ -138,6 +138,8 @@ const char *get_imx_type(u32 imxtype)
 		return "6SL";	/* Solo-Lite version of the mx6 */
 	case MXC_CPU_MX6SX:
 		return "6SX";   /* SoloX version of the mx6 */
+	case MXC_CPU_MX6UL:
+		return "6UL";   /* Ultra-Lite version of the mx6 */
 	case MXC_CPU_MX51:
 		return "51";
 	case MXC_CPU_MX53:
arch/arm/include/asm/arch-imx/cpu.h +2 -1
index 99e0e32..c7f9fff 100644
@@ -10,8 +10,9 @@
 #define MXC_CPU_MX6DL		0x61
 #define MXC_CPU_MX6SX		0x62
 #define MXC_CPU_MX6Q		0x63
-#define MXC_CPU_MX6D		0x64
+#define MXC_CPU_MX6UL		0x64
 #define MXC_CPU_MX6SOLO		0x65 /* dummy ID */
+#define MXC_CPU_MX6D		0x67
 #define MXC_CPU_MX6DP		0x68
 #define MXC_CPU_MX6QP		0x69
 
Signature · 1 line
1.8.4
#2 lore raw

PATCH 1/11 imx: mx6ul: Add i.MX6UL CPU type

Quoted 2 lines · Peng Fan

Add MXC_CPU_MX6UL for i.MX6UL CPU type which is got at runtime. The 0x64 is defined as i.MX6UL CPU type value in Reference mannual,

nit: manual, one N .

Quoted 1 line

but the value has been occupied by i.MX6D as a dummy CPU type.

Isn't the dummy ID for Solo ? ;-)

Quoted 4 lines

So we also change i.MX6D to value 0x67.

Best regards,
Marek Vasut

#3 lore raw

PATCH 1/11 imx: mx6ul: Add i.MX6UL CPU type

Hi Marek,

Quoted 9 lines · Marek Vasut
Quoted 2 lines · Peng Fan

Add MXC_CPU_MX6UL for i.MX6UL CPU type which is got at runtime. The 0x64 is defined as i.MX6UL CPU type value in Reference mannual,

nit: manual, one N .

Quoted 1 line

but the value has been occupied by i.MX6D as a dummy CPU type.

Isn't the dummy ID for Solo ? ;-)

About the dummy Id, it does not matter what the value is. You can look into function get_cpu_rev for i.MX6.

Quoted 10 lines
Quoted 5 lines

So we also change i.MX6D to value 0x67.

Best regards,
Marek Vasut

Regards,
Peng.

#4 lore raw

PATCH 1/11 imx: mx6ul: Add i.MX6UL CPU type

Quoted 1 line · Peng Fan

Hi Marek,

Hi!

Quoted 5 lines · Marek Vasut
Quoted 4 lines · Peng Fan
Quoted 2 lines

Add MXC_CPU_MX6UL for i.MX6UL CPU type which is got at runtime. The 0x64 is defined as i.MX6UL CPU type value in Reference mannual,

Quoted 8 lines
Quoted 5 lines

nit: manual, one N .

Quoted 1 line

but the value has been occupied by i.MX6D as a dummy CPU type.

Isn't the dummy ID for Solo ? ;-)

About the dummy Id, it does not matter what the value is. You can look into function get_cpu_rev for i.MX6.

Your patch description is incorrect nonetheless ;-)

Best regards,
Marek Vasut

author
#5 lore raw

PATCH 2/11 imx: mx6ul: Add pins IOMUX head file

In reply to Peng Fan

Add i.MX6UL pins IOMUX file which defines the IOMUX settings for choose.

---
 arch/arm/include/asm/arch-mx6/mx6-pins.h   |    2 +
 arch/arm/include/asm/arch-mx6/mx6ul_pins.h | 1065 ++++++++++++++++++++++++++++
 2 files changed, 1067 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6ul_pins.h
arch/arm/include/asm/arch-mx6/mx6-pins.h +2 -0
index 534f780..4b6bb18 100644
@@ -37,6 +37,8 @@ enum {
 #include "mx6sl_pins.h"
 #elif defined(CONFIG_MX6SX)
 #include "mx6sx_pins.h"
+#elif defined(CONFIG_MX6UL)
+#include "mx6ul_pins.h"
 #else
 #error "Please select cpu"
 #endif	/* CONFIG_MX6Q */
arch/arm/include/asm/arch-mx6/mx6ul_pins.h new file +1065 -0

1,065 lines not on this page · raw message

Signature · 1 line
1.8.4
#6 lore raw

PATCH 2/11 imx: mx6ul: Add pins IOMUX head file

Quoted 15 lines · Peng Fan

Add i.MX6UL pins IOMUX file which defines the IOMUX settings for choose.

---
 arch/arm/include/asm/arch-mx6/mx6-pins.h   |    2 +
 arch/arm/include/asm/arch-mx6/mx6ul_pins.h | 1065
++++++++++++++++++++++++++++ 2 files changed, 1067 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6ul_pins.h
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6-pins.h index 534f780..4b6bb18 100644

arch/arm/include/asm/arch-mx6/mx6-pins.h enum { · line 44

Quoted 8 lines
arch/arm/include/asm/arch-mx6/mx6-pins.h +2 -0
@@ -37,6 +37,8 @@ enum {
 #include "mx6sl_pins.h"
 #elif defined(CONFIG_MX6SX)
 #include "mx6sx_pins.h"
+#elif defined(CONFIG_MX6UL)
+#include "mx6ul_pins.h"
 #else
 #error "Please select cpu"
 #endif	/* CONFIG_MX6Q */

Would it be possible to build a single image for an entire MX6 lineup of CPUs ? I think it is now possible to build a single image for MX6 Quad/Dual/DualLite/Solo ... do SX and UL integrate well into this too? Seeing this patch, I don't think so ...

Quoted 3 lines
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6ul_pins.h new file mode 100644 index 0000000..c92b4f0

How very different is this from Solo or SoloX ? Is the pinmux map really that different that it needs a new file of it's own (I did not check) ?

Best regards,
Marek Vasut

#7 lore raw

PATCH 2/11 imx: mx6ul: Add pins IOMUX head file

Hi, Marek

Quoted 21 lines · Marek Vasut
Quoted 20 lines · Peng Fan

Add i.MX6UL pins IOMUX file which defines the IOMUX settings for choose.

---
 arch/arm/include/asm/arch-mx6/mx6-pins.h   |    2 +
 arch/arm/include/asm/arch-mx6/mx6ul_pins.h | 1065
++++++++++++++++++++++++++++ 2 files changed, 1067 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6ul_pins.h
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6-pins.h index 534f780..4b6bb18 100644

arch/arm/include/asm/arch-mx6/mx6-pins.h +2 -0
@@ -37,6 +37,8 @@ enum {
 #include "mx6sl_pins.h"
 #elif defined(CONFIG_MX6SX)
 #include "mx6sx_pins.h"
+#elif defined(CONFIG_MX6UL)
+#include "mx6ul_pins.h"
Quoted 8 lines

arch/arm/include/asm/arch-mx6/mx6-pins.h enum { · line 44

Quoted 3 lines
arch/arm/include/asm/arch-mx6/mx6-pins.h +0 -0
 #else
 #error "Please select cpu"
 #endif	/* CONFIG_MX6Q */

Would it be possible to build a single image for an entire MX6 lineup of CPUs ? I think it is now possible to build a single image for MX6 Quad/Dual/DualLite/Solo ... do SX and UL integrate well into this too? Seeing this patch, I don't think so ...

A single image you mean like linux kernel, one image cover all the arch/driver code, and using dts to cover board part?
If so, agree to build a single image for i.MX6, but dtb is not added now. To kernel, pinmux header are used for dtb, but now we do need this file to set pinmux in uboot board file.

SX and UL have different pinmux from others.

Quoted 8 lines
Quoted 4 lines
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6ul_pins.h new file mode 100644 index 0000000..c92b4f0

How very different is this from Solo or SoloX ? Is the pinmux map really that different that it needs a new file of it's own (I did not check) ?

SX and UL have different pinmux map.

Quoted 3 lines

Best regards,
Marek Vasut

Regards,
Peng.

#8 lore raw

PATCH 2/11 imx: mx6ul: Add pins IOMUX head file

Quoted 39 lines · Peng Fan

Hi, Marek

Quoted 27 lines · Marek Vasut
Quoted 26 lines · Peng Fan

Add i.MX6UL pins IOMUX file which defines the IOMUX settings for choose.

---

 arch/arm/include/asm/arch-mx6/mx6-pins.h   |    2 +
 arch/arm/include/asm/arch-mx6/mx6ul_pins.h | 1065

++++++++++++++++++++++++++++ 2 files changed, 1067 insertions(+)

 create mode 100644 arch/arm/include/asm/arch-mx6/mx6ul_pins.h
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6-pins.h index 534f780..4b6bb18 100644

arch/arm/include/asm/arch-mx6/mx6-pins.h +2 -0
@@ -37,6 +37,8 @@ enum {
 
 #include "mx6sl_pins.h"
 #elif defined(CONFIG_MX6SX)
 #include "mx6sx_pins.h"
 
+#elif defined(CONFIG_MX6UL)
+#include "mx6ul_pins.h"
 
Quoted 8 lines
Quoted 3 lines

#else
#error "Please select cpu"
#endif /* CONFIG_MX6Q */

Would it be possible to build a single image for an entire MX6 lineup of CPUs ? I think it is now possible to build a single image for MX6 Quad/Dual/DualLite/Solo ... do SX and UL integrate well into this too? Seeing this patch, I don't think so ...

Quoted 2 lines

A single image you mean like linux kernel, one image cover all the arch/driver code, and using dts to cover board part?

Eventually yes, but this can be done without DT too.

Quoted 3 lines

If so, agree to build a single image for i.MX6, but dtb is not added now. To kernel, pinmux header are used for dtb, but now we do need this file to set pinmux in uboot board file.

See arch/arm/include/asm/arch-mx6/mx6-pins.h and in particular CONFIG_MX6QDL option. It allows defining pins for both MX6Q and DL (and solo), thus you can build single image for a board which might use all three options. I think it should be possible to add SX and UL into this mix too.

Quoted 1 line

SX and UL have different pinmux from others.

OK

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/mx6ul_pins.h new file mode 100644 index 0000000..c92b4f0

How very different is this from Solo or SoloX ? Is the pinmux map really that different that it needs a new file of it's own (I did not check) ?

SX and UL have different pinmux map.

OK

Best regards,
Marek Vasut

author
#9 lore raw

PATCH 3/11 imx: mx6ul: Update imx registers head file

In reply to Peng Fan

Update imx register base address for i.MX6UL

---
 arch/arm/include/asm/arch-mx6/imx-regs.h | 60 ++++++++++++++++++++++----------
 1 file changed, 41 insertions(+), 19 deletions(-)
arch/arm/include/asm/arch-mx6/imx-regs.h +41 -19
index 35a324c..d78daac 100644
@@ -9,7 +9,11 @@
 
 #define ARCH_MXC
 
+#ifdef CONFIG_MX6UL
+#define CONFIG_SYS_CACHELINE_SIZE	64
+#else
 #define CONFIG_SYS_CACHELINE_SIZE	32
+#endif
 
 #define ROMCP_ARB_BASE_ADDR             0x00000000
 #define ROMCP_ARB_END_ADDR              0x000FFFFF
@@ -19,7 +23,7 @@
 #define GPU_2D_ARB_END_ADDR             0x02203FFF
 #define OPENVG_ARB_BASE_ADDR            0x02204000
 #define OPENVG_ARB_END_ADDR             0x02207FFF
-#elif CONFIG_MX6SX
+#elif (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 #define CAAM_ARB_BASE_ADDR              0x00100000
 #define CAAM_ARB_END_ADDR               0x00107FFF
 #define GPU_ARB_BASE_ADDR               0x01800000
@@ -28,10 +32,6 @@
 #define APBH_DMA_ARB_END_ADDR           0x0180BFFF
 #define M4_BOOTROM_BASE_ADDR			0x007F8000
 
-#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)
-
 #else
 #define CAAM_ARB_BASE_ADDR              0x00100000
 #define CAAM_ARB_END_ADDR               0x00103FFF
@@ -52,13 +52,13 @@
 #define MXS_BCH_BASE			(APBH_DMA_ARB_BASE_ADDR + 0x04000)
 
 /* GPV - PL301 configuration ports */
-#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX))
+#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 #define GPV2_BASE_ADDR                  0x00D00000
 #else
 #define GPV2_BASE_ADDR			0x00200000
 #endif
 
-#ifdef CONFIG_MX6SX
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 #define GPV3_BASE_ADDR			0x00E00000
 #define GPV4_BASE_ADDR			0x00F00000
 #define GPV5_BASE_ADDR			0x01000000
@@ -96,6 +96,11 @@
 #define QSPI0_AMBA_END                 0x6FFFFFFF
 #define QSPI1_AMBA_BASE                0x70000000
 #define QSPI1_AMBA_END                 0x7FFFFFFF
+#elif defined(CONFIG_MX6UL)
+#define WEIM_ARB_BASE_ADDR              0x50000000
+#define WEIM_ARB_END_ADDR               0x57FFFFFF
+#define QSPI0_AMBA_BASE                 0x60000000
+#define QSPI0_AMBA_END                  0x6FFFFFFF
 #else
 #define SATA_ARB_BASE_ADDR              0x02200000
 #define SATA_ARB_END_ADDR               0x02203FFF
@@ -111,7 +116,7 @@
 #define WEIM_ARB_END_ADDR               0x0FFFFFFF
 #endif
 
-#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX))
+#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 #define MMDC0_ARB_BASE_ADDR             0x80000000
 #define MMDC0_ARB_END_ADDR              0xFFFFFFFF
 #define MMDC1_ARB_BASE_ADDR             0xC0000000
@@ -179,8 +184,13 @@
 #define GPIO3_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x24000)
 #define GPIO4_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x28000)
 #define GPIO5_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x2C000)
+#ifdef CONFIG_MX6UL
+#define SNVS_LP_BASE_ADDR           (AIPS1_OFF_BASE_ADDR + 0x30000)
+#define ENET2_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x34000)
+#else
 #define GPIO6_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x30000)
 #define GPIO7_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x34000)
+#endif
 #define KPP_BASE_ADDR               (AIPS1_OFF_BASE_ADDR + 0x38000)
 #define WDOG1_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x3C000)
 #define WDOG2_BASE_ADDR             (AIPS1_OFF_BASE_ADDR + 0x40000)
@@ -249,6 +259,12 @@
 #define WEIM_BASE_ADDR              (AIPS2_OFF_BASE_ADDR + 0x38000)
 #define OCOTP_BASE_ADDR             (AIPS2_OFF_BASE_ADDR + 0x3C000)
 #define CSU_BASE_ADDR               (AIPS2_OFF_BASE_ADDR + 0x40000)
+#ifdef CONFIG_MX6UL
+#define CSI_BASE_ADDR               (AIPS2_OFF_BASE_ADDR + 0x44000)
+#define LCDIF1_BASE_ADDR            (AIPS2_OFF_BASE_ADDR + 0x48000)
+#define LCDIF2_BASE_ADDR            LCDIF1_BASE_ADDR
+#define PXP_BASE_ADDR               (AIPS2_OFF_BASE_ADDR + 0x4C000)
+#else
 #define IP2APB_PERFMON1_BASE_ADDR   (AIPS2_OFF_BASE_ADDR + 0x44000)
 #define IP2APB_PERFMON2_BASE_ADDR   (AIPS2_OFF_BASE_ADDR + 0x48000)
 #ifdef CONFIG_MX6SX
@@ -256,19 +272,23 @@
 #else
 #define IP2APB_PERFMON3_BASE_ADDR   (AIPS2_OFF_BASE_ADDR + 0x4C000)
 #endif
+#endif
 #define IP2APB_TZASC1_BASE_ADDR     (AIPS2_OFF_BASE_ADDR + 0x50000)
-#ifdef CONFIG_MX6SX
+#ifdef CONFIG_MX6UL
+#define SYSCNT_RD_IPS_BASE_ADDR     (AIPS2_OFF_BASE_ADDR + 0x54000)
+#define SYSCNT_CMP_IPS_BASE_ADDR    (AIPS2_OFF_BASE_ADDR + 0x58000)
+#define SYSCNT_CTRL_IPS_BASE_ADDR   (AIPS2_OFF_BASE_ADDR + 0x5C000)
+#define SCTR_BASE_ADDR              SYSCNT_CTRL_IPS_BASE_ADDR
+#define QSPI0_BASE_ADDR             (AIPS2_OFF_BASE_ADDR + 0x60000)
+#define WDOG3_BASE_ADDR             (AIPS2_OFF_BASE_ADDR + 0x64000)
+#elif defined(CONFIG_MX6SX)
 #define SAI1_BASE_ADDR              (AIPS2_OFF_BASE_ADDR + 0x54000)
-#else
-#define IP2APB_TZASC2_BASE_ADDR     (AIPS2_OFF_BASE_ADDR + 0x54000)
-#endif
 #define AUDMUX_BASE_ADDR            (AIPS2_OFF_BASE_ADDR + 0x58000)
-#define AUDMUX_BASE_ADDR            (AIPS2_OFF_BASE_ADDR + 0x58000)
-#ifdef CONFIG_MX6SX
 #define SAI2_BASE_ADDR              (AIPS2_OFF_BASE_ADDR + 0x5C000)
 #define QSPI0_BASE_ADDR             (AIPS2_OFF_BASE_ADDR + 0x60000)
 #define QSPI1_BASE_ADDR             (AIPS2_OFF_BASE_ADDR + 0x64000)
 #else
+#define IP2APB_TZASC2_BASE_ADDR     (AIPS2_OFF_BASE_ADDR + 0x54000)
 #define MIPI_CSI2_BASE_ADDR         (AIPS2_OFF_BASE_ADDR + 0x5C000)
 #define MIPI_DSI_BASE_ADDR          (AIPS2_OFF_BASE_ADDR + 0x60000)
 #define VDOA_BASE_ADDR              (AIPS2_OFF_BASE_ADDR + 0x64000)
@@ -313,7 +333,7 @@
 #define CHIP_REV_1_2                 0x12
 #define CHIP_REV_1_5                 0x15
 #define CHIP_REV_2_0                 0x20
-#ifndef CONFIG_MX6SX
+#if !(defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 #define IRAM_SIZE                    0x00040000
 #else
 #define IRAM_SIZE                    0x00020000
@@ -451,7 +471,7 @@ struct src {
 
 
 struct iomuxc {
-#ifdef CONFIG_MX6SX
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 	u8 reserved[0x4000];
 #endif
 	u32 gpr[14];
@@ -577,7 +597,7 @@ struct cspi_regs {
 #define MXC_CSPICON_POL		4  /* SCLK polarity */
 #define MXC_CSPICON_SSPOL	12 /* SS polarity */
 #define MXC_CSPICON_CTL		20 /* inactive state of SCLK */
-#if defined(CONFIG_MX6SL) || defined(CONFIG_MX6DL)
+#if defined(CONFIG_MX6SL) || defined(CONFIG_MX6DL) || defined(CONFIG_MX6UL)
 #define MXC_SPI_BASE_ADDRESSES \
 	ECSPI1_BASE_ADDR, \
 	ECSPI2_BASE_ADDR, \
@@ -661,7 +681,7 @@ struct fuse_bank1_regs {
 	u32	rsvd7[3];
 };
 
-#ifdef CONFIG_MX6SX
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 struct fuse_bank4_regs {
 	u32 sjc_resp_low;
 	u32 rsvd0[3];
@@ -674,7 +694,9 @@ struct fuse_bank4_regs {
 	u32 mac_addr2;
 	u32 rsvd4[7];
 	u32 gp1;
-	u32 rsvd5[7];
+	u32 rsvd5[3];
+	u32 gp2;
+	u32 rsvd6[3];
 };
 #else
 struct fuse_bank4_regs {
Signature · 1 line
1.8.4
#10 lore raw

PATCH 3/11 imx: mx6ul: Update imx registers head file

Quoted 14 lines · Peng Fan

Update imx register base address for i.MX6UL

---
 arch/arm/include/asm/arch-mx6/imx-regs.h | 60

++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 19 deletions(-)

(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/imx-regs.h index 35a324c..d78daac 100644

arch/arm/include/asm/arch-mx6/imx-regs.h line 14

Quoted 6 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +3 -0
@@ -9,7 +9,11 @@
 
 #define ARCH_MXC
 
+#ifdef CONFIG_MX6UL
+#define CONFIG_SYS_CACHELINE_SIZE	64
+#else

This doesn't seem like register base at all . This is cacheline size. The patch description is thus misleading. It also fails to explain this change ... probably because UL is C-A7 ?

arch/arm/include/asm/arch-mx6/imx-regs.h line 16

Quoted 2 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +1 -0
 #define CONFIG_SYS_CACHELINE_SIZE	32
+#endif

[...]

Best regards,
Marek Vasut

#11 lore raw

PATCH 3/11 imx: mx6ul: Update imx registers head file

Hi Marek,

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Peng Fan

Update imx register base address for i.MX6UL

---
 arch/arm/include/asm/arch-mx6/imx-regs.h | 60

++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 19 deletions(-)

(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/imx-regs.h index 35a324c..d78daac 100644

arch/arm/include/asm/arch-mx6/imx-regs.h +0 -0
@@ -9,7 +9,11 @@
 
 #define ARCH_MXC
 
Quoted 7 lines

arch/arm/include/asm/arch-mx6/imx-regs.h line 14

Quoted 3 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +3 -0
+#ifdef CONFIG_MX6UL
+#define CONFIG_SYS_CACHELINE_SIZE	64
+#else

This doesn't seem like register base at all . This is cacheline size. The patch description is thus misleading. It also fails to explain this change ... probably because UL is C-A7 ?

Will consider to split this part into a single patch, and fix in V2.

Quoted 7 lines

arch/arm/include/asm/arch-mx6/imx-regs.h line 16

Quoted 3 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +1 -0
 #define CONFIG_SYS_CACHELINE_SIZE	32
+#endif

[...]

Best regards,
Marek Vasut

Regards,
Peng

author
#12 lore raw

PATCH 4/11 imx-common: add syscounter driver

In reply to Peng Fan

syscounter exists on i.MX6UL and i.MX7D, so implement the driver in imx-common.
If want to use syscounter, define CONFIG_SYSCOUNTER_TIMER; if still want to use GPT timer, #define CONFIG_GPT_TIMER.

---
 arch/arm/imx-common/Makefile                 |   7 +-
 arch/arm/imx-common/syscounter.c             | 124 +++++++++++++++++++++++++++
 arch/arm/imx-common/timer.c                  |   8 +-
 arch/arm/include/asm/imx-common/syscounter.h |  29 +++++++
 4 files changed, 164 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/imx-common/syscounter.c
 create mode 100644 arch/arm/include/asm/imx-common/syscounter.h
arch/arm/imx-common/Makefile +6 -1
index b9f1ca4..947c452 100644
@@ -10,8 +10,11 @@
 ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610))
 obj-y	= iomux-v3.o
 endif
+ifeq ($(SOC),$(filter $(SOC),mx5))
+obj-y	+= timer.o
+endif
 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
-obj-y	+= timer.o cpu.o speed.o
+obj-y	+= cpu.o speed.o
 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
@@ -21,6 +24,8 @@ endif
 ifeq ($(SOC),$(filter $(SOC),mx6))
 obj-$(CONFIG_CMD_SATA) += sata.o
 obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
+obj-$(CONFIG_GPT_TIMER) += timer.o
+obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
 endif
 ifeq ($(SOC),$(filter $(SOC),vf610))
 obj-y += ddrmc-vf610.o
arch/arm/imx-common/syscounter.c new file +124 -0

124 lines not on this page · raw message

arch/arm/imx-common/timer.c +5 -3
index c12556a..7262107 100644
@@ -45,7 +45,8 @@ static inline int gpt_has_clk_source_osc(void)
 #if defined(CONFIG_MX6)
 	if (((is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) &&
 	    (soc_rev() > CHIP_REV_1_0)) || is_cpu_type(MXC_CPU_MX6DL) ||
-	     is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
+	     is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX) ||
+	     is_cpu_type(MXC_CPU_MX6UL))
 		return 1;
 
 	return 0;
@@ -103,10 +104,11 @@ int timer_init(void)
 	if (gpt_has_clk_source_osc()) {
 		i |= GPTCR_CLKSOURCE_OSC | GPTCR_TEN;
 
-		/* For DL/S, SX, set 24Mhz OSC Enable bit and prescaler */
+		/* For DL/S, SX, UL, set 24Mhz OSC Enable bit and prescaler */
 		if (is_cpu_type(MXC_CPU_MX6DL) ||
 		    is_cpu_type(MXC_CPU_MX6SOLO) ||
-		    is_cpu_type(MXC_CPU_MX6SX)) {
+		    is_cpu_type(MXC_CPU_MX6SX)||
+		    is_cpu_type(MXC_CPU_MX6UL)) {
 			i |= GPTCR_24MEN;
 
 			/* Produce 3Mhz clock */
arch/arm/include/asm/imx-common/syscounter.h new file +29 -0
new file mode 100644
index 0000000..ddb412e
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARCH_SYSTEM_COUNTER_H
+#define _ASM_ARCH_SYSTEM_COUNTER_H
+
+/* System Counter */
+struct sctr_regs {
+	u32 cntcr;
+	u32 cntsr;
+	u32 cntcv1;
+	u32 cntcv2;
+	u32 resv1[4];
+	u32 cntfid0;
+	u32 cntfid1;
+	u32 cntfid2;
+	u32 resv2[1001];
+	u32 counterid[1];
+};
+
+#define SC_CNTCR_ENABLE		(1 << 0)
+#define SC_CNTCR_HDBG		(1 << 1)
+#define SC_CNTCR_FREQ0		(1 << 8)
+#define SC_CNTCR_FREQ1		(1 << 9)
+
+#endif
Signature · 1 line
1.8.4
#13 lore raw

PATCH 4/11 imx-common: add syscounter driver

Quoted 7 lines · Peng Fan

syscounter exists on i.MX6UL and i.MX7D, so implement the driver in imx-common.
If want to use syscounter, define CONFIG_SYSCOUNTER_TIMER; if still want to use GPT timer, #define CONFIG_GPT_TIMER.

Quoted 9 lines
---
 arch/arm/imx-common/Makefile                 |   7 +-
 arch/arm/imx-common/syscounter.c             | 124
+++++++++++++++++++++++++++ arch/arm/imx-common/timer.c                  |
  8 +-
 arch/arm/include/asm/imx-common/syscounter.h |  29 +++++++
 4 files changed, 164 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/imx-common/syscounter.c
 create mode 100644 arch/arm/include/asm/imx-common/syscounter.h

Can this be converted to generic timer framework (see lib/time.c) ? I think it can , which would trim down this body of code considerably.

Best regards,
Marek Vasut

#14 lore raw

PATCH 4/11 imx-common: add syscounter driver

Hi Marek,

Quoted 18 lines · Marek Vasut
Quoted 7 lines · Peng Fan

syscounter exists on i.MX6UL and i.MX7D, so implement the driver in imx-common.
If want to use syscounter, define CONFIG_SYSCOUNTER_TIMER; if still want to use GPT timer, #define CONFIG_GPT_TIMER.

Quoted 9 lines
---
 arch/arm/imx-common/Makefile                 |   7 +-
 arch/arm/imx-common/syscounter.c             | 124
+++++++++++++++++++++++++++ arch/arm/imx-common/timer.c                  |
  8 +-
 arch/arm/include/asm/imx-common/syscounter.h |  29 +++++++
 4 files changed, 164 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/imx-common/syscounter.c
 create mode 100644 arch/arm/include/asm/imx-common/syscounter.h
Quoted 2 lines

Can this be converted to generic timer framework (see lib/time.c) ? I think it can , which would trim down this body of code considerably.

Will try lib/time.c. Thanks for suggestion.

Quoted 3 lines

Best regards,
Marek Vasut

Regards,
Peng.

author
#15 lore raw

PATCH 5/11 imx: mx6ul remove errata for i.MX6UL and use syscounter

In reply to Peng Fan

Since i.MX6UL use A7 core, but not A9 core, we do not need the erratas for i.MX6UL. Also use syscounter for i.MX6UL.

---
 include/configs/mx6_common.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
include/configs/mx6_common.h +7 -1
index b37477a..6808674 100644
@@ -17,11 +17,11 @@
 #ifndef __MX6_COMMON_H
 #define __MX6_COMMON_H
 
+#ifndef CONFIG_MX6UL
 #define CONFIG_ARM_ERRATA_743622
 #define CONFIG_ARM_ERRATA_751472
 #define CONFIG_ARM_ERRATA_794072
 #define CONFIG_ARM_ERRATA_761320
-#define CONFIG_BOARD_POSTCLK_INIT
 
 #ifndef CONFIG_SYS_L2CACHE_OFF
 #define CONFIG_SYS_L2_PL310
@@ -29,6 +29,12 @@
 #endif
 
 #define CONFIG_MP
+#define CONFIG_GPT_TIMER
+#else
+#define CONFIG_SYSCOUNTER_TIMER
+#define CONFIG_SC_TIMER_CLK	8000000 /* 8MHz */
+#endif
+#define CONFIG_BOARD_POSTCLK_INIT
 #define CONFIG_MXC_GPT_HCLK
 
 #define CONFIG_SYS_NO_FLASH
Signature · 1 line
1.8.4
author
#16 lore raw

PATCH 6/11 imx:mx6ul add clock support

In reply to Peng Fan

Add enet, uart, i2c, ipg clock support.

Correct get_periph_clk, should account for MXC_CCM_CBCDR_PERIPH_CLK2_PODF_MASK.

Refactor get_mmdc_ch0_clk to make all i.MX6 share one function, but not 'ifdef'

Use CONFIG_FSL_QSPI for enable_qspi_clk, but not #ifdef CONFIG_MX6SX. Use CONFIG_PCIE_IMX for pcie clock settings, use CONFIG_CMD_SATA for sata clock settings.
In this way, we not need "#if defined(CONFIG_MX6Q) || defined....", only need one CONFIG_PCIE_IMX in header file.

---
 arch/arm/cpu/armv7/mx6/clock.c           | 151 +++++++++++++++++++------------
 arch/arm/include/asm/arch-mx6/crm_regs.h |  79 ++++++++++------
 2 files changed, 143 insertions(+), 87 deletions(-)
arch/arm/cpu/armv7/mx6/clock.c +92 -59
index 3e94472..9cf4eec 100644
@@ -81,19 +81,32 @@ void enable_usboh3_clk(unsigned char enable)
 #if defined(CONFIG_FEC_MXC) && !defined(CONFIG_MX6SX)
 void enable_enet_clk(unsigned char enable)
 {
-	u32 mask = MXC_CCM_CCGR1_ENET_CLK_ENABLE_MASK;
+	u32 mask, *addr;
+
+	if (is_cpu_type(MXC_CPU_MX6UL)) {
+		mask = MXC_CCM_CCGR3_ENET_MASK;
+		addr = &imx_ccm->CCGR3;
+	} else {
+		mask = MXC_CCM_CCGR1_ENET_MASK;
+		addr = &imx_ccm->CCGR1;
+	}
 
 	if (enable)
-		setbits_le32(&imx_ccm->CCGR1, mask);
+		setbits_le32(addr, mask);
 	else
-		clrbits_le32(&imx_ccm->CCGR1, mask);
+		clrbits_le32(addr, mask);
 }
 #endif
 
 #ifdef CONFIG_MXC_UART
 void enable_uart_clk(unsigned char enable)
 {
-	u32 mask = MXC_CCM_CCGR5_UART_MASK | MXC_CCM_CCGR5_UART_SERIAL_MASK;
+	u32 mask;
+
+	if (is_cpu_type(MXC_CPU_MX6UL))
+		mask = MXC_CCM_CCGR5_UART_MASK;
+	else
+		mask = MXC_CCM_CCGR5_UART_MASK | MXC_CCM_CCGR5_UART_SERIAL_MASK;
 
 	if (enable)
 		setbits_le32(&imx_ccm->CCGR5, mask);
@@ -141,7 +154,7 @@ int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
 			reg &= ~mask;
 		__raw_writel(reg, &imx_ccm->CCGR2);
 	} else {
-		if (is_cpu_type(MXC_CPU_MX6SX)) {
+		if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL)) {
 			mask = MXC_CCM_CCGR6_I2C4_MASK;
 			addr = &imx_ccm->CCGR6;
 		} else {
@@ -214,9 +227,11 @@ static u32 mxc_get_pll_pfd(enum pll_clocks pll, int pfd_num)
 
 	switch (pll) {
 	case PLL_BUS:
-		if (pfd_num == 3) {
-			/* No PFD3 on PPL2 */
-			return 0;
+		if (!is_cpu_type(MXC_CPU_MX6UL)) {
+			if (pfd_num == 3) {
+				/* No PFD3 on PPL2 */
+				return 0;
+			}
 		}
 		div = __raw_readl(&imx_ccm->analog_pfd_528);
 		freq = (u64)decode_pll(PLL_BUS, MXC_HCLK);
@@ -248,10 +263,12 @@ static u32 get_mcu_main_clk(void)
 
 u32 get_periph_clk(void)
 {
-	u32 reg, freq = 0;
+	u32 reg, div = 0, freq = 0;
 
 	reg = __raw_readl(&imx_ccm->cbcdr);
 	if (reg & MXC_CCM_CBCDR_PERIPH_CLK_SEL) {
+		div = (reg & MXC_CCM_CBCDR_PERIPH_CLK2_PODF_MASK) >>
+		       MXC_CCM_CBCDR_PERIPH_CLK2_PODF_OFFSET;
 		reg = __raw_readl(&imx_ccm->cbcmr);
 		reg &= MXC_CCM_CBCMR_PERIPH_CLK2_SEL_MASK;
 		reg >>= MXC_CCM_CBCMR_PERIPH_CLK2_SEL_OFFSET;
@@ -291,7 +308,7 @@ u32 get_periph_clk(void)
 		}
 	}
 
-	return freq;
+	return freq / (div + 1);
 }
 
 static u32 get_ipg_clk(void)
@@ -311,7 +328,7 @@ static u32 get_ipg_per_clk(void)
 
 	reg = __raw_readl(&imx_ccm->cscmr1);
 	if (is_cpu_type(MXC_CPU_MX6SL) || is_cpu_type(MXC_CPU_MX6SX) ||
-	    is_mx6dqp()) {
+	    is_mx6dqp() || is_cpu_type(MXC_CPU_MX6UL)) {
 		if (reg & MXC_CCM_CSCMR1_PER_CLK_SEL_MASK)
 			return MXC_HCLK; /* OSC 24Mhz */
 	}
@@ -328,7 +345,7 @@ static u32 get_uart_clk(void)
 	reg = __raw_readl(&imx_ccm->cscdr1);
 
 	if (is_cpu_type(MXC_CPU_MX6SL) || is_cpu_type(MXC_CPU_MX6SX) ||
-	    is_mx6dqp()) {
+	    is_mx6dqp() || is_cpu_type(MXC_CPU_MX6UL)) {
 		if (reg & MXC_CCM_CSCDR1_UART_CLK_SEL)
 			freq = MXC_HCLK;
 	}
@@ -347,7 +364,8 @@ static u32 get_cspi_clk(void)
 	cspi_podf = (reg & MXC_CCM_CSCDR2_ECSPI_CLK_PODF_MASK) >>
 		     MXC_CCM_CSCDR2_ECSPI_CLK_PODF_OFFSET;
 
-	if (is_mx6dqp()) {
+	if (is_mx6dqp() || is_cpu_type(MXC_CPU_MX6SL) ||
+	    is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL)) {
 		if (reg & MXC_CCM_CSCDR2_ECSPI_CLK_SEL_MASK)
 			return MXC_HCLK / (cspi_podf + 1);
 	}
@@ -402,47 +420,60 @@ static u32 get_emi_slow_clk(void)
 	return root_freq / (emi_slow_podf + 1);
 }
 
-#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX))
 static u32 get_mmdc_ch0_clk(void)
 {
 	u32 cbcmr = __raw_readl(&imx_ccm->cbcmr);
 	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
-	u32 freq, podf;
 
-	podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH1_PODF_MASK) \
-			>> MXC_CCM_CBCDR_MMDC_CH1_PODF_OFFSET;
-
-	switch ((cbcmr & MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_MASK) >>
-		MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_OFFSET) {
-	case 0:
-		freq = decode_pll(PLL_BUS, MXC_HCLK);
-		break;
-	case 1:
-		freq = mxc_get_pll_pfd(PLL_BUS, 2);
-		break;
-	case 2:
-		freq = mxc_get_pll_pfd(PLL_BUS, 0);
-		break;
-	case 3:
-		/* static / 2 divider */
-		freq =  mxc_get_pll_pfd(PLL_BUS, 2) / 2;
+	u32 freq, podf, per2_clk2_podf;
+
+	if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL) ||
+	    is_cpu_type(MXC_CPU_MX6SL)) {
+		podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH1_PODF_MASK) >>
+			MXC_CCM_CBCDR_MMDC_CH1_PODF_OFFSET;
+		if (cbcdr & MXC_CCM_CBCDR_PERIPH2_CLK_SEL) {
+			per2_clk2_podf = (cbcdr & MXC_CCM_CBCDR_PERIPH2_CLK2_PODF_MASK) >>
+				MXC_CCM_CBCDR_PERIPH2_CLK2_PODF_OFFSET;
+			if (is_cpu_type(MXC_CPU_MX6SL)) {
+				if (cbcmr & MXC_CCM_CBCMR_PERIPH2_CLK2_SEL)
+					freq = MXC_HCLK;
+				else
+					freq = decode_pll(PLL_USBOTG, MXC_HCLK);
+			} else {
+				if (cbcmr & MXC_CCM_CBCMR_PERIPH2_CLK2_SEL)
+					freq = decode_pll(PLL_BUS, MXC_HCLK);
+				else
+					freq = decode_pll(PLL_USBOTG, MXC_HCLK);
+			}
+		} else {
+			per2_clk2_podf = 0;
+			switch ((cbcmr &
+				MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_MASK) >>
+				MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_OFFSET) {
+			case 0:
+				freq = decode_pll(PLL_BUS, MXC_HCLK);
+				break;
+			case 1:
+				freq = mxc_get_pll_pfd(PLL_BUS, 2);
+				break;
+			case 2:
+				freq = mxc_get_pll_pfd(PLL_BUS, 0);
+				break;
+			case 3:
+				/* static / 2 divider */
+				freq =  mxc_get_pll_pfd(PLL_BUS, 2) / 2;
+				break;
+			}
+		}
+		return freq / (podf + 1) / (per2_clk2_podf + 1);
+	} else {
+		podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
+			MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
+		return get_periph_clk() / (podf + 1);
 	}
-
-	return freq / (podf + 1);
-
 }
-#else
-static u32 get_mmdc_ch0_clk(void)
-{
-	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
-	u32 mmdc_ch0_podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
-				MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
 
-	return get_periph_clk() / (mmdc_ch0_podf + 1);
-}
-#endif
-
-#ifdef CONFIG_MX6SX
+#ifdef CONFIG_FSL_QSPI
 /* qspi_num can be from 0 - 1 */
 void enable_qspi_clk(int qspi_num)
 {
@@ -603,6 +634,7 @@ u32 imx_get_fecclk(void)
 	return mxc_get_clock(MXC_IPG_CLK);
 }
 
+#if defined(CONFIG_CMD_SATA) || defined(CONFIG_PCIE_IMX)
 static int enable_enet_pll(uint32_t en)
 {
 	struct mxc_ccm_reg *const imx_ccm
@@ -627,8 +659,9 @@ static int enable_enet_pll(uint32_t en)
 	writel(reg, &imx_ccm->analog_pll_enet);
 	return 0;
 }
+#endif
 
-#ifndef CONFIG_MX6SX
+#ifdef CONFIG_CMD_SATA
 static void ungate_sata_clock(void)
 {
 	struct mxc_ccm_reg *const imx_ccm =
@@ -637,18 +670,7 @@ static void ungate_sata_clock(void)
 	/* Enable SATA clock. */
 	setbits_le32(&imx_ccm->CCGR5, MXC_CCM_CCGR5_SATA_MASK);
 }
-#endif
-
-static void ungate_pcie_clock(void)
-{
-	struct mxc_ccm_reg *const imx_ccm =
-		(struct mxc_ccm_reg *)CCM_BASE_ADDR;
 
-	/* Enable PCIe clock. */
-	setbits_le32(&imx_ccm->CCGR4, MXC_CCM_CCGR4_PCIE_MASK);
-}
-
-#ifndef CONFIG_MX6SX
 int enable_sata_clock(void)
 {
 	ungate_sata_clock();
@@ -664,6 +686,16 @@ void disable_sata_clock(void)
 }
 #endif
 
+#ifdef CONFIG_PCIE_IMX
+static void ungate_pcie_clock(void)
+{
+	struct mxc_ccm_reg *const imx_ccm =
+		(struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+	/* Enable PCIe clock. */
+	setbits_le32(&imx_ccm->CCGR4, MXC_CCM_CCGR4_PCIE_MASK);
+}
+
 int enable_pcie_clock(void)
 {
 	struct anatop_regs *anatop_regs =
@@ -703,7 +735,7 @@ int enable_pcie_clock(void)
 	clrbits_le32(&ccm_regs->cbcmr, MXC_CCM_CBCMR_PCIE_AXI_CLK_SEL);
 
 	/* Party time! Ungate the clock to the PCIe. */
-#ifndef CONFIG_MX6SX
+#ifdef CONFIG_CMD_SATA
 	ungate_sata_clock();
 #endif
 	ungate_pcie_clock();
@@ -711,6 +743,7 @@ int enable_pcie_clock(void)
 	return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA |
 			       BM_ANADIG_PLL_ENET_ENABLE_PCIE);
 }
+#endif
 
 #ifdef CONFIG_SECURE_BOOT
 void hab_caam_clock_enable(unsigned char enable)
arch/arm/include/asm/arch-mx6/crm_regs.h +51 -28

210 lines not on this page · raw message

Signature · 1 line
1.8.4
author
#17 lore raw

PATCH 7/11 imx: mx6ul update soc related settings

In reply to Peng Fan

Add MX6UL in Kconfig, default select SYS_L2CACHE_OFF. update WDOG settings. No need to gate/ungate all PFDs for i.MX6UL.

---
 arch/arm/cpu/armv7/mx6/Kconfig | 4 ++++
 arch/arm/cpu/armv7/mx6/soc.c   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/mx6/Kconfig +4 -0
index 10908c4..fceba27 100644
@@ -25,6 +25,10 @@ config MX6SL
 config MX6SX
 	bool
 
+config MX6UL
+	select SYS_L2CACHE_OFF
+	bool
+
 choice
 	prompt "MX6 board select"
 	optional
arch/arm/cpu/armv7/mx6/soc.c +2 -2
index e80c09c..20abe3f 100644
@@ -317,7 +317,7 @@ static void imx_set_wdog_powerdown(bool enable)
 	struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR;
 	struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR;
 
-#ifdef CONFIG_MX6SX
+#if defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL)
 	struct wdog_regs *wdog3 = (struct wdog_regs *)WDOG3_BASE_ADDR;
 	writew(enable, &wdog3->wmcr);
 #endif
@@ -530,7 +530,7 @@ void s_init(void)
 	u32 mask528;
 	u32 reg, periph1, periph2;
 
-	if (is_cpu_type(MXC_CPU_MX6SX))
+	if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL))
 		return;
 
 	/* Due to hardware limitation, on MX6Q we need to gate/ungate all PFDs
Signature · 1 line
1.8.4
reviewer
#18 lore raw

PATCH 7/11 imx: mx6ul update soc related settings

Hi Peng,

Quoted 1 line · Peng Fan

Add MX6UL in Kconfig, default select SYS_L2CACHE_OFF.

Could you tell us more about this? Why L2 cache needs to be disabled?

Regards,

Fabio Estevam

#19 lore raw

PATCH 7/11 imx: mx6ul update soc related settings

In reply to Peng Fan
Quoted 1 line · Peng Fan

Add MX6UL in Kconfig, default select SYS_L2CACHE_OFF.

Why ?

Quoted 1 line

update WDOG settings.

I'd put this into separate patch, since L2 cache and watchdog are completely unrelated (and so is L2 cache and clock).

Quoted 4 lines

No need to gate/ungate all PFDs for i.MX6UL.

[...]

Best regards,
Marek Vasut

#20 lore raw

PATCH 7/11 imx: mx6ul update soc related settings

Hi, Marek and Fabio

Quoted 4 lines · Marek Vasut
Quoted 1 line · Peng Fan

Add MX6UL in Kconfig, default select SYS_L2CACHE_OFF.

Why ?

i.MX6UL features an Cortex-A7 core, it does not have PL310. As we know Cortex-A7 does not support L2 Cache open/close switch. When you enable D-Cache, L2 Cache default enabled. I'll add more commit msg to explain this.

Quoted 5 lines
Quoted 2 lines

update WDOG settings.

I'd put this into separate patch, since L2 cache and watchdog are completely unrelated (and so is L2 cache and clock).

Will split this patch into small patches.

Quoted 10 lines
Quoted 5 lines

No need to gate/ungate all PFDs for i.MX6UL.

[...]

Best regards,
Marek Vasut

Regards,
Peng.

#21 lore raw

PATCH 7/11 imx: mx6ul update soc related settings

Quoted 1 line · Peng Fan

Hi, Marek and Fabio

Hi,

Quoted 10 lines · Marek Vasut
Quoted 4 lines · Peng Fan
Quoted 1 line

Add MX6UL in Kconfig, default select SYS_L2CACHE_OFF.

Why ?

i.MX6UL features an Cortex-A7 core, it does not have PL310. As we know Cortex-A7 does not support L2 Cache open/close switch. When you enable D-Cache, L2 Cache default enabled. I'll add more commit msg to explain this.

Thanks, now you wrote yourself a nice commit message ;-)

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

update WDOG settings.

I'd put this into separate patch, since L2 cache and watchdog are completely unrelated (and so is L2 cache and clock).

Will split this patch into small patches.

Thanks!

Best regards,
Marek Vasut

author
#22 lore raw

PATCH 8/11 imx: mx6 add PAD_CTL_SPEED_LOW for i.MX6SX/UL

In reply to Peng Fan

PAD_CTL_SPEED_LOW for i.MX6SX/UL is (0 << 6)

---
 arch/arm/include/asm/imx-common/iomux-v3.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/include/asm/imx-common/iomux-v3.h +4 -0
index 2581019..7f9bb26 100644
@@ -98,7 +98,11 @@ typedef u64 iomux_v3_cfg_t;
 
 #define PAD_CTL_ODE		(1 << 11)
 
+#if defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL)
+#define PAD_CTL_SPEED_LOW	(0 << 6)
+#else
 #define PAD_CTL_SPEED_LOW	(1 << 6)
+#endif
 #define PAD_CTL_SPEED_MED	(2 << 6)
 #define PAD_CTL_SPEED_HIGH	(3 << 6)
 
Signature · 1 line
1.8.4
author
#23 lore raw

PATCH 9/11 mxc: gpio add i.MX6UL support

In reply to Peng Fan

i.MX6UL does not have GPIO6/7, so do not include them for i.MX6UL.

---
 drivers/gpio/mxc_gpio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/mxc_gpio.c +4 -0
index 2012f99..57a650f 100644
@@ -45,11 +45,15 @@ static unsigned long gpio_ports[] = {
 #endif
 #if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6)
 	[4] = GPIO5_BASE_ADDR,
+#ifndef CONFIG_MX6UL
 	[5] = GPIO6_BASE_ADDR,
 #endif
+#endif
 #if defined(CONFIG_MX53) || defined(CONFIG_MX6)
+#ifndef CONFIG_MX6UL
 	[6] = GPIO7_BASE_ADDR,
 #endif
+#endif
 };
 
 static int mxc_gpio_direction(unsigned int gpio,
Signature · 1 line
1.8.4
author
#24 lore raw

PATCH 10/11 mx6_common: Fix LOADADDR and SYS_TEXT_BASE for i.MX6UL

In reply to Peng Fan

ddr for i.MX6UL starts from 0x80000000

---
 include/configs/mx6_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mx6_common.h +1 -1
index 6808674..ccb2d04 100644
@@ -59,7 +59,7 @@
 #define CONFIG_REVISION_TAG
 
 /* Boot options */
-#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6SL))
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6SL) || defined(CONFIG_MX6UL))
 #define CONFIG_LOADADDR		0x82000000
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE	0x87800000
Signature · 1 line
1.8.4
#25 lore raw

PATCH 10/11 mx6_common: Fix LOADADDR and SYS_TEXT_BASE for i.MX6UL

Quoted 1 line · Peng Fan

ddr for i.MX6UL starts from 0x80000000

You really should work on your patch descriptions. I'm not asking you for essays, but at least a sentence starting with a capital letter and ending with a fullstop would be nice ...

Quoted 15 lines
---
 include/configs/mx6_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mx6_common.h +1 -1
index 6808674..ccb2d04 100644
@@ -59,7 +59,7 @@
 #define CONFIG_REVISION_TAG
 
 /* Boot options */
-#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6SL))
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6SL) ||
Quoted 3 lines

defined(CONFIG_MX6UL)) #define CONFIG_LOADADDR 0x82000000
#ifndef CONFIG_SYS_TEXT_BASE
#define CONFIG_SYS_TEXT_BASE 0x87800000

Best regards,
Marek Vasut

author
#26 lore raw

PATCH 11/11 imx: mx6ul_14x14_evk add basic board support

In reply to Peng Fan

Add USDHC, I2C, UART, 74LV, USB, QSPI support.

Boot Log:
U-Boot 2015.07-rc2-00085-gb5dc629 (Jul 02 2015 - 18:47:15 +0800)

CPU:   Freescale i.MX6UL rev1.0 792 MHz (running at 396 MHz)
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
---
 arch/arm/Kconfig                                  |   7 +
 board/freescale/mx6ul_14x14_evk/Kconfig           |  15 +
 board/freescale/mx6ul_14x14_evk/MAINTAINERS       |   6 +
 board/freescale/mx6ul_14x14_evk/Makefile          |   6 +
 board/freescale/mx6ul_14x14_evk/imximage.cfg      |  99 +++++
 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 502 ++++++++++++++++++++++
 configs/mx6ul_14x14_evk_defconfig                 |   3 +
 include/configs/mx6ul_14x14_evk.h                 | 221 ++++++++++
 8 files changed, 859 insertions(+)
 create mode 100644 board/freescale/mx6ul_14x14_evk/Kconfig
 create mode 100644 board/freescale/mx6ul_14x14_evk/MAINTAINERS
 create mode 100644 board/freescale/mx6ul_14x14_evk/Makefile
 create mode 100644 board/freescale/mx6ul_14x14_evk/imximage.cfg
 create mode 100644 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
 create mode 100644 configs/mx6ul_14x14_evk_defconfig
 create mode 100644 include/configs/mx6ul_14x14_evk.h
arch/arm/Kconfig +7 -0
index 3e07ecc..88da06c 100644
@@ -562,6 +562,12 @@ config TARGET_MX6SXSABRESD
 	select DM
 	select DM_THERMAL
 
+config TARGET_MX6UL_14X14_EVK
+	bool "Support mx6ul_14x14_evk"
+	select CPU_V7
+	select DM
+	select DM_THERMAL
+
 config TARGET_GW_VENTANA
 	bool "Support gw_ventana"
 	select CPU_V7
@@ -903,6 +909,7 @@ source "board/freescale/mx6qsabreauto/Kconfig"
 source "board/freescale/mx6sabresd/Kconfig"
 source "board/freescale/mx6slevk/Kconfig"
 source "board/freescale/mx6sxsabresd/Kconfig"
+source "board/freescale/mx6ul_14x14_evk/Kconfig"
 source "board/freescale/vf610twr/Kconfig"
 source "board/gateworks/gw_ventana/Kconfig"
 source "board/genesi/mx51_efikamx/Kconfig"
board/freescale/mx6ul_14x14_evk/Kconfig new file +15 -0
new file mode 100644
index 0000000..393aca6
@@ -0,0 +1,15 @@
+if TARGET_MX6UL_14X14_EVK
+
+config SYS_BOARD
+	default "mx6ul_14x14_evk"
+
+config SYS_VENDOR
+	default "freescale"
+
+config SYS_SOC
+	default "mx6"
+
+config SYS_CONFIG_NAME
+	default "mx6ul_14x14_evk"
+
+endif
board/freescale/mx6ul_14x14_evk/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..fe65153
@@ -0,0 +1,6 @@
+MX6ULEVK BOARD
+M:	Peng Fan <[email protected]>
+S:	Maintained
+F:	board/freescale/mx6ulevk/
+F:	include/configs/mx6ulevk.h
+F:	configs/mx6ulevk_defconfig
board/freescale/mx6ul_14x14_evk/Makefile new file +6 -0
new file mode 100644
index 0000000..61f6778
@@ -0,0 +1,6 @@
+# (C) Copyright 2015 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y  := mx6ul_14x14_evk.o
board/freescale/mx6ul_14x14_evk/imximage.cfg new file +99 -0

99 lines not on this page · raw message

board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c new file +502 -0

502 lines not on this page · raw message

configs/mx6ul_14x14_evk_defconfig new file +3 -0
new file mode 100644
index 0000000..b4fd39e
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ul_14x14_evk/imximage.cfg,MX6UL"
+CONFIG_ARM=y
+CONFIG_TARGET_MX6UL_14X14_EVK=y
include/configs/mx6ul_14x14_evk.h new file +221 -0

221 lines not on this page · raw message

Signature · 1 line
1.8.4
reviewer
#27 lore raw

PATCH 11/11 imx: mx6ul_14x14_evk add basic board support

Quoted 1 line · Peng Fan

+#if defined(CONFIG_MX6UL_EVK_EMMC_REWORK)

Why do we need this config option?

When should a user select it? Please explain it.

Regards,

Fabio Estevam

#28 lore raw

PATCH 11/11 imx: mx6ul_14x14_evk add basic board support

Hi Fabio,

Quoted 6 lines · Fabio Estevam
Quoted 1 line · Peng Fan

+#if defined(CONFIG_MX6UL_EVK_EMMC_REWORK)

Why do we need this config option?

This board default support sd. If want to use emmc, need to rework the board. So introduce this option.

Quoted 1 line

When should a user select it? Please explain it.

Will fix in V2.

Quoted 4 lines

Regards,

Fabio Estevam

Regards,
Peng.

#29 lore raw

PATCH 11/11 imx: mx6ul_14x14_evk add basic board support

In reply to Peng Fan
Quoted 18 lines · Peng Fan

Add USDHC, I2C, UART, 74LV, USB, QSPI support.

Boot Log:
U-Boot 2015.07-rc2-00085-gb5dc629 (Jul 02 2015 - 18:47:15 +0800)

CPU:   Freescale i.MX6UL rev1.0 792 MHz (running at 396 MHz)
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
Quoted 8 lines
---
 arch/arm/Kconfig                                  |   7 +
 board/freescale/mx6ul_14x14_evk/Kconfig           |  15 +
 board/freescale/mx6ul_14x14_evk/MAINTAINERS       |   6 +
 board/freescale/mx6ul_14x14_evk/Makefile          |   6 +
 board/freescale/mx6ul_14x14_evk/imximage.cfg      |  99 +++++

I think you should consider switching this board to SPL and get rid of this imximage way of configuring DDR DRAM from the getgo.

Quoted 4 lines
 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 502
++++++++++++++++++++++ configs/mx6ul_14x14_evk_defconfig                 |
  3 +
 include/configs/mx6ul_14x14_evk.h                 | 221 ++++++++++
Quoted 8 lines
 8 files changed, 859 insertions(+)
 create mode 100644 board/freescale/mx6ul_14x14_evk/Kconfig
 create mode 100644 board/freescale/mx6ul_14x14_evk/MAINTAINERS
 create mode 100644 board/freescale/mx6ul_14x14_evk/Makefile
 create mode 100644 board/freescale/mx6ul_14x14_evk/imximage.cfg
 create mode 100644 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
 create mode 100644 configs/mx6ul_14x14_evk_defconfig
 create mode 100644 include/configs/mx6ul_14x14_evk.h

[...]

Best regards,
Marek Vasut