[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 3/5] spapr_nvram: Pre-initialize the NVRAM to support
From: |
Thomas Huth |
Subject: |
[Qemu-ppc] [PATCH 3/5] spapr_nvram: Pre-initialize the NVRAM to support the -prom-env parameter |
Date: |
Tue, 18 Oct 2016 22:46:42 +0200 |
In case we do not load the NVRAM contents from a file, use the new
CHRP NVRAM helper functions to pre-initialize the NVRAM partitions.
This way we can support the "-prom-env" parameter of QEMU on the
pseries machine, too.
Signed-off-by: Thomas Huth <address@hidden>
---
hw/nvram/spapr_nvram.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index 4de5f70..36a9188 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -31,6 +31,7 @@
#include "sysemu/block-backend.h"
#include "sysemu/device_tree.h"
#include "hw/sysbus.h"
+#include "hw/nvram/chrp_nvram.h"
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_vio.h"
@@ -162,6 +163,11 @@ static void spapr_nvram_realize(VIOsPAPRDevice *dev, Error
**errp)
error_setg(errp, "can't read spapr-nvram contents");
return;
}
+ } else {
+ /* Create a system partition to pass the -prom-env variables */
+ chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4);
+ chrp_nvram_create_free_partition(&nvram->buf[MIN_NVRAM_SIZE / 4],
+ nvram->size - MIN_NVRAM_SIZE / 4);
}
spapr_rtas_register(RTAS_NVRAM_FETCH, "nvram-fetch", rtas_nvram_fetch);
--
1.8.3.1
- [Qemu-ppc] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, Thomas Huth, 2016/10/18
- [Qemu-ppc] [PATCH 1/5] nvram: Introduce helper functions for CHRP "system" and "free space" partitions, Thomas Huth, 2016/10/18
- [Qemu-ppc] [PATCH 3/5] spapr_nvram: Pre-initialize the NVRAM to support the -prom-env parameter,
Thomas Huth <=
- [Qemu-ppc] [PATCH 5/5] nvram: Rename openbios_firmware_abi.h into sun_nvram.h, Thomas Huth, 2016/10/18
- [Qemu-ppc] [PATCH 2/5] sparc: Use the new common NVRAM functions for system and free space partition, Thomas Huth, 2016/10/18
- [Qemu-ppc] [PATCH 4/5] nvram: Move the remaining CHRP NVRAM related code to chrp_nvram.[ch], Thomas Huth, 2016/10/18
- Re: [Qemu-ppc] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, David Gibson, 2016/10/19
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, Bharata B Rao, 2016/10/24
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, Thomas Huth, 2016/10/24
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, David Gibson, 2016/10/24
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, Thomas Huth, 2016/10/25
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, David Gibson, 2016/10/25
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] nvram: Refactor OpenBIOS NVRAM code to support -prom-env on pseries, too, Thomas Huth, 2016/10/26