[4232] Inventra MUSB-HDRC host-mode USB.
Revision: 4232
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4232 Author: balrog Date: 2008-04-22 03:15:10 +0000 (Tue, 22 Apr 2008)
Log Message:
-----------
Inventra MUSB-HDRC host-mode USB.
Modified Paths:
--------------
trunk/Makefile.target
trunk/hw/devices.h
trunk/hw/nseries.c
trunk/hw/usb.h
Added Paths:
-----------
trunk/hw/tusb6010.c
trunk/hw/usb-musb.cModified: trunk/Makefile.target
===================================================================
Makefile.target +1 -1
@@ -612,7 +612,7 @@ OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o OBJS+= omap2.o omap_dss.o OBJS+= palm.o tsc210x.o -OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o +OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o OBJS+= mst_fpga.o mainstone.o CPPFLAGS += -DHAS_AUDIO endif
Modified: trunk/hw/devices.h
===================================================================
hw/devices.h +7 -0
@@ -52,4 +52,11 @@void retu_key_event (void *retu,int state); +/* tusb6010.c */ +struct tusb_s ; +struct tusb_s *tusb6010_init (qemu_irq intr); +int tusb6010_sync_io (struct tusb_s *s); +int tusb6010_async_io (struct tusb_s *s); +void tusb6010_power (struct tusb_s *s,int on); +#endif
Modified: trunk/hw/nseries.c
===================================================================
hw/nseries.c +26 -0
@@ -42,6 +42,7 @@int keymap[0x80 ]; +struct tusb_s *usb;void *retu;void *tahvo; };
@@ -565,6 +566,29 @@cbus_attach (cbus, s->tahvo =tahvo_init (tahvo_irq,1 )); } +static void n800_usb_power_cb (void *opaque,int line,int level) +{ +struct n800_s *s = opaque; + +tusb6010_power (s->usb, level); +} + +static void n800_usb_setup (struct n800_s *s) +{ +qemu_irq tusb_irq =omap2_gpio_in_get (s->cpu->gpif,N8X0_TUSB_INT_GPIO )[0 ]; +qemu_irq tusb_pwr =qemu_allocate_irqs (n800_usb_power_cb, s,1 )[0 ]; +struct tusb_s *tusb =tusb6010_init (tusb_irq); + +/* Using the NOR interface */ +omap_gpmc_attach (s->cpu->gpmc,N8X0_USB_ASYNC_CS , +tusb6010_async_io (tusb),0 ,0 , tusb); +omap_gpmc_attach (s->cpu->gpmc,N8X0_USB_SYNC_CS , +tusb6010_sync_io (tusb),0 ,0 , tusb); + + s->usb = tusb; +omap2_gpio_out_set (s->cpu->gpif,N800_TUSB_ENABLE_GPIO , tusb_pwr); +} +/* This task is normally performed by the bootloader. If we're loading * a kernel directly, we need to set up GPMC mappings ourselves. */ static void n800_gpmc_init (struct n800_s *s)
@@ -891,6 +915,8 @@n800_spi_setup (s);n800_dss_setup (s, ds);n800_cbus_setup (s); +if (usb_enabled) +n800_usb_setup (s);/* Setup initial (reset) machine state */
Added: trunk/hw/tusb6010.c
===================================================================
hw/tusb6010.c +770 -0
770 lines not on this page · raw message
Added: trunk/hw/usb-musb.c
===================================================================
hw/usb-musb.c +1449 -0
1,449 lines not on this page · raw message
Modified: trunk/hw/usb.h
===================================================================
hw/usb.h +27 -0
@@ -108,6 +108,11 @@#define USB_DT_INTERFACE 0x04#define USB_DT_ENDPOINT 0x05 +#define USB_ENDPOINT_XFER_CONTROL 0 +#define USB_ENDPOINT_XFER_ISOC 1 +#define USB_ENDPOINT_XFER_BULK 2 +#define USB_ENDPOINT_XFER_INT 3 +typedef struct USBPort USBPort ;typedef struct USBDevice USBDevice ;typedef struct USBPacket USBPacket ;
@@ -227,3 +232,25 @@#define VM_USB_HUB_SIZE 8 +/* usb-musb.c */ +enum musb_irq_source_e { + musb_irq_suspend =0 , + musb_irq_resume, + musb_irq_rst_babble, + musb_irq_sof, + musb_irq_connect, + musb_irq_disconnect, + musb_irq_vbus_request, + musb_irq_vbus_error, + musb_irq_rx, + musb_irq_tx, + musb_set_vbus, + musb_set_session, + __musb_irq_max, +}; + +struct musb_s ; +struct musb_s *musb_init (qemu_irq *irqs); +uint32_t musb_core_intr_get (struct musb_s *s); +void musb_core_intr_clear (struct musb_s *s,uint32_t mask); +void musb_set_size (struct musb_s *s,int epnum,int size,int is_tx);