All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [PATCH 09/10] arm: stm32mp: add function get_soc_name
Date: Wed, 18 Mar 2020 10:16:17 +0000	[thread overview]
Message-ID: <f551f3c9-c7a9-3b1e-a9f3-ceb2e58c224a@st.com> (raw)
In-Reply-To: <20200212183744.5309-10-patrick.delaunay@st.com>


On 2/12/20 7:37 PM, Patrick Delaunay wrote:
> Add a function get_soc_name to get a string with the full name
> of the SOC "STM32MP15xxx Rev.x"
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  arch/arm/mach-stm32mp/cpu.c                    | 14 +++++++++++---
>  arch/arm/mach-stm32mp/include/mach/sys_proto.h |  4 ++++
>  2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
> index 5febed735c..9c5e0448ce 100644
> --- a/arch/arm/mach-stm32mp/cpu.c
> +++ b/arch/arm/mach-stm32mp/cpu.c
> @@ -279,8 +279,7 @@ u32 get_cpu_package(void)
>  	return get_otp(BSEC_OTP_PKG, PKG_SHIFT, PKG_MASK);
>  }
>  
> -#if defined(CONFIG_DISPLAY_CPUINFO)
> -int print_cpuinfo(void)
> +void get_soc_name(char name[SOC_NAME_SIZE])
>  {
>  	char *cpu_s, *cpu_r, *pkg;
>  
> @@ -344,7 +343,16 @@ int print_cpuinfo(void)
>  		break;
>  	}
>  
> -	printf("CPU: STM32MP%s%s Rev.%s\n", cpu_s, pkg, cpu_r);
> +	snprintf(name, SOC_NAME_SIZE, "STM32MP%s%s Rev.%s", cpu_s, pkg, cpu_r);
> +}
> +
> +#if defined(CONFIG_DISPLAY_CPUINFO)
> +int print_cpuinfo(void)
> +{
> +	char name[SOC_NAME_SIZE];
> +
> +	get_soc_name(name);
> +	printf("CPU: %s\n", name);
>  
>  	return 0;
>  }
> diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> index da46c11573..065b7b2856 100644
> --- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> +++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> @@ -29,6 +29,10 @@ u32 get_cpu_package(void);
>  #define PKG_AC_TFBGA361	2
>  #define PKG_AD_TFBGA257	1
>  
> +/* Get SOC name */
> +#define SOC_NAME_SIZE 20
> +void get_soc_name(char name[SOC_NAME_SIZE]);
> +
>  /* return boot mode */
>  u32 get_bootmode(void);
>  

Acked-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

Patrice

  reply	other threads:[~2020-03-18 10:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 18:37 [PATCH 00/10] stm32mp1: board and SOC identifications Patrick Delaunay
2020-02-12 18:37 ` [PATCH 01/10] board: stm32mp1: update command stboard on misc_write result Patrick Delaunay
2020-03-18 10:04   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-24  8:32   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 02/10] board: stm32mp1: read OTP in command stboard Patrick Delaunay
2020-03-18 10:05   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-24  8:33   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 03/10] arm: stm32mp: bsec: remove unneeded test Patrick Delaunay
2020-03-18 10:04   ` Patrice CHOTARD
2020-04-24 14:24     ` Patrick DELAUNAY
2020-03-24  8:34   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 04/10] arm: stm32mp: bsec: add permanent lock support in bsec driver Patrick Delaunay
2020-03-18 10:07   ` Patrice CHOTARD
2020-03-24  8:35   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 05/10] board: stm32mp1: stboard: lock the OTP after programming Patrick Delaunay
2020-03-18 10:10   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-24  8:36   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 06/10] arm: stm32mp: improve the error message for smc Patrick Delaunay
2020-03-18 10:10   ` Patrice CHOTARD
2020-03-24  8:36   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 07/10] board: stm32mp1: add finished good in board identifier OTP Patrick Delaunay
2020-03-18 10:13   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-18 10:44   ` Wolfgang Denk
2020-03-19  8:57     ` Patrick DELAUNAY
2020-03-19  9:13       ` Wolfgang Denk
2020-03-23  8:59         ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 08/10] board: stm32mp1: display reference only for STMicroelectronics board Patrick Delaunay
2020-03-18 10:15   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-24  8:37   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 09/10] arm: stm32mp: add function get_soc_name Patrick Delaunay
2020-03-18 10:16   ` Patrice CHOTARD [this message]
2020-03-24  8:37   ` Patrick DELAUNAY
2020-02-12 18:37 ` [PATCH 10/10] arm: stm32mp: fdt: update kernel device tree according the part number Patrick Delaunay
2020-03-18 10:16   ` Patrice CHOTARD
2020-03-24  8:37   ` Patrick DELAUNAY

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=f551f3c9-c7a9-3b1e-a9f3-ceb2e58c224a@st.com \
    --to=patrice.chotard@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.