Re: [RFC] powerpc/devtree: Parse new DRC mem/cpu/dev device, tree elements

2016-04-19 Thread Michael Bringmann


On 03/15/2016 12:15 AM, linuxppc-dev-requ...@lists.ozlabs.org wrote:


> Documentation/devicetree/bindings ? or link to PAPR where it's specified?
>
> -- 
> Stewart Smith
< OPAL Architect, IBM.

Here's the link to the Notes PAPR database's issue: 
notes://D01DBR12/86256680004635D2/565907e362ce41e28625636a000fba97/b2fa2e426b3222fd85257e810050443c

In case you don't have access to the database, here are the document headings 
attached to the issue:

10/21/15 : Updated Section:  C.6.6.2 ibm,dynamic-reconfiguration-memory to 
remove lmb-size from ibm,dynamic-memory-v2; corrected typo in C.6.6.2.
(See attached file: C PAPR Binding.doc)


10/21/15 : changed ibm,drc-index to drc-index in Section 7.3.28 and 
R1-7.3.28-14; added ibm,drc-info in the root and vdevice nodes in the Partition 
Migration/Hibernation section of Table 129.
(See attached file: Chapter 7 .doc)


10/21/15 : Updated reference " ... the drc-xxx or ibm,drc-info property ..." in 
Section 13.5.3.2. Added  "See 13.5.2.8 for additional information." to the 
first paragraph of sections 13.5.2.2, 13.5.2.4, 13.5.2.5, 13.5.2.6 : In the 
first paragraph of each section, add
(See attached file: Chapter 13.doc)

(See attached file: Chapter 17 and 18.doc)

(See attached file: Chapter 5 .doc)

-- 
Michael W. Bringmann
Linux Technology Center
IBM Corporation
Tie-Line  363-5196
External: (512) 286-5196
Cell:   (512) 466-0650
m...@linux.vnet.ibm.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC] powerpc/devtree: Parse new DRC mem/cpu/dev device tree elements

2016-03-14 Thread Stewart Smith
Michael Bringmann  writes:
> 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 
> ---

Documentation/devicetree/bindings ? or link to PAPR where it's specified?

-- 
Stewart Smith
OPAL Architect, IBM.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC] powerpc/devtree: Parse new DRC mem/cpu/dev device tree elements

2016-03-13 Thread Michael Bringmann
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