[Skiboot] [PATCH 2/2] opal-prd: occ: Add support for runtime OCC load/start in ZZ
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Mon Nov 27 20:15:13 AEDT 2017
On 11/17/2017 12:52 PM, Shilpasri G Bhat wrote:
> This patch adds support to handle OCC load/start event from FSP/PRD.
> During IPL we send a success directly to FSP without invoking any HBRT
> load routines on recieving OCC load mbox message from FSP. At runtime
> we forward this event to host opal-prd.
>
> This patch provides support for invoking OCC load/start HBRT routines
> like load_pm_complex() and start_pm_complex() from opal-prd.
Overall patch looks good to me. Few minor comments.
>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
> ---
> external/opal-prd/opal-prd.c | 78 ++++++++++++++++++++++++++++++++++++++++++++
> hw/occ.c | 66 +++++++++++++++++++++++++++++++------
> hw/prd.c | 17 ++++++++++
> include/opal-api.h | 2 ++
> include/skiboot.h | 2 ++
> 5 files changed, 155 insertions(+), 10 deletions(-)
.../...
>
> +static int pm_complex_load_start(struct opal_prd_ctx *ctx,
> + struct opal_prd_msg *msg)
> +{
> + struct opal_prd_msg omsg;
> + struct prd_range *range;
> + u64 homer, occ_common;
> + u32 proc;
> + int rc;
> +
> + proc = be64toh(msg->occ_reset.chip);
> + pr_debug("FW: Firmware requested OCC load for proc 0x%x", proc);
> +
> + if (!hservice_runtime->load_pm_complex) {
> + pr_log_nocall("load_pm_complex");
> + rc = -1;
> + goto out;
> + }
> +
> + if (!hservice_runtime->start_pm_complex) {
> + pr_log_nocall("start_pm_complex");
> + rc = -1;
> + goto out;
> + }
> +
> + range = find_range("ibm,homer-image", proc);
> + if (!range) {
> + pr_log(LOG_ERR, "Homer image not found");
Please add prefix to logs ("FW: ...").
> + rc = -1;
> + goto out;
> + }
> +
> + homer = range->physaddr;
> + range = NULL;
Redundant ? as find_range return NULL.
> + range = find_range("ibm,occ-common-area", 0);
> + if (!range) {
> + pr_log(LOG_ERR, "occ common area not found");
ditto.
> + rc = -1;
> + goto out;
> + }
> + occ_common = range->physaddr;
> + pr_debug("PM: calling load_pm_complex(0x%x, 0x%lx, 0x%lx, LOAD)",
> + proc, homer, occ_common);
> +
.../...
> diff --git a/include/opal-api.h b/include/opal-api.h
> index 9c9d7fb..3cfb43f 100644
> --- a/include/opal-api.h
> +++ b/include/opal-api.h
> @@ -1056,6 +1056,8 @@ enum opal_prd_msg_type {
> OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH, /* HBRT <-- OPAL */
> OPAL_PRD_MSG_TYPE_OCC_RESET_STATUS, /* HBRT --> OPAL */
> OPAL_PRD_MSG_TYPE_CORE_SPECIAL_WAKEUP, /* HBRT --> OPAL */
> + OPAL_PRD_MSG_TYPE_OCC_LOAD_START, /* HBRT --> OPAL */
HBRT <-- OPAL ?
> + OPAL_PRD_MSG_TYPE_OCC_LOAD_START_STATUS, /* HBRT --> OPAL */
> };
>
-Vasant
More information about the Skiboot
mailing list