Skip to contentSkip to conversation

ARM: armv7: Make indirect vector addresses globl

PATCH New Marek Vasut 3 participants 26 messages Nov 11, 2013 – Dec 3, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ARM: armv7: Make indirect vector addresses globl

Make indirect vectors addresses global, so they can be replaced by various code that needs to do so. For example the MX6 PCI express driver needs to temporarily replace data abort handler when reading the config space.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/start.S | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/cpu/armv7/start.S +7 -0
index 6c9b11a..5aac773 100644
@@ -38,12 +38,19 @@ _irq:			.word _irq
 _fiq:			.word _fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
 #else
+.globl _undefined_instruction
 _undefined_instruction: .word undefined_instruction
+.globl _software_interrupt
 _software_interrupt:	.word software_interrupt
+.globl _prefetch_abort
 _prefetch_abort:	.word prefetch_abort
+.globl _data_abort
 _data_abort:		.word data_abort
+.globl _not_used
 _not_used:		.word not_used
+.globl _irq
 _irq:			.word irq
+.globl _fiq
 _fiq:			.word fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
 #endif	/* CONFIG_SPL_BUILD */
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/5 ARM: armv7: Make indirect vector addresses globl

Hi

+Cc Sinan

Quoted 26 lines

Make indirect vectors addresses global, so they can be replaced by various code that needs to do so. For example the MX6 PCI express driver needs to temporarily replace data abort handler when reading the config space.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/start.S | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/cpu/armv7/start.S +3 -0
index 6c9b11a..5aac773 100644
@@ -38,12 +38,19 @@ _irq:			.word _irq
 _fiq:			.word _fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
 #else
+.globl _undefined_instruction
 _undefined_instruction: .word undefined_instruction
+.globl _software_interrupt
 _software_interrupt:	.word software_interrupt
+.globl _prefetch_abort
 _prefetch_abort:	.word prefetch_abort

arch/arm/cpu/armv7/start.S _irq: .word _irq · line 56

Quoted 10 lines
arch/arm/cpu/armv7/start.S +4 -0
+.globl _data_abort
 _data_abort:		.word data_abort
+.globl _not_used
 _not_used:		.word not_used
+.globl _irq
 _irq:			.word irq
+.globl _fiq
 _fiq:			.word fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
 #endif	/* CONFIG_SPL_BUILD */

Best regards,
Marek Vasut

#2 lore raw

PATCH 2/5 ARM: lib: Add cpu_clock_teardown() call

In reply to Marek Vasut

Add cpu_clock_teardown() call before the Linux kernel is started, so the CPU code can stop clock that may hinder the Linux's boot.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/cpu/armv7/cpu.c +4 -0
index 01cdb7e..75f8a33 100644
@@ -23,6 +23,7 @@
 #include <linux/compiler.h>
 
 void __weak cpu_cache_initialization(void){}
+void __weak cpu_clock_teardown(void) {}
 
 int cleanup_before_linux(void)
 {
@@ -66,5 +67,8 @@ int cleanup_before_linux(void)
 	 */
 	cpu_cache_initialization();
 
+	/* Let CPUs stop clock that might hinder Linux's boot. */
+	cpu_clock_teardown();
+
 	return 0;
 }
Signature · 1 line
1.8.4.rc3
#3 lore raw

PATCH 2/5 ARM: lib: Add cpu_clock_teardown() call

Quoted 7 lines · Marek Vasut

Add cpu_clock_teardown() call before the Linux kernel is started, so the CPU code can stop clock that may hinder the Linux's boot.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#4 lore raw

PATCH 2/5 ARM: lib: Add cpu_clock_teardown() call

Hi,

Quoted 10 lines · Marek Vasut
Quoted 7 lines

Add cpu_clock_teardown() call before the Linux kernel is started, so the CPU code can stop clock that may hinder the Linux's boot.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Albert, you OK with this one ?

Best regards,
Marek Vasut

#5 lore raw

PATCH 2/5 ARM: lib: Add cpu_clock_teardown() call

Hi Marek,

Quoted 6 lines · Marek Vasut

Hi,

Quoted 4 lines · Marek Vasut
Quoted 3 lines

