public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] USB OHCI drivers unification
@ 2006-05-30 14:04 Rodolfo Giometti
  2006-05-30 14:17 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Rodolfo Giometti @ 2006-05-30 14:04 UTC (permalink / raw)
  To: u-boot

Hello,

I'm trying to unify the several USB OHCI drivers. First of all I
created two new files called "common/usb_ohci.c" and
"include/usb_ohci.h".

Latter file is just a copy of several OHCI headers (for instance I
copy the file cpu/mips/au1x00_usb_ohci.h) and the former is an OHCI
driver modified as follow:

Functions "usb_lowlevel_init()" and "usb_lowlevel_stop()" have the
form:

   int usb_lowlevel_init(void)
   {
           /* Specific board OHCI init */
           usb_ohci_lowlevel_init();

           dbg("OHCI board setup complete\n");

           memset (&gohci, 0, sizeof (ohci_t));
           memset (&urb_priv, 0, sizeof (urb_priv_t));

           ... bla bla ...

           dbg("OHCI revision: 0x%08x\nRH: a: 0x%08x b: 0x%08x\n",
                   readl(&gohci.regs->revision),
                   readl(&gohci.regs->roothub.a), readl(&gohci.regs->roothub.b));

           /* enable host controller */
           if (usb_ohci_lowlevel_enable() < 0)
                   goto errout;

           dbg("OHCI clock running\n");

           if (hc_reset (&gohci) < 0)
                   goto errout;

   	... bla	bla ...

   errout:
           err("OHCI initialization error\n");
           hc_release_ohci (&gohci);

           /* Initialization failed */
	   usb_ohci_lowlevel_disable();

           return -1;
   }

   int usb_lowlevel_stop(void)
   {
           /* this gets called really early - before the controller has */
           /* even been initialized! */
           if (!ohci_inited)
                   return 0;

           /* TODO release any interrupts, etc. */
           /* call hc_release_ohci() here ? */
           hc_reset (&gohci);

           /* disable host controller */
           usb_ohci_lowlevel_disable();

           return 0;
   }

Where the new functions "usb_ohci_lowlevel_init()",
"usb_ohci_lowlevel_enable()" and "usb_ohci_lowlevel_disable()" will be
defined per CPUs into their own directories.

I'd like to know if this modification can be acceptable and who can
help me in testing and doing the patch for each platform using USB
OHCI. I can test and patch my board with MIPS au1100.

Also, I'd like to know how I should build my patch since I'm quite
sure that it could be greater than 40KB...

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

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

end of thread, other threads:[~2006-05-31 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 14:04 [U-Boot-Users] USB OHCI drivers unification Rodolfo Giometti
2006-05-30 14:17 ` Wolfgang Denk
     [not found]   ` <20060530145421.GU21995@enneenne.com>
2006-05-31  8:43     ` Markus Klotzbücher
2006-05-31  9:21       ` Rodolfo Giometti
2006-05-31 10:29         ` Markus Klotzbücher
2006-05-31 10:34           ` Rodolfo Giometti
2006-05-31 12:11             ` Markus Klotzbücher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox