Revision 46e50e9d hw/ppc_chrp.c

b/hw/ppc_chrp.c
89 89
    cpu_register_physical_memory(addr + 0x20000, 0x1000, ide1_mem_index);
90 90
}
91 91

  
92
static void macio_init(void)
92
static void macio_init(PCIBus *bus)
93 93
{
94 94
    PCIDevice *d;
95 95

  
96
    d = pci_register_device("macio", sizeof(PCIDevice),
97
                            0, -1, 
98
                            NULL, NULL);
96
    d = pci_register_device(bus, "macio", sizeof(PCIDevice),
97
                            -1, NULL, NULL);
99 98
    /* Note: this code is strongly inspirated from the corresponding code
100 99
       in PearPC */
101 100
    d->config[0x00] = 0x6b; // vendor_id
......
128 127
    int ret, linux_boot, i, fd;
129 128
    unsigned long bios_offset;
130 129
    uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
131
    
130
    PCIBus *pci_bus;
131

  
132 132
    linux_boot = (kernel_filename != NULL);
133 133

  
134 134
    /* allocate RAM */
......
182 182
    cpu_ppc_tb_init(cpu_single_env, 100UL * 1000UL * 1000UL);
183 183

  
184 184
    isa_mem_base = 0x80000000;
185
    pci_pmac_init();
185
    pci_bus = pci_pmac_init();
186 186

  
187 187
    /* Register 8 MB of ISA IO space */
188 188
    PPC_io_memory = cpu_register_io_memory(0, PPC_io_read, PPC_io_write, NULL);
189 189
    cpu_register_physical_memory(0xF2000000, 0x00800000, PPC_io_memory);
190 190

  
191 191
    /* init basic PC hardware */
192
    vga_initialize(ds, phys_ram_base + ram_size, ram_size, 
193
                   vga_ram_size, 1);
194
    openpic = openpic_init(0x00000000, 0xF0000000, 1);
195

  
192
    vga_initialize(pci_bus, ds, phys_ram_base + ram_size, ram_size, 
193
                   vga_ram_size);
194
    openpic = openpic_init(pci_bus, 0x00000000, 0xF0000000, 1);
195
    pci_pmac_set_openpic(pci_bus, openpic);
196
    
196 197
    /* XXX: suppress that */
197 198
    pic_init();
198 199

  
......
201 202
    serial_init(0x3f8, 4, fd);
202 203

  
203 204
    for(i = 0; i < nb_nics; i++) {
204
        pci_ne2000_init(&nd_table[i]);
205
        pci_ne2000_init(pci_bus, &nd_table[i]);
205 206
    }
206 207

  
207 208
    ide0_mem_index = pmac_ide_init(&bs_table[0], openpic, 0x13);
......
213 214
    adb_kbd_init(&adb_bus);
214 215
    adb_mouse_init(&adb_bus);
215 216
    
216
    macio_init();
217
    macio_init(pci_bus);
217 218

  
218 219
    nvram = m48t59_init(8, 0xFFF04000, 0x0074, NVRAM_SIZE);
219 220
    

Also available in: Unified diff