gen_ipmi_fru.pl : retrieve children of FRUs

For IPMI FRUs, figure out if they have children (non-FRU) that are of
interest, and if yes, generate metadata for those children.

Change-Id: Iecc54dd39633f869b2210de83df9cb3292ab483a
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/gen_ipmi_fru.pl b/gen_ipmi_fru.pl
index 760082f..aab9bdb 100755
--- a/gen_ipmi_fru.pl
+++ b/gen_ipmi_fru.pl
@@ -45,12 +45,12 @@
 my @inventory = Inventory::getInventory($targetObj);
 for my $item (@inventory) {
     my $isFru = 0, my $fruID = 0, my $fruType = "";
-    #Fetch the FRU ID.
+    #Fetch the FRUID.
     if (!$targetObj->isBadAttribute($item->{TARGET}, "FRU_ID")) {
         $fruID = $targetObj->getAttribute($item->{TARGET}, "FRU_ID");
         $isFru = 1;
     }
-    # Fetch the FRU Type.
+    #Fetch the FRU Type.
     if (!$targetObj->isBadAttribute($item->{TARGET}, "TYPE")) {
         $fruType = $targetObj->getAttribute($item->{TARGET}, "TYPE");
     }
@@ -65,11 +65,71 @@
 
     writeToFile($fruType,$item->{OBMC_NAME},$fruTypeConfig,$fh);
 
+    # Fetch all the children for this inventory target,It might happen the child is fru or non fru
+    # Following condition to be true for fetching the associated non fru devices.
+    # -it should be non fru.
+    # -type of the fru is in the interested types.
+    # - the parent of the child should be same as inventory target.
+
+    foreach my $child ($targetObj->getAllTargetChildren($item->{TARGET})) {
+        $fruType = $targetObj->getAttribute($child, "TYPE");
+
+        if (!$targetObj->isBadAttribute($child, "FRU_ID")) {
+            #i.e this child is a fru,we are interrested in non fru devices
+            next;
+        }
+
+        #Fetch the Fru Type
+        if (!$targetObj->isBadAttribute($child, "TYPE")) {
+            $fruType = $targetObj->getAttribute($child, "TYPE");
+        }
+
+        # check whether this fru type is in interested fru types.
+        if (not exists $types{$fruType}) {
+            next;
+        }
+
+        # find the parent fru of this child.
+        my $parent = $targetObj->getTargetParent($child);
+        while ($parent ne ($item->{TARGET})) {
+            $parent = $targetObj->getTargetParent($parent);
+            if (!$targetObj->isBadAttribute($parent, "FRU_ID")) {
+                last;
+            }
+
+        }
+        #if parent of the child is not equal to the item->target
+        #i.e some other fru is parent of this child.
+        if ( $parent ne ($item->{TARGET}) ){
+            next;
+        }
+
+        printDebug("     ".$child);
+        printDebug("     Type:".$fruType );
+        my $childObmcName = getObmcName(\@inventory, $child);
+        writeToFile($fruType, $childObmcName, $fruTypeConfig, $fh);
+    }
 }
 close $fh;
 
 #------------------------------------END OF MAIN-----------------------
 
+# Map an MRW name to corresponding OBMC name
+sub getObmcName
+{
+    my $inventory = $_[0]; # Inventory items
+    my $target = $_[1]; # MRW Target name
+    for my $item (@inventory)
+    {
+        if($item->{TARGET} eq $target)
+        {
+            return $item->{OBMC_NAME};
+        }
+    }
+    return undef;
+}
+
+
 #Get the metdata for the incoming frutype from the loaded config file.
 #Write the FRU data into the output file
 
diff --git a/inventory-gen.yaml b/inventory-gen.yaml
index c1ddb40..2a9402b 100644
--- a/inventory-gen.yaml
+++ b/inventory-gen.yaml
@@ -1,34 +1,39 @@
 0:
   /system:
+    xyz.openbmc_project.Inventory.Item:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
+      Present:
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      Manufacturer:
-        IPMIFRUProperty: Manufacturer
+      SerialNumber:
+        IPMIFRUProperty: Serial Number
         IPMIFruSection: Product
       BuildDate:
         IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
-      SerialNumber:
-        IPMIFRUProperty: Serial Number
-        IPMIFruSection: Product
       PartNumber:
         IPMIFRUProperty: Part Number
         IPMIFruSection: Product
