com: meta: Add OEM "UnifiedSEL" event

Existing Meta BIOS create a "UnifiedSEL" structure for reporting
problems detected by the Host.  These are sent via either IPMI
or PLDM messages.  Create a new-style event for these so that
they can be exposed via Redfish.

Change-Id: I155e90c75f72f1b061646453f13cdc76fee56532
Signed-off-by: Amithash Prasad <amithash@meta.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/gen/com/meta/IPMI/UnifiedSEL/meson.build b/gen/com/meta/IPMI/UnifiedSEL/meson.build
new file mode 100644
index 0000000..889eae3
--- /dev/null
+++ b/gen/com/meta/IPMI/UnifiedSEL/meson.build
@@ -0,0 +1,26 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'com/meta/IPMI/UnifiedSEL'
+
+generated_sources += custom_target(
+    'com/meta/IPMI/UnifiedSEL__cpp'.underscorify(),
+    input: ['../../../../../yaml/com/meta/IPMI/UnifiedSEL.events.yaml'],
+    output: ['event.cpp', 'event.hpp'],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog,
+        '--command',
+        'cpp',
+        '--output',
+        meson.current_build_dir(),
+        '--tool',
+        sdbusplusplus_prog,
+        '--directory',
+        meson.current_source_dir() / '../../../../../yaml',
+        'com/meta/IPMI/UnifiedSEL',
+    ],
+    install: should_generate_cpp,
+    install_dir: [false, get_option('includedir') / sdbusplus_current_path],
+    build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/com/meta/IPMI/meson.build b/gen/com/meta/IPMI/meson.build
new file mode 100644
index 0000000..3f6c34c
--- /dev/null
+++ b/gen/com/meta/IPMI/meson.build
@@ -0,0 +1,49 @@
+# Generated file; do not modify.
+subdir('UnifiedSEL')
+
+sdbusplus_current_path = 'com/meta/IPMI'
+
+generated_markdown += custom_target(
+    'com/meta/IPMI/UnifiedSEL__markdown'.underscorify(),
+    input: ['../../../../yaml/com/meta/IPMI/UnifiedSEL.events.yaml'],
+    output: ['UnifiedSEL.md'],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog,
+        '--command',
+        'markdown',
+        '--output',
+        meson.current_build_dir(),
+        '--tool',
+        sdbusplusplus_prog,
+        '--directory',
+        meson.current_source_dir() / '../../../../yaml',
+        'com/meta/IPMI/UnifiedSEL',
+    ],
+    install: should_generate_markdown,
+    install_dir: [inst_markdown_dir / sdbusplus_current_path],
+    build_by_default: should_generate_markdown,
+)
+
+generated_registry += custom_target(
+    'com/meta/IPMI/UnifiedSEL__registry'.underscorify(),
+    input: ['../../../../yaml/com/meta/IPMI/UnifiedSEL.events.yaml'],
+    output: ['UnifiedSEL.json'],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog,
+        '--command',
+        'registry',
+        '--output',
+        meson.current_build_dir(),
+        '--tool',
+        sdbusplusplus_prog,
+        '--directory',
+        meson.current_source_dir() / '../../../../yaml',
+        'com/meta/IPMI/UnifiedSEL',
+    ],
+    install: should_generate_registry,
+    install_dir: [inst_registry_dir / sdbusplus_current_path],
+    build_by_default: should_generate_registry,
+)
+
diff --git a/gen/com/meta/meson.build b/gen/com/meta/meson.build
index d98d1bb..36df8d2 100644
--- a/gen/com/meta/meson.build
+++ b/gen/com/meta/meson.build
@@ -1,3 +1,4 @@
 # Generated file; do not modify.
 subdir('Hardware')
+subdir('IPMI')
 subdir('Inventory')
diff --git a/yaml/com/meta/IPMI/UnifiedSEL.events.yaml b/yaml/com/meta/IPMI/UnifiedSEL.events.yaml
new file mode 100644
index 0000000..fd0d222
--- /dev/null
+++ b/yaml/com/meta/IPMI/UnifiedSEL.events.yaml
@@ -0,0 +1,21 @@
+version: 1.0.0
+
+errors:
+    - name: UnifiedSELEvent
+      severity: critical
+      metadata:
+          - name: Source
+            type: object_path
+            primary: true
+            description: The source from where the event was generated.
+          - name: Event
+            type: string
+            primary: true
+            description: The parsed event log contents.
+          - name: RawEvent
+            type: string
+            description: The RAW IPMI data received (as hex).
+      en:
+          description: Unified System Event Log received by the BMC.
+          message: "Unified SEL received from '{Source}': {Event}"
+      errno: EIO