Re: [PATCH] ppc44x:PHY fixup for USB on canyonlands board

2010-11-10 Thread Josh Boyer
On Wed, Nov 10, 2010 at 05:07:15PM +0530, Rupjyoti Sarmah wrote:
This fix is a reset for USB PHY that requires some amount of time for power to 
be stable on Canyonlands.

Signed-off-by: Rupjyoti Sarmah rsar...@apm.com
---
 arch/powerpc/boot/dts/canyonlands.dts |   11 
 arch/powerpc/platforms/44x/44x.h  |5 ++
 arch/powerpc/platforms/44x/Kconfig|7 ++
 arch/powerpc/platforms/44x/Makefile   |1 +
 arch/powerpc/platforms/44x/ppc44x_fixup.c |   90 +
 5 files changed, 114 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/44x/ppc44x_fixup.c

Is this just for canyonlands?  If so, it's probably better off in a
caynonlands specific file, or a function that gets called in the common
platform file if the model matches canyonlands.  It seems a bit overkill
to introduce an entire new file and Kconfig option for this.


diff --git a/arch/powerpc/boot/dts/canyonlands.dts 
b/arch/powerpc/boot/dts/canyonlands.dts
index a303703..d6e9ba2 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -171,6 +171,11 @@
 0x5 0x4; /* AHBDMA */
   };

+  CPLD: c...@e100 {
+  compatible = apm, ppc460ex-bcsr;
+  reg = 4 0xe100 0x9;
+  };

Normally we don't leave a space in compatible properties.

+
   POB0: opb {
   compatible = ibm,opb-460ex, ibm,opb;
   #address-cells = 1;
@@ -320,6 +325,12 @@
   interrupts = 0x3 0x4;
   };

+  GPIO0: g...@ef600b00 {
+  compatible = apm,ppc44x-gpio-base;
+  reg = 0xef600b00 0x0048;
+  gpio-controller;
+  };

We already have ibm,ppc4xx-gpio as an established compatible field for
4xx GPIO.  As far as I know, this is not a different kind of GPIO
controller than what is found on the other boards, so we should stick
with the existing property.

+
   ZMII0: emac-z...@ef600d00 {
   compatible = ibm,zmii-460ex, ibm,zmii;
   reg = 0xef600d00 0x000c;
diff --git a/arch/powerpc/platforms/44x/44x.h 
b/arch/powerpc/platforms/44x/44x.h
index dbc4d2b..bc2ab7a 100644
--- a/arch/powerpc/platforms/44x/44x.h
+++ b/arch/powerpc/platforms/44x/44x.h
@@ -4,4 +4,9 @@
 extern u8 as1_readb(volatile u8 __iomem  *addr);
 extern void as1_writeb(u8 data, volatile u8 __iomem *addr);

+#define BCSR_USB_EN   0x11
+#define GPIO0_OSRH0xC
+#define GPIO0_TSRH0x14
+#define GPIO0_ISR1H   0x34
+
 #endif /* __POWERPC_PLATFORMS_44X_44X_H */
diff --git a/arch/powerpc/platforms/44x/Kconfig 
b/arch/powerpc/platforms/44x/Kconfig
index 0f979c5..9ca4aaa 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -117,12 +117,19 @@ config CANYONLANDS
   default n
   select PPC44x_SIMPLE
   select 460EX
+  select 44X_FIXUP
   select PCI
   select PPC4xx_PCI_EXPRESS
   select IBM_NEW_EMAC_RGMII
   select IBM_NEW_EMAC_ZMII
   help
 This option enables support for the AMCC PPC460EX evaluation board.
+config 44X_FIXUP
+  bool 4xx_fixup
+  depends on 44x
+  default n
+  help
+This option enables supporting APM PPC4XX based evaluation board 
fixups.

 config GLACIER
   bool Glacier
diff --git a/arch/powerpc/platforms/44x/Makefile 
b/arch/powerpc/platforms/44x/Makefile
index 82ff326..d4bfb97 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_44x) := misc_44x.o idle.o
 obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
 obj-$(CONFIG_EBONY)   += ebony.o
+obj-$(CONFIG_44X_FIXUP) += ppc44x_fixup.o
 obj-$(CONFIG_SAM440EP)+= sam440ep.o
 obj-$(CONFIG_WARP)+= warp.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
