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] [day] [month] [year] [list]
Date:   Wed, 19 Jul 2023 09:20:59 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     William-tw Lin <william-tw.lin@...iatek.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Kevin Hilman <khilman@...nel.org>
Cc:     Project_Global_Chrome_Upstream_Group@...iatek.com,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 1/3] soc: mediatek: mtk-socinfo: Add driver for getting
 chip information

Il 18/07/23 13:21, William-tw Lin ha scritto:
> Add driver for socinfo retrieval. This patch includes the following:
> 1. mtk-socinfo driver for chip info retrieval
> 2. Related changes to Makefile and Kconfig
> 
> Signed-off-by: William-tw Lin <william-tw.lin@...iatek.com>
> ---
>   drivers/soc/mediatek/Kconfig       |  18 +++
>   drivers/soc/mediatek/Makefile      |   1 +
>   drivers/soc/mediatek/mtk-socinfo.c | 203 +++++++++++++++++++++++++++
>   drivers/soc/mediatek/mtk-socinfo.h | 213 +++++++++++++++++++++++++++++
>   4 files changed, 435 insertions(+)
>   create mode 100644 drivers/soc/mediatek/mtk-socinfo.c
>   create mode 100644 drivers/soc/mediatek/mtk-socinfo.h
> 

..snip..

> +
> +/* begin 8186 info */
> +#define mtk_mt8186_EFUSE_DATA_COUNT 1
> +static struct efuse_data mtk_mt8186_efuse_data_info[][mtk_mt8186_EFUSE_DATA_COUNT] = {
> +	{{.nvmem_cell_name = "socinfo-data1", .efuse_data = 0x81861001}},
> +	{{.nvmem_cell_name = "socinfo-data1", .efuse_data = 0x81862001}},
> +};

I'm *sure* that there's a way to avoid specifying the soc-specific compatible, as
the efuse_data is used only for validation, while what you do here is to simply
read the SoC ID from eFuse array.

In theory, this driver could simply have

compatible = "mediatek,socinfo";

as compatible string, without any SoC-specific string in the devicetree, at all,
so that the SoC ID would get recognized completely dynamically - and adding the
name and other strings would be a consequence.

> +
> +static struct name_data mtk_mt8186_name_data_info[] = {
> +	{.soc_name = "MT8186",
> +	 .soc_segment_name = "MT8186GV/AZA",
> +	 .marketing_name = "Kompanio 520"},
> +	{.soc_name = "MT8186T",
> +	 .soc_segment_name = "MT8186TV/AZA",
> +	 .marketing_name = "Kompanio 528"},
> +};
> +/* end 8186 info */
> +

Regards,
Angelo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