mirror of https://gitee.com/openkylin/qemu.git
sun4u: use sunhme as default on-board NIC
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
This commit is contained in:
parent
c110425d16
commit
8d9329719c
|
@ -427,7 +427,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
uint64_t initrd_addr, initrd_size, kernel_addr, kernel_size, kernel_entry;
|
uint64_t initrd_addr, initrd_size, kernel_addr, kernel_size, kernel_entry;
|
||||||
PCIBus *pci_bus, *pci_busA, *pci_busB;
|
PCIBus *pci_bus, *pci_busA, *pci_busB;
|
||||||
PCIDevice *ebus;
|
PCIDevice *ebus, *pci_dev;
|
||||||
ISABus *isa_bus;
|
ISABus *isa_bus;
|
||||||
SysBusDevice *s;
|
SysBusDevice *s;
|
||||||
qemu_irq *ivec_irqs, *pbm_irqs;
|
qemu_irq *ivec_irqs, *pbm_irqs;
|
||||||
|
@ -435,6 +435,8 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||||
DriveInfo *fd[MAX_FD];
|
DriveInfo *fd[MAX_FD];
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
FWCfgState *fw_cfg;
|
FWCfgState *fw_cfg;
|
||||||
|
NICInfo *nd;
|
||||||
|
int onboard_nic_idx;
|
||||||
|
|
||||||
/* init CPUs */
|
/* init CPUs */
|
||||||
cpu = sparc64_cpu_devinit(machine->cpu_model, hwdef->default_cpu_model,
|
cpu = sparc64_cpu_devinit(machine->cpu_model, hwdef->default_cpu_model,
|
||||||
|
@ -464,8 +466,23 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||||
serial_hds_isa_init(isa_bus, i, MAX_SERIAL_PORTS);
|
serial_hds_isa_init(isa_bus, i, MAX_SERIAL_PORTS);
|
||||||
parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
|
parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
|
||||||
|
|
||||||
for(i = 0; i < nb_nics; i++)
|
onboard_nic_idx = -1;
|
||||||
pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
|
for (i = 0; i < nb_nics; i++) {
|
||||||
|
nd = &nd_table[i];
|
||||||
|
|
||||||
|
if (onboard_nic_idx == -1 &&
|
||||||
|
(!nd->model || strcmp(nd->model, "sunhme") == 0)) {
|
||||||
|
pci_dev = pci_create(pci_bus, -1, "sunhme");
|
||||||
|
dev = &pci_dev->qdev;
|
||||||
|
qdev_set_nic_properties(dev, nd);
|
||||||
|
qdev_init_nofail(dev);
|
||||||
|
|
||||||
|
onboard_nic_idx = i;
|
||||||
|
} else {
|
||||||
|
pci_nic_init_nofail(nd, pci_bus, "ne2k_pci", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onboard_nic_idx = MAX(onboard_nic_idx, 0);
|
||||||
|
|
||||||
ide_drive_get(hd, ARRAY_SIZE(hd));
|
ide_drive_get(hd, ARRAY_SIZE(hd));
|
||||||
|
|
||||||
|
@ -510,7 +527,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||||
/* XXX: need an option to load a NVRAM image */
|
/* XXX: need an option to load a NVRAM image */
|
||||||
0,
|
0,
|
||||||
graphic_width, graphic_height, graphic_depth,
|
graphic_width, graphic_height, graphic_depth,
|
||||||
(uint8_t *)&nd_table[0].macaddr);
|
(uint8_t *)&nd_table[onboard_nic_idx].macaddr);
|
||||||
|
|
||||||
dev = qdev_create(NULL, TYPE_FW_CFG_IO);
|
dev = qdev_create(NULL, TYPE_FW_CFG_IO);
|
||||||
qdev_prop_set_bit(dev, "dma_enabled", false);
|
qdev_prop_set_bit(dev, "dma_enabled", false);
|
||||||
|
|
Loading…
Reference in New Issue