configurations: ventura: Simplifying the fan representation in the EM

To avoid duplicating fan board information in the Entity Manager.
Shrinking two fan board definitions into one by using a parameterized
bus number.

Change-Id: Id89628e37bdfa76d20482e9a399f6d3d8a632a41
Signed-off-by: Jason Hsu <Jason-Hsu@quantatw.com>
diff --git a/configurations/meta/ventura_fanboard_adc_max.json b/configurations/meta/ventura_fanboard_adc_max.json
index 2f4678d..19b7f3b 100644
--- a/configurations/meta/ventura_fanboard_adc_max.json
+++ b/configurations/meta/ventura_fanboard_adc_max.json
@@ -47,96 +47,19 @@
                 ],
                 "Type": "MAX11617",
                 "in_voltage0_Max": 18,
-                "in_voltage0_Name": "FCB_0_FAN_0_VOLT_V",
+                "in_voltage0_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 VOLT_V",
                 "in_voltage0_Scale": 266.525,
-                "in_voltage1_Name": "FCB_0_FAN_0_IMON_VOLT_V",
+                "in_voltage1_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 IMON_VOLT_V",
                 "in_voltage1_Scale": 2,
                 "in_voltage2_Max": 18,
-                "in_voltage2_Name": "FCB_0_FAN_1_VOLT_V",
+                "in_voltage2_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 + 1 VOLT_V",
                 "in_voltage2_Scale": 266.525,
-                "in_voltage3_Name": "FCB_0_FAN_1_IMON_VOLT_V",
+                "in_voltage3_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 + 1 IMON_VOLT_V",
                 "in_voltage3_Scale": 2
             }
         ],
-        "Name": "Ventura Fan Board 0",
-        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BUS': 16, 'BOARD_INFO_AM4': 'adc-max'})",
-        "Type": "Board",
-        "xyz.openbmc_project.Inventory.Decorator.Asset": {
-            "BuildDate": "$BOARD_MANUFACTURE_DATE",
-            "Manufacturer": "$BOARD_MANUFACTURER",
-            "Model": "$BOARD_PRODUCT_NAME",
-            "PartNumber": "$BOARD_PART_NUMBER",
-            "SerialNumber": "$BOARD_SERIAL_NUMBER",
-            "SparePartNumber": "$BOARD_INFO_AM1"
-        },
-        "xyz.openbmc_project.Inventory.Decorator.AssetTag": {
-            "AssetTag": "$PRODUCT_ASSET_TAG"
-        },
-        "xyz.openbmc_project.Inventory.Decorator.Revision": {
-            "Version": "$PRODUCT_VERSION"
-        }
-    },
-    {
-        "Exposes": [
-            {
-                "Address": "0x35",
-                "Bus": "$bus",
-                "Labels": [
-                    "in_voltage0",
-                    "in_voltage1",
-                    "in_voltage2",
-                    "in_voltage3"
-                ],
-                "Name": "FAN_ADC",
-                "Thresholds": [
-                    {
-                        "Direction": "greater than",
-                        "Hysteresis": 0.272,
-                        "Label": "in_voltage0",
-                        "Name": "upper critical",
-                        "Severity": 1,
-                        "Value": 13.6
-                    },
-                    {
-                        "Direction": "less than",
-                        "Hysteresis": 0.21,
-                        "Label": "in_voltage0",
-                        "Name": "lower critical",
-                        "Severity": 1,
-                        "Value": 10.5
-                    },
-                    {
-                        "Direction": "greater than",
-                        "Hysteresis": 0.272,
-                        "Label": "in_voltage2",
-                        "Name": "upper critical",
-                        "Severity": 1,
-                        "Value": 13.6
-                    },
-                    {
-                        "Direction": "less than",
-                        "Hysteresis": 0.21,
-                        "Label": "in_voltage2",
-                        "Name": "lower critical",
-                        "Severity": 1,
-                        "Value": 10.5
-                    }
-                ],
-                "Type": "MAX11617",
-                "in_voltage0_Max": 18,
-                "in_voltage0_Name": "FCB_1_FAN_2_VOLT_V",
-                "in_voltage0_Scale": 266.525,
-                "in_voltage1_Name": "FCB_1_FAN_2_IMON_VOLT_V",
-                "in_voltage1_Scale": 2,
-                "in_voltage2_Max": 18,
-                "in_voltage2_Name": "FCB_1_FAN_3_VOLT_V",
-                "in_voltage2_Scale": 266.525,
-                "in_voltage3_Name": "FCB_1_FAN_3_IMON_VOLT_V",
-                "in_voltage3_Scale": 2
-            }
-        ],
-        "Name": "Ventura Fan Board 1",
-        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BUS': 17, 'BOARD_INFO_AM4': 'adc-max'})",
+        "Name": "Ventura Fan Board $bus % 2",
+        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_MANUFACTURER': 'Quanta', BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BOARD_INFO_AM4': 'adc-max'})",
         "Type": "Board",
         "xyz.openbmc_project.Inventory.Decorator.Asset": {
             "BuildDate": "$BOARD_MANUFACTURE_DATE",
diff --git a/configurations/meta/ventura_fanboard_adc_tic.json b/configurations/meta/ventura_fanboard_adc_tic.json
index 2bb9a2b..7e4688c 100644
--- a/configurations/meta/ventura_fanboard_adc_tic.json
+++ b/configurations/meta/ventura_fanboard_adc_tic.json
@@ -47,96 +47,19 @@
                 ],
                 "Type": "ADC128D818",
                 "in0_Max": 18,
