{
struct beagle_s *s = (struct beagle_s *) qemu_mallocz(sizeof(*s));
int sdindex = drive_get_index(IF_SD, 0, 0);
+ void *opaque;
if (sdindex == -1) {
fprintf(stderr, "%s: missing SecureDigital device\n", __FUNCTION__);
s->i2c = omap_i2c_bus(s->cpu->i2c[0]);
s->twl4030 = twl4030_init(s->i2c, s->cpu->irq[0][OMAP_INT_3XXX_SYS_NIRQ]);
- smc91c111_init(&nd_table[0], 0x01000000,
- omap2_gpio_in_get(s->cpu->gpif, 51)[0]);
-/* omap_gpmc_attach(s->cpu->gpmc, BEAGLE_SMC_CS, 0, 0, 0, NULL, NULL); */
+ opaque = smc91c111_init(&nd_table[0], 0x08000000,
+ omap2_gpio_in_get(s->cpu->gpif, 54)[0], 0);
+ omap_gpmc_attach(s->cpu->gpmc, BEAGLE_SMC_CS, smc91c111_iomemtype(opaque), 0, 0, opaque, NULL);
s->lcd_panel = omap3_lcd_panel_init();
omap3_lcd_panel_attach(s->cpu->dss, 0, s->lcd_panel);
/* Devices that have nowhere better to go. */
/* smc91c111.c */
-void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
+void *smc91c111_init(NICInfo *, uint32_t, qemu_irq, int phys_alloc);
+int smc91c111_iomemtype(void *opaque);
/* ssd0323.c */
int ssd0323_xfer_ssi(void *opaque, int data);
/* Interrupt line of NIC is connected to GPIO line 36 */
smc91c111_init(&nd_table[0], 0x04000300,
- pxa2xx_gpio_in_get(cpu->gpio)[36]);
+ pxa2xx_gpio_in_get(cpu->gpio)[36], 1);
}
static void verdex_init(ram_addr_t ram_size, int vga_ram_size,
/* Interrupt line of NIC is connected to GPIO line 99 */
smc91c111_init(&nd_table[0], 0x04000300,
- pxa2xx_gpio_in_get(cpu->gpio)[99]);
+ pxa2xx_gpio_in_get(cpu->gpio)[99], 1);
}
QEMUMachine connex_machine = {
}
pl181_init(0x1c000000, drives_table[sd].bdrv, pic[23], pic[24]);
if (nd_table[0].vlan)
- smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
+ smc91c111_init(&nd_table[0], 0xc8000000, pic[27], 1);
pl110_init(0xc0000000, pic[22], 0);
integrator_binfo.ram_size = ram_size;
/* MMC/SD host */
pxa2xx_mmci_handlers(cpu->mmc, NULL, mst_irq[MMC_IRQ]);
- smc91c111_init(&nd_table[0], MST_ETH_PHYS, mst_irq[ETHERNET_IRQ]);
+ smc91c111_init(&nd_table[0], MST_ETH_PHYS, mst_irq[ETHERNET_IRQ], 1);
mainstone_binfo.kernel_filename = kernel_filename;
mainstone_binfo.kernel_cmdline = kernel_cmdline;
nd = &nd_table[n];
if ((!nd->model && !done_smc) || strcmp(nd->model, "smc91c111") == 0) {
- smc91c111_init(nd, 0x4e000000, pic[28]);
+ smc91c111_init(nd, 0x4e000000, pic[28], 1);
done_smc = 1;
} else {
pci_nic_init(pci_bus, nd, -1, "rtl8139");
int rx_fifo[NUM_PACKETS];
int tx_fifo_done_len;
int tx_fifo_done[NUM_PACKETS];
+ int iomemtype;
/* Packet buffer memory. */
uint8_t data[NUM_PACKETS][2048];
uint8_t int_level;
smc91c111_writel
};
-void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
+int smc91c111_iomemtype(void *opaque) {
+ smc91c111_state *s=(smc91c111_state *) opaque;
+ return s->iomemtype;
+}
+
+void *smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq, int phys_alloc)
{
smc91c111_state *s;
- int iomemtype;
qemu_check_nic_model(nd, "smc91c111");
s = (smc91c111_state *)qemu_mallocz(sizeof(smc91c111_state));
- iomemtype = cpu_register_io_memory(0, smc91c111_readfn,
- smc91c111_writefn, s);
- cpu_register_physical_memory(base, 16, iomemtype);
+ s->iomemtype = cpu_register_io_memory(0, smc91c111_readfn,
+ smc91c111_writefn, s);
+ if (phys_alloc)
+ cpu_register_physical_memory(base, 16, s->iomemtype);
s->irq = irq;
memcpy(s->macaddr, nd->macaddr, 6);
smc91c111_receive, smc91c111_can_receive, s);
qemu_format_nic_info_str(s->vc, s->macaddr);
/* ??? Save/restore. */
+ return s;
}
nd = &nd_table[n];
if ((!nd->model && !done_smc) || strcmp(nd->model, "smc91c111") == 0) {
- smc91c111_init(nd, 0x10010000, sic[25]);
+ smc91c111_init(nd, 0x10010000, sic[25], 1);
done_smc = 1;
} else {
pci_nic_init(pci_bus, nd, -1, "rtl8139");