Skip to contentSkip to conversation

ppc44x:PHY fixup for USB on canyonlands board

PATCH Superseded Rupjyoti Sarmah 4 participants 4 messages Nov 26, 2010

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ppc44x:PHY fixup for USB on canyonlands board

This fix is a reset for USB PHY that requires some amount of time for power to be stable on Canyonlands.

---
changes from previous version:
- moved a Macro from header file to the source file
- corrected & updated comments
- replaced the out_be32 calls by setbits32 calls
- bootup delay reduced, udelay is replaced by msleep

 arch/powerpc/boot/dts/canyonlands.dts      |   13 +++
 arch/powerpc/platforms/44x/44x.h           |    4 +
 arch/powerpc/platforms/44x/Makefile        |    1 +
 arch/powerpc/platforms/44x/canyonlands.c   |  120 ++++++++++++++++++++++++++++
 arch/powerpc/platforms/44x/ppc44x_simple.c |    1 -
 5 files changed, 138 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/platforms/44x/canyonlands.c
arch/powerpc/boot/dts/canyonlands.dts +13 -0
index a303703..a9f7538 100644
@@ -224,6 +224,13 @@
 					};
 				};
 
+				cpld@2,0 {
+					#address-cells = <1>;
+					#size-cells = <1>;
+					compatible = "apm,ppc460ex-bcsr";
+					reg = <2 0x0 0x9>;
+				};
+
 				ndfc@3,0 {
 					compatible = "ibm,ndfc";
 					reg = <0x00000003 0x00000000 0x00002000>;
@@ -320,6 +327,12 @@
 				interrupts = <0x3 0x4>;
 			};
 
+			GPIO0: gpio@ef600b00 {
+				compatible = "ibm,ppc4xx-gpio";
+				reg = <0xef600b00 0x00000048>;
+				gpio-controller;
+			};
+
 			ZMII0: emac-zmii@ef600d00 {
 				compatible = "ibm,zmii-460ex", "ibm,zmii";
 				reg = <0xef600d00 0x0000000c>;
arch/powerpc/platforms/44x/44x.h +4 -0
index dbc4d2b..63f703e 100644
@@ -4,4 +4,8 @@
 extern u8 as1_readb(volatile u8 __iomem  *addr);
 extern void as1_writeb(u8 data, volatile u8 __iomem *addr);
 
+#define GPIO0_OSRH	0xC
+#define GPIO0_TSRH	0x14
+#define GPIO0_ISR1H	0x34
+
 #endif /* __POWERPC_PLATFORMS_44X_44X_H */
arch/powerpc/platforms/44x/Makefile +1 -0
index 82ff326..6854e73 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
 obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
 obj-$(CONFIG_ISS4xx)	+= iss4xx.o
+obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
arch/powerpc/platforms/44x/canyonlands.c new file +120 -0

120 lines not on this page · raw message

arch/powerpc/platforms/44x/ppc44x_simple.c +0 -1
index 7ddcba3..c81c19c 100644
@@ -53,7 +53,6 @@ static char *board[] __initdata = {
 	"amcc,arches",
 	"amcc,bamboo",
 	"amcc,bluestone",
-	"amcc,canyonlands",
 	"amcc,glacier",
 	"ibm,ebony",
 	"amcc,eiger",
Signature · 1 line
1.5.6.3
#1 lore raw

Dear Rupjyoti Sarmah,

arch/powerpc/boot/dts/canyonlands.dts line 230

Quoted 5 lines · In message <[email protected]> you wrote:
arch/powerpc/boot/dts/canyonlands.dts +4 -0
+				cpld@2,0 {
+					#address-cells = <1>;
+					#size-cells = <1>;
+					compatible = "apm,ppc460ex-bcsr";

This results in a mix of "amcc," and "apm," strings.

Are there any plans to unify this?

arch/powerpc/platforms/44x/canyonlands.c line 3

Quoted 9 lines
arch/powerpc/platforms/44x/canyonlands.c new file +3 -0
new file mode 100644
index 0000000..61e80ce
@@ -0,0 +1,120 @@
+/*
+ * This contain platform specific code for Canyonlands board based on
+ * APM ppc44x series of processors.

Canyonlands is always PPC460EX, or does it ever come with other processors as well?

arch/powerpc/platforms/44x/canyonlands.c line 62

Quoted 9 lines
arch/powerpc/platforms/44x/canyonlands.c new file +9 -0
+static int __init ppc44x_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+		if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
+			ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
+			return 1;
+		}
+	return 0;
+}

Bad indentation.

Quoted 4 lines
arch/powerpc/platforms/44x/canyonlands.c new file +4 -0
+	/* Disable USB, through the BCSR7 bits */
+	setbits8(&bcsr[7], BCSR_USB_EN);
+
+	/* Wait for a while after reset */

arch/powerpc/platforms/44x/canyonlands.c line 105

Quoted 10 lines
arch/powerpc/platforms/44x/canyonlands.c new file +10 -0
+	msleep(100);
+
+	/* Enable USB here */
+	clrbits8(&bcsr[7], BCSR_USB_EN);
+
+	/*
+	 * Configure multiplexed gpio16 and gpio19 as alternate1 output
+	 * source after USB reset.This configuration is done through GPIO0_TSRH
+	 * and GPIO0_OSRH bits 0:1 and 6:7.
+	 */

Earlier versions of the patch included a delay after the clrbits8() call as well. Is it intentional that you dropped this now?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Every program has at least one bug and can be shortened by  at  least
one instruction - from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.
#2 lore raw

Hi Wolfgang,

Quoted 2 lines
Quoted 2 lines

This results in a mix of "amcc," and "apm," strings. Are there any plans to unify this?

We can make all as apm, but right now I believe there is no plan to do so.

Quoted 2 lines
Quoted 2 lines

Earlier versions of the patch included a delay after the clrbits8() call as well. Is it intentional that you dropped this now?

It is dropped intentionally.

Rest of your suggestions, I will modify and resubmit. Thanks.

Regards,
Rup

#3 lore raw
Quoted 11 lines · Rupjyoti Sarmah

Hi Wolfgang,

Quoted 2 lines
Quoted 2 lines

This results in a mix of "amcc," and "apm," strings. Are there any plans to unify this?

We can make all as apm, but right now I believe there is no plan to do so.

Quoted 2 lines
Quoted 2 lines

Earlier versions of the patch included a delay after the clrbits8() call as well. Is it intentional that you dropped this now?

It is dropped intentionally.

Rest of your suggestions, I will modify and resubmit. Thanks.

I think this should remain consistent within the platform and stick to "amcc".

Cheers,
Ben.