[PATCH v2 2/4] arm64/sysreg: Support feature-specific fields with 'Prefix' descriptor

Mark Brown broonie at kernel.org
Tue Oct 21 12:22:32 PDT 2025


On Thu, Oct 09, 2025 at 04:54:48PM +0000, Sascha Bischoff wrote:

> The Prefix descriptor can be used in the following way:
> 
>         Sysreg  EXAMPLE 0    1    2    3    4
>         Prefix    FEAT_A
> 	Field   63:0    Foo
> 	EndPrefix
> 	Prefix    FEAT_B
> 	Field   63:1    Bar
>  	Res0    0
>         EndPrefix
>         Field   63:0    Baz
>         EndSysreg

This seems like a reasonable solution to the practical problem, and the
implementation seems OK:

Reviewed-by: Mark Brown <broonie at kernel.org>

I think trying to do too much more would open up far too many cans of
worms to be reasonable to block things on.

One nit:

>  # Parse a "<msb>[:<lsb>]" string into the global variables @msb and @lsb
> @@ -132,10 +149,7 @@ $1 == "EndSysregFields" && block_current() == "SysregFields" {
>  	if (next_bit >= 0)
>  		fatal("Unspecified bits in " reg)
>  
> -	define(reg "_RES0", "(" res0 ")")
> -	define(reg "_RES1", "(" res1 ")")
> -	define(reg "_UNKN", "(" unkn ")")
> -	print ""
> +	define_resx_unkn(prefix, reg, res0, res1, unkn)

This refactoring into a function seems like it could usefully have been
a separate patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20251021/6c561288/attachment.sig>


More information about the linux-arm-kernel mailing list