mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master v2 1/2] ARM: psci: make PSCI method a of_psci_fixup parameter
Date: Mon, 7 Nov 2022 08:48:25 +0100	[thread overview]
Message-ID: <20221107074825.GX3143@pengutronix.de> (raw)
In-Reply-To: <20221105121154.3716964-1-ahmad@a3f.at>

On Sat, Nov 05, 2022 at 01:11:53PM +0100, Ahmad Fatoum wrote:
> We currently assume PSCI fixups to always be of method smc, but this is
> not true when barebox fixes up the node while running under QEMU.
> 
> In preparation for handling QEMU boot properly when psci-client driver
> is enabled, give of_psci_fixup an extra parameter.
> 
> No functional change.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> v1 -> v2:
>   - new patch
> ---
>  arch/arm/cpu/psci-client.c     | 2 +-
>  arch/arm/cpu/psci-of.c         | 5 +++--
>  arch/arm/cpu/psci.c            | 2 +-
>  arch/arm/include/asm/psci.h    | 3 ++-
>  arch/arm/mach-layerscape/ppa.c | 2 +-
>  5 files changed, 8 insertions(+), 6 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/cpu/psci-client.c b/arch/arm/cpu/psci-client.c
> index 7d5b3768b59e..613280ad3f23 100644
> --- a/arch/arm/cpu/psci-client.c
> +++ b/arch/arm/cpu/psci-client.c
> @@ -110,7 +110,7 @@ static u32 invoke_psci_fn_smc(ulong function, ulong arg0, ulong arg1, ulong arg2
>  
>  static int of_psci_do_fixup(struct device_node *root, void *context)
>  {
> -	return of_psci_fixup(root, *(u32 *)context);
> +	return of_psci_fixup(root, *(u32 *)context, "smc");
>  }
>  
>  static int __init psci_probe(struct device_d *dev)
> diff --git a/arch/arm/cpu/psci-of.c b/arch/arm/cpu/psci-of.c
> index ef83b0edee69..be16b08617ec 100644
> --- a/arch/arm/cpu/psci-of.c
> +++ b/arch/arm/cpu/psci-of.c
> @@ -7,7 +7,8 @@
>  #include <asm/psci.h>
>  #include <linux/arm-smccc.h>
>  
> -int of_psci_fixup(struct device_node *root, unsigned long psci_version)
> +int of_psci_fixup(struct device_node *root, unsigned long psci_version,
> +		  const char *method)
>  {
>  	struct device_node *psci;
>  	int ret;
> @@ -46,7 +47,7 @@ int of_psci_fixup(struct device_node *root, unsigned long psci_version)
>  	if (ret)
>  		return ret;
>  
> -	ret = of_property_write_string(psci, "method", "smc");
> +	ret = of_property_write_string(psci, "method", method);
>  	if (ret)
>  		return ret;
>  
> diff --git a/arch/arm/cpu/psci.c b/arch/arm/cpu/psci.c
> index d1056e0659da..70c97e03a5ff 100644
> --- a/arch/arm/cpu/psci.c
> +++ b/arch/arm/cpu/psci.c
> @@ -189,7 +189,7 @@ static int of_psci_do_fixup(struct device_node *root, void *unused)
>  	if (bootm_arm_security_state() < ARM_STATE_NONSECURE)
>  		return 0;
>  
> -	return of_psci_fixup(root, ARM_PSCI_VER_1_0);
> +	return of_psci_fixup(root, ARM_PSCI_VER_1_0, "smc");
>  }
>  
>  int psci_cpu_entry_c(void)
> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
> index 3c1d046eb990..dbb9adfc3e43 100644
> --- a/arch/arm/include/asm/psci.h
> +++ b/arch/arm/include/asm/psci.h
> @@ -144,6 +144,7 @@ static inline int psci_printf(const char *fmt, ...)
>  
>  int psci_get_cpu_id(void);
>  
> -int of_psci_fixup(struct device_node *root, unsigned long psci_version);
> +int of_psci_fixup(struct device_node *root, unsigned long psci_version,
> +		  const char *method);
>  
>  #endif /* __ARM_PSCI_H__ */
> diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
> index d962fba75105..144d0524754b 100644
> --- a/arch/arm/mach-layerscape/ppa.c
> +++ b/arch/arm/mach-layerscape/ppa.c
> @@ -46,7 +46,7 @@ static int of_psci_do_fixup(struct device_node *root, void *unused)
>  		break;
>  	}
>  
> -	return of_psci_fixup(root, psci_version);
> +	return of_psci_fixup(root, psci_version, "smc");
>  }
>  
>  static int ppa_init(void *ppa, size_t ppa_size, void *sec_firmware_addr)
> -- 
> 2.37.2
> 
> 
> 

-- 
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 |



      parent reply	other threads:[~2022-11-07  7:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 12:11 Ahmad Fatoum
2022-11-05 12:11 ` [PATCH master v2 2/2] ARM: psci: client: don't hardcode method smc in fixup Ahmad Fatoum
2022-11-07  7:48 ` Sascha Hauer [this message]

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=20221107074825.GX3143@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /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