Re: [PATCH 3/3] arm: mach-imx: tzasc: convert to cpu_is_mx8xyz macros

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

 



On Mon, Feb 26, 2024 at 03:40:23PM +0100, Stefan Kerkmann wrote:
> Instead of passing in configuration parameters at runtime we can utilize
> the `cpu_is_mx8xyz` macro family to determine which bits should be set.
> 
> As the tzasc driver is imx specific, all functions are prefixed with
> `imx8m_` as well.
> 
> Signed-off-by: Stefan Kerkmann <s.kerkmann@xxxxxxxxxxxxxx>
> ---
>  arch/arm/mach-imx/atf.c   |  8 ++++----
>  arch/arm/mach-imx/imx8m.c |  2 +-
>  arch/arm/mach-imx/tzasc.c | 25 +++++--------------------
>  include/mach/imx/tzasc.h  |  8 ++------
>  4 files changed, 12 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/atf.c b/arch/arm/mach-imx/atf.c
> index e8060ebd95..9cbc38ef11 100644
> --- a/arch/arm/mach-imx/atf.c
> +++ b/arch/arm/mach-imx/atf.c
> @@ -158,7 +158,7 @@ __noreturn void __imx8mm_load_and_start_image_via_tfa(void *bl33)
>  		size_t bl32_size;
>  		void *bl32_image;
>  
> -		imx8mm_tzc380_init();
> +		imx8m_tzc380_init();

I am not so sure about this patch. So far the whole PBL is coded in the
way that we inherently know the SoC type from the code path chosen.

This patch changes this. It doesn't really matter for this patch, but it
sends a sign how we want to solve this in future.

One implication of this patch is that cpu_is_mx() is a runtime decision,
so code paths behind an unused cpu_is_mx() can't be discarded anymore.

Another thing is that the usage of cpu_is() has the tendency to lead to
cascades of if (cpu_is_x() || cpu_is_y() || cpu_is_z()) which is not
paticularly nice to read.

Both are not really strong points, but on the other hand there's not
much improvement in this patch, so I tend to not take it.

> -bool tzc380_is_enabled(void)
> +bool imx8m_tzc380_is_enabled(void)

This change is good though as the function is clearly i.MX8 specific.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux