[Skiboot] [PATCH v3] core/cpu.c: Add OPAL call to setup Nest MMU
Balbir Singh
bsingharora at gmail.com
Tue Aug 16 13:59:04 AEST 2016
On 15/08/16 16:18, Alistair Popple wrote:
> POWER9 has an off core MMU called the Nest MMU which allows other
> units within a chip to perform address translations. The context and
> setup for translations is handled by the requesting agents, however
> the Nest MMU does need to know where in system memory the page tables
> are located.
>
> This patch adds a call to setup the Nest MMU page table pointer on a
> per-chip basis.
>
> Signed-off-by: Alistair Popple <alistair at popple.id.au>
> ---
>
> Changes from v2:
> - Add check to make sure we're on a supported platform
>
> core/cpu.c | 32 ++++++++++++++++++++++++++++++++
> doc/opal-api/opal-nmmu-set-ptcr-127.txt | 22 ++++++++++++++++++++++
> include/opal-api.h | 3 ++-
> 3 files changed, 56 insertions(+), 1 deletion(-)
> create mode 100644 doc/opal-api/opal-nmmu-set-ptcr-127.txt
>
> diff --git a/core/cpu.c b/core/cpu.c
> index f33ac48..8675f06 100644
> --- a/core/cpu.c
> +++ b/core/cpu.c
> @@ -30,6 +30,7 @@
> #include <timebase.h>
> #include <ccan/str/str.h>
> #include <ccan/container_of/container_of.h>
> +#include <xscom.h>
>
> /* The cpu_threads array is static and indexed by PIR in
> * order to speed up lookup from asm entry points
> @@ -894,3 +895,34 @@ static int64_t opal_reinit_cpus(uint64_t flags)
> return rc;
> }
> opal_call(OPAL_REINIT_CPUS, opal_reinit_cpus, 1);
> +
> +/*
> + * Setup the the Nest MMU PTCR register for all chips in the system or
> + * the specified chip id.
> + *
> + * The PTCR value may be overwritten so long as all users have been
> + * quiesced. If it is set to an invalid memory address the system will
> + * checkstop if anything attempts to use it.
> + */
> +#define NMMU_CFG_XLAT_CTL_PTCR 0x5012c4b
> +static int64_t opal_nmmu_set_ptcr(uint64_t chip_id, uint64_t ptcr)
> +{
> + struct proc_chip *chip;
> + int64_t rc = OPAL_PARAMETER;
> +
> + if (proc_gen != proc_gen_p9)
> + return OPAL_UNSUPPORTED;
> +
Although I think proc_gen < proc_gen_p9 is better
Reviewed-by: Balbir Singh <bsingharora at gmail.com>
More information about the Skiboot
mailing list