Add cpu_clock_teardown() call before the Linux kernel is started, so the CPU code can stop clock that may hinder the Linux's boot.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Albert, you OK with this one ?

I'll wait before pushing to the server.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#6 lore raw

PATCH 3/5 ARM: mx6: Add PCI express clock configuration

In reply to Marek Vasut

Split the SATA clock enabling function and add PCI express clock enabling function. The SATA clock enabling function starts up the 100MHz SATA reference PLL in ENET_PLL register, but the code can be re-used to enable the 125MHz PCIe reference in ENET_PLL, so pull this code into separate function. Moreover, add the PCIe clock enabling code.

Cc Albert Aribaud <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/mx6/clock.c        | 84 ++++++++++++++++++++++++++++++-----
 arch/arm/include/asm/arch-mx6/clock.h |  1 +
 2 files changed, 75 insertions(+), 10 deletions(-)
arch/arm/cpu/armv7/mx6/clock.c +74 -10
index df11678..3101cb9 100644
@@ -376,17 +376,12 @@ u32 imx_get_fecclk(void)
 	return decode_pll(PLL_ENET, MXC_HCLK);
 }
 
-int enable_sata_clock(void)
+static int enable_enet_pll(uint32_t en)
 {
-	u32 reg = 0;
-	s32 timeout = 100000;
 	struct mxc_ccm_reg *const imx_ccm
 		= (struct mxc_ccm_reg *) CCM_BASE_ADDR;
-
-	/* Enable sata clock */
-	reg = readl(&imx_ccm->CCGR5); /* CCGR5 */
-	reg |= MXC_CCM_CCGR5_SATA_MASK;
-	writel(reg, &imx_ccm->CCGR5);
+	s32 timeout = 100000;
+	u32 reg = 0;
 
 	/* Enable PLLs */
 	reg = readl(&imx_ccm->analog_pll_enet);
@@ -401,10 +396,79 @@ int enable_sata_clock(void)
 		return -EIO;
 	reg &= ~BM_ANADIG_PLL_SYS_BYPASS;
 	writel(reg, &imx_ccm->analog_pll_enet);
-	reg |= BM_ANADIG_PLL_ENET_ENABLE_SATA;
+	reg |= en;
 	writel(reg, &imx_ccm->analog_pll_enet);
+	return 0;
+}
+
+static void ungate_sata_clock(void)
+{
+	struct mxc_ccm_reg *const imx_ccm =
+		(struct mxc_ccm_reg *) CCM_BASE_ADDR;
+
+	/* Enable SATA clock. */
+	setbits_le32(&imx_ccm->CCGR5, MXC_CCM_CCGR5_SATA_MASK);
+}
+
+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_sata_clock(void)
+{
+	ungate_sata_clock();
+	return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA);
+}
+
+int enable_pcie_clock(void)
+{
+	struct anatop_regs *anatop_regs =
+		(struct anatop_regs *)ANATOP_BASE_ADDR;
+	struct mxc_ccm_reg *ccm_regs = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+	/*
+	 * Here be dragons!
+	 *
+	 * The register ANATOP_MISC1 is not documented in the Freescale
+	 * MX6RM. The register that is mapped in the ANATOP space and
+	 * marked as ANATOP_MISC1 is actually documented in the PMU section
+	 * of the datasheet as PMU_MISC1.
+	 *
+	 * Switch LVDS clock source to SATA (0xb), disable clock INPUT and
+	 * enable clock OUTPUT. This is important for PCI express link that
+	 * is clocked from the i.MX6.
+	 */
+#define ANADIG_ANA_MISC1_LVDSCLK1_IBEN		(1 << 12)
+#define ANADIG_ANA_MISC1_LVDSCLK1_OBEN		(1 << 10)
+#define ANADIG_ANA_MISC1_LVDS1_CLK_SEL_MASK	0x0000001F
+	clrsetbits_le32(&anatop_regs->ana_misc1,
+			ANADIG_ANA_MISC1_LVDSCLK1_IBEN |
+			ANADIG_ANA_MISC1_LVDS1_CLK_SEL_MASK,
+			ANADIG_ANA_MISC1_LVDSCLK1_OBEN | 0xb);
+
+	/* PCIe reference clock sourced from AXI. */
+	clrbits_le32(&ccm_regs->cbcmr, MXC_CCM_CBCMR_PCIE_AXI_CLK_SEL);
+
+	/* Party time! Ungate the clock to the PCIe. */
+	ungate_sata_clock();
+	ungate_pcie_clock();
+
+	return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA |
+			       BM_ANADIG_PLL_ENET_ENABLE_PCIE);
+}
+
+void cpu_clock_teardown(void)
+{
+	struct anatop_regs *anatop_regs =
+		(struct anatop_regs *)ANATOP_BASE_ADDR;
 
-	return 0 ;
+	/* Stop the PCIe/LVDS clock source before booting Linux. */
+	writel(0, &anatop_regs->ana_misc1);
 }
 
 unsigned int mxc_get_clock(enum mxc_clock clk)
arch/arm/include/asm/arch-mx6/clock.h +1 -0
index 93f29a7..95b1270 100644
@@ -48,6 +48,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk);
 void enable_ocotp_clk(unsigned char enable);
 void enable_usboh3_clk(unsigned char enable);
 int enable_sata_clock(void);
+int enable_pcie_clock(void);
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
 void enable_ipu_clock(void);
 int enable_fec_anatop_clock(void);
Signature · 1 line
1.8.4.rc3
#7 lore raw

PATCH 3/5 ARM: mx6: Add PCI express clock configuration

Quoted 7 lines · Marek Vasut

Split the SATA clock enabling function and add PCI express clock enabling function. The SATA clock enabling function starts up the 100MHz SATA reference PLL in ENET_PLL register, but the code can be re-used to enable the 125MHz PCIe reference in ENET_PLL, so pull this code into separate function. Moreover, add the PCIe clock enabling code.

Quoted 5 lines
Cc Albert Aribaud <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#8 lore raw

PATCH 4/5 ARM: mx6: Add PCI express driver

In reply to Marek Vasut

Add PCIe driver for the Freescale i.MX6 SoC . This driver operates the PCIe block in RC mode only, the EP mode is NOT supported. The driver is tested with the Intel e1000 NIC driver.

Cc Albert Aribaud <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/include/asm/arch-mx6/iomux.h |  30 ++
 drivers/pci/Makefile                  |   1 +
 drivers/pci/pcie_imx.c                | 560 ++++++++++++++++++++++++++++++++++
 3 files changed, 591 insertions(+)
 create mode 100644 drivers/pci/pcie_imx.c
arch/arm/include/asm/arch-mx6/iomux.h +30 -0
index ff13a1e..bf727a9 100644
@@ -10,6 +10,36 @@
 #define MX6_IOMUXC_GPR7		0x020e001c
 
 /*
+ * IOMUXC_GPR1 bit fields
+ */
+#define IOMUXC_GPR1_REF_SSP_EN			(1 << 16)
+#define IOMUXC_GPR1_TEST_POWERDOWN		(1 << 18)
+
+/*
+ * IOMUXC_GPR8 bit fields
+ */
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN1_MASK		(0x3f << 0)
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN1_OFFSET		0
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN2_3P5DB_MASK	(0x3f << 6)
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN2_3P5DB_OFFSET	6
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN2_6DB_MASK		(0x3f << 12)
+#define IOMUXC_GPR8_PCS_TX_DEEMPH_GEN2_6DB_OFFSET	12
+#define IOMUXC_GPR8_PCS_TX_SWING_FULL_MASK		(0x7f << 18)
+#define IOMUXC_GPR8_PCS_TX_SWING_FULL_OFFSET		18
+#define IOMUXC_GPR8_PCS_TX_SWING_LOW_MASK		(0x7f << 25)
+#define IOMUXC_GPR8_PCS_TX_SWING_LOW_OFFSET		25
+
+/*
+ * IOMUXC_GPR12 bit fields
+ */
+#define IOMUXC_GPR12_LOS_LEVEL_9		(0x9 << 4)
+#define IOMUXC_GPR12_LOS_LEVEL_MASK		(0x1f << 4)
+#define IOMUXC_GPR12_APPS_LTSSM_ENABLE		(1 << 10)
+#define IOMUXC_GPR12_DEVICE_TYPE_EP		(0x0 << 12)
+#define IOMUXC_GPR12_DEVICE_TYPE_RC		(0x2 << 12)
+#define IOMUXC_GPR12_DEVICE_TYPE_MASK		(0xf << 12)
+
+/*
  * IOMUXC_GPR13 bit fields
  */
 #define IOMUXC_GPR13_SDMA_STOP_REQ	(1<<30)
drivers/pci/Makefile +1 -0
index be26b60..46c5c9a 100644
@@ -13,6 +13,7 @@ COBJS-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
 COBJS-$(CONFIG_PCI) += pci.o pci_auto.o
 COBJS-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o
 COBJS-$(CONFIG_PCI_GT64120) += pci_gt64120.o
+COBJS-$(CONFIG_PCIE_IMX) += pcie_imx.o
 COBJS-$(CONFIG_FTPCI100) += pci_ftpci100.o
 COBJS-$(CONFIG_IXP_PCI) += pci_ixp.o
 COBJS-$(CONFIG_SH4_PCI) += pci_sh4.o
drivers/pci/pcie_imx.c new file +560 -0

560 lines not on this page · raw message

Signature · 1 line
1.8.4.rc3
#9 lore raw

PATCH 4/5 ARM: mx6: Add PCI express driver

Quoted 9 lines · Marek Vasut

Add PCIe driver for the Freescale i.MX6 SoC . This driver operates the PCIe block in RC mode only, the EP mode is NOT supported. The driver is tested with the Intel e1000 NIC driver.

Cc Albert Aribaud <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#10 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

In reply to Marek Vasut

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/boundary/nitrogen6x/nitrogen6x.c |  7 ++++++-
 include/configs/nitrogen6x.h           | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
board/boundary/nitrogen6x/nitrogen6x.c +6 -1
index 1712908..46be51e 100644
@@ -369,7 +369,12 @@ int board_eth_init(bd_t *bis)
 		free(bus);
 	}
 #endif
-	return 0;
+
+#ifdef CONFIG_PCI
+	ret = pci_eth_init(bis);
+#endif
+
+	return ret;
 }
 
 static void setup_buttons(void)
include/configs/nitrogen6x.h +11 -0
index 3454b86..ccde896 100644
@@ -355,4 +355,15 @@
 #define CONFIG_SUPPORT_RAW_INITRD
 #define CONFIG_CMD_FS_GENERIC
 
+/*
+ * PCI express
+ */
+#define CONFIG_CMD_PCI
+#ifdef CONFIG_CMD_PCI
+#define CONFIG_PCI
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW
+#define CONFIG_PCIE_IMX
+#endif
+
 #endif	       /* __CONFIG_H */
Signature · 1 line
1.8.4.rc3
#11 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Quoted 8 lines · Marek Vasut

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#13 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Marek,

Quoted 12 lines · Marek Vasut

Hi,

Quoted 10 lines · Marek Vasut
Quoted 8 lines

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

Quoted 4 lines
Quoted 1 line

Applied to u-boot-imx, thanks.

Eric, is this one OK?

It's okay by me in principle, though we haven't tested it for any side effects.

I should be able to do that this morning, and pulling from u-boot-imx will make that easier.

Regards,

Eric

#14 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Eric,

Quoted 17 lines

Hi Marek,

Quoted 14 lines · Marek Vasut

Hi,

Quoted 11 lines · Marek Vasut
Quoted 8 lines

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Quoted 7 lines
Quoted 1 line

Eric, is this one OK?

It's okay by me in principle, though we haven't tested it for any side effects.

I should be able to do that this morning, and pulling from u-boot-imx will make that easier.

Cool, thanks :)

Best regards,
Marek Vasut

#15 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

In reply to Marek Vasut

Thanks Marek,

Quoted 17 lines · Marek Vasut

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
  board/boundary/nitrogen6x/nitrogen6x.c |  7 ++++++-
  include/configs/nitrogen6x.h           | 11 +++++++++++
  2 files changed, 17 insertions(+), 1 deletion(-)
board/boundary/nitrogen6x/nitrogen6x.c +0 -0
index 1712908..46be51e 100644

board/boundary/nitrogen6x/nitrogen6x.c int board_eth_init(bd_t *bis) · line 372

Quoted 5 lines
board/boundary/nitrogen6x/nitrogen6x.c +1 -1
@@ -369,7 +369,12 @@ int board_eth_init(bd_t *bis)
  		free(bus);
  	}
  #endif
-	return 0;
+

I think this bit needs a different configuration option and should be disabled by default.

board/boundary/nitrogen6x/nitrogen6x.c int board_eth_init(bd_t *bis) · line 376

Quoted 4 lines
board/boundary/nitrogen6x/nitrogen6x.c +4 -0
+#ifdef CONFIG_PCI
+	ret = pci_eth_init(bis);
+#endif
+

It seems to lock up the system if you don't have the proper device connected.

Without this bit, I was able to confirm proper enumeration of a PCIe bus with a USB 3.0 controller:

    00:01.0     - 16c3:abcd - Bridge device
    01:00.0    - 1b21:0612 - Mass storage controller

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

Regards,

Eric

#16 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Eric, Marek,

Quoted 9 lines · Eric Nelson

It seems to lock up the system if you don't have the proper device connected.

Without this bit, I was able to confirm proper enumeration of a PCIe bus with a USB 3.0 controller:

   00:01.0     - 16c3:abcd - Bridge device
   01:00.0    - 1b21:0612 - Mass storage controller
Quoted 7 lines

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

Waiting for someone from Mars is coming to help Marek, I'll put the patchset in the -next for better testing.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#17 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Dear Stefano Babic,

Quoted 16 lines

Hi Eric, Marek,

Quoted 13 lines · Eric Nelson

It seems to lock up the system if you don't have the proper device connected.

Without this bit, I was able to confirm proper enumeration

of a PCIe bus with a USB 3.0 controller:

   00:01.0     - 16c3:abcd - Bridge device
   01:00.0    - 1b21:0612 - Mass storage controller

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

Quoted 6 lines
Quoted 3 lines

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

Waiting for someone from Mars is coming to help Marek, I'll put the patchset in the -next for better testing.

I got a hint from fourth dimension, let's see if the patch I produced in a higher level of consciousness helps ... let's hope I wasn't too high (pun intended, lol!)

Best regards,
Marek Vasut

#18 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Marek,

Quoted 22 lines · Marek Vasut

Dear Stefano Babic,

Quoted 20 lines

Hi Eric, Marek,

Quoted 16 lines · Eric Nelson

It seems to lock up the system if you don't have the proper device connected.

Without this bit, I was able to confirm proper enumeration

of a PCIe bus with a USB 3.0 controller:

    00:01.0     - 16c3:abcd - Bridge device
    01:00.0    - 1b21:0612 - Mass storage controller

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

Quoted 7 lines
Quoted 2 lines

Waiting for someone from Mars is coming to help Marek, I'll put the patchset in the -next for better testing.

I got a hint from fourth dimension, let's see if the patch I produced in a higher level of consciousness helps ... let's hope I wasn't too high (pun intended, lol!)

Sorry for the delayed response. The holiday got in the way of testing.

I think I already had this patch. I tested with these patches against Stefano's master branch:

0001-ARM-mx6-Update-non-Freescale-boards-to-include-CPU-e.patch 0002-ARM-armv7-Make-indirect-vector-addresses-globl.patch 0003-ARM-lib-Add-cpu_clock_teardown-call.patch 0004-ARM-mx6-Add-PCI-express-clock-configuration.patch 0005-ARM-mx6-Add-PCI-express-driver.patch 0006-ARM-mx6-Enable-PCIe-on-Sabrelite.patch

I also apologize for some bad information the other day.

I saw (and reported) lock-ups during PCIE bus enumeration, but I can't seem to reproduce them tonight.

I've tested against three different PCIe devices, and with nothing connected, and everything boots.

As I mentioned, we don't have one of the ethernet adapters you're using, but this patch set doesn't appear to break anything.

