pdr: sensor/effecter support for power supply fault leds

This is to support sensor/effecter pdrs for power supply
fault leds.

Tested By:

EFFECTER (Power Supply 0):

pldmtool platform GetPDR -d 251
{
    "nextRecordHandle": 252,
    "responseCount": 29,
    "recordHandle": 251,
    "PDRHeaderVersion": 1,
    "PDRType": "State Effecter PDR",
    "recordChangeNumber": 0,
    "dataLength": 19,
    "PLDMTerminusHandle": 1,
    "effecterID": 108,
    "entityType": "Power Supply",
    "entityInstanceNumber": 1,
    "containerID": 3,
    "effecterSemanticID": 0,
    "effecterInit": "noInit",
    "effecterDescriptionPDR": false,
    "compositeEffecterCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

Set Fault On:
pldmtool raw -d 0x80 0x02 0x39 0x6C 0x00 0x01 0x01 0x01
Request Message:
08 01 80 02 39 6c 00 01 01 01
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b false

Set Fault Off:
pldmtool raw -d 0x80 0x02 0x39 0x6C 0x00 0x01 0x01 0x02
Request Message:
08 01 80 02 39 6c 00 01 01 02
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b true

SENSOR (Power Supply 1):

pldmtool platform GetPDR -d 143
{
    "nextRecordHandle": 144,
    "responseCount": 27,
    "recordHandle": 143,
    "PDRHeaderVersion": 1,
    "PDRType": "State Sensor PDR",
    "recordChangeNumber": 0,
    "dataLength": 17,
    "PLDMTerminusHandle": 0,
    "sensorID": 111,
    "entityType": "Power Supply",
    "entityInstanceNumber": 2,
    "containerID": 3,
    "sensorInit": "noInit",
    "sensorAuxiliaryNamesPDR": false,
    "compositeSensorCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

Set Fault On:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/powersupply1_fault
xyz.openbmc_project.Led.Group Asserted b false

pldmtool raw --data 0x80 0x02 0x21 0x6F 0x00 0x01 0x00
Request Message:
08 01 80 02 21 6f 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 01

Set Fault Off:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/powersupply1_fault
xyz.openbmc_project.Led.Group Asserted b true

pldmtool raw --data 0x80 0x02 0x21 0x6F 0x00 0x01 0x00
Request Message:
08 01 80 02 21 6f 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 02

Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com>
Change-Id: I31b90172a3c891c83f2e66d804599367c2879fa3
diff --git a/configurations/pdr/11.json b/configurations/pdr/11.json
index fbbfcbb..55a3aba 100644
--- a/configurations/pdr/11.json
+++ b/configurations/pdr/11.json
@@ -1837,6 +1837,40 @@
         }]
     },
     {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
        "type" : 45,
        "instance" : 0,
        "container" : 0,
diff --git a/configurations/pdr/4.json b/configurations/pdr/4.json
index a451d2e..2e62a09 100644
--- a/configurations/pdr/4.json
+++ b/configurations/pdr/4.json
@@ -1870,6 +1870,40 @@
                 "property_values" : [false, true]
              }
         }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/powersupply0_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [false, true]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/powersupply1_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [false, true]
+             }
+        }]
     }]
   }]
 }