From nobody Mon May 25 01:57:46 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63678408008 for ; Tue, 19 May 2026 15:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779204499; cv=none; b=dedCcAWJJaiwOYwEedhM+U5Bnv5zfEmspu8SJpKXQI0mmK+PIR4x3MRoS/6TSNlYbHxezXCFAUTns/vVnesXyKNP2Y7lsGxljUqhbrWq4CRdLjKyu4i/qMaEO4yYUth2oIBFJJ/KB+6eTsJTC8OZTKvoBq8LxO2+Qvln8cNVVyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779204499; c=relaxed/simple; bh=fMdQt/aGSLfWf1IFgJvS/76+p2Aty2j96FTfOBL2lgk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RdL7AmYM95TkaVDSt+H3ZAaX2FwMW2LWxciROBQwwGANjnyAiLUSNWwPBfW/zkFKF9JWSOe635AEgbHUHsJvZUG8qYwCFezSW2qy7dwRIj8DE84tRcTaBXJaLbjg/0fWnwWN3NFxIWfHc27v8rDFYEOdz5ChFl3Mf9CjZsJSLO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jUdPF6f6; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jUdPF6f6" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-43fe62837baso2112425f8f.3 for ; Tue, 19 May 2026 08:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779204496; x=1779809296; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NtE/izIKPJg8dCdDmYZeqnA+KX0HuBWWzPxI6Am7M4k=; b=jUdPF6f6lGTY5p3sx4cYFo1GDwd35Se0cAbVaKKHVAyZfPZQKp1yCDy6utiUE8LSZc 0xvO1fQO6DrYLT5AJdVdGJGtYktUZCiNol+jh4JP1LFciFjmmEKax3hQl1Uz2ob8JUfP 5VGmuWENnE+PLhXwEgbx4Y/1+22yYmJAx4F67eRd2aEu0wyMOiGChds8RJV6TncIK5qY gyw43cw3ZehUYTBsxj+cKY0fUxFTjVhyiqAsMLLeISUH0sy5WPexOwzQ9zWxKzQDQ+x+ qJRKw3jrYFSbCdaBDDbdjWwK4ysj/OxPoyQt6523QZyNHc1a5nVztIssyCeYLqLFRtRW NTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779204496; x=1779809296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=NtE/izIKPJg8dCdDmYZeqnA+KX0HuBWWzPxI6Am7M4k=; b=fZd50drMWqOogCwS2e9jB9Oy7vpcja5EMcJvmdHJrHpjqFE2YrcIgUm/9H5ImkLGns ZAnybFUx5Yl0coi4ZsNBFY8vhC29i6DsGq6Bn6wF/Qcm1wFUis8wIVyxkX1lt/+3jol9 w6iuQ1GDj8+Lpo2CX2bPMRNrFHqX/uIaMzrPNdlCxhKCVui1ieK6AY0eWMEGVfjfR3sM Fq4WrWrJPtH0UFIygFCdXsxSZXiQipmcTq66ojiGnQLuL9SlGJTpTHNseGDqDwIdV/28 ewUcQSkzPcUL/cKZNLBNhidCzNAkZ14HXT001wobHKzjwdNn9tLEYuEIsamjZUzGVJwz 5m1Q== X-Forwarded-Encrypted: i=1; AFNElJ/VCUCUCBru8xyNS0Cp5T/AJ8QXRtdE+VstNxwljO8hOdMCR6wQP1XRvaDyTdCyBBsGfz7yFGSl9vveIUU=@vger.kernel.org X-Gm-Message-State: AOJu0YwCPtFWoeZSROepRiOX4fJGJGFW4Lvf6IzQTNAQzFpYnifihfPY zwTmMplrxPK/IZaazmwXxS1QytAPvEkWxvUhQZvbPnmZdmNSblWasm18 X-Gm-Gg: Acq92OEQI3BvJQjk4xebuzdocfSjQEiEfQxtx2b40zPlWtV6HEu+mAhA5CK8/gpu8go 9ML8mLzWxyYe6QsytghkEXOq4YfsIxBMJNjW6t5w+ecPUuOoMjYQij8ZeQz/shyrI5nL1XiCVaj KMAtqiJC7CG7Gp2SWoxXb/ZoJQyOwjYqD5fK5VaAmRlGnwkUqG7CN15IfCD4eI2/289lDkQOH8O MR+Ocd1Z6TiWWjMYq+gtcjQVRuK0tbRSfaQJ0duvzXZQqYH9Oqntx+/9x8qXN3TZp4SazoK4Ixx ugiNd+XHoRlY0p4RVUJ/R8e05DChpWI9E6CvJXxc2DI/E5WOf84lfDegF5kZ/R8U9/6exP57UQQ uGtNjq5NnqKT7Wwq+Zow3DClIUdsrCVo7LKqpg3hcCHCbnTbbS9r+LFYs/yvP4hg0fZEnR2jsT8 MauKOuh+ghFQO5/kDfJoDosIGweYhcxe9YEVRKzKUyltp2kpsiV+6m5jYZSPYjr2XyyKqzPtk= X-Received: by 2002:a05:6000:401e:b0:43c:d665:3830 with SMTP id ffacd0b85a97d-45e5c59540bmr31619437f8f.32.1779204495541; Tue, 19 May 2026 08:28:15 -0700 (PDT) Received: from Ansuel-XPS24 (host-82-55-252-101.retail.telecomitalia.it. [82.55.252.101]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45da0a178adsm49005662f8f.18.2026.05.19.08.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 08:28:15 -0700 (PDT) From: Christian Marangi To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/2] dt-bindings: nvmem: airoha: add SMC eFuses schema Date: Tue, 19 May 2026 17:28:05 +0200 Message-ID: <20260519152807.29407-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260519152807.29407-1-ansuelsmth@gmail.com> References: <20260519152807.29407-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add Airoha SMC eFuses schema to document new Airoha SoC AN7581/AN7583 way of accessing the 2 eFuse bank via the SMC command. Each eFuse bank expose 64 eFuse cells of 32 bit used to give information on HW Revision, PHY Calibration, Device Model, Private Key and all kind of other info specific to the SoC or the running system. Signed-off-by: Christian Marangi Reviewed-by: Rob Herring (Arm) --- .../bindings/nvmem/airoha,smc-efuses.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/airoha,smc-efus= es.yaml diff --git a/Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml= b/Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml new file mode 100644 index 000000000000..c52f8d4bec39 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/airoha,smc-efuses.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Airoha SMC eFuses + +description: | + Airoha new SoC AN7581 expose banks of eFuse accessible + via specific SMC commands. + + 2 different bank of eFuse or 64 cells of 32 bit are exposed + read-only used to give information on HW Revision, PHY Calibration, + Device Model, Private Key... + +maintainers: + - Christian Marangi + +properties: + compatible: + enum: + - airoha,an7581-efuses + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + '^efuse-bank@[0-1]$': + type: object + + allOf: + - $ref: nvmem.yaml# + + properties: + reg: + description: Identify the eFuse bank. + enum: [0, 1] + + required: + - reg + + unevaluatedProperties: false + +required: + - compatible + - '#address-cells' + - '#size-cells' + +additionalProperties: false + +examples: + - | + efuse { + compatible =3D "airoha,an7581-efuses"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + efuse-bank@0 { + reg =3D <0>; + }; + }; + +... --=20 2.53.0 From nobody Mon May 25 01:57:46 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61D9D40801F for ; Tue, 19 May 2026 15:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779204500; cv=none; b=QcJVhrhFNXGrpY6vwhJKna4/n+pHk+3v2s/DI4x38sFr/HnhHc6dvs4fD4197fw7P+I6iyejXKNVDYKIhlJaVnJlL/BIJthMsiM0GS64npVQ3XjcrCE3Sp5mnf++wIxM4/Q7mThXXfpPI5R0r4z3k4A4KrcaHwKzzwbONpZpcrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779204500; c=relaxed/simple; bh=qaZwUWQxeXPjWRkxNfWYw6kUcDzps+t5748MTI9+Ldw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X7rqrz1JzW4Lp2HFRy1FPM03lGBAAct6HLcs2Cmr8rX1GTIzCVRCrRRJ5t/Zrpe4n+afI5RUrfb+/5/WFrw9BjxxurbvPJWU/DNcXQ+IaFiNt6uGG3x3A/WVf8yKQMdhS1w2+wpE0zLZ8N0Y2UmaaqhFdhq0kllaCokMLxuP+pA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KAgS6lpW; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KAgS6lpW" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-45e7c636e74so1682620f8f.0 for ; Tue, 19 May 2026 08:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779204497; x=1779809297; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=tAFD3a/xT9LTsvvD+jxa4TD+i5y2aSqMXXaQQCJTkcQ=; b=KAgS6lpWQaECmwY+rhMs6EiMVwx+LIPqPv8pFV2PxB8bdEFdZWCFM4lXTie/3hHYiN 3t6F4C1Ij/jC2Lnwwu3acb+skG0B3q/aPRmn5BGIfvSXkecBtQCx0q+pJ8uf7/kXFa03 2u2T3oQ4lhFsb3lt9Zx36//pgef00r9LF9OzJH3kes1rnzSWr+W7Z6ymN4OQkNMRpHGq tDfiE3qPEKF5mXRzwiCIiJGdmOaJKeLT7cGPRJ+KLzcU4nQmhyIM1ZgIHy4XJ6/sORGE T6iIlEqHvc/gsXx4SD3If5+qCfRrToDad0EFwDyWbpV2CtZZRqhjPXztP3OLsiA0nDws oziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779204497; x=1779809297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tAFD3a/xT9LTsvvD+jxa4TD+i5y2aSqMXXaQQCJTkcQ=; b=ikcizBMqK7GX1or+L82QyhiG0tDHaJGUwKIskw07i1KuRCj2wdKKCLkzZR6EAo6aZE rbzSMUopePbHq8i1QeGEje2LXfGr2go41FWxZ2/jFQ5eixrsaRzFyvHUiozhRkap+rD8 tJd8IaKzHxZg/bxJf4uutIhHsdkUQovGChAZASN8DG7q5MKWA4nh3iNOj6v8s0X8epXS 3As4Odl/mPc7ZYk+6OcecU7Rf8IUhmLu0/RCZiHFAUDBstzpfvvzbpLQCR4a/P6S1Nol IyoGuZcImLDFAzpcS7e9PFel/lM+Jr0xUagJxUjKpO10X5rhu5ASXDUNGzlKL6ND+zYM zp3A== X-Forwarded-Encrypted: i=1; AFNElJ/jenDjYRkJ/95fNvrYNIHlVjteephnr5VoYXhOX9+paWuNPAC6BIoDGuCXppbw7P3Nl3s112pNMvGfCWc=@vger.kernel.org X-Gm-Message-State: AOJu0Yxb/KuN3VUo3AmsRkIkStx6ukjQAGFeO84sp1pnoJQRXU3NhzoD sr4F7MctEcKsPE1MexXMDqvaF7pk/8QgRp+JkPZmUuop38o80nb9kywS X-Gm-Gg: Acq92OGGGqIyKKMgPxP6s5t7/MTYgYRLEVFl6KhLn4oOWvcyagFZVESnEIlk7us9wQL 8TtUC3Rc9rTYQuckvso29YjpXT8VImWHRGbf/rxeQCiaL2IXLoRE3I97RENabl42gH0qV+oarY+ S0bp1R6hosuWRZb94BpnyEo/t1E0udUCjYpQP3DB8lVK1yinbjN6XBb1BCbBPoL9WIFRFhcvci8 kgO0KqBBjQdCmE0UMA3QpXbPMB7dNVMiEOYG7od7XeoOYKtCc03o9vtwySgGvyley8tA+d/SgCP 4vq9J/ZwbIbcxvFx0ciKzEqDWKaU6VSXwRRDNRA0XmuEebQI3nutfV8ePEISFyJvnbYQfj5i0wL Zv3aVXS3x/kVub3by/0PAa/17EWf+nNWI2gQHORIb7e2a6QC8eGm8dgxr9A0ZvTxiKr6U2iM6EQ t4XJ/vkGqdRCY7YjGtZjn10IUaS30zJSHsGgE7iJjK7bQ/6GlCFMdoiNX+vMvYbHRcy+HJhR9RY qiTYwHhSA== X-Received: by 2002:a05:6000:2405:b0:43b:3e40:2223 with SMTP id ffacd0b85a97d-45e5c5b9673mr33073152f8f.19.1779204496633; Tue, 19 May 2026 08:28:16 -0700 (PDT) Received: from Ansuel-XPS24 (host-82-55-252-101.retail.telecomitalia.it. [82.55.252.101]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45da0a178adsm49005662f8f.18.2026.05.19.08.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 08:28:16 -0700 (PDT) From: Christian Marangi To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] nvmem: airoha: Add support for SMC eFUSE Date: Tue, 19 May 2026 17:28:06 +0200 Message-ID: <20260519152807.29407-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260519152807.29407-1-ansuelsmth@gmail.com> References: <20260519152807.29407-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for SMC eFUSE on AN7581 SoC. The SoC have 2 set of 2048 bits of eFUSE that are used to read calibration value for PCIe, Thermal, USB and other specific info of the SoC like revision and HW device present. eFuse value are taken by sending SMC command. ATF is responsible of validaing the data and rejecting reading protected data (like Private Key). In such case the SMC command will return non-zero value on a0 register. Signed-off-by: Christian Marangi --- drivers/nvmem/Kconfig | 13 ++++ drivers/nvmem/Makefile | 2 + drivers/nvmem/airoha-smc-efuses.c | 125 ++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/nvmem/airoha-smc-efuses.c diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 74ddbd0f79b0..95a399258538 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -28,6 +28,19 @@ source "drivers/nvmem/layouts/Kconfig" =20 # Devices =20 +config NVMEM_AIROHA_SMC_EFUSES + tristate "Airoha SMC eFuse support" + depends on ARCH_AIROHA || COMPILE_TEST + depends on HAVE_ARM_SMCCC + default ARCH_AIROHA + help + Say y here to enable support for reading eFuses on Airoha AN7581 + SoCs. These are e.g. used to store factory programmed + calibration data required for the PCIe or the USB-C PHY or Thermal. + + This driver can also be built as a module. If so, the module will + be called nvmem-airoha-smc-efuses. + config NVMEM_AN8855_EFUSE tristate "Airoha AN8855 eFuse support" depends on COMPILE_TEST diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 7252b8ec88d4..f6f2bc51dee1 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -10,6 +10,8 @@ nvmem_layouts-y :=3D layouts.o obj-y +=3D layouts/ =20 # Devices +obj-$(CONFIG_NVMEM_AIROHA_SMC_EFUSES) +=3D nvmem-airoha-smc-efuses.o +nvmem-airoha-smc-efuses-y :=3D airoha-smc-efuses.o obj-$(CONFIG_NVMEM_AN8855_EFUSE) +=3D nvmem-an8855-efuse.o nvmem-an8855-efuse-y :=3D an8855-efuse.o obj-$(CONFIG_NVMEM_APPLE_EFUSES) +=3D nvmem-apple-efuses.o diff --git a/drivers/nvmem/airoha-smc-efuses.c b/drivers/nvmem/airoha-smc-e= fuses.c new file mode 100644 index 000000000000..e56a99f4aa1f --- /dev/null +++ b/drivers/nvmem/airoha-smc-efuses.c @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Author: Christian Marangi + */ + +#include +#include +#include +#include +#include +#include +#include + +#define AIROHA_SMC_EFUSE_FID 0x82000001 +#define AIROHA_SMC_EFUSE_SUB_ID_READ 0x44414552 + +#define AIROHA_EFUSE_CELLS 64 + +struct airoha_efuse_bank_priv { + u32 bank_index; +}; + +static int airoha_efuse_read(void *context, unsigned int offset, + void *val, size_t bytes) +{ + struct regmap *regmap =3D context; + + return regmap_bulk_read(regmap, offset, + val, bytes / sizeof(u32)); +} + +static int airoha_efuse_reg_read(void *context, unsigned int offset, + unsigned int *val) +{ + struct airoha_efuse_bank_priv *priv =3D context; + struct arm_smccc_res res; + + arm_smccc_1_1_invoke(AIROHA_SMC_EFUSE_FID, + AIROHA_SMC_EFUSE_SUB_ID_READ, + priv->bank_index, offset, 0, 0, 0, 0, &res); + + /* check if SMC reported an error */ + if (res.a0) + return -EIO; + + *val =3D res.a1; + return 0; +} + +static int airoha_efuse_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + int ret; + + for_each_child_of_node_scoped(dev->of_node, child) { + struct nvmem_config nvmem_config =3D { + .size =3D AIROHA_EFUSE_CELLS * sizeof(u32), + .stride =3D sizeof(u32), + .word_size =3D sizeof(u32), + .reg_read =3D airoha_efuse_read, + }; + struct regmap_config regmap_config =3D { + .reg_read =3D airoha_efuse_reg_read, + .reg_bits =3D 32, + .val_bits =3D 32, + .reg_stride =3D 4, + }; + struct airoha_efuse_bank_priv *priv; + struct nvmem_device *nvmem; + struct regmap *regmap; + const char *name; + u32 bank; + + ret =3D of_property_read_u32(child, "reg", &bank); + if (ret) + return ret; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + name =3D devm_kasprintf(dev, GFP_KERNEL, "airoha-efuse-%u", + bank); + if (!name) + return -ENOMEM; + + priv->bank_index =3D bank; + + regmap_config.name =3D name; + regmap =3D devm_regmap_init(dev, NULL, priv, + ®map_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + nvmem_config.name =3D name; + nvmem_config.priv =3D regmap; + nvmem_config.dev =3D dev; + nvmem_config.id =3D bank; + nvmem_config.of_node =3D child; + nvmem =3D devm_nvmem_register(dev, &nvmem_config); + if (IS_ERR(nvmem)) + return PTR_ERR(nvmem); + } + + return 0; +} + +static const struct of_device_id airoha_efuse_of_match[] =3D { + { .compatible =3D "airoha,an7581-efuses", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, airoha_efuse_of_match); + +static struct platform_driver airoha_efuse_driver =3D { + .probe =3D airoha_efuse_probe, + .driver =3D { + .name =3D "airoha-efuse", + .of_match_table =3D airoha_efuse_of_match, + }, +}; +module_platform_driver(airoha_efuse_driver); + +MODULE_AUTHOR("Christian Marangi "); +MODULE_DESCRIPTION("Driver for Airoha SMC eFUSEs"); +MODULE_LICENSE("GPL"); --=20 2.53.0