diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-12 17:40:23 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-12 17:40:23 +0000 |
commit | 7fa9ae1aaab87bd197a34623a1c264dca51d6217 (patch) | |
tree | acc5debc4d208f4b0f116a04d9975c1d73011802 /hw | |
parent | b4ed08e09e1afefff885baffbea6e092386addc2 (diff) |
Use ESCC for PowerMac serial
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6271 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/macio.c | 9 | ||||
-rw-r--r-- | hw/ppc_chrp.c | 9 | ||||
-rw-r--r-- | hw/ppc_mac.h | 4 | ||||
-rw-r--r-- | hw/ppc_oldworld.c | 9 |
4 files changed, 21 insertions, 10 deletions
diff --git a/hw/macio.c b/hw/macio.c index 7f0d9f7910..2a98dfb318 100644 --- a/hw/macio.c +++ b/hw/macio.c @@ -25,6 +25,7 @@ #include "hw.h" #include "ppc_mac.h" #include "pci.h" +#include "escc.h" typedef struct macio_state_t macio_state_t; struct macio_state_t { @@ -32,6 +33,7 @@ struct macio_state_t { int pic_mem_index; int dbdma_mem_index; int cuda_mem_index; + int escc_mem_index; void *nvram; int nb_ide; int ide_mem_index[4]; @@ -59,6 +61,10 @@ static void macio_map (PCIDevice *pci_dev, int region_num, cpu_register_physical_memory(addr + 0x08000, 0x1000, macio_state->dbdma_mem_index); } + if (macio_state->escc_mem_index >= 0) { + cpu_register_physical_memory(addr + 0x13000, ESCC_SIZE << 4, + macio_state->escc_mem_index); + } if (macio_state->cuda_mem_index >= 0) { cpu_register_physical_memory(addr + 0x16000, 0x2000, macio_state->cuda_mem_index); @@ -75,7 +81,7 @@ static void macio_map (PCIDevice *pci_dev, int region_num, void macio_init (PCIBus *bus, int device_id, int is_oldworld, int pic_mem_index, int dbdma_mem_index, int cuda_mem_index, void *nvram, - int nb_ide, int *ide_mem_index) + int nb_ide, int *ide_mem_index, int escc_mem_index) { PCIDevice *d; macio_state_t *macio_state; @@ -89,6 +95,7 @@ void macio_init (PCIBus *bus, int device_id, int is_oldworld, int pic_mem_index, macio_state->pic_mem_index = pic_mem_index; macio_state->dbdma_mem_index = dbdma_mem_index; macio_state->cuda_mem_index = cuda_mem_index; + macio_state->escc_mem_index = escc_mem_index; macio_state->nvram = nvram; if (nb_ide > 4) nb_ide = 4; diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c index 5bdb80536b..d57e2860fe 100644 --- a/hw/ppc_chrp.c +++ b/hw/ppc_chrp.c @@ -31,6 +31,7 @@ #include "net.h" #include "sysemu.h" #include "boards.h" +#include "escc.h" #define MAX_IDE_BUS 2 @@ -80,7 +81,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size, m48t59_t *m48t59; int vga_bios_size, bios_size; qemu_irq *dummy_irq; - int pic_mem_index, dbdma_mem_index, cuda_mem_index; + int pic_mem_index, dbdma_mem_index, cuda_mem_index, escc_mem_index; int ide_mem_index[2]; int ppc_boot_device; int index; @@ -262,8 +263,8 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size, /* XXX: suppress that */ dummy_irq = i8259_init(NULL); - /* XXX: use Mac Serial port */ - serial_init(0x3f8, dummy_irq[4], 115200, serial_hds[0]); + escc_mem_index = escc_init(0x80013000, dummy_irq[4], serial_hds[0], + serial_hds[1], ESCC_CLOCK, 4); for(i = 0; i < nb_nics; i++) { if (!nd_table[i].model) nd_table[i].model = "ne2k_pci"; @@ -295,7 +296,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size, dbdma_init(&dbdma_mem_index); macio_init(pci_bus, 0x0022, 0, pic_mem_index, dbdma_mem_index, - cuda_mem_index, NULL, 2, ide_mem_index); + cuda_mem_index, NULL, 2, ide_mem_index, escc_mem_index); if (usb_enabled) { usb_ohci_init_pci(pci_bus, 3, -1); diff --git a/hw/ppc_mac.h b/hw/ppc_mac.h index d895b893d0..cc70fb7dc7 100644 --- a/hw/ppc_mac.h +++ b/hw/ppc_mac.h @@ -37,6 +37,8 @@ #define KERNEL_LOAD_ADDR 0x01000000 #define INITRD_LOAD_ADDR 0x01800000 +#define ESCC_CLOCK 3686400 + /* DBDMA */ void dbdma_init (int *dbdma_mem_index); @@ -46,7 +48,7 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq); /* MacIO */ void macio_init (PCIBus *bus, int device_id, int is_oldworld, int pic_mem_index, int dbdma_mem_index, int cuda_mem_index, void *nvram, - int nb_ide, int *ide_mem_index); + int nb_ide, int *ide_mem_index, int escc_mem_index); /* NewWorld PowerMac IDE */ int pmac_ide_init (BlockDriverState **hd_table, qemu_irq irq); diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index 37f7646293..21b88b034a 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -33,6 +33,7 @@ #include "pci.h" #include "boards.h" #include "fw_cfg.h" +#include "escc.h" #define MAX_IDE_BUS 2 #define VGA_BIOS_SIZE 65536 @@ -126,7 +127,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size, int vga_bios_size, bios_size; qemu_irq *dummy_irq; int pic_mem_index, nvram_mem_index, dbdma_mem_index, cuda_mem_index; - int ide_mem_index[2]; + int escc_mem_index, ide_mem_index[2]; int ppc_boot_device; BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int index; @@ -296,8 +297,8 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size, /* XXX: suppress that */ dummy_irq = i8259_init(NULL); - /* XXX: use Mac Serial port */ - serial_init(0x3f8, dummy_irq[4], 115200, serial_hds[0]); + escc_mem_index = escc_init(0x80013000, pic[0x10], serial_hds[0], + serial_hds[1], ESCC_CLOCK, 4); for(i = 0; i < nb_nics; i++) { if (!nd_table[i].model) @@ -350,7 +351,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size, dbdma_init(&dbdma_mem_index); macio_init(pci_bus, 0x0010, 1, pic_mem_index, dbdma_mem_index, - cuda_mem_index, nvr, 2, ide_mem_index); + cuda_mem_index, nvr, 2, ide_mem_index, escc_mem_index); if (usb_enabled) { usb_ohci_init_pci(pci_bus, 3, -1); |