From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6271] Use ESCC for PowerMac serial
Date: Mon, 12 Jan 2009 17:40:24 +0000 [thread overview]
Message-ID: <E1LMQm0-00080V-KV@cvs.savannah.gnu.org> (raw)
Revision: 6271
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6271
Author: blueswir1
Date: 2009-01-12 17:40:23 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
Use ESCC for PowerMac serial
Modified Paths:
--------------
trunk/Makefile.target
trunk/hw/macio.c
trunk/hw/ppc_chrp.c
trunk/hw/ppc_mac.h
trunk/hw/ppc_oldworld.c
Modified: trunk/Makefile.target
===================================================================
--- trunk/Makefile.target 2009-01-12 17:38:28 UTC (rev 6270)
+++ trunk/Makefile.target 2009-01-12 17:40:23 UTC (rev 6271)
@@ -646,7 +646,7 @@
OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
OBJS+= prep_pci.o ppc_prep.o
# Mac shared devices
-OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
+OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
# OldWorld PowerMac
OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
# NewWorld PowerMac
Modified: trunk/hw/macio.c
===================================================================
--- trunk/hw/macio.c 2009-01-12 17:38:28 UTC (rev 6270)
+++ trunk/hw/macio.c 2009-01-12 17:40:23 UTC (rev 6271)
@@ -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 @@
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 @@
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 @@
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 @@
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;
Modified: trunk/hw/ppc_chrp.c
===================================================================
--- trunk/hw/ppc_chrp.c 2009-01-12 17:38:28 UTC (rev 6270)
+++ trunk/hw/ppc_chrp.c 2009-01-12 17:40:23 UTC (rev 6271)
@@ -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 @@
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 @@
/* 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 @@
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);
Modified: trunk/hw/ppc_mac.h
===================================================================
--- trunk/hw/ppc_mac.h 2009-01-12 17:38:28 UTC (rev 6270)
+++ trunk/hw/ppc_mac.h 2009-01-12 17:40:23 UTC (rev 6271)
@@ -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 @@
/* 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);
Modified: trunk/hw/ppc_oldworld.c
===================================================================
--- trunk/hw/ppc_oldworld.c 2009-01-12 17:38:28 UTC (rev 6270)
+++ trunk/hw/ppc_oldworld.c 2009-01-12 17:40:23 UTC (rev 6271)
@@ -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 @@
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 @@
/* 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 @@
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);
next reply other threads:[~2009-01-12 17:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 17:40 Blue Swirl [this message]
2009-01-12 20:18 ` [Qemu-devel] [6271] Use ESCC for PowerMac serial Aurelien Jarno
2009-01-12 20:32 ` Blue Swirl
2009-01-12 20:40 ` Aurelien Jarno
2009-01-12 20:48 ` Blue Swirl
2009-01-12 21:10 ` Aurelien Jarno
2009-01-12 20:50 ` Aurelien Jarno
2009-01-12 20:59 ` Blue Swirl
2009-01-12 21:10 ` Aurelien Jarno
2009-01-13 17:03 ` Aurelien Jarno
2009-01-13 17:21 ` Blue Swirl
2009-01-13 17:28 ` Aurelien Jarno
2009-01-13 20:12 ` Blue Swirl
2009-01-13 21:24 ` Aurelien Jarno
2009-01-13 21:28 ` Laurent Vivier
2009-01-13 20:46 ` Laurent Vivier
2009-01-13 21:41 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1LMQm0-00080V-KV@cvs.savannah.gnu.org \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).