diff --git a/arch/powerpc/platforms/44x/ppc44x_fixup.c 
b/arch/powerpc/platforms/44x/ppc44x_fixup.c
new file mode 100644
index 000..4e254eb
--- /dev/null
+++ b/arch/powerpc/platforms/44x/ppc44x_fixup.c
@@ -0,0 +1,90 @@
+/*
+ * This contain fixup code for Applied Micro ppc44x series of processors.
+ *
+ * Copyright (c) 2010, Applied Micro Circuits Corporation
+ * Author: Rupjyoti Sarmah rsar...@apm.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 

Re: [PATCH] ppc44x:PHY fixup for USB on canyonlands board

2010-11-10 Thread Benjamin Herrenschmidt
On Wed, 2010-11-10 at 09:19 -0500, Josh Boyer wrote:
 With this being an arch_initcall, it will get called for every kind of
 platform in a multi-board kernel.  Another reason to only call it from
 a
 board specific probe function if it really is canyonlands specific. 

Right. Time to take canyonlands out of ppc4xx_simple and have its own
board file again. Do the fixups there.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH] ppc44x:PHY fixup for USB on canyonlands board

2010-11-10 Thread Rupjyoti Sarmah
Is this just for canyonlands?  If so, it's probably better off in a
caynonlands specific file, or a function that gets called in the common
platform file if the model matches canyonlands.  It seems a bit overkill
to introduce an entire new file and Kconfig option for this.


We want to have a file that will have fixup codes for all the ppc44x
specific boards. Within this ppc44x_fixup.c file we would like to place
any fixup code that
might come later for any of the ppc44x based boards. Although I released
it only with Canyonlands code, it would be ppc44x specific file.

Do let me know if that is ok.

Regards,
Rup
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] ppc44x:PHY fixup for USB on canyonlands board

2010-11-10 Thread Stefan Roese
On Wednesday 10 November 2010 12:37:15 Rupjyoti Sarmah wrote:
 This fix is a reset for USB PHY that requires some amount of time for power
 to be stable on Canyonlands.
 
 Signed-off-by: Rupjyoti Sarmah rsar...@apm.com
 ---
  arch/powerpc/boot/dts/canyonlands.dts |   11 
  arch/powerpc/platforms/44x/44x.h  |5 ++
  arch/powerpc/platforms/44x/Kconfig|7 ++
  arch/powerpc/platforms/44x/Makefile   |1 +
  arch/powerpc/platforms/44x/ppc44x_fixup.c |   90
 + 5 files changed, 114 insertions(+), 0
 deletions(-)
  create mode 100644 arch/powerpc/platforms/44x/ppc44x_fixup.c
 
 diff --git a/arch/powerpc/boot/dts/canyonlands.dts
 b/arch/powerpc/boot/dts/canyonlands.dts index a303703..d6e9ba2 100644
 --- a/arch/powerpc/boot/dts/canyonlands.dts
 +++ b/arch/powerpc/boot/dts/canyonlands.dts
 @@ -171,6 +171,11 @@
 0x5 0x4; /* AHBDMA */
   };
 
 + CPLD: c...@e100 {
 + compatible = apm, ppc460ex-bcsr;
 + reg = 4 0xe100 0x9;
 + };

This node should be moved to the EBC section. It would look something like 
this then (note the reg property change here):

CPLD: c...@2,0 {
...
reg = 2 0x0 0x9;
};

Cheers,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH] ppc44x:PHY fixup for USB on canyonlands board

2010-11-10 Thread Benjamin Herrenschmidt
On Wed, 2010-11-10 at 20:13 +0530, Rupjyoti Sarmah wrote:
 Is this just for canyonlands?  If so, it's probably better off in a
 caynonlands specific file, or a function that gets called in the common
 platform file if the model matches canyonlands.  It seems a bit overkill
 to introduce an entire new file and Kconfig option for this.
 
 
 We want to have a file that will have fixup codes for all the ppc44x
 specific boards. Within this ppc44x_fixup.c file we would like to place
 any fixup code that
 might come later for any of the ppc44x based boards. Although I released
 it only with Canyonlands code, it would be ppc44x specific file.
 
 Do let me know if that is ok.

No. You should have a file per board that needs fixup. Take them out of
ppc4xx_simple.c and create a board file.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev