diff mbox

[06/33] chip: Add more P9 accessors for converting to/from PIR

Message ID 1466808476-32690-6-git-send-email-benh@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt June 24, 2016, 10:47 p.m. UTC
To access a local CPU number within a chip essentially, will be
used by XIVE

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 include/chip.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Michael Neuling July 6, 2016, 7:17 a.m. UTC | #1
On Sat, 2016-06-25 at 08:47 +1000, Benjamin Herrenschmidt wrote:
> To access a local CPU number within a chip essentially, will be
> used by XIVE
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Michael Neuling <mikey@neuling.org>

> ---
>  include/chip.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/include/chip.h b/include/chip.h
> index 463cce3..0038814 100644
> --- a/include/chip.h
> +++ b/include/chip.h
> @@ -87,7 +87,10 @@
>   * |               |           |
>   * |___|___|___|___|___|___|___|
>   *
> - * Bit 56 is unused according to the manual by we add it to the coreid
> here.
> + * Bit 56 is unused according to the manual by we add it to the coreid
> here,
> + * thus we have a 6-bit core number.
> + *
> + * Note: XIVE Only supports 4-bit chip numbers ...
>   */
>  #define P9_PIR2GCID(pir) (((pir) >> 8) & 0x7f)
>  
> @@ -95,6 +98,11 @@
>  
>  #define P9_PIR2THREADID(pir) ((pir) & 0x3)
>  
> +/* P9 specific ones mostly used by XIVE */
> +#define P9_PIR2LOCALCPU(pir) ((pir) & 0xff)
> +#define P9_PIRFROMLOCALCPU(chip, cpu)	(((chip) << 8) | (cpu))
> +
> +
>  struct dt_node;
>  struct centaur_chip;
>  struct mfsi;
diff mbox

Patch

diff --git a/include/chip.h b/include/chip.h
index 463cce3..0038814 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -87,7 +87,10 @@ 
  * |               |           |
  * |___|___|___|___|___|___|___|
  *
- * Bit 56 is unused according to the manual by we add it to the coreid here.
+ * Bit 56 is unused according to the manual by we add it to the coreid here,
+ * thus we have a 6-bit core number.
+ *
+ * Note: XIVE Only supports 4-bit chip numbers ...
  */
 #define P9_PIR2GCID(pir) (((pir) >> 8) & 0x7f)
 
@@ -95,6 +98,11 @@ 
 
 #define P9_PIR2THREADID(pir) ((pir) & 0x3)
 
+/* P9 specific ones mostly used by XIVE */
+#define P9_PIR2LOCALCPU(pir) ((pir) & 0xff)
+#define P9_PIRFROMLOCALCPU(chip, cpu)	(((chip) << 8) | (cpu))
+
+
 struct dt_node;
 struct centaur_chip;
 struct mfsi;