[Skiboot] [PATCH v4 15/18] fadump: Send OPAL relocated base address to SBE

Stewart Smith stewart at linux.vnet.ibm.com
Tue Aug 7 18:02:38 AEST 2018


Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:
> OPAL relocates itself during boot. During memory preserving IPL hostboot needs
> to access relocated OPAL to get MDST, MDDT tables. Hence send relocated base
> address to SBE via 'stash MPIPL config' chip-op. During next IPL SBE will send
> stashed data to hostboot... so that hostboot can access these data.
>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
>  core/opal-mpipl.c |  4 ++++
>  hw/sbe-p9.c       | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  include/sbe-p9.h  |  6 ++++++
>  3 files changed, 57 insertions(+)
>
> diff --git a/core/opal-mpipl.c b/core/opal-mpipl.c
> index 455ecbd2a..6f6016a46 100644
> --- a/core/opal-mpipl.c
> +++ b/core/opal-mpipl.c
> @@ -23,6 +23,7 @@
>  #include <opal.h>
>  #include <opal-dump.h>
>  #include <opal-internal.h>
> +#include <sbe-p9.h>
>  #include <skiboot.h>
>
>  #include <ccan/endian/endian.h>
> @@ -348,6 +349,9 @@ void opal_fadump_init(void)
>
>  	adjust_opal_dump_size(dump_node);
>
> +	/* Send OPAL relocated base address to SBE */
> +	p9_sbe_send_relocated_base(SKIBOOT_BASE);
> +
>  	/* OPAL interface */
>  	opal_register(OPAL_FADUMP_MANAGE, opal_fadump_manage, 3);
>  }
> diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c
> index d52ada15a..b05a4ec0f 100644
> --- a/hw/sbe-p9.c
> +++ b/hw/sbe-p9.c
> @@ -861,6 +861,53 @@ bool p9_sbe_timer_ok(void)
>  	return sbe_has_timer;
>  }
>
> +static void p9_sbe_stash_chipop_resp(struct p9_sbe_msg *msg)
> +{
> +	int rc = p9_sbe_get_primary_rc(msg->resp);
> +	struct p9_sbe *sbe = (void *)msg->user_data;
> +
> +	if (rc == SBE_STATUS_PRI_SUCCESS) {
> +		prlog(PR_DEBUG, "Sent stash MPIPL config [chip id =0x%x]\n",
> +		      sbe->chip_id);
> +	} else {
> +		prlog(PR_DEBUG, "Failed to send stash MPIPL config "
> +		      "[chip id = 0x%x, rc = %d]\n", sbe->chip_id, rc);

Should this be PR_ERR in the case where hostboot told us mpipl is supported?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list