Re: [PATCH] ARM: l2x0: add L210 write allocate override flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 18, 2019 at 09:30:53AM +0100, Linus Walleij wrote:
> This adds support for setting the flag bit "write allocate
> override" to the L210 variant.
> 
> The "write allocate override" bit is used on the Nomadik STn8815
> and is necessary to properly make use of the L210 cache on that
> machine without sporadic crashes.
> 
> After this the platform can boot and run without any out-of-tree
> patches.

This is not something that should be done by the kernel but by the
firmware - needing this bit set is a basic requirement of having
the caches enabled, and if (eg) the boot loader enables the caches
it too will suffer this problem.

> 
> Cc: devicetree@xxxxxxxxxxxxxxx
> Cc: Russell King <linux@xxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
>  Documentation/devicetree/bindings/arm/l2c2x0.yaml | 5 +++++
>  arch/arm/mm/cache-l2x0.c                          | 8 ++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.yaml b/Documentation/devicetree/bindings/arm/l2c2x0.yaml
> index bfc5c185561c..4cffcda3e2b7 100644
> --- a/Documentation/devicetree/bindings/arm/l2c2x0.yaml
> +++ b/Documentation/devicetree/bindings/arm/l2c2x0.yaml
> @@ -168,6 +168,11 @@ properties:
>        be specified to indicate that such transforms are precluded.
>      type: boolean
>  
> +  arm,write-allocate-override:
> +    description: On L210 only, normally the L210 will use HPROT attributes,
> +    setting this bit overrides that behaviour and cause the cache to make all
> +    write-through and write-back accesses into read-write-allocate accesses.
> +
>    arm,parity-enable:
>      description: enable parity checking on the L2 cache (L220 or PL310).
>      type: boolean
> diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
> index 808efbb89b88..5cbdb9c18884 100644
> --- a/arch/arm/mm/cache-l2x0.c
> +++ b/arch/arm/mm/cache-l2x0.c
> @@ -1078,6 +1078,14 @@ static void __init l2x0_of_parse(const struct device_node *np,
>  		val |= L2C_AUX_CTRL_SHARED_OVERRIDE;
>  	}
>  
> +	/* L210-specific aux control flag */
> +	if (of_device_is_compatible(np, "arm,l210-cache")) {
> +		if (of_property_read_bool(np, "arm,write-allocate-override")) {
> +			mask &= ~L210_AUX_CTRL_WA_OVERRIDE;
> +			val |= L210_AUX_CTRL_WA_OVERRIDE;
> +		}
> +	}
> +
>  	ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
>  	if (ret)
>  		return;
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux