Skip to contentSkip to conversation

Various fixes for Marvell EBU platforms

GIT PULL New Thomas Petazzoni 3 participants 10 messages Mar 6, 2013 – Mar 9, 2013

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

Jason, Andrew, Greg,

Here are four fixes for Marvell EBU platforms. The first fix is very important, without it, all Armada 370/XP platforms are broken. The second fix is important as well because it makes the Armada XP GP platform actually usable (without it, the platform boots, but no network, no XOR, almost nothing works). The two other patches are minor DT fixes.

Thanks.

The following changes since commit 6dbe51c251a327e012439c4772097a13df43c5b8:

Linux 3.9-rc1 (2013-03-03 15:11:05 -0800)

are available in the git repository at:

git at github.com:MISL-EBU-System-SW/mainline-public.git tags/marvell-3.9-fixes-tag

for you to fetch changes up to 6e025ae424c90febf2d0ad4368f0e5cba8b46f77:

arm: mach-orion5x: fix typo in compatible string of a .dts file (2013-03-06 10:32:59 +0100)

----------------------------------------------------------------
Various small fixes for Marvell EBU platforms, intended for 3.9.

----------------------------------------------------------------
Heikki Krogerus (1):
arm: mvebu: Reduce reg-io-width with UARTs

Thomas Petazzoni (3):
arm: plat-orion: fix address decoding when > 4GB is used
arm: mvebu: fix address-cells in mpic DT node
arm: mach-orion5x: fix typo in compatible string of a .dts file

 arch/arm/boot/dts/armada-370-xp.dtsi               |    5 ++---
 arch/arm/boot/dts/armada-xp.dtsi                   |    4 ++--
 .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts    |    2 +-
 arch/arm/plat-orion/addr-map.c                     |    7 +++++--
 4 files changed, 10 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/4 arm: mvebu: Reduce reg-io-width with UARTs

From: Heikki Krogerus <[email protected]>

Setting the reg-io-width to 1 byte represents more accurate description of the HW.

This will fix an issue where UART driver causes kernel panic during bootup. Gregory CLEMENT traced the issue to autoconfig() in 8250.c, where the existence of FIFO is checked from UART_IIR register. The register is now read as 32-bit value as the reg-io-width is set to 4-bytes. The retuned value seems to contain bogus data for bits 31:8, causing the issue.

---
 arch/arm/boot/dts/armada-370-xp.dtsi |    4 ++--
 arch/arm/boot/dts/armada-xp.dtsi     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/armada-370-xp.dtsi +2 -2
index 6f1acc7..99afca4 100644
@@ -54,7 +54,7 @@
 				reg = <0xd0012000 0x100>;
 				reg-shift = <2>;
 				interrupts = <41>;
-				reg-io-width = <4>;
+				reg-io-width = <1>;
 				status = "disabled";
 		};
 		serial at d0012100 {
@@ -62,7 +62,7 @@
 				reg = <0xd0012100 0x100>;
 				reg-shift = <2>;
 				interrupts = <42>;
-				reg-io-width = <4>;
+				reg-io-width = <1>;
 				status = "disabled";
 		};
 
arch/arm/boot/dts/armada-xp.dtsi +2 -2
index 1443949..ca00d83 100644
@@ -46,7 +46,7 @@
 				reg = <0xd0012200 0x100>;
 				reg-shift = <2>;
 				interrupts = <43>;
-				reg-io-width = <4>;
+				reg-io-width = <1>;
 				status = "disabled";
 		};
 		serial at d0012300 {
@@ -54,7 +54,7 @@
 				reg = <0xd0012300 0x100>;
 				reg-shift = <2>;
 				interrupts = <44>;
-				reg-io-width = <4>;
+				reg-io-width = <1>;
 				status = "disabled";
 		};
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/4 arm: plat-orion: fix address decoding when > 4GB is used

In reply to Thomas Petazzoni

During the system initialization, the orion_setup_cpu_mbus_target() function reads the SDRAM address decoding registers to find out how many chip-selects of SDRAM have been enabled, and builds a small array with one entry per chip-select. This array is then used by device drivers (XOR, Ethernet, etc.) to configure their own address decoding windows to the SDRAM.

However, devices can only access the first 32 bits of the physical memory. Even though LPAE is not supported for now, some Marvell boards are now showing up with 8 GB of RAM, configured using two SDRAM address decoding windows: the first covering the first 4 GB, the second covering the last 4 GB. The array built by orion_setup_cpu_mbus_target() has therefore two entries, and device drivers try to set up two address decoding windows to the SDRAM. However, in the device registers for the address decoding, the base address is only 32 bits, so those two windows overlap each other, and the devices do not work at all.

