aboutsummaryrefslogtreecommitdiff
path: root/hw/hppa/machine.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-01-28 15:11:04 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-01-28 15:11:04 +0000
commit4c60e3289875ae6c516a37523bcecb87f68ce67c (patch)
tree43b687b4d1bfe827bae9684f23d313eebed02f3e /hw/hppa/machine.c
parent750fe5989f9efffce86368c6feac013f8b7b433c (diff)
parentb1af755c33bf0d690553a5ccd93689dfd15a98e8 (diff)
Merge remote-tracking branch 'remotes/rth/tags/pull-pa-20200127' into staging
Improve LASI emulation Add Artist graphics Fix main memory allocation Improve LDCW emulation wrt real hw # gpg: Signature made Mon 27 Jan 2020 18:53:35 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-pa-20200127: target/hppa: Allow, but diagnose, LDCW aligned only mod 4 hw/hppa/machine: Map the PDC memory region with higher priority hw/hppa/machine: Restrict the total memory size to 3GB hw/hppa/machine: Correctly check the firmware is in PDC range hppa: Add emulation of Artist graphics seabios-hppa: update to latest version hppa: Switch to tulip NIC by default hppa: add emulation of LASI PS2 controllers ps2: accept 'Set Key Make and Break' commands hppa: Add support for LASI chip with i82596 NIC hw/hppa/dino.c: Improve emulation of Dino PCI chip Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/hppa/machine.c')
-rw-r--r--hw/hppa/machine.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 5d0de26140..2d62a248b8 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -16,6 +16,7 @@
#include "hw/ide.h"
#include "hw/timer/i8254.h"
#include "hw/char/serial.h"
+#include "hw/net/lasi_82596.h"
#include "hppa_sys.h"
#include "qemu/units.h"
#include "qapi/error.h"
@@ -74,6 +75,7 @@ static void machine_hppa_init(MachineState *machine)
MemoryRegion *cpu_region;
long i;
unsigned int smp_cpus = machine->smp.cpus;
+ SysBusDevice *s;
ram_size = machine->ram_size;
@@ -90,16 +92,18 @@ static void machine_hppa_init(MachineState *machine)
g_free(name);
}
- /* Limit main memory. */
- if (ram_size > FIRMWARE_START) {
- machine->ram_size = ram_size = FIRMWARE_START;
- }
-
/* Main memory region. */
+ if (machine->ram_size > 3 * GiB) {
+ error_report("RAM size is currently restricted to 3GB");
+ exit(EXIT_FAILURE);
+ }
ram_region = g_new(MemoryRegion, 1);
memory_region_allocate_system_memory(ram_region, OBJECT(machine),
"ram", ram_size);
- memory_region_add_subregion(addr_space, 0, ram_region);
+ memory_region_add_subregion_overlap(addr_space, 0, ram_region, -1);
+
+ /* Init Lasi chip */
+ lasi_init(addr_space);
/* Init Dino (PCI host bus chip). */
pci_bus = dino_init(addr_space, &rtc_irq, &serial_irq);
@@ -123,9 +127,20 @@ static void machine_hppa_init(MachineState *machine)
dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
lsi53c8xx_handle_legacy_cmdline(dev);
- /* Network setup. e1000 is good enough, failing Tulip support. */
+ /* Graphics setup. */
+ if (machine->enable_graphics && vga_interface_type != VGA_NONE) {
+ dev = qdev_create(NULL, "artist");
+ qdev_init_nofail(dev);
+ s = SYS_BUS_DEVICE(dev);
+ sysbus_mmio_map(s, 0, LASI_GFX_HPA);
+ sysbus_mmio_map(s, 1, ARTIST_FB_ADDR);
+ }
+
+ /* Network setup. */
for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+ if (!enable_lasi_lan()) {
+ pci_nic_init_nofail(&nd_table[i], pci_bus, "tulip", NULL);
+ }
}
/* Load firmware. Given that this is not "real" firmware,
@@ -155,7 +170,7 @@ static void machine_hppa_init(MachineState *machine)
qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64
"-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n",
firmware_low, firmware_high, firmware_entry);
- if (firmware_low < ram_size || firmware_high >= FIRMWARE_END) {
+ if (firmware_low < FIRMWARE_START || firmware_high >= FIRMWARE_END) {
error_report("Firmware overlaps with memory or IO space");
exit(1);
}