-                "in0_Name": "FCB_0_FAN_0_VOLT_V",
+                "in0_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 VOLT_V",
                 "in0_Scale": 133.262,
-                "in1_Name": "FCB_0_FAN_0_IMON_VOLT_V",
+                "in1_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 IMON_VOLT_V",
                 "in1_Scale": 1,
                 "in2_Max": 18,
-                "in2_Name": "FCB_0_FAN_1_VOLT_V",
+                "in2_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 + 1 VOLT_V",
                 "in2_Scale": 133.262,
-                "in3_Name": "FCB_0_FAN_1_IMON_VOLT_V",
+                "in3_Name": "FCB_$bus % 2 FAN_$bus % 2 * 2 + 1 IMON_VOLT_V",
                 "in3_Scale": 1
             }
         ],
-        "Name": "Ventura Fan Board 0",
-        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BUS': 16, 'BOARD_INFO_AM4': 'adc-tic'})",
-        "Type": "Board",
-        "xyz.openbmc_project.Inventory.Decorator.Asset": {
-            "BuildDate": "$BOARD_MANUFACTURE_DATE",
-            "Manufacturer": "$BOARD_MANUFACTURER",
-            "Model": "$BOARD_PRODUCT_NAME",
-            "PartNumber": "$BOARD_PART_NUMBER",
-            "SerialNumber": "$BOARD_SERIAL_NUMBER",
-            "SparePartNumber": "$BOARD_INFO_AM1"
-        },
-        "xyz.openbmc_project.Inventory.Decorator.AssetTag": {
-            "AssetTag": "$PRODUCT_ASSET_TAG"
-        },
-        "xyz.openbmc_project.Inventory.Decorator.Revision": {
-            "Version": "$PRODUCT_VERSION"
-        }
-    },
-    {
-        "Exposes": [
-            {
-                "Address": "0x1f",
-                "Bus": "$bus",
-                "Labels": [
-                    "in0",
-                    "in1",
-                    "in2",
-                    "in3"
-                ],
-                "Name": "FAN_ADC",
-                "Thresholds": [
-                    {
-                        "Direction": "greater than",
-                        "Hysteresis": 0.272,
-                        "Label": "in0",
-                        "Name": "upper critical",
-                        "Severity": 1,
-                        "Value": 13.6
-                    },
-                    {
-                        "Direction": "less than",
-                        "Hysteresis": 0.21,
-                        "Label": "in0",
-                        "Name": "lower critical",
-                        "Severity": 1,
-                        "Value": 10.5
-                    },
-                    {
-                        "Direction": "greater than",
-                        "Hysteresis": 0.272,
-                        "Label": "in2",
-                        "Name": "upper critical",
-                        "Severity": 1,
-                        "Value": 13.6
-                    },
-                    {
-                        "Direction": "less than",
-                        "Hysteresis": 0.21,
-                        "Label": "in2",
-                        "Name": "lower critical",
-                        "Severity": 1,
-                        "Value": 10.5
-                    }
-                ],
-                "Type": "ADC128D818",
-                "in0_Max": 18,
-                "in0_Name": "FCB_1_FAN_2_VOLT_V",
-                "in0_Scale": 133.262,
-                "in1_Name": "FCB_1_FAN_2_IMON_VOLT_V",
-                "in1_Scale": 1,
-                "in2_Max": 18,
-                "in2_Name": "FCB_1_FAN_3_VOLT_V",
-                "in2_Scale": 133.262,
-                "in3_Name": "FCB_1_FAN_3_IMON_VOLT_V",
-                "in3_Scale": 1
-            }
-        ],
-        "Name": "Ventura Fan Board 1",
-        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BUS': 17, 'BOARD_INFO_AM4': 'adc-tic'})",
+        "Name": "Ventura Fan Board $bus % 2",
+        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_MANUFACTURER': 'Quanta', 'BOARD_PRODUCT_NAME': 'Ventura FAN Board', 'BOARD_INFO_AM4': 'adc-tic'})",
         "Type": "Board",
         "xyz.openbmc_project.Inventory.Decorator.Asset": {
             "BuildDate": "$BOARD_MANUFACTURE_DATE",