* [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
* Re: [MPC8349ITX] USB Init with PPC arch
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:32 ` Timur Tabi
1 sibling, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-01-22 22:19 UTC (permalink / raw)
To: Benjamin Zores; +Cc: linuxppc-embedded
On Jan 22, 2007, at 11:10 AM, Benjamin Zores wrote:
>
> 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.
What are these features?
> 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).
If you are forward porting the Freescale patches and not using the in
kernel driver that would explain the issue. There are bugs in the
Freescale driver that have been fixed in the driver that is in the
kernel.
- kumar
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [MPC8349ITX] USB Init with PPC arch
2007-01-22 22:19 ` Kumar Gala
@ 2007-01-23 8:18 ` Benjamin Zores
2007-01-23 16:18 ` Kumar Gala
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Zores @ 2007-01-23 8:18 UTC (permalink / raw)
To: linuxppc-embedded
On Mon, 22 Jan 2007 16:19:06 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
> What are these features?
External RT patch that only supports PPC arch atm.
Also I've encountered some stability issues with PowerPC branch
(card hangs after some time for undetermined reason).
> If you are forward porting the Freescale patches and not using the in
> kernel driver that would explain the issue. There are bugs in the
> Freescale driver that have been fixed in the driver that is in the
> kernel.
I only ported what needs to be i.e. the platform initialization part.
I'm using the regular USB drivers (EHCI-FSL) from vanilla 2.6.19, this part
hasn't be ported from old 2.6.13 BSP code (which would have been useless).
The goal of the patch i've sent early is to init the USB bus the same way
it is done by OF device tree in arch/powerpc/sysdev/fsl_soc.c (but for PPC).
Does it sounds ok to you ?
Regards,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [MPC8349ITX] USB Init with PPC arch
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
0 siblings, 2 replies; 7+ messages in thread
From: Kumar Gala @ 2007-01-23 16:18 UTC (permalink / raw)
To: Benjamin Zores; +Cc: linuxppc-embedded
On Jan 23, 2007, at 2:18 AM, Benjamin Zores wrote:
> On Mon, 22 Jan 2007 16:19:06 -0600
> Kumar Gala <galak@kernel.crashing.org> wrote:
>
>> What are these features?
>
> External RT patch that only supports PPC arch atm.
> Also I've encountered some stability issues with PowerPC branch
> (card hangs after some time for undetermined reason).
Do you get an oops on the hang? would be useful to know if we have
an issue in arch/powerpc
>> If you are forward porting the Freescale patches and not using the in
>> kernel driver that would explain the issue. There are bugs in the
>> Freescale driver that have been fixed in the driver that is in the
>> kernel.
>
> I only ported what needs to be i.e. the platform initialization part.
> I'm using the regular USB drivers (EHCI-FSL) from vanilla 2.6.19,
> this part
> hasn't be ported from old 2.6.13 BSP code (which would have been
> useless).
>
> The goal of the patch i've sent early is to init the USB bus the
> same way
> it is done by OF device tree in arch/powerpc/sysdev/fsl_soc.c (but
> for PPC).
>
> Does it sounds ok to you ?
that sounds reasonable.
Take a look at this patch from Randy Vinson that adds support to arch/
ppc for USB.
http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021773.html
- k
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [MPC8349ITX] USB Init with PPC arch
2007-01-22 17:10 [MPC8349ITX] USB Init with PPC arch Benjamin Zores
2007-01-22 22:19 ` Kumar Gala
@ 2007-01-23 16:32 ` Timur Tabi
1 sibling, 0 replies; 7+ messages in thread
From: Timur Tabi @ 2007-01-23 16:32 UTC (permalink / raw)
To: Benjamin Zores; +Cc: linuxppc-embedded
Benjamin Zores wrote:
> 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 the maintainer, although I don't think I can help you with this specific
problem.
> 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.
What feature is that? I would think it would be easier to port that feature to
the powerpc architecture, then it would be to port ITX support to the ppc
architecture.
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [MPC8349ITX] USB Init with PPC arch
2007-01-23 16:18 ` Kumar Gala
@ 2007-01-24 9:53 ` Benjamin Zores
2007-01-24 12:56 ` Benjamin Zores
1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Zores @ 2007-01-24 9:53 UTC (permalink / raw)
To: linuxppc-embedded
On Tue, 23 Jan 2007 10:18:34 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
> Do you get an oops on the hang? would be useful to know if we have
> an issue in arch/powerpc
Unfortunately not, I may do more tests with 2.6.20-rcX snapshots.
But it just hang at random periods, no oops nor crash info :-(
> Take a look at this patch from Randy Vinson that adds support to arch/
> ppc for USB.
>
> http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021773.html
Thanks a lot, I'll keep you posted of the results.
Regards,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [MPC8349ITX] USB Init with PPC arch
2007-01-23 16:18 ` Kumar Gala
2007-01-24 9:53 ` Benjamin Zores
@ 2007-01-24 12:56 ` Benjamin Zores
1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Zores @ 2007-01-24 12:56 UTC (permalink / raw)
To: linuxppc-embedded
On Tue, 23 Jan 2007 10:18:34 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
> Take a look at this patch from Randy Vinson that adds support to arch/
> ppc for USB.
>
> http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021773.html
Thanks for the hint.
I've seen the part that was missing in my own patch and now the MPH is well detected (though the DR one still hangs the card but it's useless to me atm).
Ben
^ 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).