linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [MPC8349ITX] USB Init with PPC arch
@ 2007-01-22 17:10 Benjamin Zores
  2007-01-22 22:19 ` Kumar Gala
  2007-01-23 16:32 ` Timur Tabi
  0 siblings, 2 replies; 7+ messages in thread
From: Benjamin Zores @ 2007-01-22 17:10 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 3068 bytes --]


Hi,

This question is mainly intended to Freescale's MPC8349ITX board maintainer
but the issue/resolution is probably the same for other boards.

I'm trying to boot the MPC8349ITX card with Linux 2.6.19 using old PPC
architecture (and not the new PowerPC one).
I've ported patches from Freescale's BSP from 2.6.13 to 2.6.19 and
it works pretty well but USB doesn't init properly.

Switching to PowerPC arch of course works fine and USB is well inited
but due to other feature i use that only exist on PPC right now, I can't
make use of it.

So I've added the attached patched to my PPC kernel in order to initialize
the USB controller the same way it is done in DTS file for PowerPC arch.
The goal is of course to use the regular EHCI-FSL driver.

I've noticed that PowerPC arch starts by initing the DR controller than MPH one.
On PPC it's the opposite way. Although I have to not initialize the DR one, which
seems to completely hang the card at USB controller probe.

Initializing the MPH controller seems to work fine but then
USB stack has a lot of errors which seem to come from bad EHCI-FSL init.
(see below)

fsl-ehci fsl-ehci.1: No platform data for fsl-ehci.1.               
fsl-ehci fsl-ehci.2: Freescale On-Chip EHCI Host Controller               
fsl-ehci fsl-ehci.2: new USB bus registered, assigned bus number 1      
fsl-ehci fsl-ehci.2: irq 39, io base 0xe0022000                                
fsl-ehci fsl-ehci.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004     
usb usb1: Product: Freescale On-Chip EHCI Host Controller                
usb usb1: Manufacturer: Linux 2.6.19.2-fsl ehci_hcd                            
usb usb1: SerialNumber: fsl-ehci.2                                  
usb usb1: configuration #1 chosen from 1 choice                        
hub 1-0:1.0: USB hub found                                     
hub 1-0:1.0: 2 ports detected                                           
USB Universal Host Controller Interface driver v3.0           
Initializing USB Mass Storage driver...                                  
usb 1-1: new high speed USB device using fsl-ehci and address 2  
usb 1-1: device descriptor read/64, error -32                     
usb 1-1: device descriptor read/64, error -32            
usb 1-1: new high speed USB device using fsl-ehci and address 3  
usb 1-1: device descriptor read/64, error -32                 
usb 1-1: device descriptor read/64, error -32                  
usb 1-1: new high speed USB device using fsl-ehci and address 4     
usb 1-1: device not accepting address 4, error -32              
usb 1-1: new high speed USB device using fsl-ehci and address 5
usb 1-1: device not accepting address 5, error -32                   
usbcore: registered new interface driver usb-storage   
USB Mass Storage support registered.

Of course, the USB controller isn't working afterwards
and no USB device can be used.

Does anyone has an idea where the problem might come from and how to solve it
(once again, switching to PowerPC arch is ok but i don't want to).

Thx in advance,

Regards,

Ben


[-- Attachment #2: usb.patch --]
[-- Type: application/octet-stream, Size: 2289 bytes --]

diff -NEwabur -x '*~' -x linux.orig -x '*.rej' linux.orig/arch/ppc/platforms/83xx/mpc834x_itx.c linux.edit/arch/ppc/platforms/83xx/mpc834x_itx.c
--- linux.orig/arch/ppc/platforms/83xx/mpc834x_itx.c	2007-01-22 19:00:09.000000000 +0100
+++ linux.edit/arch/ppc/platforms/83xx/mpc834x_itx.c	2007-01-22 18:40:42.000000000 +0100
@@ -210,6 +210,7 @@
   unsigned int freq;
   struct gianfar_platform_data *pdata;
   struct gianfar_mdio_data *mdata;
+  struct fsl_usb2_platform_data *udata;
 
   /* get the core frequency */
   freq = binfo->bi_intfreq;
@@ -247,6 +248,17 @@
     memcpy (pdata->mac_addr, binfo->bi_enet1addr, 6);
   }
   
+  /* setup the board related information for the USB controllers */
+  udata=(struct fsl_usb2_platform_data *)ppc_sys_get_pdata(MPC83xx_USB2_MPH);
+  if (udata) {
+    udata->operating_mode = FSL_USB2_MPH_HOST;
+    udata->port_enables |= FSL_USB2_PORT1_ENABLED;
+  }
+
+  udata=(struct fsl_usb2_platform_data *)ppc_sys_get_pdata(MPC83xx_USB2_DR);
+  if (udata)
+    udata->operating_mode = FSL_USB2_DR_HOST;
+  
 #ifdef CONFIG_BLK_DEV_INITRD
   if (initrd_start)
     ROOT_DEV = Root_RAM0;
diff -NEwabur -x '*~' -x linux.orig -x '*.rej' linux.orig/arch/ppc/syslib/mpc83xx_devices.c linux.edit/arch/ppc/syslib/mpc83xx_devices.c
--- linux.orig/arch/ppc/syslib/mpc83xx_devices.c	2007-01-10 20:10:37.000000000 +0100
+++ linux.edit/arch/ppc/syslib/mpc83xx_devices.c	2007-01-22 18:45:25.000000000 +0100
@@ -48,6 +48,16 @@
 	.device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
 };
 
+static struct fsl_usb2_platform_data mpc83xx_usb2_dr_pdata = {
+        .phy_mode = FSL_USB2_PHY_ULPI,
+        .port_enables = 0,
+};
+
+static struct fsl_usb2_platform_data mpc83xx_usb2_mph_pdata = {
+        .phy_mode = FSL_USB2_PHY_ULPI,
+        .port_enables = 0,
+};
+
 static struct plat_serial8250_port serial_platform_data[] = {
 	[0] = {
 		.mapbase	= 0x4500,
@@ -189,6 +199,7 @@
 		.name = "fsl-ehci",
 		.id	= 1,
 		.num_resources	 = 2,
+                //.dev.platform_data = &mpc83xx_usb2_dr_pdata,
 		.resource = (struct resource[]) {
 			{
 				.start	= 0x23000,
@@ -206,6 +217,7 @@
 		.name = "fsl-ehci",
 		.id	= 2,
 		.num_resources	 = 2,
+                .dev.platform_data = &mpc83xx_usb2_mph_pdata,
 		.resource = (struct resource[]) {
 			{
 				.start	= 0x22000,

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-24 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-22 17:10 [MPC8349ITX] USB Init with PPC arch Benjamin Zores
2007-01-22 22:19 ` Kumar Gala
2007-01-23  8:18   ` Benjamin Zores
2007-01-23 16:18     ` Kumar Gala
2007-01-24  9:53       ` Benjamin Zores
2007-01-24 12:56       ` Benjamin Zores
2007-01-23 16:32 ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).