Summary: The following properties: ibm,drc-indexes, ibm,drc-names,
ibm,drc-types and ibm,drc-power-domains will be combined and condensed
into the single property, ibm,drc-info.
The ibm,dynamic-memory property will be condensed into a new version,
ibm,dynamic-memory-v2.
Note: "[PATCH] powerpc/devtree: Parse new DRC mem/cpu/dev device tree
elements" is withdrawn at this time.
Several properties in the DRC device tree format are replaced by
more compact representations to allow, for example, for the encoding
of vast amounts of memory, and or reduced duplication of information
in related data structures.
"ibm,drc-info": This property, when present, replaces the following
four properties: “ibm,drc-indexes”, “ibm,drc-names”, “ibm,drc-types”
and “ibm,drc-power-domains”. This property is defined for all
dynamically reconfigurable platform nodes. The "ibm,drc-info" elements
are intended to provide a more compact representation, and reduce some
search overhead.
"ibm,dynamic-memory-v2": This property replaces the "ibm,dynamic-memory"
node representation within the "ibm,dynamic-reconfiguration-memory"
property. This element format is intended to provide a more compact
representation of memory, especially, for systems with massive amounts
of RAM.
"ibm,architecture.vec": Bit flags are added to this data structure
by the front end processor to inform the kernel as to whether to expect
the changes to one or both of the device tree structures "ibm,drc-info"
and "ibm,dynamic-memory-v2".
The new element structures, "ibm,dynamic-memory-v2" and "ibm,drc-info",
should completely replace the previously used structures at execution.
Signed-off-by: Michael Bringmann
---
diff --git a/arch/powerpc/include/asm/firmware.h
b/arch/powerpc/include/asm/firmware.h
index b062924..a9d66d5 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -51,6 +51,8 @@
#define FW_FEATURE_BEST_ENERGY ASM_CONST(0x8000)
#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0001)
#define FW_FEATURE_PRRNASM_CONST(0x0002)
+#define FW_FEATURE_RPS_DM2 ASM_CONST(0x0004)
+#define FW_FEATURE_RPS_DRC_INFOASM_CONST(0x0008)
#ifndef __ASSEMBLY__
@@ -66,7 +68,8 @@ enum {
FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO |
FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
- FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN,
+ FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN |
+ FW_FEATURE_RPS_DM2 | FW_FEATURE_RPS_DRC_INFO,
FW_FEATURE_PSERIES_ALWAYS = 0,
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL,
FW_FEATURE_POWERNV_ALWAYS = 0,
diff --git a/arch/powerpc/include/asm/prom.h
b/arch/powerpc/include/asm/prom.h
index 7f436ba..dc4c5c0 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -81,8 +81,9 @@ extern void of_instantiate_rtc(void);
extern int of_get_ibm_chip_id(struct device_node *np);
/* The of_drconf_cell struct defines the layout of the LMB array
- * specified in the device tree property
- * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory
+ * specified in the device tree properties,
+ * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory
+ * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory-v2
*/
struct of_drconf_cell {
u64 base_addr;
@@ -92,9 +93,36 @@ struct of_drconf_cell {
u32 flags;
};
-#define DRCONF_MEM_ASSIGNED0x0008
-#define DRCONF_MEM_AI_INVALID 0x0040
-#define DRCONF_MEM_RESERVED0x0080
+struct of_drconf_cell_v2 {
+ u32 num_seq_lmbs;
+ u64 base_addr;
+ u32 drc_index;
+ u32 aa_index;
+ u32 flags;
+};
+
+#define DRCONF_MEM_PRESERVED 0x0001
+#define DRCONF_MEM_PRESERVABLE 0x0002
+#define DRCONF_MEM_PRESERVED_STATE 0x0004
+#define DRCONF_MEM_ASSIGNED0x0008
+#define DRCONF_MEM_NO_H_MIGRATE_DATA 0x0010
+#define DRCONF_MEM_DRC_INVALID 0x0020
+#define DRCONF_MEM_AI_INVALID 0x0040
+#define DRCONF_MEM_RESERVED0x0080
+#define DRCONF_MEM_RESERVED_SW 0x8000
+
+/*
+ * Set of dynamic DLPAR memory function operations
+ */
+struct dlpar_memory_ops {
+ struct property* (*clone_drconf_property)(struct device_node *dn);
+ int (*add_by_count)(u32 lmbs_to_add, struct property **prop);
+ int (*add_by_index)(u32 lmbs_to_add, struct property **prop);
+ int (*remove_by_count)(u32 lmbs_to_add, struct property **prop);
+ int (*remove_by_index)(u32 lmbs_to_add, struct property **prop);
+ void (*update_drconf_property)(struct device_node *dn,
+ struct property *prop);
+};
/*
* There are two methods for telling