|
21 | 21 | #include "qemu-common.h"
|
22 | 22 | #include "qemu/datadir.h"
|
23 | 23 | #include "qemu/units.h"
|
| 24 | +#include "qemu/cutils.h" |
24 | 25 | #include "qapi/error.h"
|
25 | 26 | #include "sysemu/qtest.h"
|
26 | 27 | #include "sysemu/sysemu.h"
|
|
65 | 66 | #define FW_MAX_SIZE (16 * MiB)
|
66 | 67 |
|
67 | 68 | #define KERNEL_LOAD_ADDR 0x20000000
|
68 |
| -#define KERNEL_MAX_SIZE (256 * MiB) |
69 |
| -#define INITRD_LOAD_ADDR 0x60000000 |
70 |
| -#define INITRD_MAX_SIZE (256 * MiB) |
| 69 | +#define KERNEL_MAX_SIZE (128 * MiB) |
| 70 | +#define INITRD_LOAD_ADDR 0x28000000 |
| 71 | +#define INITRD_MAX_SIZE (128 * MiB) |
71 | 72 |
|
72 | 73 | static const char *pnv_chip_core_typename(const PnvChip *o)
|
73 | 74 | {
|
@@ -725,8 +726,11 @@ static void pnv_init(MachineState *machine)
|
725 | 726 | DeviceState *dev;
|
726 | 727 |
|
727 | 728 | /* allocate RAM */
|
728 |
| - if (machine->ram_size < (1 * GiB)) { |
729 |
| - warn_report("skiboot may not work with < 1GB of RAM"); |
| 729 | + if (machine->ram_size < mc->default_ram_size) { |
| 730 | + char *sz = size_to_str(mc->default_ram_size); |
| 731 | + error_report("Invalid RAM size, should be bigger than %s", sz); |
| 732 | + g_free(sz); |
| 733 | + exit(EXIT_FAILURE); |
730 | 734 | }
|
731 | 735 | memory_region_add_subregion(get_system_memory(), 0, machine->ram);
|
732 | 736 |
|
@@ -871,6 +875,14 @@ static void pnv_init(MachineState *machine)
|
871 | 875 | pnv_ipmi_bt_init(pnv->isa_bus, pnv->bmc, 10);
|
872 | 876 | }
|
873 | 877 |
|
| 878 | + /* |
| 879 | + * The PNOR is mapped on the LPC FW address space by the BMC. |
| 880 | + * Since we can not reach the remote BMC machine with LPC memops, |
| 881 | + * map it always for now. |
| 882 | + */ |
| 883 | + memory_region_add_subregion(pnv->chips[0]->fw_mr, PNOR_SPI_OFFSET, |
| 884 | + &pnv->pnor->mmio); |
| 885 | + |
874 | 886 | /*
|
875 | 887 | * OpenPOWER systems use a IPMI SEL Event message to notify the
|
876 | 888 | * host to powerdown
|
@@ -1150,6 +1162,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
|
1150 | 1162 | qdev_realize(DEVICE(&chip8->lpc), NULL, &error_fatal);
|
1151 | 1163 | pnv_xscom_add_subregion(chip, PNV_XSCOM_LPC_BASE, &chip8->lpc.xscom_regs);
|
1152 | 1164 |
|
| 1165 | + chip->fw_mr = &chip8->lpc.isa_fw; |
1153 | 1166 | chip->dt_isa_nodename = g_strdup_printf("/xscom@%" PRIx64 "/isa@%x",
|
1154 | 1167 | (uint64_t) PNV_XSCOM_BASE(chip),
|
1155 | 1168 | PNV_XSCOM_LPC_BASE);
|
@@ -1479,6 +1492,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
|
1479 | 1492 | memory_region_add_subregion(get_system_memory(), PNV9_LPCM_BASE(chip),
|
1480 | 1493 | &chip9->lpc.xscom_regs);
|
1481 | 1494 |
|
| 1495 | + chip->fw_mr = &chip9->lpc.isa_fw; |
1482 | 1496 | chip->dt_isa_nodename = g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0",
|
1483 | 1497 | (uint64_t) PNV9_LPCM_BASE(chip));
|
1484 | 1498 |
|
@@ -1592,6 +1606,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
|
1592 | 1606 | memory_region_add_subregion(get_system_memory(), PNV10_LPCM_BASE(chip),
|
1593 | 1607 | &chip10->lpc.xscom_regs);
|
1594 | 1608 |
|
| 1609 | + chip->fw_mr = &chip10->lpc.isa_fw; |
1595 | 1610 | chip->dt_isa_nodename = g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0",
|
1596 | 1611 | (uint64_t) PNV10_LPCM_BASE(chip));
|
1597 | 1612 | }
|
@@ -1983,7 +1998,7 @@ static void pnv_machine_class_init(ObjectClass *oc, void *data)
|
1983 | 1998 | * RAM defaults to less than 2048 for 32-bit hosts, and large
|
1984 | 1999 | * enough to fit the maximum initrd size at it's load address
|
1985 | 2000 | */
|
1986 |
| - mc->default_ram_size = INITRD_LOAD_ADDR + INITRD_MAX_SIZE; |
| 2001 | + mc->default_ram_size = 1 * GiB; |
1987 | 2002 | mc->default_ram_id = "pnv.ram";
|
1988 | 2003 | ispc->print_info = pnv_pic_print_info;
|
1989 | 2004 | nc->nmi_monitor_handler = pnv_nmi;
|
|
0 commit comments