From 802f9d8005aae394374df3814d11ae8c3bba09b2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 09 2017 13:14:53 +0000 Subject: import opal-prd-5.7.0-0.2.rc2.el7a --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70635c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/skiboot-5.7.0-rc2.tar.gz diff --git a/.opal-prd.metadata b/.opal-prd.metadata new file mode 100644 index 0000000..1382086 --- /dev/null +++ b/.opal-prd.metadata @@ -0,0 +1 @@ +760110f4584ba87bf8ea9dff5aa9c3b51c6c3a13 SOURCES/skiboot-5.7.0-rc2.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-opal-prd-Fix-occ_reset-call.patch b/SOURCES/0001-opal-prd-Fix-occ_reset-call.patch new file mode 100644 index 0000000..ef3e7d7 --- /dev/null +++ b/SOURCES/0001-opal-prd-Fix-occ_reset-call.patch @@ -0,0 +1,86 @@ +From e2ab540ac169cac9737ff09605182a333086f848 Mon Sep 17 00:00:00 2001 +From: Vasant Hegde +Date: Thu, 21 Sep 2017 19:49:47 +0530 +Subject: [PATCH 1/2] opal-prd: Fix occ_reset call + +HBRT OCC reset interface depends on service processor type. + FSP -> reset_pm_complex() + BMC -> process_occ_reset() + +This patch adds logic to detect service processor type and +then make appropriate occ reset call. + +CC: Jeremy Kerr +CC: Daniel M Crowell +Signed-off-by: Vasant Hegde +Signed-off-by: Shilpasri G Bhat +Signed-off-by: Vasant Hegde +Signed-off-by: Shilpasri G Bhat +Signed-off-by: Stewart Smith +--- + external/opal-prd/opal-prd.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c +index a09a6366..20ce5dac 100644 +--- a/external/opal-prd/opal-prd.c ++++ b/external/opal-prd/opal-prd.c +@@ -246,6 +246,21 @@ static void pr_log_daemon_init(void) + } + } + ++/* Check service processor type */ ++static bool is_fsp_system(void) ++{ ++ char *path; ++ int rc; ++ ++ rc = asprintf(&path, "%s/fsps", devicetree_base); ++ if (rc < 0) { ++ pr_log(LOG_ERR, "FW: error creating '/fsps' path %m"); ++ return false; ++ } ++ ++ return access(path, F_OK) ? false : true; ++} ++ + /** + * ABI check that we can't perform at build-time: we want to ensure that the + * layout of struct host_interfaces matches that defined in the thunk. +@@ -1336,18 +1351,27 @@ static int pm_complex_reset(uint64_t chip) + { + int rc; + +- if (hservice_runtime->reset_pm_complex) { ++ /* ++ * FSP system -> reset_pm_complex ++ * BMC system -> process_occ_reset ++ */ ++ if (is_fsp_system()) { ++ if (!hservice_runtime->reset_pm_complex) { ++ pr_log_nocall("reset_pm_complex"); ++ return -1; ++ } ++ + pr_debug("PM: calling pm_complex_reset(%ld)", chip); + rc = call_reset_pm_complex(chip); ++ } else { ++ if (!hservice_runtime->process_occ_reset) { ++ pr_log_nocall("process_occ_reset"); ++ return -1; ++ } + +- } else if (hservice_runtime->process_occ_reset) { + pr_debug("PM: calling process_occ_reset(%ld)", chip); + call_process_occ_reset(chip); + rc = 0; +- +- } else { +- pr_log_nocall("reset_pm_complex/process_occ_reset"); +- rc = -1; + } + + return rc; +-- +2.13.5 + diff --git a/SOURCES/0002-opal-prd-Fix-opal-prd-command-line-options.patch b/SOURCES/0002-opal-prd-Fix-opal-prd-command-line-options.patch new file mode 100644 index 0000000..13bf19f --- /dev/null +++ b/SOURCES/0002-opal-prd-Fix-opal-prd-command-line-options.patch @@ -0,0 +1,68 @@ +From dceed210a2bd2c4031e41d78548e6fc1f37d8f6f Mon Sep 17 00:00:00 2001 +From: Vasant Hegde +Date: Thu, 21 Sep 2017 19:49:48 +0530 +Subject: [PATCH 2/2] opal-prd: Fix opal-prd command line options + +HBRT OCC reset interface depends on service processor type. + FSP -> reset_pm_complex() + BMC -> process_occ_reset() + +We have both `occ` and `pm-complex` command line interfaces. +This patch adds support to dispaly appropriate message depending +on system type. + FSP -> opal-prd occ --> display error message + FSP -> opal-prd pm-complex --> Call pm_complex_reset() + BMC -> opal-prd occ --> Call process_occ_reset() + BMC -> opal-prd pm-complex --> display error message + +CC: Jeremy Kerr +CC: Daniel M Crowell +Signed-off-by: Vasant Hegde +Signed-off-by: Vasant Hegde +Signed-off-by: Stewart Smith +--- + external/opal-prd/opal-prd.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c +index 20ce5dac..c26cc951 100644 +--- a/external/opal-prd/opal-prd.c ++++ b/external/opal-prd/opal-prd.c +@@ -1584,7 +1584,7 @@ static void handle_prd_control_occ_reset(struct control_msg *send_msg, + chip = msg->occ_reset.chip; + + /* do reset */ +- pr_debug("CTRL: resetting PM complex on chip %ld", chip); ++ pr_debug("CTRL: Calling OCC reset on chip %ld", chip); + pm_complex_reset(chip); + + send_msg->data_len = 0; +@@ -2326,9 +2326,24 @@ static int parse_action(const char *str, enum action *action) + { + int rc; + +- if (!strcmp(str, "occ") || !strcmp(str, "pm-complex")) { ++ if (!strcmp(str, "occ")) { + *action = ACTION_OCC_CONTROL; + rc = 0; ++ ++ if (is_fsp_system()) { ++ pr_log(LOG_ERR, "CTRL: occ commands are not " ++ "supported on this system"); ++ rc = -1; ++ } ++ } else if (!strcmp(str, "pm-complex")) { ++ *action = ACTION_OCC_CONTROL; ++ rc = 0; ++ ++ if (!is_fsp_system()) { ++ pr_log(LOG_ERR, "CTRL: pm-complex commands are not " ++ "supported on this system"); ++ rc = -1; ++ } + } else if (!strcmp(str, "daemon")) { + *action = ACTION_RUN_DAEMON; + rc = 0; +-- +2.13.5 + diff --git a/SOURCES/opal-prd.service b/SOURCES/opal-prd.service new file mode 100644 index 0000000..451e445 --- /dev/null +++ b/SOURCES/opal-prd.service @@ -0,0 +1,12 @@ +[Unit] +Description=OPAL PRD daemon +ConditionArchitecture=ppc64-le +ConditionVirtualization=false +ConditionPathExists=/sys/firmware/devicetree/base/ibm,opal/diagnostics + +[Service] +ExecStart=/usr/sbin/opal-prd --pnor /dev/mtd0 +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/opal-prd.spec b/SPECS/opal-prd.spec new file mode 100644 index 0000000..4e8008a --- /dev/null +++ b/SPECS/opal-prd.spec @@ -0,0 +1,134 @@ +Name: opal-prd +Version: 5.7.0 +Release: 0.2.rc2%{?dist} +Summary: OPAL Processor Recovery Diagnostics Daemon + +Group: System Environment/Daemons +License: ASL 2.0 +URL: http://github.com/open-power/skiboot + +# Presently opal-prd is supported on ppc64le architecture only. +ExclusiveArch: ppc64le + +BuildRequires: systemd +BuildRequires: openssl-devel + +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +#Source0: https://github.com/open-power/skiboot/archive/skiboot-%{version}.tar.gz +Source0: https://github.com/open-power/skiboot/archive/v5.7-rc2.tar.gz#/skiboot-%{version}-rc2.tar.gz +Source1: opal-prd.service +Patch0: 0001-opal-prd-Fix-occ_reset-call.patch +Patch1: 0002-opal-prd-Fix-opal-prd-command-line-options.patch + +%description +This package provides a daemon to load and run the OpenPower firmware's +Processor Recovery Diagnostics binary. This is responsible for run time +maintenance of OpenPower Systems hardware. + + +%package -n opal-utils +Summary: OPAL firmware utilities +Group: Applications/System + +%description -n opal-utils +This package contains utility programs. + +The 'gard' utility, can read, parse and clear hardware gard partitions +on OpenPower platforms. The 'getscom' and 'putscom' utilities provide +an interface to query or modify the registers of the different chipsets +of an OpenPower system. 'pflash' is a tool to access the flash modules +on such systems and update the OpenPower firmware. + +%package -n opal-firmware +Summary: OPAL firmware +BuildArch: noarch + +%description -n opal-firmware +OPAL firmware, aka skiboot, loads the bootloader and provides runtime +services to the OS (Linux) on IBM Power and OpenPower systems. + +%prep + +%setup -q -n skiboot-5.7-rc2 +%patch0 -p1 +%patch1 -p1 + +%build +OPAL_PRD_VERSION=%{version} make V=1 CFLAGS="%{optflags}" -C external/opal-prd +GARD_VERSION=%{version} make V=1 CFLAGS="%{optflags}" -C external/gard +PFLASH_VERSION=%{version} make V=1 CFLAGS="%{optflags}" -C external/pflash +XSCOM_VERSION=%{version} make V=1 CFLAGS="%{optflags}" -C external/xscom-utils +SKIBOOT_VERSION=%{version} CROSS= make V=1 %{?_smp_mflags} + +%install +make -C external/opal-prd install DESTDIR=%{buildroot} prefix=/usr +make -C external/gard install DESTDIR=%{buildroot} prefix=/usr +make -C external/pflash install DESTDIR=%{buildroot} prefix=/usr +make -C external/xscom-utils install DESTDIR=%{buildroot} prefix=/usr + +mkdir -p %{buildroot}%{_unitdir} +install -m 644 -p %{SOURCE1} %{buildroot}%{_unitdir}/opal-prd.service + +mkdir -p %{buildroot}%{_datadir}/qemu +install -m 644 -p skiboot.lid %{buildroot}%{_datadir}/qemu/skiboot.lid + +%post +%systemd_post opal-prd.service + +%preun +%systemd_preun opal-prd.service + +%postun +%systemd_postun_with_restart opal-prd.service + +%files +%doc README.md +%license LICENCE +%{_sbindir}/opal-prd +%{_unitdir}/opal-prd.service +%{_mandir}/man8/* + +%files -n opal-utils +%doc README.md +%license LICENCE +%{_sbindir}/opal-gard +%{_sbindir}/getscom +%{_sbindir}/putscom +%{_sbindir}/getsram +%{_sbindir}/pflash +%{_mandir}/man1/* + +%files -n opal-firmware +%doc README.md +%license LICENCE +%{_datadir}/qemu/ + +%changelog +* Fri Sep 29 2017 Josh Boyer - 5.7.0-0.2.rc2 +- Resolves: rhbz#1493672 - fix OCC reset + +* Fri Jul 21 2017 Dan HorĂ¡k - 5.7.0-0.1.rc2 +- Resolves: rhbz#1368702 - opal-prd update to 5.7-rc2 + +* Thu Apr 20 2017 Rafael Fonseca - 5.5.0-1 +- Resolves: rhbz#1368702 - [Pegas1.0 FEAT] opal-prd package update + +* Tue Mar 14 2017 Rafael Fonseca - 5.4.3-2 +- Resolves: rhbz#1430332 - Restart opal-prd daemon on any kind of failure + +* Wed Jan 18 2017 Rafael Fonseca - 5.4.3-1 +- Resolves: rhbz#1384952 - [7.4 FEAT] opal-prd package update for ppc64le + +* Thu Sep 22 2016 Rafael Fonseca - 5.2.0-3 +- Resolves: rhbz#1375449 + +* Thu Aug 25 2016 Rafael Fonseca - 5.2.0-2 +- Resolves: rhbz#1367342 +- Remove systemd socket. + +* Fri May 20 2016 Rafael dos Santos - 5.2.0-1 +- Importing package from Fedora. +