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: <20251103-polar-wasp-of-chivalry-9cd93f@kuoka>
Date: Mon, 3 Nov 2025 11:15:50 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Tudor Ambarus <tudor.ambarus@...aro.org>
Cc: Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	Alim Akhtar <alim.akhtar@...sung.com>, Peter Griffin <peter.griffin@...aro.org>, 
	André Draszik <andre.draszik@...aro.org>, semen.protsenko@...aro.org, willmcvicker@...gle.com, 
	kernel-team@...roid.com, devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/11] soc: samsung: exynos-chipid: introduce
 match_data->get_chipid_info()

On Fri, Oct 31, 2025 at 12:56:04PM +0000, Tudor Ambarus wrote:
> Newer SoCs, like GS101, don't have a dedicated Chip ID controller.

This would suggest that these are completely different devices and
should not be part of the same bindings. Actually bindings also
suggested this - changing programming model.

> The GS101 Chip ID info is available as part of the OTP controller
> registers, among other things. For GS101 we will read the Chip ID from
> the OTP controller using the nvmem API.
> 
> Extend the match_data with a get_chipid_info() method, to allow nvmem
> integration.
> 
> `struct exynos_chipid_info` is moved to the top of the file to avoid a
> forward declaration. The structure is extended with pointers to device
> and regmap to allow current implementation to obtain the regmap in the
> newly introduced exynos_chipid_get_regmap_chipid_info() method. The
> nvmem consumer support that will follow won't use the regmap, and
> instead will use the nvmem API. It will need the pointer to the device
> to report errors.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...aro.org>
> ---
>  drivers/soc/samsung/exynos-chipid.c | 35 ++++++++++++++++++++++-------------
>  1 file changed, 22 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
> index ab6bdf24a754a0faf974190c1fa1f99735cbef8e..7b1951f28e8d4958ab941af91dab4b0183ceda5f 100644
> --- a/drivers/soc/samsung/exynos-chipid.c
> +++ b/drivers/soc/samsung/exynos-chipid.c
> @@ -26,17 +26,21 @@
>  
>  #include "exynos-asv.h"
>  
> +struct exynos_chipid_info {
> +	struct regmap *regmap;
> +	struct device *dev;
> +	u32 product_id;
> +	u32 revision;
> +};
> +
>  struct exynos_chipid_variant {
> +	int (*get_chipid_info)(const struct exynos_chipid_variant *data,
> +			       struct exynos_chipid_info *exynos_chipid);
>  	unsigned int rev_reg;		/* revision register offset */
>  	unsigned int main_rev_shift;	/* main revision offset in rev_reg */
>  	unsigned int sub_rev_shift;	/* sub revision offset in rev_reg */
>  };
>  
> -struct exynos_chipid_info {
> -	u32 product_id;
> -	u32 revision;
> -};
> -
>  static const struct exynos_soc_id {
>  	const char *name;
>  	unsigned int id;
> @@ -80,13 +84,19 @@ static const char *product_id_to_soc_id(unsigned int product_id)
>  	return NULL;
>  }
>  
> -static int exynos_chipid_get_chipid_info(struct regmap *regmap,
> -		const struct exynos_chipid_variant *data,
> +static int exynos_chipid_get_regmap_chipid_info(const struct exynos_chipid_variant *data,
>  		struct exynos_chipid_info *exynos_chipid)
>  {

This function now gets both regmap and chip info, that's too much.
Probably all ASV and regmap getting should be somehow split/customized
per variant.

I don't know yet, need to read rest of patches.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