[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/17] e500: move uarts CCSR
From: |
Michael Davidsaver |
Subject: |
[Qemu-devel] [PATCH 10/17] e500: move uarts CCSR |
Date: |
Sun, 26 Nov 2017 15:59:08 -0600 |
Signed-off-by: Michael Davidsaver <address@hidden>
---
hw/ppc/e500.c | 13 -------------
hw/ppc/e500_ccsr.c | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 1872bb8eaa..2d87d91582 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -22,7 +22,6 @@
#include "net/net.h"
#include "qemu/config-file.h"
#include "hw/hw.h"
-#include "hw/char/serial.h"
#include "hw/pci/pci.h"
#include "hw/boards.h"
#include "sysemu/sysemu.h"
@@ -770,18 +769,6 @@ void ppce500_init(MachineState *machine, PPCE500Params
*params)
mpicdev = DEVICE(object_resolve_path("/machine/pic", 0));
assert(mpicdev);
- /* Serial */
- if (serial_hds[0]) {
- serial_mm_init(ccsr_addr_space, MPC8544_SERIAL0_REGS_OFFSET,
- 0, qdev_get_gpio_in(mpicdev, 42), 399193,
- serial_hds[0], DEVICE_BIG_ENDIAN);
- }
-
- if (serial_hds[1]) {
- serial_mm_init(ccsr_addr_space, MPC8544_SERIAL1_REGS_OFFSET,
- 0, qdev_get_gpio_in(mpicdev, 42), 399193,
- serial_hds[1], DEVICE_BIG_ENDIAN);
- }
/* PCI */
dev = qdev_create(NULL, "e500-pcihost");
diff --git a/hw/ppc/e500_ccsr.c b/hw/ppc/e500_ccsr.c
index 68d952794e..f1adba4e54 100644
--- a/hw/ppc/e500_ccsr.c
+++ b/hw/ppc/e500_ccsr.c
@@ -31,6 +31,7 @@
#include "sysemu/sysemu.h"
#include "sysemu/kvm.h"
#include "hw/sysbus.h"
+#include "hw/char/serial.h"
#include "hw/ppc/openpic.h"
/* E500_ denotes registers common to all */
@@ -45,6 +46,8 @@
#define E500_ERR_DETECT (0x2e40)
#define E500_ERR_DISABLE (0x2e44)
+#define E500_DUART_OFFSET(N) (0x4500 + (N) * 0x100)
+
#define E500_PORPLLSR (0xE0000)
#define E500_PVR (0xE00A0)
#define E500_SVR (0xE00A4)
@@ -266,6 +269,21 @@ static void e500_ccsr_realize(DeviceState *dev, Error
**errp)
memory_region_add_subregion(&ccsr->iomem, E500_MPIC_OFFSET,
sysbus_mmio_get_region(pic, 0));
+ /* Note: MPIC internal interrupts are offset by 16 */
+
+ /* DUARTS */
+ if (serial_hds[0]) {
+ serial_mm_init(&ccsr->iomem, E500_DUART_OFFSET(0),
+ 0, qdev_get_gpio_in(ccsr->pic, 16 + 26), 399193,
+ serial_hds[0], DEVICE_BIG_ENDIAN);
+ }
+
+ if (serial_hds[1]) {
+ serial_mm_init(&ccsr->iomem, E500_DUART_OFFSET(1),
+ 0, qdev_get_gpio_in(ccsr->pic, 16 + 26), 399193,
+ serial_hds[1], DEVICE_BIG_ENDIAN);
+ }
+
}
static Property e500_ccsr_props[] = {
--
2.11.0
- [Qemu-devel] [PATCH 03/17] i2c: add mpc8540 i2c controller, (continued)
- [Qemu-devel] [PATCH 03/17] i2c: add mpc8540 i2c controller, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 01/17] openpic: debug w/ info_report(), Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 07/17] e500: fix pci host bridge class/type, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 05/17] timer: generalize Dallas/Maxim RTC i2c devices, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 11/17] e500: derive baud from CCB clock, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 06/17] tests: rewrite testing for DS RTC devices, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 09/17] e500: move mpic under CCSR, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 10/17] e500: move uarts CCSR,
Michael Davidsaver <=
- [Qemu-devel] [PATCH 14/17] e500: split mpc8544ds specific initialization, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 08/17] e500: additional CCSR registers, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 12/17] e500: add i2c controller to CCSR, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 13/17] e500: move PCI host bridge into CCSR, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 17/17] tests: add mvme3100-test, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 16/17] tests: run ds-rtc-i2c-test w/ ppc/mvme3100, Michael Davidsaver, 2017/11/26
- [Qemu-devel] [PATCH 15/17] ppc: add mvme3100 machine, Michael Davidsaver, 2017/11/26