This patch makes sure that the array built by orion_setup_cpu_mbus_target() only contains the SDRAM decoding windows that correspond to the first 4 GB of the memory. To do that, it ignores the SDRAM decoding windows for which the 4 low-order bits are not zero (the 4 low-order bits of the base register are used to store bits 32:35 of the base address, so they actually indicate whether the base address is above 4 GB).

This patch allows the newly introduced armada-xp-gp board to properly operate when it is mounted with more than 4 GB of RAM. Without that, all devices doing DMA (for example XOR and Ethernet) do not work at all.

---
This is a slightly updated version compared to the one sent on February 27th on LAKML. The earlier version was looking at the three low-order bits, but in fact there are four low-order bits to encode the high bits of the base address. So the mask was changed from 0x7 to 0xF.

Since I've changed the patch, I haven't kept the Tested-by from Lior Amsalem, Gr?gory Clement and Ezequiel Garcia.

---
 arch/arm/plat-orion/addr-map.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/plat-orion/addr-map.c +5 -2
index febe386..807ac8e 100644
@@ -157,9 +157,12 @@ void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
 		u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
 
 		/*
-		 * Chip select enabled?
+		 * We only take care of entries for which the chip
+		 * select is enabled, and that don't have high base
+		 * address bits set (devices can only access the first
+		 * 32 bits of the memory).
 		 */
