Skip to contentSkip to conversation

mx6: Add support for the mx6solox variant

PATCH Superseded Fabio Estevam 1 participant 4 messages Jun 23, 2014

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v4 1/4 mx6: Add support for the mx6solox variant

From: Fabio Estevam <[email protected]>

mx6solox is the newest member of the mx6 family.

Some of the new features on this variants are:
- Cortex M4 microcontroller (besides the CortexA9)
- Dual Gigabit Ethernet

Add the initial support for it.

---
Changes since v3:
- Add missing is_cpu_type(MXC_CPU_MX6SL)
Changes since v2:
- Improve commit log
- Use is_cpu_type() when possible

 arch/arm/cpu/armv7/mx6/clock.c            |  11 +-
 arch/arm/cpu/armv7/mx6/soc.c              |  26 +++++
 arch/arm/imx-common/cpu.c                 |   2 +
 arch/arm/include/asm/arch-imx/cpu.h       |   3 +-
 arch/arm/include/asm/arch-mx6/crm_regs.h  | 170 ++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-mx6/imx-regs.h  | 122 ++++++++++++++++++++-
 arch/arm/include/asm/arch-mx6/mx6-ddr.h   |   4 +
 arch/arm/include/asm/arch-mx6/mx6sx-ddr.h |  45 ++++++++
 8 files changed, 373 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6sx-ddr.h
arch/arm/cpu/armv7/mx6/clock.c +6 -5
index bd65a08..25bee6c 100644
@@ -214,10 +214,11 @@ static u32 get_uart_clk(void)
 	u32 reg, uart_podf;
 	u32 freq = decode_pll(PLL_USBOTG, MXC_HCLK) / 6; /* static divider */
 	reg = __raw_readl(&imx_ccm->cscdr1);
-#ifdef CONFIG_MX6SL
-	if (reg & MXC_CCM_CSCDR1_UART_CLK_SEL)
-		freq = MXC_HCLK;
-#endif
+
+	if (is_cpu_type(MXC_CPU_MX6SL) || is_cpu_type(MXC_CPU_MX6SX))
+		if (reg & MXC_CCM_CSCDR1_UART_CLK_SEL)
+			freq = MXC_HCLK;
+
 	reg &= MXC_CCM_CSCDR1_UART_CLK_PODF_MASK;
 	uart_podf = reg >> MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET;
 
@@ -282,7 +283,7 @@ static u32 get_emi_slow_clk(void)
 	return root_freq / (emi_slow_podf + 1);
 }
 
