Flatten PID configuration and add 2U PID config

By flattening ILimit and OutLimit we can remove an interface.

Change-Id: I44ce238e77df94830e515c0c60583e50a36e7cf5
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/configurations/R1000 Chassis.json b/configurations/R1000 Chassis.json
index 99fff13..d7af315 100644
--- a/configurations/R1000 Chassis.json
+++ b/configurations/R1000 Chassis.json
@@ -245,161 +245,158 @@
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 1a",
-                "Fan 1b",
-                "Pwm 1"
+                "Fan 1b"
             ],
             "Name": "Fan 1",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 1"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
             "Class": "fan",
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 2a",
                 "Fan 2b",
                 "Pwm 2"
             ],
             "Name": "Fan 2",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 2"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
             "Class": "fan",
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 3a",
-                "Fan 3b",
-                "Pwm 3"
+                "Fan 3b"
             ],
             "Name": "Fan 3",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 3"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
             "Class": "fan",
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 4a",
-                "Fan 4b",
-                "Pwm 4"
+                "Fan 4b"
             ],
             "Name": "Fan 4",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 4"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ],
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
             "Class": "fan",
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 5a",
-                "Fan 5b",
-                "Pwm 5"
+                "Fan 5b"
             ],
             "Name": "Fan 5",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 5"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
             "Class": "fan",
             "FFGainCoefficient": 0.01,
             "FFOffCoefficient": 0.0,
             "ICoefficient": 0.0,
-            "ILimit": {
-                "Max": 0.0,
-                "Min": 0.0
-            },
-            "Index": 1,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
             "Inputs": [
                 "Fan 6a",
-                "Fan 6b",
-                "Pwm 6"
+                "Fan 6b"
             ],
             "Name": "Fan 6",
-            "OutLimit": {
-                "Max": 100.0,
-                "Min": 30.0
-            },
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 6"
+            ],
             "PCoefficient": 0.0,
-            "SetPoint": 90.0,
             "SlewNeg": 0.0,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         },
         {
-            "Index": 1,
-            "MinThermalRpm": 3000,
             "FailSafePercent": 90,
+            "MinThermalRpm": 3000,
             "Name": "Pid 1",
             "Type": "Pid.Zone"
         }
diff --git a/configurations/R2000 Chassis.json b/configurations/R2000 Chassis.json
index 304e8c3..4184162 100644
--- a/configurations/R2000 Chassis.json
+++ b/configurations/R2000 Chassis.json
@@ -119,6 +119,156 @@
                 }
             ],
             "Type": "AspeedFan"
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 1"
+            ],
+            "Name": "Fan 1",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 1"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 2"
+            ],
+            "Name": "Fan 2",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 2"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 3"
+            ],
+            "Name": "Fan 3",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 3"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 4"
+            ],
+            "Name": "Fan 4",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 4"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 5"
+            ],
+            "Name": "Fan 5",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 5"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "Class": "fan",
+            "FFGainCoefficient": 0.01,
+            "FFOffCoefficient": 0.0,
+            "ICoefficient": 0.0,
+            "ILimitMax": 0.0,
+            "ILimitMin": 0.0,
+            "Inputs": [
+                "Fan 6"
+            ],
+            "Name": "Fan 6",
+            "OutLimitMax": 100.0,
+            "OutLimitMin": 30.0,
+            "Outputs": [
+                "Pwm 6"
+            ],
+            "PCoefficient": 0.0,
+            "SlewNeg": 0.0,
+            "SlewPos": 0.0,
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
+        },
+        {
+            "FailSafePercent": 90,
+            "MinThermalRpm": 3000,
+            "Name": "Pid 1",
+            "Type": "Pid.Zone"
         }
     ],
     "Name": "R2000 Chassis",
diff --git a/configurations/WFT Baseboard.json b/configurations/WFT Baseboard.json
index e7381bd..0db1be0 100644
--- a/configurations/WFT Baseboard.json
+++ b/configurations/WFT Baseboard.json
@@ -844,24 +844,23 @@
             "FFGainCoefficient": 0.0,
             "FFOffCoefficient": 0.0,
             "ICoefficient": -20.0,
-            "ILimit": {
-                "Max": 7000,
-                "Min": 3000
-            },
-            "Index": 1,
+            "ILimitMax": 7000,
+            "ILimitMin": 3000,
             "Inputs": [
                 "Core 0 CPU0"
             ],
             "Name": "Core 0 CPU0",
-            "OutLimit": {
-                "Max": 7000,
-                "Min": 3000
-            },
+            "OutLimitMax": 7000,
+            "OutLimitMin": 3000,
+            "Outputs": [],
             "PCoefficient": -300.0,
             "SetPoint": 45.0,
             "SlewNeg": -100,
             "SlewPos": 0.0,
-            "Type": "Pid"
+            "Type": "Pid",
+            "Zones": [
+                "Pid 1"
+            ]
         }
     ],
     "Name": "WFP Baseboard",
@@ -873,4 +872,4 @@
         "PartNumber": "$PRODUCT_PART_NUMBER",
         "SerialNumber": "$PRODUCT_PRODUCT_SERIAL_NUMBER"
     }
-}
+}
\ No newline at end of file
diff --git a/schemas/global.json b/schemas/global.json
index ab87394..691b3c2 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -169,20 +169,11 @@
                             "ICoefficient": {
                                 "type": "number"
                             },
-                            "ILimit": {
-                                "type": "object",
-                                "properties": {
-                                    "Max": {
-                                        "type": "number"
-                                    },
-                                    "Min": {
-                                        "type": "number"
-                                    }
-                                },
-                                "required": [
-                                    "Max",
-                                    "Min"
-                                ]
+                            "ILimitMax": {
+                                "type": "number"
+                            },
+                            "ILimitMin": {
+                                "type": "number"
                             },
                             "Inputs": {
                                 "type": "array",
@@ -190,20 +181,17 @@
                                     "type": "string"
                                 }
                             },
-                            "OutLimit": {
-                                "type": "object",
-                                "properties": {
-                                    "Max": {
-                                        "type": "number"
-                                    },
-                                    "Min": {
-                                        "type": "number"
-                                    }
-                                },
-                                "required": [
-                                    "Max",
-                                    "Min"
-                                ]
+                            "OutLimitMax": {
+                                "type": "number"
+                            },
+                            "OutLimitMin": {
+                                "type": "number"
+                            },
+                            "Outputs": {
+                                "type": "array",
+                                "items": {
+                                    "type": "string"
+                                }
                             },
                             "PCoefficient": {
                                 "type": "number"
@@ -217,12 +205,18 @@
                             "SlewPos": {
                                 "type": "number"
                             },
-                            "MinThermalRpm": {
-                                "type": "integer"
+                            "Zones": {
+                                "type": "array",
+                                "items": {
+                                    "type": "string"
+                                }
                             },
                             "FailSafePercent": {
                                 "type": "integer"
                             },
+                            "MinThermalRpm": {
+                                "type": "integer"
+                            },
                             "present": {
                                 "type": "integer"
                             },