-		if (size & 1) {
+		if ((size & 1) && !(base & 0xF)) {
 			struct mbus_dram_window *w;
 
 			w = &orion_mbus_dram_info.cs[cs++];
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/4 arm: plat-orion: fix address decoding when > 4GB is used

On Wed, Mar 06, 2013 at 11:23:34AM +0100, Thomas Petazzoni wrote:
...

Quoted 8 lines

This is a slightly updated version compared to the one sent on February 27th on LAKML. The earlier version was looking at the three low-order bits, but in fact there are four low-order bits to encode the high bits of the base address. So the mask was changed from 0x7 to 0xF.

Since I've changed the patch, I haven't kept the Tested-by from Lior Amsalem, Gr?gory Clement and Ezequiel Garcia.

Then please don't send this as part of a pull-request. Threading it under a pull-request implies that it is ready to be applied, causing most reviewers/testers to ignore the email. Please have Lior, Gr?gory, and Ezequiel retest and report back.

thx,

Jason.

#4 lore raw

PATCH 2/4 arm: plat-orion: fix address decoding when > 4GB is used

Dear Jason Cooper,

Quoted 7 lines · Jason Cooper
Quoted 2 lines

Since I've changed the patch, I haven't kept the Tested-by from Lior Amsalem, Gr?gory Clement and Ezequiel Garcia.

Then please don't send this as part of a pull-request. Threading it under a pull-request implies that it is ready to be applied, causing most reviewers/testers to ignore the email. Please have Lior, Gr?gory, and Ezequiel retest and report back.

I believe it is ready to be applied. The change I've done from the version tested by others is minor, and I'm quite convinced that the change is OK. If the change had been more significant, I would for sure not have sent this as a pull request.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 2/4 arm: plat-orion: fix address decoding when > 4GB is used

In reply to Thomas Petazzoni
Quoted 26 lines · Thomas Petazzoni

During the system initialization, the orion_setup_cpu_mbus_target() function reads the SDRAM address decoding registers to find out how many chip-selects of SDRAM have been enabled, and builds a small array with one entry per chip-select. This array is then used by device drivers (XOR, Ethernet, etc.) to configure their own address decoding windows to the SDRAM.

However, devices can only access the first 32 bits of the physical memory. Even though LPAE is not supported for now, some Marvell boards are now showing up with 8 GB of RAM, configured using two SDRAM address decoding windows: the first covering the first 4 GB, the second covering the last 4 GB. The array built by orion_setup_cpu_mbus_target() has therefore two entries, and device drivers try to set up two address decoding windows to the SDRAM. However, in the device registers for the address decoding, the base address is only 32 bits, so those two windows overlap each other, and the devices do not work at all.

This patch makes sure that the array built by orion_setup_cpu_mbus_target() only contains the SDRAM decoding windows that correspond to the first 4 GB of the memory. To do that, it ignores the SDRAM decoding windows for which the 4 low-order bits are not zero (the 4 low-order bits of the base register are used to store bits 32:35 of the base address, so they actually indicate whether the base address is above 4 GB).

Quoted 6 lines

This patch allows the newly introduced armada-xp-gp board to properly operate when it is mounted with more than 4 GB of RAM. Without that, all devices doing DMA (for example XOR and Ethernet) do not work at all.

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#6 lore raw

PATCH 3/4 arm: mvebu: fix address-cells in mpic DT node

In reply to Thomas Petazzoni

There is no need to have a #address-cells property in the MPIC Device Tree node, and more than that, having it confuses the of_irq_map_raw() logic, which will be used by the Marvell PCIe driver.

---
 arch/arm/boot/dts/armada-370-xp.dtsi |    1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/armada-370-xp.dtsi +0 -1
index 99afca4..5b70820 100644
@@ -31,7 +31,6 @@
 	mpic: interrupt-controller at d0020000 {
 	      compatible = "marvell,mpic";
 	      #interrupt-cells = <1>;
-	      #address-cells = <1>;
 	      #size-cells = <1>;
 	      interrupt-controller;
 	};
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 4/4 arm: mach-orion5x: fix typo in compatible string of a .dts file

In reply to Thomas Petazzoni

The orion5x-lacie-ethernet-disk-mini-v2.dts file was using "marvell-orion5x-88f5182" as a compatible string, while it should have been "marvell,orion5x-88f5182".

---
 .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts    |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts +1 -1
index 5a3a58b..0077fc8 100644
@@ -11,7 +11,7 @@
 
 / {
 	model = "LaCie Ethernet Disk mini V2";
-	compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x";
+	compatible = "lacie,ethernet-disk-mini-v2", "marvell,orion5x-88f5182", "marvell,orion5x";
 
 	memory {
 		reg = <0x00000000 0x4000000>; /* 64 MB */
Signature · 1 line
1.7.9.5
#8 lore raw
In reply to Thomas Petazzoni
Quoted 35 lines · Thomas Petazzoni

Jason, Andrew, Greg,

Here are four fixes for Marvell EBU platforms. The first fix is very important, without it, all Armada 370/XP platforms are broken. The second fix is important as well because it makes the Armada XP GP platform actually usable (without it, the platform boots, but no network, no XOR, almost nothing works). The two other patches are minor DT fixes.

Thanks.

The following changes since commit 6dbe51c251a327e012439c4772097a13df43c5b8:

Linux 3.9-rc1 (2013-03-03 15:11:05 -0800)

are available in the git repository at:

git at github.com:MISL-EBU-System-SW/mainline-public.git tags/marvell-3.9-fixes-tag

for you to fetch changes up to 6e025ae424c90febf2d0ad4368f0e5cba8b46f77:

arm: mach-orion5x: fix typo in compatible string of a .dts file (2013-03-06 10:32:59 +0100)

----------------------------------------------------------------
Various small fixes for Marvell EBU platforms, intended for 3.9.

----------------------------------------------------------------
Heikki Krogerus (1):
arm: mvebu: Reduce reg-io-width with UARTs

Thomas Petazzoni (3):
arm: plat-orion: fix address decoding when > 4GB is used
arm: mvebu: fix address-cells in mpic DT node
arm: mach-orion5x: fix typo in compatible string of a .dts file

Quoted 5 lines
 arch/arm/boot/dts/armada-370-xp.dtsi               |    5 ++---
 arch/arm/boot/dts/armada-xp.dtsi                   |    4 ++--
 .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts    |    2 +-
 arch/arm/plat-orion/addr-map.c                     |    7 +++++--
 4 files changed, 10 insertions(+), 8 deletions(-)

All applied to mvebu/fixes

thx,

Jason.

#9 lore raw

Dear Jason Cooper,

Quoted 8 lines · Jason Cooper
Quoted 8 lines

Heikki Krogerus (1):
arm: mvebu: Reduce reg-io-width with UARTs

Thomas Petazzoni (3):
arm: plat-orion: fix address decoding when > 4GB is used
arm: mvebu: fix address-cells in mpic DT node
arm: mach-orion5x: fix typo in compatible string of a .dts file

Quoted 7 lines
Quoted 5 lines
 arch/arm/boot/dts/armada-370-xp.dtsi               |    5 ++---
 arch/arm/boot/dts/armada-xp.dtsi                   |    4 ++--
 .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts    |    2 +-
 arch/arm/plat-orion/addr-map.c                     |    7 +++++--
 4 files changed, 10 insertions(+), 8 deletions(-)

All applied to mvebu/fixes

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com