+      Manufacturer:
+        IPMIFRUProperty: Manufacturer
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
+0:
+  /system/chassis:
+0:
+  /system/chassis/motherboard/dimm0:
     xyz.openbmc_project.Inventory.Item:
       Present:
       PrettyName:
         IPMIFRUProperty: Product Name
         IPMIFruSection: Product
-0:
-  /system/chassis:
-0:
-  /system/chassis/motherboard/dimm0:
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -36,23 +41,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm1:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -60,23 +65,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm10:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -84,23 +89,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm11:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -108,23 +113,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm12:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -132,23 +137,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm13:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -156,23 +161,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm14:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -180,23 +185,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm15:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -204,23 +209,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm2:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -228,23 +233,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm3:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -252,23 +257,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm4:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -276,23 +281,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm5:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -300,23 +305,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm6:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -324,23 +329,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm7:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -348,23 +353,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm8:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -372,23 +377,23 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
         IPMIFruSection: Product
 0:
   /system/chassis/motherboard/dimm9:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+      PrettyName:
+        IPMIFRUProperty: Product Name
+        IPMIFruSection: Product
     xyz.openbmc_project.Inventory.Decorator.Asset:
-      PartNumber:
-        IPMIFRUProperty: Part Number
+      BuildDate:
+        IPMIFRUProperty: Mfg Date
         IPMIFruSection: Product
       SerialNumber:
         IPMIFRUProperty: Serial Number
@@ -396,14 +401,9 @@
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Product
-      BuildDate:
-        IPMIFRUProperty: Mfg Date
+      PartNumber:
+        IPMIFRUProperty: Part Number
         IPMIFruSection: Product
-    xyz.openbmc_project.Inventory.Item:
-      PrettyName:
-        IPMIFRUProperty: Product Name
-        IPMIFruSection: Product
-      Present:
     xyz.openbmc_project.Inventory.Revision:
       Version:
         IPMIFRUProperty: Version
@@ -411,40 +411,184 @@
 0:
   /system/chassis/motherboard/cpu0:
     xyz.openbmc_project.Inventory.Item:
+      Present:
       PrettyName:
         IPMIFRUProperty: Product Name
         IPMIFruSection: Board
-      Present:
     xyz.openbmc_project.Inventory.Decorator.Asset:
       SerialNumber:
         IPMIFRUProperty: Serial Number
         IPMIFruSection: Board
-      PartNumber:
-        IPMIFRUProperty: Part Number
-        IPMIFruSection: Board
       BuildDate:
         IPMIFRUProperty: Mfg Date
         IPMIFruSection: Board
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Board
+      PartNumber:
+        IPMIFRUProperty: Part Number
+        IPMIFruSection: Board
+  /system/chassis/motherboard/cpu0/core0:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core1:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core2:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core3:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core4:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core5:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core6:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core7:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core8:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core9:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core10:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core11:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core12:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core13:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core14:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core15:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core16:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core17:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core18:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core19:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core20:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core21:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core22:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu0/core23:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
 0:
   /system/chassis/motherboard/cpu1:
     xyz.openbmc_project.Inventory.Item:
+      Present:
       PrettyName:
         IPMIFRUProperty: Product Name
         IPMIFruSection: Board
-      Present:
     xyz.openbmc_project.Inventory.Decorator.Asset:
       SerialNumber:
         IPMIFRUProperty: Serial Number
         IPMIFruSection: Board
-      PartNumber:
-        IPMIFRUProperty: Part Number
-        IPMIFruSection: Board
       BuildDate:
         IPMIFRUProperty: Mfg Date
         IPMIFruSection: Board
       Manufacturer:
         IPMIFRUProperty: Manufacturer
         IPMIFruSection: Board
+      PartNumber:
+        IPMIFRUProperty: Part Number
+        IPMIFruSection: Board
+  /system/chassis/motherboard/cpu1/core0:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core1:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core2:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core3:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core4:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core5:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core6:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core7:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core8:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core9:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core10:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core11:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core12:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core13:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core14:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core15:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core16:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core17:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core18:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core19:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core20:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core21:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core22:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+  /system/chassis/motherboard/cpu1/core23:
+    xyz.openbmc_project.Inventory.Item:
+      Present: