Re: [PATCH v2 08/53] MIPS: SGI-IP27: add REMOTE_HUB_PI_S()/REMOTE_HUB_PI_L()
From: Thomas Bogendoerfer
Date: Sat Dec 05 2026 - 08:33:58 EST
On Tue, Oct 13, 2026 at 03:16:28PM +0200, Imre Kaloz wrote:
> Some hub generations split each hub's PI registers across two
> subnode blocks instead of one, so a remote access needs a subnode
> selector on top of REMOTE_HUB_ADDR()'s node selector. Passing
> subnode 0 reduces the new form to plain REMOTE_HUB_L()/REMOTE_HUB_S().
>
> Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
> ---
> arch/mips/include/asm/sn/addrs.h | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/mips/include/asm/sn/addrs.h b/arch/mips/include/asm/sn/addrs.h
> index 7c675fecbf9a..d5c7cfea7761 100644
> --- a/arch/mips/include/asm/sn/addrs.h
> +++ b/arch/mips/include/asm/sn/addrs.h
> @@ -267,6 +267,27 @@
>
> #endif /* !__ASSEMBLER__ */
>
> +/*
> + * Some hub generations split each hub's PI registers across two subnode
> + * blocks HUBPI_OFFSET apart; REMOTE_HUB_ADDR() always targets subnode 0.
> + */
> +#define HUBPI_OFFSET 0x00200000
> +
> +#define REMOTE_HUB_PI_ADDR(_n, _sn, _x) \
> + (REMOTE_HUB_ADDR((_n), (_x)) + ((_sn) ? HUBPI_OFFSET : 0))
> +
> +#ifndef __ASSEMBLER__
> +
> +#define REMOTE_HUB_PI_PTR(_n, _sn, _x) \
> + ((u64 *)REMOTE_HUB_PI_ADDR((_n), (_sn), (_x)))
> +
> +#define REMOTE_HUB_PI_L(_n, _sn, _r) \
> + __raw_readq(REMOTE_HUB_PI_PTR((_n), (_sn), (_r)))
> +#define REMOTE_HUB_PI_S(_n, _sn, _r, _d) \
> + __raw_writeq((_d), REMOTE_HUB_PI_PTR((_n), (_sn), (_r)))
> +
> +#endif /* !__ASSEMBLER__ */
> +
> /*
> * Software structure locations -- permanently fixed
> * See diagram in kldir.h
> --
> 2.47.3
applied to mips-next
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]