[U-Boot-Users] PCI OHCI / testing-USB branch

Matthias Fuchs matthias.fuchs at esd-electronics.com
Wed Nov 29 20:16:55 CET 2006


Hi Markus,

do you see a problem in passing a pointer to the gohci structure to 
usb_cpu_init() or at least to usb_board_init()?

In order to get the base address of my PCI OHCI controller I first have to 
find the device on the PCI bus. I think usb_board_init() is the right place 
for this. But I need &gohci to pass it back to the usb driver.

Here's is what I mean:

diff --git a/drivers/usb_ohci.c b/drivers/usb_ohci.c
index c5e4c38..8afadd1 100644
--- a/drivers/usb_ohci.c
+++ b/drivers/usb_ohci.c
@@ -1680,19 +1680,20 @@ static char ohci_inited = 0;
 
 int usb_lowlevel_init(void)
 {
+       memset (&gohci, 0, sizeof (ohci_t));
 
 #ifdef CFG_USB_OHCI_CPU_INIT
        /* cpu dependant init */
-       if(usb_cpu_init())
+       if(usb_cpu_init(&gohci))
                return -1;
 #endif
 
 #ifdef CFG_USB_OHCI_BOARD_INIT
        /*  board dependant init */
-       if(usb_board_init())
+       if(usb_board_init(&gohci))
                return -1;
 #endif
-       memset (&gohci, 0, sizeof (ohci_t));
+
        memset (&urb_priv, 0, sizeof (urb_priv_t));
 
        /* align the storage */
@@ -1719,8 +1720,10 @@ int usb_lowlevel_init(void)
        gohci.disabled = 1;
        gohci.sleeping = 0;
        gohci.irq = -1;
-       gohci.regs = (struct ohci_regs *)CFG_USB_OHCI_REGS_BASE;
 
+#ifdef CFG_USB_OHCI_REGS_BASE
+       gohci.regs = (struct ohci_regs *)CFG_USB_OHCI_REGS_BASE;
+#endif
        gohci.flags = 0;
        gohci.slot_name = CFG_USB_OHCI_SLOT_NAME;


Regards
Matthias

On Tuesday 28 November 2006 14:24, Markus Klotzbücher wrote:
> Dear Robert,
>
> Robert Delien <robert.delien at nxp.com> writes:
> >> > is someone currently working on the testing-USB branch? Does it
> >
> > contain
> >
> >> > the most up to date USB code?
> >>
> >> Yes, and no. I've got a couple of patches for the generic OHCI
> >
> > driver
> >
> >> which have not been merged yet, because I want to do some more
> >> testing. I'll try to do this soon.
> >
> > I was working on that too, but I only started today, so I'm glad I'm
> > reading this posting now instead of two weeks later ;-). Could you
> > please send me your patches, or even post them here? I could help you
> > debugging it...
>
> It's now all in the testing-USB branch. Please also see
> doc/README.generic_usb_ohci for a brief description.
>
> Regards
>
> Markus Klotzbuecher




More information about the U-Boot mailing list