Fix PowerPC boot device selection.
Fix gcc warning in PowerPC PreP machine init routine. Add second IDE channel to Heathrow Mac machine (still not handled by OHW). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3586 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
be98f1f822
commit
0d913fdb62
@ -179,11 +179,12 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
|
|||||||
/* We consider that NewWorld PowerMac never have any floppy drive
|
/* We consider that NewWorld PowerMac never have any floppy drive
|
||||||
* For now, OHW cannot boot from the network.
|
* For now, OHW cannot boot from the network.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < boot_device[i] != '\0'; i++) {
|
for (i = 0; boot_device[i] != '\0'; i++) {
|
||||||
|
if (boot_device[i] >= 'c' && boot_device[i] <= 'f') {
|
||||||
ppc_boot_device = boot_device[i];
|
ppc_boot_device = boot_device[i];
|
||||||
if (ppc_boot_device >= 'c' && ppc_boot_device <= 'f')
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ppc_boot_device == '\0') {
|
if (ppc_boot_device == '\0') {
|
||||||
fprintf(stderr, "No valid boot device for Mac99 machine\n");
|
fprintf(stderr, "No valid boot device for Mac99 machine\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -113,6 +113,7 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size,
|
|||||||
int vga_bios_size, bios_size;
|
int vga_bios_size, bios_size;
|
||||||
qemu_irq *dummy_irq;
|
qemu_irq *dummy_irq;
|
||||||
int pic_mem_index, nvram_mem_index, dbdma_mem_index, cuda_mem_index;
|
int pic_mem_index, nvram_mem_index, dbdma_mem_index, cuda_mem_index;
|
||||||
|
int ide_mem_index[2];
|
||||||
int ppc_boot_device;
|
int ppc_boot_device;
|
||||||
|
|
||||||
linux_boot = (kernel_filename != NULL);
|
linux_boot = (kernel_filename != NULL);
|
||||||
@ -213,18 +214,21 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size,
|
|||||||
initrd_base = 0;
|
initrd_base = 0;
|
||||||
initrd_size = 0;
|
initrd_size = 0;
|
||||||
ppc_boot_device = '\0';
|
ppc_boot_device = '\0';
|
||||||
for (i = 0; i < boot_device[i] != '\0'; i++) {
|
for (i = 0; boot_device[i] != '\0'; i++) {
|
||||||
ppc_boot_device = boot_device[i];
|
|
||||||
/* TOFIX: for now, the second IDE channel is not properly
|
/* TOFIX: for now, the second IDE channel is not properly
|
||||||
* emulated. The Mac floppy disk are not emulated.
|
* used by OHW. The Mac floppy disk are not emulated.
|
||||||
* For now, OHW cannot boot from the network.
|
* For now, OHW cannot boot from the network.
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
if (ppc_boot_device >= 'a' && ppc_boot_device <= 'f')
|
if (boot_device[i] >= 'a' && boot_device[i] <= 'f') {
|
||||||
|
ppc_boot_device = boot_device[i];
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (ppc_boot_device >= 'c' && ppc_boot_device <= 'd')
|
if (boot_device[i] >= 'c' && boot_device[i] <= 'd') {
|
||||||
|
ppc_boot_device = boot_device[i];
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ppc_boot_device == '\0') {
|
if (ppc_boot_device == '\0') {
|
||||||
@ -279,7 +283,11 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size,
|
|||||||
pci_nic_init(pci_bus, &nd_table[i], -1);
|
pci_nic_init(pci_bus, &nd_table[i], -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* First IDE channel is a CMD646 on the PCI bus */
|
||||||
pci_cmd646_ide_init(pci_bus, &bs_table[0], 0);
|
pci_cmd646_ide_init(pci_bus, &bs_table[0], 0);
|
||||||
|
/* Second IDE channel is a MAC IDE on the MacIO bus */
|
||||||
|
ide_mem_index[0] = -1;
|
||||||
|
ide_mem_index[1] = pmac_ide_init(&bs_table[2], pic[0x0D]);
|
||||||
|
|
||||||
/* cuda also initialize ADB */
|
/* cuda also initialize ADB */
|
||||||
cuda_init(&cuda_mem_index, pic[0x12]);
|
cuda_init(&cuda_mem_index, pic[0x12]);
|
||||||
@ -293,7 +301,7 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size,
|
|||||||
dbdma_init(&dbdma_mem_index);
|
dbdma_init(&dbdma_mem_index);
|
||||||
|
|
||||||
macio_init(pci_bus, 0x0017, 1, pic_mem_index, dbdma_mem_index,
|
macio_init(pci_bus, 0x0017, 1, pic_mem_index, dbdma_mem_index,
|
||||||
cuda_mem_index, nvr, 0, NULL);
|
cuda_mem_index, nvr, 2, ide_mem_index);
|
||||||
|
|
||||||
if (usb_enabled) {
|
if (usb_enabled) {
|
||||||
usb_ohci_init_pci(pci_bus, 3, -1);
|
usb_ohci_init_pci(pci_bus, 3, -1);
|
||||||
|
@ -529,7 +529,7 @@ static void ppc_prep_init (int ram_size, int vga_ram_size,
|
|||||||
const char *initrd_filename,
|
const char *initrd_filename,
|
||||||
const char *cpu_model)
|
const char *cpu_model)
|
||||||
{
|
{
|
||||||
CPUState *env, *envs[MAX_CPUS];
|
CPUState *env = NULL, *envs[MAX_CPUS];
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
nvram_t nvram;
|
nvram_t nvram;
|
||||||
m48t59_t *m48t59;
|
m48t59_t *m48t59;
|
||||||
@ -614,11 +614,12 @@ static void ppc_prep_init (int ram_size, int vga_ram_size,
|
|||||||
initrd_size = 0;
|
initrd_size = 0;
|
||||||
ppc_boot_device = '\0';
|
ppc_boot_device = '\0';
|
||||||
/* For now, OHW cannot boot from the network. */
|
/* For now, OHW cannot boot from the network. */
|
||||||
for (i = 0; i < boot_device[i] != '\0'; i++) {
|
for (i = 0; boot_device[i] != '\0'; i++) {
|
||||||
|
if (boot_device[i] >= 'a' && boot_device[i] <= 'f') {
|
||||||
ppc_boot_device = boot_device[i];
|
ppc_boot_device = boot_device[i];
|
||||||
if (ppc_boot_device >= 'a' && ppc_boot_device <= 'f')
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ppc_boot_device == '\0') {
|
if (ppc_boot_device == '\0') {
|
||||||
fprintf(stderr, "No valid boot device for Mac99 machine\n");
|
fprintf(stderr, "No valid boot device for Mac99 machine\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user