I'll try on some other boards over the coming days and let you know if I see any issues.

Regards,

Eric

#19 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Eric,

Quoted 19 lines · Eric Nelson

I think I already had this patch. I tested with these patches against Stefano's master branch:

0001-ARM-mx6-Update-non-Freescale-boards-to-include-CPU-e.patch 0002-ARM-armv7-Make-indirect-vector-addresses-globl.patch 0003-ARM-lib-Add-cpu_clock_teardown-call.patch 0004-ARM-mx6-Add-PCI-express-clock-configuration.patch 0005-ARM-mx6-Add-PCI-express-driver.patch 0006-ARM-mx6-Enable-PCIe-on-Sabrelite.patch

I also apologize for some bad information the other day.

I saw (and reported) lock-ups during PCIE bus enumeration, but I can't seem to reproduce them tonight.

I've tested against three different PCIe devices, and with nothing connected, and everything boots.

Quoted 6 lines

As I mentioned, we don't have one of the ethernet adapters you're using, but this patch set doesn't appear to break anything.

I'll try on some other boards over the coming days and let you know if I see any issues.

Thanks for testing. I will let the patchset on -next until your feedback. If boards can boot flawlessly, I will merge it into -master.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#20 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Dear Stefano Babic,

Quoted 25 lines

Hi Eric,

Quoted 22 lines · Eric Nelson

I think I already had this patch. I tested with these patches against Stefano's master branch:

0001-ARM-mx6-Update-non-Freescale-boards-to-include-CPU-e.patch 0002-ARM-armv7-Make-indirect-vector-addresses-globl.patch 0003-ARM-lib-Add-cpu_clock_teardown-call.patch 0004-ARM-mx6-Add-PCI-express-clock-configuration.patch 0005-ARM-mx6-Add-PCI-express-driver.patch 0006-ARM-mx6-Enable-PCIe-on-Sabrelite.patch

I also apologize for some bad information the other day.

I saw (and reported) lock-ups during PCIE bus enumeration, but I can't seem to reproduce them tonight.

I've tested against three different PCIe devices, and with nothing connected, and everything boots.

As I mentioned, we don't have one of the ethernet adapters you're using, but this patch set doesn't appear to break anything.

Quoted 5 lines
Quoted 2 lines

I'll try on some other boards over the coming days and let you know if I see any issues.

Thanks for testing. I will let the patchset on -next until your feedback. If boards can boot flawlessly, I will merge it into -master.

Will this still make it for 2014.01 please?

Best regards,
Marek Vasut

#21 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 2 lines

Thanks for testing. I will let the patchset on -next until your feedback. If boards can boot flawlessly, I will merge it into -master.

Will this still make it for 2014.01 please?

If boards can anyway boot, yes.

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================
#22 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

Dear Stefano Babic,

Quoted 9 lines

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 2 lines

Thanks for testing. I will let the patchset on -next until your feedback. If boards can boot flawlessly, I will merge it into -master.

Will this still make it for 2014.01 please?

If boards can anyway boot, yes.

OK, thanks!

Best regards,
Marek Vasut

#23 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

In reply to Eric Nelson

Hi Eric,

Quoted 28 lines

Hi Marek,

Quoted 25 lines · Marek Vasut

Dear Stefano Babic,

Quoted 22 lines

Hi Eric, Marek,

Quoted 9 lines · Eric Nelson

It seems to lock up the system if you don't have the proper device connected.

Without this bit, I was able to confirm proper enumeration

of a PCIe bus with a USB 3.0 controller:

    00:01.0     - 16c3:abcd - Bridge device
    01:00.0    - 1b21:0612 - Mass storage controller
Quoted 7 lines

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

Waiting for someone from Mars is coming to help Marek, I'll put the patchset in the -next for better testing.

Quoted 6 lines
Quoted 3 lines

I got a hint from fourth dimension, let's see if the patch I produced in a higher level of consciousness helps ... let's hope I wasn't too high (pun intended, lol!)

Sorry for the delayed response. The holiday got in the way of testing.

No problem ;-)

Quoted 1 line

I think I already had this patch.

The one I attached is a new one. I suppose that one fixes your lockups and stuff :)

Quoted 22 lines

I tested with these
patches against Stefano's master branch:

0001-ARM-mx6-Update-non-Freescale-boards-to-include-CPU-e.patch 0002-ARM-armv7-Make-indirect-vector-addresses-globl.patch 0003-ARM-lib-Add-cpu_clock_teardown-call.patch 0004-ARM-mx6-Add-PCI-express-clock-configuration.patch 0005-ARM-mx6-Add-PCI-express-driver.patch 0006-ARM-mx6-Enable-PCIe-on-Sabrelite.patch

I also apologize for some bad information the other day.

I saw (and reported) lock-ups during PCIE bus enumeration, but I can't seem to reproduce them tonight.

I've tested against three different PCIe devices, and with nothing connected, and everything boots.

As I mentioned, we don't have one of the ethernet adapters you're using, but this patch set doesn't appear to break anything.

Quoted 7 lines

I'll try on some other boards over the coming days and let you know if I see any issues.

Regards,

Eric

Best regards,
Marek Vasut

#24 lore raw

PATCH 5/5 ARM: mx6: Enable PCIe on Sabrelite

In reply to Eric Nelson

Hi Eric,

Quoted 26 lines

Thanks Marek,

Quoted 23 lines · Marek Vasut

Enable PCI express on MX6 Sabrelite.

Cc Albert Aribaud <[email protected]>
Cc Eric Nelson <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>

---

  board/boundary/nitrogen6x/nitrogen6x.c |  7 ++++++-
  include/configs/nitrogen6x.h           | 11 +++++++++++
  2 files changed, 17 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/board/boundary/nitrogen6x/nitrogen6x.c index 1712908..46be51e 100644

board/boundary/nitrogen6x/nitrogen6x.c +0 -0
@@ -369,7 +369,12 @@ int board_eth_init(bd_t *bis)
 
  		free(bus);
 
  	}
 
Quoted 7 lines

board/boundary/nitrogen6x/nitrogen6x.c int board_eth_init(bd_t *bis) · line 372

Quoted 4 lines
board/boundary/nitrogen6x/nitrogen6x.c +1 -1
  #endif
 
-	return 0;
+

I think this bit needs a different configuration option and should be disabled by default.

This activates all PCI/PCI-express ethernet cards, that's why CONFIG_PCI. I suppose testing CONFIG_CMD_NET would be a good idea here as well.

Quoted 7 lines

board/boundary/nitrogen6x/nitrogen6x.c int board_eth_init(bd_t *bis) · line 376

Quoted 4 lines
board/boundary/nitrogen6x/nitrogen6x.c +4 -0
+#ifdef CONFIG_PCI
+	ret = pci_eth_init(bis);
+#endif
+

It seems to lock up the system if you don't have the proper device connected.

I am attaching you a patch, can you please try with the attached patch ? It should fix your enumeration issue.

btw. I noticed there's no PCIe reset connected on the sabrelite, that's a bit bad, we found out the PCIe reset should be connected, otherwise the PCIe will misbehave upon init sometimes.

Quoted 6 lines

Without this bit, I was able to confirm proper enumeration of a PCIe bus with a USB 3.0 controller:

    00:01.0     - 16c3:abcd - Bridge device
    01:00.0    - 1b21:0612 - Mass storage controller
Quoted 7 lines

Unfortunately, in a quick test, the image fails to boot without a PCIe device connected, or oddly, with a different PCIe ethernet controller connected.

I think it's handy to have the placeholder here, but I think you're the only person on the planet with the right set of components to make it work at the moment.

I'd usually be proud by hearing that, but ... I can't say I'm too happy about this ;-)

Best regards,
Marek Vasut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcie.diff
Type: text/x-patch
Size: 2332 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131130/add3d089/attachment.bin>

#25 lore raw

PATCH 1/5 ARM: armv7: Make indirect vector addresses globl

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

Make indirect vectors addresses global, so they can be replaced by various code that needs to do so. For example the MX6 PCI express driver needs to temporarily replace data abort handler when reading the config space.

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================