From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92320606A322 for ; Fri, 4 Dec 2026 01:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=OUpNCAq4; dkim=pass (2048-bit key) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=E9dGH0T0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Date:Cc:To:From :Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=uNDuNf+bfmEi6eIIJAsUkM6NXRoMA0pUx62Bwiuuv68=; b=OUpNCAq474cs1+9dMUGBenLTRt qyFPGeKXiHzWZdkosBVMeBv7hBaoY75EQdmeuVdj98frQY8shXpjiWFE4kAYLrnShA3PAurlsgxLe 5Pp63L+3ZWcVlqCv2S/fkgk1u3eCuZZ+yEJv1AT9EIMzH96LXFK5LGLg0adUQgrIZg0qEVTq+LvBW XuJ7CCCC5qlygGr3CyHMeIrqbsfVqlcGAK0V6hFO1LXgt8KAj678KrelJcWq7FfVlHLV4uVaZYSgg MUCFLNncl8uzZDA6OaTAolAKVy8rkt+BQeyFBB8xgVPOeig3XVLKVCv3eygKQyfURh+EBMQxbtaVz Ee97CZzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZHfN-0000000GIky-3m7E; Fri, 04 Dec 2026 01:00:50 +0000 Received: from pi.codeconstruct.com.au ([203.29.241.158] helo=codeconstruct.com.au) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZHfE-0000000GIcp-1w51 for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 01:00:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeconstruct.com.au; s=2022a; t=1796346031; bh=uNDuNf+bfmEi6eIIJAsUkM6NXRoMA0pUx62Bwiuuv68=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=E9dGH0T0ZIaRsoqsStnkhX+HkyzrVH/TGvzCt+BQj69SS4wlKLmWwsuw7BafQKXws mcfyCIHtNyy0f6ZYCXNT/PrIhLuakGDcjtn8HCBWC9+zXySEWVzX6rieSxblEWtofN LxCHyDtP0V2gojGyQ7lwgEA1o8YL50UMyoXWC90xu3/zrW7Ubzq6Pidn3eBCHQowPq Vdht01boz3M7j8roMM9wJBksyVag5Il9a1bSAJ+jb2wQyuKP61FLPyN4uzLj9kdu3e 26FVrbI+cto/VngG1ziPDCORsHMsczfsNNxzPwOGXJJv0gxxnPIiQL+fwYQmX5ZbNu oh0ivlFKhoL7Q== Received: from [192.168.68.117] (unknown [180.150.112.139]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id EF73D60185; Fri, 4 Dec 2026 09:00:27 +0800 (AWST) Message-ID: <9c7e2c877422850b71221efc3c1316157e563a90.camel@codeconstruct.com.au> Subject: Re: [PATCH v4 2/2] nvmem: aspeed: Add read-only AST2600 OTP support From: Andrew Jeffery To: Prasanth Kumar Padarthi , Srinivas Kandagatla Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Ryan Chen , Billy Tsai , Neal Liu , Tan Siewert , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Fri, 04 Dec 2026 11:30:26 +1030 In-Reply-To: <20261127025817.20090-3-prasanth.padarthi10@gmail.com> References: <20261127025817.20090-1-prasanth.padarthi10@gmail.com> <20261127025817.20090-3-prasanth.padarthi10@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 X-Archived-By: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_170040_794418_D9539CA8 X-CRM114-Status: GOOD ( 47.71 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-20.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, 2026-11-27 at 08:28 +0530, Prasanth Kumar Padarthi wrote: > AST2600's secure boot controller provides an 8-KiB OTP data region throug= h > paired-word commands rather than memory-mapped storage. Expose permitted > words through NVMEM for privileged userspace bring-up diagnostics, which > compare raw OTP offsets with reference reads; no named cells are required > by this consumer. >=20 > Earlier firmware may leave the OTP macro in programming mode, so Linux > must establish read mode before using it. Programming protection does not > prevent reads, but the configured secure prefix and SEC54 restrict the > readable region. SEC54 can increase until ARM reset, so a probe-time > snapshot alone cannot describe every later read restriction. >=20 > SEC00 relocking does not cancel a running command. Since there is no > documented safe retry after a timeout, stop issuing commands rather than > risk overlapping an outstanding operation. Normal reads take less than > 1 us; the 100-ms bound is deliberately generous, not a specified maximum. >=20 > The read sequence is adapted from ASPEED's downstream driver. >=20 > Link: https://github.com/AspeedTech-BMC/linux/blob/769f62b7baa84d6998723b= 0ea60280e380183553/drivers/soc/aspeed/ast2600-otp.c > Link: https://lore.kernel.org/linux-aspeed/KL1PR0601MB3986A356BD06F98D0FF= 9AD5E80792@KL1PR0601MB3986.apcprd06.prod.outlook.com/ >=20 > Co-developed-by: Neal Liu > Signed-off-by: Neal Liu > Signed-off-by: Prasanth Kumar Padarthi > --- > Changes since v3: > - Drop linux/mod_devicetable.h as requested by Uwe; platform_device.h > =C2=A0 already provides the required declaration. >=20 > v4 validation: > - ARM driver-object compilation with W=3D1 passed. > - Strict patch checkpatch: zero errors, zero checks, one new-file/ > =C2=A0 MAINTAINERS warning. The existing ASPEED matcher covers the driver= . >=20 > Earlier v3 validation, before this include-only change: > Tested on ASRock Rack B650D4U (AST2600 A3), Linux 7.4-rc1: > - ARM zImage build with W=3D1 completed. > - Repeated 12-byte reads and cross-pair/final-pair comparisons passed. > - Four concurrent readers completed 40 matching reads. > - Bytes 8172..8183 matched the saved ASPEED-derived reference fingerprint= . > The kernel was RAM-booted with the working OpenBMC DTB and initramfs. >=20 > Host-model checks passed 4096 protection combinations, 200 copying cases > and 24 timeout cases, including unlock-failure cleanup. Strict source > checkpatch passed. The existing ASPEED MAINTAINERS matcher covers the fil= e. >=20 > =C2=A0drivers/nvmem/Kconfig=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 |=C2=A0 13 ++ > =C2=A0drivers/nvmem/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + > =C2=A0drivers/nvmem/nvmem-aspeed-otp.c | 298 ++++++++++++++++++++++++++++= +++ > =C2=A03 files changed, 312 insertions(+) > =C2=A0create mode 100644 drivers/nvmem/nvmem-aspeed-otp.c >=20 > diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig > index d2f5bb2..65f6a88 100644 > --- a/drivers/nvmem/Kconfig > +++ b/drivers/nvmem/Kconfig > @@ -164,6 +164,19 @@ config NVMEM_APPLE_SPMI > =C2=A0 =C2=A0 This driver can also be built as a module. If so, the modul= e > =C2=A0 =C2=A0 will be called apple-nvmem-spmi. > =C2=A0 > +config NVMEM_ASPEED_OTP > + tristate "ASPEED OTP support" > + depends on ARCH_ASPEED || COMPILE_TEST > + depends on HAS_IOMEM > + help > + =C2=A0 Say Y here to enable read-only access to the OTP data region > + =C2=A0 on ASPEED AST2600 BMCs through the NVMEM interface. > + > + =C2=A0 This driver can also be built as a module. If so, the module > + =C2=A0 will be called nvmem-aspeed-otp. > + > + =C2=A0 If unsure, say N. > + > =C2=A0config NVMEM_BCM_OCOTP > =C2=A0 tristate "Broadcom On-Chip OTP Controller support" > =C2=A0 depends on ARCH_BCM_IPROC || COMPILE_TEST > diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile > index 5e70bad..ca62940 100644 > --- a/drivers/nvmem/Makefile > +++ b/drivers/nvmem/Makefile > @@ -23,6 +23,7 @@ obj-$(CONFIG_NVMEM_APPLE_EFUSES) +=3D nvmem-apple-efuse= s.o > =C2=A0nvmem-apple-efuses-y=C2=A0 :=3D apple-efuses.o > =C2=A0obj-$(CONFIG_NVMEM_APPLE_SPMI) +=3D apple_nvmem_spmi.o > =C2=A0apple_nvmem_spmi-y :=3D apple-spmi-nvmem.o > +obj-$(CONFIG_NVMEM_ASPEED_OTP) +=3D nvmem-aspeed-otp.o In my editor it looks like this needs another tab indent to align the assignment. > =C2=A0obj-$(CONFIG_NVMEM_BCM_OCOTP) +=3D nvmem-bcm-ocotp.o > =C2=A0nvmem-bcm-ocotp-y :=3D bcm-ocotp.o > =C2=A0obj-$(CONFIG_NVMEM_BRCM_NVRAM) +=3D nvmem_brcm_nvram.o > diff --git a/drivers/nvmem/nvmem-aspeed-otp.c b/drivers/nvmem/nvmem-aspee= d-otp.c > new file mode 100644 > index 0000000..cbe05fc > --- /dev/null > +++ b/drivers/nvmem/nvmem-aspeed-otp.c > @@ -0,0 +1,298 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) ASPEED Technology Inc. > + * > + * ASPEED AST2600 OTP Controller driver > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define AST2600_OTP_PROTECT_KEY 0x00 > +#define=C2=A0 AST2600_OTP_UNLOCK_KEY 0x349fe38a > +#define AST2600_OTP_CMD 0x04 > +#define=C2=A0 AST2600_OTP_CMD_READ 0x23b1e361 > +#define=C2=A0 AST2600_OTP_CMD_WRITE_MODE 0x23b1e362 > +#define AST2600_OTP_ADDR 0x10 > +#define AST2600_OTP_STATUS 0x14 > +#define=C2=A0 AST2600_OTP_STATUS_DONE GENMASK(2, 1) > +#define AST2600_OTP_COMPARE_1 0x20 > +#define AST2600_OTP_COMPARE_2 0x24 > +#define AST2600_OTP_EXTRA_READ_PROTECT 0x54 > +#define=C2=A0 AST2600_OTP_EXTRA_READ_RANGE GENMASK(5, 0) > + > +/* OTP macro addresses selected through AST2600_OTP_ADDR, not MMIO offse= ts. */ > +#define AST2600_OTP_CONF0_ADDR 0x800 > +#define=C2=A0 AST2600_OTP_CONF0_SEC_SIZE GENMASK(21, 16) > +#define AST2600_OTP_MR 0x1000 > +#define AST2600_OTP_MRA 0x3000 > +#define AST2600_OTP_MRB 0x5000 > + > +/* Normal reads take less than 1 us; allow a generous bounded wait. */ > +#define AST2600_OTP_TIMEOUT_US 100000 > +#define AST2600_OTP_DATA_WORDS 0x800 > +#define AST2600_OTP_SIZE (AST2600_OTP_DATA_WORDS * sizeof(u32)) > +#define AST2600_OTP_SEC_SIZE_UNIT (32 * sizeof(u32)) > + > +struct aspeed_otp { > + struct device *dev; > + void __iomem *base; > + /* Serialize the complete unlock, read and relock sequence. */ > + struct mutex lock; > + struct nvmem_keepout secure_keepout; > + bool failed; > +}; > + > +static int aspeed_otp_unlock(struct aspeed_otp *priv) > +{ > + writel(AST2600_OTP_UNLOCK_KEY, priv->base + AST2600_OTP_PROTECT_KEY); > + if (readl(priv->base + AST2600_OTP_PROTECT_KEY) !=3D 1) > + return -EIO; > + > + return 0; > +} > + > +static void aspeed_otp_lock(struct aspeed_otp *priv) > +{ > + writel(0, priv->base + AST2600_OTP_PROTECT_KEY); > +} > + > +static int aspeed_otp_wait_complete(struct aspeed_otp *priv) > +{ > + u32 status; > + int ret; > + > + /* Wait at least 1 us before the first sample of both idle flags. */ > + ret =3D read_poll_timeout(readl, status, Perhaps readl_poll_timeout()? > + (status & AST2600_OTP_STATUS_DONE) =3D=3D > + AST2600_OTP_STATUS_DONE, > + 1, AST2600_OTP_TIMEOUT_US, true, aspeed_otp_wait_complete() is used in two contexts, the common case is after issuing an OTP command at which point we do want to wait a short period, but the other case (e.g. in aspeed_otp_read_data() and aspeed_otp_init_read_mode()) it seems to guard against commands issued outside the scope of the driver. I'm not sure we want to wait a short period in those circumstances. That said, the delay isn't significant... > + priv->base + AST2600_OTP_STATUS); > + if (ret) { > + /* Relocking SEC00 does not abort an outstanding command. */ > + priv->failed =3D true; > + dev_err(priv->dev, > + "OTP completion timed out (status=3D%#x); further reads blocked\n", > + status); > + } > + > + return ret; > +} > + > +static int aspeed_otp_init_read_mode(struct aspeed_otp *priv) > +{ > + static const u32 mode_addresses[] =3D { > + AST2600_OTP_MRA, AST2600_OTP_MRB, AST2600_OTP_MR, > + }; > + int i, ret; > + > + ret =3D aspeed_otp_wait_complete(priv); > + if (ret) > + return ret; > + > + /* Earlier firmware may leave the macro in program mode; restore read m= ode. */ > + for (i =3D 0; i < ARRAY_SIZE(mode_addresses); i++) { > + writel(mode_addresses[i], priv->base + AST2600_OTP_ADDR); > + writel(0, priv->base + AST2600_OTP_COMPARE_1); > + writel(AST2600_OTP_CMD_WRITE_MODE, priv->base + AST2600_OTP_CMD); > + ret =3D aspeed_otp_wait_complete(priv); > + if (ret) > + return ret; > + } > + > + return 0; > +} > + > +static int aspeed_otp_read_pair(struct aspeed_otp *priv, > + unsigned int aligned_word, u32 data[2]) > +{ > + int ret; > + > + /* The hardware reads two words starting at an even word index. */ Perhaps we should enforce this and error out if the address is unaligned? if (aligned_word & 1) return -EINVAL; > + writel(aligned_word, priv->base + AST2600_OTP_ADDR); > + writel(AST2600_OTP_CMD_READ, priv->base + AST2600_OTP_CMD); > + > + ret =3D aspeed_otp_wait_complete(priv); > + if (ret) > + return ret; > + > + data[0] =3D readl(priv->base + AST2600_OTP_COMPARE_1); > + data[1] =3D readl(priv->base + AST2600_OTP_COMPARE_2); > + > + return 0; > +} > + > +static int aspeed_otp_init_unlocked(struct aspeed_otp *priv) > +{ > + u32 data[2]; > + int ret; > + > + ret =3D aspeed_otp_init_read_mode(priv); > + if (ret) > + return ret; > + > + ret =3D aspeed_otp_read_pair(priv, AST2600_OTP_CONF0_ADDR, data); > + if (ret) > + return ret; > + > + priv->secure_keepout.end =3D > + FIELD_GET(AST2600_OTP_CONF0_SEC_SIZE, data[0]) * > + AST2600_OTP_SEC_SIZE_UNIT; > + > + return 0; > +} > + > +static int aspeed_otp_init(struct aspeed_otp *priv) > +{ > + int ret; > + > + /* The provider is not registered yet; there are no concurrent readers.= */ Given this, the mutex will be uncontended and there will be negligible impact on taking it :) You could then remove the comment, and annotate the relevant fields with __guarded_by(), and enable context analysis for the driver. > + ret =3D aspeed_otp_unlock(priv); > + if (!ret) > + ret =3D aspeed_otp_init_unlocked(priv); This is the only call-site for aspeed_otp_init_unlocked() - I'm not convinced there's much benefit to breaking it out, but, not necessary to change it either. > + aspeed_otp_lock(priv); > + > + return ret; > +} > + > +static int aspeed_otp_read_data(struct aspeed_otp *priv, unsigned int of= fset, > + void *val, size_t bytes) > +{ > + unsigned int word_index =3D offset / sizeof(u32); > + u8 *buf =3D val; > + u32 data[2]; > + int i, ret; > + > + ret =3D aspeed_otp_wait_complete(priv); > + if (ret) > + return ret; > + > + while (bytes) { > + ret =3D aspeed_otp_read_pair(priv, word_index & ~1U, data); > + if (ret) > + return ret; > + > + for (i =3D word_index & 1; i < ARRAY_SIZE(data) && bytes; i++) { > + put_unaligned_le32(data[i], buf); > + buf +=3D sizeof(u32); > + bytes -=3D sizeof(u32); I would much prefer the validation of the value of bytes occur in this function rather than aspeed_otp_read(). Currently it requires we look across both implementation to ensure correctness. The same can be said for the alignment test of offset. The only downside of that is doing the tests under the mutex, but I don't see this a large penalty given the task of the driver, especially when we need valid arithmetic here to ensure memory safety.=20 > + word_index++; > + } > + } > + > + return 0; > +} > + > +static int aspeed_otp_read(void *context, unsigned int offset, > + =C2=A0=C2=A0 void *val, size_t bytes) > +{ > + struct aspeed_otp *priv =3D context; > + unsigned int secure_size; > + u32 extra_read; > + int ret; > + > + if (!bytes) > + return 0; > + > + if (offset % sizeof(u32) || bytes % sizeof(u32)) > + return -EINVAL; > + > + if (offset >=3D AST2600_OTP_SIZE || > + =C2=A0=C2=A0=C2=A0 bytes > AST2600_OTP_SIZE - offset) I don't think it's necessary to wrap this. > + return -EINVAL; > + > + guard(mutex)(&priv->lock); > + > + if (priv->failed) > + return -EIO; Would we not want to test this prior to any operation? aspeed_otp_init_unlocked() performs multiple operations, and if we're admitting the possibility of failure, then subsequent operations shouldn't be tried. > + > + /* SEC54[5:0] can only grow until the ARM cores reset. */ > + extra_read =3D readl(priv->base + AST2600_OTP_EXTRA_READ_PROTECT); > + secure_size =3D FIELD_GET(AST2600_OTP_EXTRA_READ_RANGE, extra_read) * > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AST2600_OTP_SEC_SIZE_UNIT; > + secure_size =3D max(priv->secure_keepout.end, secure_size); > + if (offset < secure_size) > + return -EACCES; This looks unnecessary?=C2=A0Nothing in the driver writes the read protect value, and the nvmem core handles keepout ranges itself: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/nvmem/core.c?h=3Dv7.3#n90 Essentially, we should never hit this early-exit, and the calculations leading up to it are redundant. I don't think we should try to account for changes via e.g. /dev/mem... Even if we did hit it ... the OTP shouldn't return valid data for the read, right? That's the point? Can we not just issue the read and report whatever the OTP reports? Is -EACCESS necessary? > + > + ret =3D aspeed_otp_unlock(priv); > + if (!ret) > + ret =3D aspeed_otp_read_data(priv, offset, val, bytes); > + aspeed_otp_lock(priv); > + /* Complete the lock write before handing the mutex to another reader. = */ > + readl(priv->base + AST2600_OTP_PROTECT_KEY); Okay, but the level of caution there has me curious. Is this addressing an errata? The unlock write shouldn't overtake the lock write should it? > + > + return ret; > +} > + > +static int aspeed_otp_probe(struct platform_device *pdev) > +{ > + struct nvmem_config config =3D { > + .name =3D "aspeed-otp", > + .id =3D NVMEM_DEVID_AUTO, > + .owner =3D THIS_MODULE, > + .type =3D NVMEM_TYPE_OTP, > + .read_only =3D true, > + .root_only =3D true, > + .word_size =3D sizeof(u32), > + .stride =3D sizeof(u32), > + .size =3D AST2600_OTP_SIZE, > + .reg_read =3D aspeed_otp_read, > + }; > + struct aspeed_otp *priv; > + struct device *dev =3D &pdev->dev; > + int ret; > + > + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); devm_kzalloc_obj() ? > + if (!priv) > + return -ENOMEM; > + > + priv->dev =3D dev; > + priv->base =3D devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(priv->base)) > + return PTR_ERR(priv->base); > + > + ret =3D devm_mutex_init(dev, &priv->lock); > + if (ret) > + return ret; > + > + ret =3D aspeed_otp_init(priv); > + if (ret) > + return dev_err_probe(dev, ret, > + =C2=A0=C2=A0=C2=A0=C2=A0 "Failed to initialize OTP read mode and sec= ure prefix\n"); > + > + config.dev =3D dev; > + config.priv =3D priv; > + if (priv->secure_keepout.end) { > + config.keepout =3D &priv->secure_keepout; > + config.nkeepout =3D 1; > + } > + > + return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); > +} > + > +static const struct of_device_id aspeed_otp_of_match[] =3D { > + { .compatible =3D "aspeed,ast2600-sbc" }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, aspeed_otp_of_match); > + > +static struct platform_driver aspeed_otp_driver =3D { > + .probe =3D aspeed_otp_probe, > + .driver =3D { > + .name =3D "aspeed-otp", > + .of_match_table =3D aspeed_otp_of_match, > + }, > +}; > +module_platform_driver(aspeed_otp_driver); > + > +MODULE_AUTHOR("Neal Liu "); > +MODULE_AUTHOR("Prasanth Kumar Padarthi ")= ; > +MODULE_DESCRIPTION("ASPEED AST2600 read-only OTP NVMEM driver"); > +MODULE_LICENSE("GPL");