Inventra MUSB-HDRC host-mode USB.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4232 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
balrog 2008-04-22 03:15:10 +00:00
parent a050e24df2
commit 942ac05261
6 changed files with 2280 additions and 1 deletions

View file

@ -42,6 +42,7 @@ struct n800_s {
int keymap[0x80];
struct tusb_s *usb;
void *retu;
void *tahvo;
};
@ -565,6 +566,29 @@ static void n800_cbus_setup(struct n800_s *s)
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 @@ static void n800_init(int ram_size, int vga_ram_size,
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 */