public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: PSCI: Rework the DT handler slightly
Date: Fri, 6 Mar 2015 09:49:26 -0800	[thread overview]
Message-ID: <54F9E8A6.4040600@freescale.com> (raw)
In-Reply-To: <1425604776-19036-1-git-send-email-trini@konsulko.com>



On 03/05/2015 05:19 PM, Tom Rini wrote:
> The way the PSCI DT update happens currently means we pull in
> <asm/armv7.h> everywhere, including on ARMv8 and that in turn brings in
> <asm/io.h> for some non-PSCI related things that header needs to deal
> with.
> 
> To fix this, we rework the hook slightly.  A good portion of
> arch/arm/cpu/armv7/virt-dt.c is common looking and I hope that when PSCI
> is needed on ARMv8 we can re-use this by and large.  So rename the
> current hook to psci_update_dt(), move the prototype to <asm/psci.h> and
> add an #ifdef that will make re-use later easier.
> 
> Reported-by: York Sun <yorksun@freescale.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: York Sun <yorksun@freescale.com>
> Cc: Ian Campbell <ijc@hellion.org.uk>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/arm/cpu/armv7/virt-dt.c |    4 +++-
>  arch/arm/include/asm/armv7.h |    1 -
>  arch/arm/include/asm/psci.h  |    4 ++++
>  arch/arm/lib/bootm-fdt.c     |    4 ++--
>  4 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c
> index ad19e4c..9408e33 100644
> --- a/arch/arm/cpu/armv7/virt-dt.c
> +++ b/arch/arm/cpu/armv7/virt-dt.c
> @@ -88,10 +88,12 @@ static int fdt_psci(void *fdt)
>  	return 0;
>  }
>  
> -int armv7_update_dt(void *fdt)
> +int psci_update_dt(void *fdt)
>  {
> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>  	if (!armv7_boot_nonsec())
>  		return 0;
> +#endif
>  #ifndef CONFIG_ARMV7_SECURE_BASE
>  	/* secure code lives in RAM, keep it alive */
>  	fdt_add_mem_rsv(fdt, (unsigned long)__secure_start,
> diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
> index edb3b80..c3cc508 100644
> --- a/arch/arm/include/asm/armv7.h
> +++ b/arch/arm/include/asm/armv7.h
> @@ -124,7 +124,6 @@ void v7_outer_cache_inval_range(u32 start, u32 end);
>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>  
>  int armv7_init_nonsec(void);
> -int armv7_update_dt(void *fdt);
>  bool armv7_boot_nonsec(void);
>  
>  /* defined in assembly file */
> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
> index 704b4b0..50a3ca4 100644
> --- a/arch/arm/include/asm/psci.h
> +++ b/arch/arm/include/asm/psci.h
> @@ -32,4 +32,8 @@
>  #define ARM_PSCI_RET_INVAL		(-2)
>  #define ARM_PSCI_RET_DENIED		(-3)
>  
> +#ifndef __ASSEMBLY__
> +int psci_update_dt(void *fdt);
> +#endif /* ! __ASSEMBLY__ */
> +
>  #endif /* __ARM_PSCI_H__ */
> diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
> index d4f1578..665a3bc 100644
> --- a/arch/arm/lib/bootm-fdt.c
> +++ b/arch/arm/lib/bootm-fdt.c
> @@ -17,7 +17,7 @@
>  
>  #include <common.h>
>  #include <fdt_support.h>
> -#include <asm/armv7.h>
> +#include <asm/psci.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -38,7 +38,7 @@ int arch_fixup_fdt(void *blob)
>  	if (ret)
>  		return ret;
>  
> -	ret = armv7_update_dt(blob);
> +	ret = psci_update_dt(blob);
>  #endif
>  	return ret;
>  }
> 

Tested on armv8 targets.

Acked-by: York Sun <yorksun@freescale.com>

  reply	other threads:[~2015-03-06 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06  1:19 [U-Boot] [PATCH] ARM: PSCI: Rework the DT handler slightly Tom Rini
2015-03-06 17:49 ` York Sun [this message]
2015-03-09 16:47 ` [U-Boot] " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F9E8A6.4040600@freescale.com \
    --to=yorksun@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox