PHAL: reinitialize the devtree attributes

In the regular host boot path devtree attribute need to
initialize the default data and also some of the selected
attributes need to preserve with previous boot value.
Preserve attribute list is available BMC pre-defined location.
This function helps to meet the host ipl requirement
related to attribute persistency management for host ipl.

Steps involved
  1. create attribute data file from devtree r/w version based on
     the attribute list file installed in bmc.
  2. create temporary copy of r/w version devtree for attributes
     updates and initialise with r/o DEVTREE version
     to default data.
  3. apply step-1 attribute file on top of the temporary
     copy file.
  4. Incase any failure from step 1 to 3 log an error and
     update r/w version with r/o version ( genesis boot).
  5. Update DEVTREE r/w version with temporary version file.

Also added devtree libs part of the pdata repository to
export/import attributes devtree.

Tested: verified the devtree attribute values.

Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I20c17ba3013a0b4b01f9f8e0d4462c91489308e8
diff --git a/meson.build b/meson.build
index d39f9f5..a1ec942 100644
--- a/meson.build
+++ b/meson.build
@@ -39,6 +39,22 @@
                       description : 'Path to the devtree export copy file'
                     )
 
+conf_data.set_quoted('CEC_DEVTREE_RW_PATH', get_option('CEC_DEVTREE_RW_PATH'),
+                      description : 'Path to the devtree file r/w version'
+                    )
+
+conf_data.set_quoted('CEC_DEVTREE_RO_PATH', get_option('CEC_DEVTREE_RO_PATH'),
+                      description : 'Path to the devtree file read only version'
+                    )
+
+conf_data.set_quoted('CEC_INFODB_PATH', get_option('CEC_INFODB_PATH'),
+                      description : 'Path to the devtree attributes based database path'
+                    )
+
+conf_data.set_quoted('DEVTREE_REINIT_ATTRS_LIST', get_option('DEVTREE_REINIT_ATTRS_LIST'),
+                      description : 'Path to the phal devtree reinit attribute list file'
+                    )
+
 configure_file(configuration : conf_data,
                output : 'config.h'
               )
@@ -85,6 +101,7 @@
         'procedures/phal/check_host_running.cpp',
         'procedures/phal/import_devtree.cpp',
         'procedures/phal/enter_mpreboot.cpp',
+        'procedures/phal/reinit_devtree.cpp',
         'extensions/phal/common_utils.cpp',
         'extensions/phal/pdbg_utils.cpp',
         'extensions/phal/create_pel.cpp',
@@ -97,6 +114,7 @@
         cxx.find_library('ekb'),
         cxx.find_library('ipl'),
         cxx.find_library('phal'),
+        cxx.find_library('dtree'),
     ]
     extra_unit_files = [
         'service_files/set-spi-mux.service',