summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/hppa/hppa_hardware.h10
-rw-r--r--hw/hppa/machine.c22
-rw-r--r--hw/intc/pnv_xive2.c3
-rw-r--r--hw/ppc/e500.c1
-rw-r--r--hw/ppc/spapr.c25
5 files changed, 35 insertions, 26 deletions
diff --git a/hw/hppa/hppa_hardware.h b/hw/hppa/hppa_hardware.h
index 8b6b9222cb..a5ac3dd0fd 100644
--- a/hw/hppa/hppa_hardware.h
+++ b/hw/hppa/hppa_hardware.h
@@ -1,4 +1,5 @@
/* HPPA cores and system support chips. */
+/* Be aware: QEMU and seabios-hppa repositories share this file as-is. */
#ifndef HW_HPPA_HPPA_HARDWARE_H
#define HW_HPPA_HPPA_HARDWARE_H
@@ -30,13 +31,18 @@
#define PCI_HPA DINO_HPA /* PCI bus */
#define IDE_HPA 0xf9000000 /* Boot disc controller */
+/* offsets to DINO HPA: */
+#define DINO_PCI_ADDR 0x064
+#define DINO_CONFIG_DATA 0x068
+#define DINO_IO_DATA 0x06c
+
#define PORT_PCI_CMD (PCI_HPA + DINO_PCI_ADDR)
#define PORT_PCI_DATA (PCI_HPA + DINO_CONFIG_DATA)
#define FW_CFG_IO_BASE 0xfffa0000
-#define PORT_SERIAL1 (DINO_UART_HPA + 0x800)
-#define PORT_SERIAL2 (LASI_UART_HPA + 0x800)
+#define PORT_SERIAL1 (LASI_UART_HPA + 0x800)
+#define PORT_SERIAL2 (DINO_UART_HPA + 0x800)
#define HPPA_MAX_CPUS 16 /* max. number of SMP CPUs */
#define CPU_CLOCK_MHZ 250 /* emulate a 250 MHz CPU */
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index d1e174b1f4..63b9dd2396 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -32,7 +32,7 @@
#define MAX_IDE_BUS 2
-#define MIN_SEABIOS_HPPA_VERSION 1 /* require at least this fw version */
+#define MIN_SEABIOS_HPPA_VERSION 6 /* require at least this fw version */
#define HPA_POWER_BUTTON (FIRMWARE_END - 0x10)
@@ -236,20 +236,14 @@ static void machine_hppa_init(MachineState *machine)
/* Realtime clock, used by firmware for PDC_TOD call. */
mc146818_rtc_init(isa_bus, 2000, NULL);
- /* Serial code setup. */
- if (serial_hd(0)) {
- uint32_t addr = DINO_UART_HPA + 0x800;
- serial_mm_init(addr_space, addr, 0,
- qdev_get_gpio_in(dino_dev, DINO_IRQ_RS232INT),
- 115200, serial_hd(0), DEVICE_BIG_ENDIAN);
- }
+ /* Serial ports: Lasi and Dino use a 7.272727 MHz clock. */
+ serial_mm_init(addr_space, LASI_UART_HPA + 0x800, 0,
+ qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 7272727 / 16,
+ serial_hd(0), DEVICE_BIG_ENDIAN);
- if (serial_hd(1)) {
- /* Serial port */
- serial_mm_init(addr_space, LASI_UART_HPA + 0x800, 0,
- qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 8000000 / 16,
- serial_hd(1), DEVICE_BIG_ENDIAN);
- }
+ serial_mm_init(addr_space, DINO_UART_HPA + 0x800, 0,
+ qdev_get_gpio_in(dino_dev, DINO_IRQ_RS232INT), 7272727 / 16,
+ serial_hd(1), DEVICE_BIG_ENDIAN);
/* Parallel port */
parallel_mm_init(addr_space, LASI_LPT_HPA + 0x800, 0,
diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c
index 87303b4064..a39e070e82 100644
--- a/hw/intc/pnv_xive2.c
+++ b/hw/intc/pnv_xive2.c
@@ -1295,7 +1295,6 @@ static void pnv_xive2_ic_tctxt_write(void *opaque, hwaddr offset,
uint64_t val, unsigned size)
{
PnvXive2 *xive = PNV_XIVE2(opaque);
- uint32_t reg = offset >> 3;
switch (offset) {
/*
@@ -1322,8 +1321,6 @@ static void pnv_xive2_ic_tctxt_write(void *opaque, hwaddr offset,
xive2_error(xive, "TCTXT: invalid write @%"HWADDR_PRIx, offset);
return;
}
-
- xive->pc_regs[reg] = val;
}
static const MemoryRegionOps pnv_xive2_ic_tctxt_ops = {
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 2bc3dce1fb..7f7f5b3452 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -47,7 +47,6 @@
#include "hw/irq.h"
#define EPAPR_MAGIC (0x45504150)
-#define BINARY_DEVICE_TREE_FILE "mpc8544ds.dtb"
#define DTC_LOAD_PAD 0x1800000
#define DTC_PAD_MASK 0xFFFFF
#define DTB_MAX_SIZE (8 * MiB)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 6de800524a..fd4942e881 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1066,7 +1066,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)
_FDT(fdt_setprop_string(fdt, chosen, "qemu,boot-device", boot_device));
}
- if (!spapr->has_graphics && stdout_path) {
+ if (spapr->want_stdout_path && stdout_path) {
/*
* "linux,stdout-path" and "stdout" properties are
* deprecated by linux kernel. New platforms should only
@@ -2712,6 +2712,7 @@ static void spapr_machine_init(MachineState *machine)
const char *kernel_filename = machine->kernel_filename;
const char *initrd_filename = machine->initrd_filename;
PCIHostState *phb;
+ bool has_vga;
int i;
MemoryRegion *sysmem = get_system_memory();
long load_limit, fw_size;
@@ -2950,9 +2951,12 @@ static void spapr_machine_init(MachineState *machine)
}
/* Graphics */
- if (spapr_vga_init(phb->bus, &error_fatal)) {
- spapr->has_graphics = true;
+ has_vga = spapr_vga_init(phb->bus, &error_fatal);
+ if (has_vga) {
+ spapr->want_stdout_path = !machine->enable_graphics;
machine->usb |= defaults_enabled() && !machine->usb_disabled;
+ } else {
+ spapr->want_stdout_path = true;
}
if (machine->usb) {
@@ -2962,7 +2966,7 @@ static void spapr_machine_init(MachineState *machine)
pci_create_simple(phb->bus, -1, "nec-usb-xhci");
}
- if (spapr->has_graphics) {
+ if (has_vga) {
USBBus *usb_bus = usb_bus_find(-1);
usb_create_simple(usb_bus, "usb-kbd");
@@ -2971,14 +2975,16 @@ static void spapr_machine_init(MachineState *machine)
}
if (kernel_filename) {
+ uint64_t loaded_addr = 0;
+
spapr->kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, spapr,
- NULL, NULL, NULL, NULL, 1,
+ NULL, &loaded_addr, NULL, NULL, 1,
PPC_ELF_MACHINE, 0, 0);
if (spapr->kernel_size == ELF_LOAD_WRONG_ENDIAN) {
spapr->kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, spapr,
- NULL, NULL, NULL, NULL, 0,
+ NULL, &loaded_addr, NULL, NULL, 0,
PPC_ELF_MACHINE, 0, 0);
spapr->kernel_le = spapr->kernel_size > 0;
}
@@ -2988,6 +2994,13 @@ static void spapr_machine_init(MachineState *machine)
exit(1);
}
+ if (spapr->kernel_addr != loaded_addr) {
+ warn_report("spapr: kernel_addr changed from 0x%"PRIx64
+ " to 0x%"PRIx64,
+ spapr->kernel_addr, loaded_addr);
+ spapr->kernel_addr = loaded_addr;
+ }
+
/* load initrd */
if (initrd_filename) {
/* Try to locate the initrd in the gap between the kernel