Watchdog timeout support in SBE boot window

Added support to handle SBE boot failure when watchdog
times out in the SBE boot window. FFDC information from SBE
is captured using libphal provided API, and the SBE specific
PEL for a valid FFDC is created. In case the error is related
to SBE timeout or no FFDC data then SBE dump to capture additional
debug data is initiated.

Tested: verified PEL log
root@p10bmc:~# peltool -l
{
    "0x50000332": {
        "SRC":                  "BD123504",
        "Message":              "timeout reported during SBE boot
process",
        "PLID":                 "0x50000332",
        "CreatorID":            "BMC",
        "Subsystem":            "Processor Chip Cache",
        "Commit Time":          "10/04/2021 18:25:27",
        "Sev":                  "Unrecoverable Error",
        "CompID":               "0x3500"
    }
}

- Verified SBE dump was collected
  Steps used:
  1. obmcutil poweroff
  2. istep -s0
  3. systemctl start org.open_power.Dump.Manager.service
  4. systemctl start openpower-debug-collector-watchdog@0.service
  5. Check journal log to see SBE dump requested, dump entry created
     and the dump is completed
     journalctl -f -t watchdog_timeout
  6. Verify the SBE dump:
     ls /var/lib/phosphor-debug-collector/sbedump/<dump-entry-id>

- Verified Hostboot dump was collected
  Steps Used:
  1. obmcutil poweroff
  2. istep -s0..6
  3. systemctl start org.open_power.Dump.Manager.service
  4. systemctl start openpower-debug-collector-watchdog@0.service
  5. Check journal log to see Hostboot dump requested, dump entry
     created and the dump is completed
     journalctl -f -t watchdog_timeout
  6. Verify the SBE dump:
     ls /var/lib/phosphor-debug-collector/hostbootdump/<dump-entry-id>

Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: Ibfe7cc6619cd99f303c6106e617bc636632d0940
diff --git a/meson.build b/meson.build
index b03d995..4f3415c 100644
--- a/meson.build
+++ b/meson.build
@@ -44,10 +44,6 @@
   fmt_dep = fmt_proj.dependency('fmt')
 endif
 
-deps = [
-    systemd, sdbusplus, phosphorlogging, fmt_dep
-]
-
 realpath_prog = find_program('realpath')
 
 selected_subdirs = []
@@ -86,15 +82,30 @@
     endforeach
 endforeach
 
+cxx = meson.get_compiler('cpp')
 conf_data = configuration_data()
 if get_option('hostboot-dump-collection').enabled()
-    conf_data.set('HOSTBOOT_DUMP_COLLECTION', true)
+    conf_data.set('WATCHDOG_DUMP_COLLECTION', true)
+    extra_deps = [
+        cxx.find_library('pdbg'),
+        cxx.find_library('libdt-api'),
+        cxx.find_library('phal')
+    ]
     subdir('watchdog')
 else
-    conf_data.set('HOSTBOOT_DUMP_COLLECTION', false)
+    conf_data.set('WATCHDOG_DUMP_COLLECTION', false)
     watchdog_lib = []
+    extra_deps = []
 endif
 
+deps = [
+    systemd,
+    sdbusplus,
+    phosphorlogging,
+    fmt_dep,
+    extra_deps
+]
+
 executable('watchdog_timeout',
     'watchdog_timeout.cpp',
     configure_file(output: 'config.h', configuration: conf_data),