[PATCH v4] arm: tcm: Don't crash when TCM banks are protected by TrustZone

Linus Walleij linus.walleij at linaro.org
Thu Jun 4 05:14:16 PDT 2015

On Thu, Jun 4, 2015 at 1:58 PM, Michael van der Westhuizen
<michael at smart-africa.com> wrote:

> Fixes the TCM initialisation code to handle TCM banks that are
> present but inaccessible due to TrustZone configuration.  This is
> the default case when enabling the non-secure world.  It may also
> be the case that that the user decided to use TCM for TrustZone.
> This change has exposed a bug in handling of TCM where no TCM bank
> was usable (the 0 size TCM case).  This change addresses the
> resulting hang.
> This code only handles the ARMv6 TCMTR register format, and will not
> work correctly on boards that use the ARMv7 (or any other) format.
> This is handled by performing an early exit from the initialisation
> function when the TCMTR reports any format other than v6.
> Signed-off-by: Michael van der Westhuizen <michael at smart-africa.com>
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Cc: Russell King <rmk+kernel at arm.linux.org.uk>
> Cc: Dave Martin <Dave.Martin at arm.com>
> ---
> Changes in v4:
>   - Clarify that the instruction encoding for unconditional MRC
>     happens to be identical between ARM and Thumb-2 modes.

Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

If no further comment appear, I suggest you put this into Russell's
patch tracker.

Linus Walleij

More information about the linux-arm-kernel mailing list