Skip to contentSkip to conversation

CS4270 node is misplaced in the MPC8610 device tree

PATCH In review Timur Tabi 2 participants 5 messages May 14, 2008 – May 19, 2008

Subsystems (2)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 CS4270 node is misplaced in the MPC8610 device tree

The CS4270 is using the second I2C bus, not the first, on the Freescale MPC8610 HPCD, so its node in the device tree belongs under 'i2c@3100' and not 'i2c@3000'.

---

Kumar, this is a must-fix for 2.6.26.

The reason this didn't show up before is because the CS4270 driver is an old-style driver, and so it doesn't actually use the device tree to determine the I2C bus/address.

 arch/powerpc/boot/dts/mpc8610_hpcd.dts |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
arch/powerpc/boot/dts/mpc8610_hpcd.dts +7 -7
index 08a780d..771f169 100644
@@ -124,13 +124,6 @@
 			interrupts = <43 2>;
 			interrupt-parent = <&mpic>;
 			dfsrr;
-
-			cs4270:codec@4f {
-				compatible = "cirrus,cs4270";
-				reg = <0x4f>;
-				/* MCLK source is a stand-alone oscillator */
-				clock-frequency = <12288000>;
-			};
 		};
 
 		i2c@3100 {
@@ -142,6 +135,13 @@
 			interrupts = <43 2>;
 			interrupt-parent = <&mpic>;
 			dfsrr;
+
+			cs4270:codec@4f {
+				compatible = "cirrus,cs4270";
+				reg = <0x4f>;
+				/* MCLK source is a stand-alone oscillator */
+				clock-frequency = <12288000>;
+			};
 		};
 
 		serial0: serial@4500 {
Signature · 1 line
1.5.5
author
#1 lore raw
Quoted 5 lines · Timur Tabi

The CS4270 is using the second I2C bus, not the first, on the Freescale MPC8610 HPCD, so its node in the device tree belongs under 'i2c@3100' and not 'i2c@3000'.

Please disregard this patch. It turns out that that both I2C controllers are connected to the same bus, so it technically doesn't matter which node a device is a child of. However, tests show that sometimes one parent works, and sometimes the other parent works.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#2 lore raw
Quoted 11 lines · Timur Tabi
Quoted 5 lines · Timur Tabi

The CS4270 is using the second I2C bus, not the first, on the Freescale MPC8610 HPCD, so its node in the device tree belongs under 'i2c@3100' and not 'i2c@3000'.

Please disregard this patch. It turns out that that both I2C controllers are connected to the same bus, so it technically doesn't matter which node a device is a child of. However, tests show that sometimes one parent works, and sometimes the other parent works.

Hm... this should be controlled by the PIXIS' BRDCFG0's I2CSPAN and SERSEL bits:

0: I2C1 and I2C2 buses are separated. System (boot sequencer EEPROM)
is on I2C1, all others are on I2C2. MPC8610 SPI functions cannot be used.
1: I2C1 and I2C2 are bridged. MPC8610 SPI functions may be used. All I2C
devices may be accessed via I2C1 controller and/or I2C2 (I2C2 depends on SERSEL setting).

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
author
#3 lore raw
Quoted 2 lines · Anton Vorontsov

Hm... this should be controlled by the PIXIS' BRDCFG0's I2CSPAN and SERSEL bits:

Since these pins should not have changed from one kernel version to another, it doesn't explain how my device "jumped" from I2C2 to I2C1. I'm debugging this now.

Quoted 3 lines

1: I2C1 and I2C2 are bridged. MPC8610 SPI functions may be used. All I2C
devices may be accessed via I2C1 controller and/or I2C2 (I2C2 depends on SERSEL setting).

I believe this is wrong. The chip documentation says that the pin controlled by I2CSPAN selects which of the two inputs to use. It does not bridge.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#4 lore raw
Quoted 7 lines · Timur Tabi
Quoted 2 lines · Anton Vorontsov

Hm... this should be controlled by the PIXIS' BRDCFG0's I2CSPAN and SERSEL bits:

Since these pins should not have changed from one kernel version to another, it doesn't explain how my device "jumped" from I2C2 to I2C1. I'm debugging this now.

I found the problem. Your patch "86xx: mpc8610_hpcd: fix second serial port" fixes it.

The original code moved the I2C devices from I2C1 to I2C2. On R1 boards, the default for I2CSPAN was 1 because the chip used on those boards would bridge the two buses together if I2CSPAN==1. On R3 boards, a different chip is used, and I2CSPAN==1 means to use I2C2 instead of I2C1. On R1 boards, the default for BRDCFG0 is 0xBD, but on R3 boards it's 0xB8. So when mpc8610hpcd_set_monitor_port() wrote 0xBD to BRDCFG0, it moved the I2C devices from I2C1 to I2C2.

I also had a hard time pinpointing this code because mpc8610hpcd_set_monitor_port() is called only when the DIU is enabled. Since I don't have anything attached to my DIU port, I don't always enable the DIU. So some of my kernels had DIU support, and some of them didn't! Those kernels that have DIU enabled but not your patch will move the devices to I2C2. I was running one of those kernels when I posted my patch.

So in summary, this patch "CS4270 node is misplaced in the MPC8610 device tree" should not be applied. The I2C devices should stay on I2C1.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale