Skip to content

Commit e6521e4

Browse files
zbalatonnpiggin
authored andcommitted
ppc/amigaone: Add #defines for memory map constants
Suggested-by: Nicholas Piggin <[email protected]> Signed-off-by: BALATON Zoltan <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Nicholas Piggin <[email protected]> Message-ID: <3b8e54ad9220d57e7b0a33f3570e880f26677ce8.1740673173.git.balaton@eik.bme.hu> Signed-off-by: Nicholas Piggin <[email protected]>
1 parent 34f053d commit e6521e4

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

hw/ppc/amigaone.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
#define BUS_FREQ_HZ 100000000
3333

3434
#define INITRD_MIN_ADDR 0x600000
35+
#define INIT_RAM_ADDR 0x40000000
36+
37+
#define PCI_HIGH_ADDR 0x80000000
38+
#define PCI_HIGH_SIZE 0x7d000000
39+
#define PCI_LOW_ADDR 0xfd000000
40+
#define PCI_LOW_SIZE 0xe0000
41+
42+
#define ARTICIA_ADDR 0xfe000000
3543

3644
/*
3745
* Firmware binary available at
@@ -287,7 +295,7 @@ static void amigaone_init(MachineState *machine)
287295
/* Firmware uses this area for startup */
288296
mr = g_new(MemoryRegion, 1);
289297
memory_region_init_ram(mr, NULL, "init-cache", 32 * KiB, &error_fatal);
290-
memory_region_add_subregion(get_system_memory(), 0x40000000, mr);
298+
memory_region_add_subregion(get_system_memory(), INIT_RAM_ADDR, mr);
291299
}
292300

293301
/* nvram */
@@ -322,7 +330,7 @@ static void amigaone_init(MachineState *machine)
322330
}
323331

324332
/* Articia S */
325-
dev = sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL);
333+
dev = sysbus_create_simple(TYPE_ARTICIA, ARTICIA_ADDR, NULL);
326334

327335
i2c_bus = I2C_BUS(qdev_get_child_bus(dev, "smbus"));
328336
if (machine->ram_size > 512 * MiB) {
@@ -339,12 +347,12 @@ static void amigaone_init(MachineState *machine)
339347
pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
340348
mr = g_new(MemoryRegion, 1);
341349
memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", pci_mem,
342-
0, 0xe0000);
343-
memory_region_add_subregion(get_system_memory(), 0xfd000000, mr);
350+
0, PCI_LOW_SIZE);
351+
memory_region_add_subregion(get_system_memory(), PCI_LOW_ADDR, mr);
344352
mr = g_new(MemoryRegion, 1);
345353
memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", pci_mem,
346-
0x80000000, 0x7d000000);
347-
memory_region_add_subregion(get_system_memory(), 0x80000000, mr);
354+
PCI_HIGH_ADDR, PCI_HIGH_SIZE);
355+
memory_region_add_subregion(get_system_memory(), PCI_HIGH_ADDR, mr);
348356
pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
349357

350358
/* VIA VT82c686B South Bridge (multifunction PCI device) */

0 commit comments

Comments
 (0)