lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230807025153.GM151430@dragon>
Date:   Mon, 7 Aug 2023 10:51:53 +0800
From:   Shawn Guo <shawnguo@...nel.org>
To:     "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc:     s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, aisheng.dong@....com,
        alexander.stein@...tq-group.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Peng Fan <peng.fan@....com>
Subject: Re: [PATCH V5 4/9] firmware: imx: scu: use soc name for soc_id

On Mon, Jul 31, 2023 at 05:04:44PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
> 
> Same as soc-imx8m and soc-imx driver, use soc name for soc_id
> 
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
>  drivers/firmware/imx/imx-scu-soc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/imx/imx-scu-soc.c b/drivers/firmware/imx/imx-scu-soc.c
> index ef9103987e76..cb8377670a7d 100644
> --- a/drivers/firmware/imx/imx-scu-soc.c
> +++ b/drivers/firmware/imx/imx-scu-soc.c
> @@ -107,10 +107,12 @@ int imx_scu_soc_init(struct device *dev)
>  		return -EINVAL;
>  
>  	/* format soc_id value passed from SCU firmware */
> -	val = id & 0x1f;
> -	soc_dev_attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "0x%x", val);
> -	if (!soc_dev_attr->soc_id)
> -		return -ENOMEM;
> +	if (of_machine_is_compatible("fsl,imx8qm"))
> +		soc_dev_attr->soc_id = "i.MX8QM";
> +	else if (of_machine_is_compatible("fsl,imx8qxp"))
> +		soc_dev_attr->soc_id = "i.MX8QXP";
> +	else if (of_machine_is_compatible("fsl,imx8dxl"))
> +		soc_dev_attr->soc_id = "i.MX8DXL";

Is it possible to deduce SoC name from the id retrieved from SCU firmware?
IMO, device tree should be the last resort when there is no other
sources for the such information.

Shawn

>  
>  	/* format revision value passed from SCU firmware */
>  	val = (id >> 5) & 0xf;
> -- 
> 2.37.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