Skip to contentSkip to conversation

spapr: Support ibm, dynamic-memory-v2 property

RFC PATCH Applied Bharata B Rao 2 participants 2 messages Apr 19, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH v4 1/1 spapr: Support ibm, dynamic-memory-v2 property

The new property ibm,dynamic-memory-v2 allows memory to be represented in a more compact manner in device tree.

---
v3: https://lists.gnu.org/archive/html/qemu-devel/2018-04/msg02159.html
Changes in v4: (Addresses all David Gibson's comments)
- Use of QEMU_PACKED for struct sPAPRDrconfCellV2.
- Use of sizeof() when creating ibm,dynamic-memory-v2 FDT buffer.
- Keep the drconf_queue list local and let the helper return a populated DrconfCellQueue entry.
- ibm,dynamic-memory-v2 property is no longer dependent of machine type version.

 docs/specs/ppc-spapr-hotplug.txt |  19 ++++
 hw/ppc/spapr.c                   | 230 +++++++++++++++++++++++++++++++--------
 include/hw/ppc/spapr_ovec.h      |   1 +
 3 files changed, 202 insertions(+), 48 deletions(-)
docs/specs/ppc-spapr-hotplug.txt +19 -0
index f57e2a09c6..cc7833108e 100644
@@ -387,4 +387,23 @@ Each LMB list entry consists of the following elements:
 - A 32bit flags word. The bit at bit position 0x00000008 defines whether
   the LMB is assigned to the the partition as of boot time.
 
+ibm,dynamic-memory-v2
+
+This property describes the dynamically reconfigurable memory. This is
+an alternate and newer way to describe dyanamically reconfigurable memory.
+It is a property encoded array that has an integer N (the number of
+LMB set entries) followed by N LMB set entries. There is an LMB set entry
+for each sequential group of LMBs that share common attributes.
+
+Each LMB set entry consists of the following elements:
+
+- Number of sequential LMBs in the entry represented by a 32bit integer.
+- Logical address of the first LMB in the set encoded as a 64bit integer.
+- DRC index of the first LMB in the set.
+- Associativity list index that is used as an index into
+  ibm,associativity-lookup-arrays property described earlier. This
+  is used to retrieve the right associativity list to be used for all
+  the LMBs in this set.
+- A 32bit flags word that applies to all the LMBs in the set.
+
 [1] http://thread.gmane.org/gmane.linux.ports.ppc.embedded/75350/focus=106867
hw/ppc/spapr.c +182 -48

279 lines not on this page · raw message

include/hw/ppc/spapr_ovec.h +1 -0
index bf25e5d954..0f2d8d715d 100644
@@ -51,6 +51,7 @@ typedef struct sPAPROptionVector sPAPROptionVector;
 #define OV5_FORM1_AFFINITY      OV_BIT(5, 0)
 #define OV5_HP_EVT              OV_BIT(6, 5)
 #define OV5_HPT_RESIZE          OV_BIT(6, 7)
+#define OV5_DRMEM_V2            OV_BIT(22, 0)
 #define OV5_XIVE_BOTH           OV_BIT(23, 0)
 #define OV5_XIVE_EXPLOIT        OV_BIT(23, 1) /* 1=exploitation 0=legacy */
 
Signature · 1 line
2.14.3
Applied
#1 lore raw
Quoted 4 lines · Bharata B Rao

The new property ibm,dynamic-memory-v2 allows memory to be represented in a more compact manner in device tree.

Applied to ppc-for-2.13.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson