[Skiboot] [PATCH V3 1/2] prd: Fix PRD scoms for P9
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Sun Mar 12 04:32:33 AEDT 2017
On 02/24/2017 04:00 PM, Ananth N Mavinakayanahalli wrote:
> The IPOLL register addresses have changed from P8.
>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth at linux.vnet.ibm.com>
> ---
> hw/prd.c | 61 +++++++++++++++++++++++++++++++++++++++++++++----------------
> 1 file changed, 45 insertions(+), 16 deletions(-)
>
> diff --git a/hw/prd.c b/hw/prd.c
> index a44faa9..a5c8cc3 100644
> --- a/hw/prd.c
> +++ b/hw/prd.c
> @@ -48,14 +48,41 @@ static struct dt_node *prd_node;
> static struct lock events_lock = LOCK_UNLOCKED;
> static struct lock ipoll_lock = LOCK_UNLOCKED;
>
> +static uint64_t prd_ipoll_mask_reg;
> +static uint64_t prd_ipoll_status_reg;
> +static uint64_t prd_ipoll_mask;
> +
> /* PRD registers */
> -#define PRD_IPOLL_REG_MASK 0x01020013
> -#define PRD_IPOLL_REG_STATUS 0x01020014
> -#define PRD_IPOLL_XSTOP PPC_BIT(0) /* Xstop for host/core/millicode */
> -#define PRD_IPOLL_RECOV PPC_BIT(1) /* Recoverable */
> -#define PRD_IPOLL_SPEC_ATTN PPC_BIT(2) /* Special attention */
> -#define PRD_IPOLL_HOST_ATTN PPC_BIT(3) /* Host attention */
> -#define PRD_IPOLL_MASK PPC_BITMASK(0, 3)
> +#define PRD_P8_IPOLL_REG_MASK 0x01020013
> +#define PRD_P8_IPOLL_REG_STATUS 0x01020014
> +#define PRD_P8_IPOLL_XSTOP PPC_BIT(0) /* Xstop for host/core/millicode */
> +#define PRD_P8_IPOLL_RECOV PPC_BIT(1) /* Recoverable */
> +#define PRD_P8_IPOLL_SPEC_ATTN PPC_BIT(2) /* Special attention */
> +#define PRD_P8_IPOLL_HOST_ATTN PPC_BIT(3) /* Host attention */
> +#define PRD_P8_IPOLL_MASK PPC_BITMASK(0, 3)
> +
> +#define PRD_P9_IPOLL_REG_MASK 0x000F0033
> +#define PRD_P9_IPOLL_REG_STATUS 0x000F0034
> +#define PRD_P9_ERROR_TYPE0 PPC_BIT(0)
> +#define PRD_P9_ERROR_TYPE1 PPC_BIT(1)
> +#define PRD_P9_ERROR_TYPE2 PPC_BIT(2)
> +#define PRD_P9_ERROR_TYPE3 PPC_BIT(3)
> +#define PRD_P9_ERROR_TYPE4 PPC_BIT(4)
> +#define PRD_P9_MASK_INTERRUPT PPC_BIT(5)
> +#define PRD_P9_IPOLL_MASK PPC_BITMASK(0, 5)
> +
> +static void prd_init_scoms(void)
> +{
> + if (proc_gen == proc_gen_p8) {
> + prd_ipoll_mask_reg = PRD_P8_IPOLL_REG_MASK;
> + prd_ipoll_status_reg = PRD_P8_IPOLL_REG_STATUS;
> + prd_ipoll_mask = PRD_P8_IPOLL_MASK;
> + } else if (proc_gen == proc_gen_p9) {
> + prd_ipoll_mask_reg = PRD_P9_IPOLL_REG_MASK;
> + prd_ipoll_status_reg = PRD_P9_IPOLL_REG_STATUS;
> + prd_ipoll_mask = PRD_P9_IPOLL_MASK;
> + }
This works for now ... but if proc_gen doesn't match then we are in trouble.
May be its good to add return value and abort prd_init if we don't find
appropriate proc_gen.
Otherwise it looks good.
-Vasant
More information about the Skiboot
mailing list