diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5171c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +build*/ + +subprojects/* +!subprojects/*.wrap +subprojects/stdexec.wrap diff --git a/config/amd_ras_gpio_config0.json b/config/amd_ras_gpio_config0.json index 4753449..1fa10fd 100644 --- a/config/amd_ras_gpio_config0.json +++ b/config/amd_ras_gpio_config0.json @@ -1,3 +1,8 @@ { - "GPIO_ALERT_LINES": ["P0_I3C_APML_ALERT_L", "P1_I3C_APML_ALERT_L", "P2_I3C_APML_ALERT_L", "P3_I3C_APML_ALERT_L"] + "GPIO_ALERT_LINES": [ + "P0_I3C_APML_ALERT_L", + "P1_I3C_APML_ALERT_L", + "P2_I3C_APML_ALERT_L", + "P3_I3C_APML_ALERT_L" + ] } diff --git a/config/platform_default.json b/config/platform_default.json index c9bb533..f0edcae 100644 --- a/config/platform_default.json +++ b/config/platform_default.json @@ -1,18 +1,6 @@ { - "CpuCount": 1, - "Model": "0x50", - "FamilyID": "0x1A", - "DebugLogID": [ - 1, - 2, - 3, - 23, - 24, - 25, - 33, - 36, - 37, - 38, - 40 - ] + "CpuCount": 1, + "Model": "0x50", + "FamilyID": "0x1A", + "DebugLogID": [1, 2, 3, 23, 24, 25, 33, 36, 37, 38, 40] } diff --git a/meson.build b/meson.build index fa516c3..f7e81c6 100644 --- a/meson.build +++ b/meson.build @@ -4,6 +4,7 @@ project( default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'], license: 'Apache-2.0', version: '1.0', + meson_version: '>=1.1.1', ) config_file = get_option('config_file') @@ -25,7 +26,6 @@ cpp_args = [ libdir = meson.current_source_dir() + './lib/' cpp = meson.get_compiler('cpp') -apml_dep = cpp.find_library('apml64', dirs: libdir) boost_args = [ '-DBOOST_ALL_NO_LIB', @@ -48,7 +48,13 @@ deps = [ apml = get_option('apml-interface') if apml + apml_dep = cpp.find_library('apml64', dirs: libdir) add_project_arguments('-DAPML', language: 'cpp') + + apml_nda = get_option('apml-nda') + if apml_nda + add_project_arguments('-DAPML_NDA', language: 'cpp') + endif endif pldm = get_option('pldm-interface') @@ -56,10 +62,6 @@ if pldm add_project_arguments('-DPLDM', language: 'cpp') endif -apml_nda = get_option('apml-nda') -if apml_nda - add_project_arguments('-DAPML_NDA', language: 'cpp') -endif sources = [ 'src/config_manager.cpp', @@ -92,16 +94,28 @@ install_data( [ join_paths(meson.current_source_dir(), 'config', 'ras_config.json'), join_paths(meson.current_source_dir(), 'config', 'platform_default.json'), - join_paths(meson.current_source_dir(), 'config', 'amd_ras_gpio_config0.json'), - join_paths(meson.current_source_dir(), 'config', 'amd_ras_gpio_config1.json'), - join_paths(meson.current_source_dir(), 'config', 'amd_ras_gpio_config2.json'), + join_paths( + meson.current_source_dir(), + 'config', + 'amd_ras_gpio_config0.json', + ), + join_paths( + meson.current_source_dir(), + 'config', + 'amd_ras_gpio_config1.json', + ), + join_paths( + meson.current_source_dir(), + 'config', + 'amd_ras_gpio_config2.json', + ), ], - install_dir: ras_config_dir + install_dir: ras_config_dir, ) systemd = dependency('systemd') install_data( ['service_files/com.amd.RAS@.service'], - install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'), + install_dir: systemd.get_variable('systemd_system_unit_dir'), ) diff --git a/meson_options.txt b/meson.options similarity index 100% rename from meson_options.txt rename to meson.options diff --git a/src/config_manager.cpp b/src/config_manager.cpp index be8a64a..4a3ff06 100644 --- a/src/config_manager.cpp +++ b/src/config_manager.cpp @@ -178,9 +178,9 @@ void Manager::updateConfigToDbus() { lg2::error("Failed to create directory: {DIR}, ec={EC}", "DIR", destDir.string(), "EC", ec.message()); - throw std::runtime_error("Failed to create directory: " + - destDir.string() + " (" + - ec.message() + ")"); + throw std::runtime_error( + "Failed to create directory: " + destDir.string() + " (" + + ec.message() + ")"); } } @@ -214,7 +214,7 @@ void Manager::updateConfigToDbus() for (const auto& item : data["Configuration"]) { AttributeType attributeType = sdbusplus::common::com::amd::ras:: - Configuration::AttributeType::Boolean; + Configuration::AttributeType::Boolean; std::string key; std::string description; std::variant, diff --git a/src/utils/cper.cpp b/src/utils/cper.cpp index 52091dd..723051b 100644 --- a/src/utils/cper.cpp +++ b/src/utils/cper.cpp @@ -762,10 +762,10 @@ void createFile(const std::shared_ptr& data, std::string rasErrMsg = "Generated runtime CPER file : "; rasErrMsg.append(cperFilePath); - sd_journal_send( - "MESSAGE=%s", rasErrMsg.c_str(), "PRIORITY=%i", LOG_ERR, - "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.AtScaleDebugConnected", - "REDFISH_MESSAGE_ARGS=%s", rasErrMsg.c_str(), NULL); + sd_journal_send("MESSAGE=%s", rasErrMsg.c_str(), "PRIORITY=%i", + LOG_ERR, "REDFISH_MESSAGE_ID=%s", + "OpenBMC.0.1.AtScaleDebugConnected", + "REDFISH_MESSAGE_ARGS=%s", rasErrMsg.c_str(), NULL); } } fclose(file); diff --git a/subprojects/libgpiod.wrap b/subprojects/libgpiod.wrap new file mode 100644 index 0000000..e85aa49 --- /dev/null +++ b/subprojects/libgpiod.wrap @@ -0,0 +1,12 @@ +[wrap-file] +directory = libgpiod-1.6.3 +source_url = https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-1.6.3.tar.gz +source_filename = libgpiod-1.6.3.tar.gz +source_hash = eb446070be1444fd7d32d32bbca53c2f3bbb0a21193db86198cf6050b7a28441 +patch_filename = libgpiod_1.6.3-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/libgpiod_1.6.3-1/get_patch +patch_hash = 76821c637073679a88f77593c6f7ce65b4b5abf8c998f823fffa13918c8761df + +[provide] +libgpiod = gpiod_dep +libgpiodcxx = gpiodcxx_dep diff --git a/subprojects/nlohmann_json.wrap b/subprojects/nlohmann_json.wrap new file mode 100644 index 0000000..3745380 --- /dev/null +++ b/subprojects/nlohmann_json.wrap @@ -0,0 +1,6 @@ +[wrap-git] +revision = HEAD +url = https://github.com/nlohmann/json.git + +[provide] +nlohmann_json = nlohmann_json_dep diff --git a/subprojects/phosphor-dbus-interfaces.wrap b/subprojects/phosphor-dbus-interfaces.wrap new file mode 100644 index 0000000..0bf731e --- /dev/null +++ b/subprojects/phosphor-dbus-interfaces.wrap @@ -0,0 +1,7 @@ + +[wrap-git] +url = https://github.com/openbmc/phosphor-dbus-interfaces.git +revision = HEAD + +[provide] +phosphor-dbus-interfaces = phosphor_dbus_interfaces_dep diff --git a/subprojects/phosphor-logging.wrap b/subprojects/phosphor-logging.wrap new file mode 100644 index 0000000..71eee8b --- /dev/null +++ b/subprojects/phosphor-logging.wrap @@ -0,0 +1,6 @@ +[wrap-git] +url = https://github.com/openbmc/phosphor-logging.git +revision = HEAD + +[provide] +phosphor-logging = phosphor_logging_dep diff --git a/subprojects/sdbusplus.wrap b/subprojects/sdbusplus.wrap new file mode 100644 index 0000000..edd9a31 --- /dev/null +++ b/subprojects/sdbusplus.wrap @@ -0,0 +1,7 @@ +[wrap-git] +url = https://github.com/openbmc/sdbusplus.git +revision = HEAD + +[provide] +sdbusplus = sdbusplus_dep +program_names = sdbus++, sdbus++-gen-meson