Revision 942ac052 hw/nseries.c

b/hw/nseries.c
42 42

  
43 43
    int keymap[0x80];
44 44

  
45
    struct tusb_s *usb;
45 46
    void *retu;
46 47
    void *tahvo;
47 48
};
......
565 566
    cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1));
566 567
}
567 568

  
569
static void n800_usb_power_cb(void *opaque, int line, int level)
570
{
571
    struct n800_s *s = opaque;
572

  
573
    tusb6010_power(s->usb, level);
574
}
575

  
576
static void n800_usb_setup(struct n800_s *s)
577
{
578
    qemu_irq tusb_irq = omap2_gpio_in_get(s->cpu->gpif, N8X0_TUSB_INT_GPIO)[0];
579
    qemu_irq tusb_pwr = qemu_allocate_irqs(n800_usb_power_cb, s, 1)[0];
580
    struct tusb_s *tusb = tusb6010_init(tusb_irq);
581

  
582
    /* Using the NOR interface */
583
    omap_gpmc_attach(s->cpu->gpmc, N8X0_USB_ASYNC_CS,
584
                    tusb6010_async_io(tusb), 0, 0, tusb);
585
    omap_gpmc_attach(s->cpu->gpmc, N8X0_USB_SYNC_CS,
586
                    tusb6010_sync_io(tusb), 0, 0, tusb);
587

  
588
    s->usb = tusb;
589
    omap2_gpio_out_set(s->cpu->gpif, N800_TUSB_ENABLE_GPIO, tusb_pwr);
590
}
591

  
568 592
/* This task is normally performed by the bootloader.  If we're loading
569 593
 * a kernel directly, we need to set up GPMC mappings ourselves.  */
570 594
static void n800_gpmc_init(struct n800_s *s)
......
891 915
    n800_spi_setup(s);
892 916
    n800_dss_setup(s, ds);
893 917
    n800_cbus_setup(s);
918
    if (usb_enabled)
919
        n800_usb_setup(s);
894 920

  
895 921
    /* Setup initial (reset) machine state */
896 922

  

Also available in: Unified diff