-#ifdef CONFIG_MX6SL
+#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX))
 static u32 get_mmdc_ch0_clk(void)
 {
 	u32 cbcmr = __raw_readl(&imx_ccm->cbcmr);
arch/arm/cpu/armv7/mx6/soc.c +26 -0
index 1725279..e394e3f 100644
@@ -79,9 +79,15 @@ u32 __weak get_board_rev(void)
 void init_aips(void)
 {
 	struct aipstz_regs *aips1, *aips2;
+#ifdef CONFIG_MX6SX
+	struct aipstz_regs *aips3;
+#endif
 
 	aips1 = (struct aipstz_regs *)AIPS1_BASE_ADDR;
 	aips2 = (struct aipstz_regs *)AIPS2_BASE_ADDR;
+#ifdef CONFIG_MX6SX
+	aips3 = (struct aipstz_regs *)AIPS3_BASE_ADDR;
+#endif
 
 	/*
 	 * Set all MPROTx to be non-bufferable, trusted for R/W,
@@ -107,6 +113,26 @@ void init_aips(void)
 	writel(0x00000000, &aips2->opacr2);
 	writel(0x00000000, &aips2->opacr3);
 	writel(0x00000000, &aips2->opacr4);
+
+#ifdef CONFIG_MX6SX
+	/*
+	 * Set all MPROTx to be non-bufferable, trusted for R/W,
+	 * not forced to user-mode.
+	 */
+	writel(0x77777777, &aips3->mprot0);
+	writel(0x77777777, &aips3->mprot1);
+
+	/*
+	 * Set all OPACRx to be non-bufferable, not require
+	 * supervisor privilege level for access,allow for
+	 * write access and untrusted master access.
+	 */
+	writel(0x00000000, &aips3->opacr0);
+	writel(0x00000000, &aips3->opacr1);
+	writel(0x00000000, &aips3->opacr2);
+	writel(0x00000000, &aips3->opacr3);
+	writel(0x00000000, &aips3->opacr4);
+#endif
 }
 
 static void clear_ldo_ramp(void)
arch/arm/imx-common/cpu.c +2 -0
index 5a09107..7bb0e83 100644
@@ -112,6 +112,8 @@ const char *get_imx_type(u32 imxtype)
 		return "6SOLO";	/* Solo version of the mx6 */
 	case MXC_CPU_MX6SL:
 		return "6SL";	/* Solo-Lite version of the mx6 */
+	case MXC_CPU_MX6SX:
+		return "6SX";   /* SoloX 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 a35940e..a3cc96f 100644
@@ -8,6 +8,7 @@
 #define MXC_CPU_MX53		0x53
 #define MXC_CPU_MX6SL		0x60
 #define MXC_CPU_MX6DL		0x61
-#define MXC_CPU_MX6SOLO		0x62
+#define MXC_CPU_MX6SX		0x62
 #define MXC_CPU_MX6Q		0x63
 #define MXC_CPU_MX6D		0x64
+#define MXC_CPU_MX6SOLO		0x65 /* dummy ID */
arch/arm/include/asm/arch-mx6/crm_regs.h +170 -0

455 lines not on this page · raw message

arch/arm/include/asm/arch-mx6/imx-regs.h +118 -4

227 lines not on this page · raw message

arch/arm/include/asm/arch-mx6/mx6-ddr.h +4 -0
index d544d2e..5ebabfa 100644
@@ -13,7 +13,11 @@
 #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
 #include "mx6dl-ddr.h"
 #else
+#ifdef CONFIG_MX6SX
+#include "mx6sx-ddr.h"
+#else
 #error "Please select cpu"
+#endif	/* CONFIG_MX6SX */
 #endif	/* CONFIG_MX6DL or CONFIG_MX6S */
 #endif	/* CONFIG_MX6Q */
 #else
arch/arm/include/asm/arch-mx6/mx6sx-ddr.h new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.8.3.2
author reviewer
#1 lore raw

PATCH v4 2/4 mx6sx: Add pin definitions

From: Fabio Estevam <[email protected]>

Add the pin definitions for mx6sx.

---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- None

 arch/arm/include/asm/arch-mx6/mx6-pins.h   |    2 +
 arch/arm/include/asm/arch-mx6/mx6sx_pins.h | 1675 ++++++++++++++++++++++++++++
 2 files changed, 1677 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6sx_pins.h
arch/arm/include/asm/arch-mx6/mx6-pins.h +2 -0
index dcd7f8f..534f780 100644
@@ -35,6 +35,8 @@ enum {
 };
 #elif defined(CONFIG_MX6SL)
 #include "mx6sl_pins.h"
+#elif defined(CONFIG_MX6SX)
+#include "mx6sx_pins.h"
 #else
 #error "Please select cpu"
 #endif	/* CONFIG_MX6Q */
arch/arm/include/asm/arch-mx6/mx6sx_pins.h new file +1675 -0

1,675 lines not on this page · raw message

Signature · 1 line
1.8.3.2
author reviewer
#2 lore raw

PATCH v4 3/4 mx6: clock: Do not enable sata and ipu clocks

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

mx6sx does not have sata nor ipu blocks, so do not handle such clocks.

---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- None

 arch/arm/cpu/armv7/mx6/clock.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/cpu/armv7/mx6/clock.c +8 -0
index d31fbbd..51c964c 100644
@@ -437,6 +437,7 @@ static int enable_enet_pll(uint32_t en)
 	return 0;
 }
 
