server3: pcie_bifurcation: Add overrides for EVT1

Handle EVT1 NIC cable incorrect bifurcation issue by overriding bifurcation
string based on board product name.

Tested: Verified on hardware.
Google-Bug-Id: 471332425
Change-Id: I294aa45b242f983d20490a73ef3e23867145e606
Signed-off-by: Tom Tung <tomtung@google.com>
diff --git a/fru/pcie_bifurcation_server_3.cpp b/fru/pcie_bifurcation_server_3.cpp
index 3b55eb3..ede39aa 100644
--- a/fru/pcie_bifurcation_server_3.cpp
+++ b/fru/pcie_bifurcation_server_3.cpp
@@ -153,6 +153,7 @@
             continue;
         }
 
+        bool hasOverride = false;
         uint32_t bus{0};
         uint32_t addr{0};
         std::string bifurcationStr;
@@ -167,10 +168,25 @@
             {
                 addr = std::get<uint32_t>(value);
             }
-            if (key.starts_with("BOARD_INFO_AM"))
+            if (key.starts_with("BOARD_INFO_AM") && !hasOverride)
             {
                 bifurcationStr = std::get<std::string>(value);
             }
+            // TODO(b/472373833) - remove this after swapping to use EVT2+
+            // cables.
+            if (key == "BOARD_PRODUCT_NAME")
+            {
+                // For these cables, the logical bifurcation are supposed to be
+                // x16 though physically they are x8x8 from the viewpoint of a
+                // PE slot.
+                std::string pn = std::get<std::string>(value);
+                if (pn.starts_with("x32_apec_to_4x8_mxio_P") ||
+                    pn.starts_with("x16_cem_to_2x8_mxio_P"))
+                {
+                    bifurcationStr = "PCIe-bifurcation:x16";
+                    hasOverride = true;
+                }
+            }
         }
 
         for (auto& host : hostBifurcations_)