[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 17/18] hw/arm/boot: Expose the pmem nodes in the
From: |
Eric Auger |
Subject: |
[Qemu-devel] [PATCH v5 17/18] hw/arm/boot: Expose the pmem nodes in the DT |
Date: |
Wed, 23 Jan 2019 11:14:57 +0100 |
In case of NV-DIMM slots, let's add /pmem DT nodes.
Signed-off-by: Eric Auger <address@hidden>
---
hw/arm/boot.c | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 15432bb895..8fbdc3ff00 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -454,6 +454,36 @@ out:
return ret;
}
+static int fdt_add_pmem_node(void *fdt, uint32_t acells, hwaddr mem_base,
+ uint32_t scells, hwaddr mem_len,
+ int numa_node_id)
+{
+ char *nodename = NULL;
+ int ret;
+
+ nodename = g_strdup_printf("/address@hidden" PRIx64, mem_base);
+ qemu_fdt_add_subnode(fdt, nodename);
+ qemu_fdt_setprop_string(fdt, nodename, "compatible", "pmem-region");
+ ret = qemu_fdt_setprop_sized_cells(fdt, nodename, "reg", acells, mem_base,
+ scells, mem_len);
+ if (ret < 0) {
+ fprintf(stderr, "couldn't set %s/reg\n", nodename);
+ goto out;
+ }
+ if (numa_node_id < 0) {
+ goto out;
+ }
+
+ ret = qemu_fdt_setprop_cell(fdt, nodename, "numa-node-id", numa_node_id);
+ if (ret < 0) {
+ fprintf(stderr, "couldn't set %s/numa-node-id\n", nodename);
+ }
+
+out:
+ g_free(nodename);
+ return ret;
+}
+
static void fdt_add_psci_node(void *fdt)
{
uint32_t cpu_suspend_fn;
@@ -541,7 +571,8 @@ static int fdt_add_hotpluggable_memory_nodes(void *fdt,
di = !is_nvdimm ? mi->u.dimm.data : mi->u.nvdimm.data;
if (is_nvdimm) {
- ret = -ENOENT; /* NV-DIMM not yet supported */
+ ret = fdt_add_pmem_node(fdt, acells, di->addr,
+ scells, di->size, di->node);
} else {
ret = fdt_add_memory_node(fdt, acells, di->addr,
scells, di->size, di->node);
--
2.20.1
- [Qemu-devel] [PATCH v5 04/18] hw/arm/virt: Split the memory map description, (continued)
- [Qemu-devel] [PATCH v5 04/18] hw/arm/virt: Split the memory map description, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 09/18] hw/arm/virt: Implement kvm_type function for 4.0 machine, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 08/18] vl: Set machine ram_size, maxram_size and ram_slots earlier, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 12/18] hw/arm/boot: Expose the PC-DIMM nodes in the DT, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 11/18] hw/arm/virt: Add memory hotplug framework, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 10/18] hw/arm/virt: Bump the 255GB initial RAM limit, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 02/18] linux-headers: Update to v5.0-rc2, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 13/18] hw/arm/virt-acpi-build: Add PC-DIMM in SRAT, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 15/18] nvdimm: use configurable ACPI IO base and size, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 14/18] hw/arm/virt: Allocate device_memory, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 17/18] hw/arm/boot: Expose the pmem nodes in the DT,
Eric Auger <=
- [Qemu-devel] [PATCH v5 16/18] hw/arm/virt: Add nvdimm hot-plug infrastructure, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 18/18] hw/arm/virt: Add nvdimm and nvdimm-persistence options, Eric Auger, 2019/01/23
- [Qemu-devel] [PATCH v5 01/18] update-linux-headers.sh: Copy new headers, Eric Auger, 2019/01/23