+#ifndef CONFIG_MX6SX
 static void ungate_sata_clock(void)
 {
 	struct mxc_ccm_reg *const imx_ccm =
@@ -445,6 +446,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)
 {
@@ -455,11 +457,13 @@ static void ungate_pcie_clock(void)
 	setbits_le32(&imx_ccm->CCGR4, MXC_CCM_CCGR4_PCIE_MASK);
 }
 
+#ifndef CONFIG_MX6SX
 int enable_sata_clock(void)
 {
 	ungate_sata_clock();
 	return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA);
 }
+#endif
 
 int enable_pcie_clock(void)
 {
@@ -491,7 +495,9 @@ 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
 	ungate_sata_clock();
+#endif
 	ungate_pcie_clock();
 
 	return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA |
@@ -573,6 +579,7 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#ifndef CONFIG_MX6SX
 void enable_ipu_clock(void)
 {
 	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
@@ -581,6 +588,7 @@ void enable_ipu_clock(void)
 	reg |= MXC_CCM_CCGR3_IPU1_IPU_MASK;
 	writel(reg, &mxc_ccm->CCGR3);
 }
+#endif
 /***************************************************/
 
 U_BOOT_CMD(
Signature · 1 line
1.8.3.2
author reviewer
#3 lore raw

PATCH v4 4/4 mx6sx: Add initial support for mx6sxsabresd board

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

---
Changes since v3:
- None
Changes since v2:
- Adjust CONFIG_LOADADDR
Changes since v1:
- Previous commit log belonged to 1/4 patch, so moved it to the correct patch

 board/freescale/mx6sxsabresd/Makefile       |   6 +
 board/freescale/mx6sxsabresd/imximage.cfg   | 105 ++++++++++++++++
 board/freescale/mx6sxsabresd/mx6sxsabresd.c |  95 ++++++++++++++
 boards.cfg                                  |   1 +
 include/configs/mx6sxsabresd.h              | 186 ++++++++++++++++++++++++++++
 5 files changed, 393 insertions(+)
 create mode 100644 board/freescale/mx6sxsabresd/Makefile
 create mode 100644 board/freescale/mx6sxsabresd/imximage.cfg
 create mode 100644 board/freescale/mx6sxsabresd/mx6sxsabresd.c
 create mode 100644 include/configs/mx6sxsabresd.h
board/freescale/mx6sxsabresd/Makefile new file +6 -0
new file mode 100644
index 0000000..97dbfda
@@ -0,0 +1,6 @@
+# (C) Copyright 2014 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y  := mx6sxsabresd.o
board/freescale/mx6sxsabresd/imximage.cfg new file +105 -0

105 lines not on this page · raw message

board/freescale/mx6sxsabresd/mx6sxsabresd.c new file +95 -0

95 lines not on this page · raw message

boards.cfg +1 -0
index fd4324d..b726feb 100644
@@ -328,6 +328,7 @@ Active  arm         armv7          mx6         freescale       mx6qsabreauto
 Active  arm         armv7          mx6         freescale       mx6sabresd          mx6dlsabresd                          mx6sabresd:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL                                                             Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         freescale       mx6sabresd          mx6qsabresd                           mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q                                                           Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         freescale       mx6slevk            mx6slevk                              mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL                                                                   Fabio Estevam <[email protected]>
+Active  arm         armv7          mx6         freescale       mx6sxsabresd          mx6sxsabresd                              mx6sxsabresd:IMX_CONFIG=board/freescale/mx6sxsabresd/imximage.cfg,MX6SX                                                                  Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         gateworks       gw_ventana          gwventana                            gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6QDL,SPL                                                  Tim Harvey <[email protected]>
 Active  arm         armv7          mx6         solidrun        hummingboard        hummingboard_solo                     hummingboard:IMX_CONFIG=board/solidrun/hummingboard/solo.cfg,MX6S,DDR_MB=512                                                      Jon Nettleton <[email protected]>
 Active  arm         armv7          omap3       -               overo               omap3_overo                           -                                                                                                                                 Steve Sakoman <[email protected]>
include/configs/mx6sxsabresd.h new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
1.8.3.2