support multiple device trees in the same BMC image
This commit checks for current system type and if it is changed from last boot,
it loads new/appropriate device tree and reboot the system.
Tested-
=========================================
Test Case 1: first boot when env not defined
triggerred system vpd collection-
DBG: systemType is: 50001000
DBG: newDeviceTree: fw_dt2
U-Boot environment is not set. Updating...
DBG: rebooting...
root@rainier:/tmp# Connection to rain4bmc closed by remote host.
Connection to rain4bmc closed.
========================================
Test case 2-
triggerred system vpd collection-
DBG: systemType is: 50001001
DBG: newDeviceTree: fw_dt1
U-Boot environment is not updated. Updating...
DBG: rebooting...
root@rainier:/tmp# Connection to rain4bmc closed by remote host.
Connection to rain4bmc closed.
alpana07> ssh -k root@rain4bmc
root@rain4bmc's password:
printenv
...
bootside=b
devTree=fw_dt1
root@rainier:~#
=========================================
Test case 3-
triggerred system vpd collection again-
DBG: systemType is: 50001001
DBG: newDeviceTree: fw_dt1
U-Boot environment is Updated.
root@rainier:~# fw_printenv
...
bootside=b
devTree=fw_dt1
=========================================
Change-Id: I28bce8ced4a970e1818b4f4f613bd062647a4d3a
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
diff --git a/const.hpp b/const.hpp
index ac8dafe..40ffc62 100644
--- a/const.hpp
+++ b/const.hpp
@@ -47,8 +47,8 @@
constexpr uint8_t EXP_LOCATIN_CODE_MIN_LENGTH = 17;
static constexpr auto SE_KWD_LENGTH = 7;
static constexpr auto INVALID_NODE_NUMBER = -1;
-static constexpr auto SYSTEM_2U = "50001001";
-static constexpr auto SYSTEM_4U = "50001000";
+static constexpr auto RAINIER_2U = "50001001";
+static constexpr auto RAINIER_4U = "50001000";
constexpr uint8_t KW_VPD_START_TAG = 0x82;
constexpr uint8_t KW_VPD_END_TAG = 0x78;