From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 7F41047A0D1 for ; Fri, 15 May 2026 12:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778846409; cv=none; b=Hba2vQWw7hv93z3ntHFz6gfSbSDXaH7uGhBRZVF1pWGtCtcn2kdcJWYhwQ101u3lEkJeXe7A29YGqimZwe5cEQcVhE5FBoNz2nDIVQIbtIeG7hVKUWNIN6RG9THAWpF/Ix6nrhwfwzQ0XoxOfBWg8t0M+wURS323SqH7QdArvKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778846409; c=relaxed/simple; bh=Sipl+3EFg1DjSRVyXgI3vSXEGD5UiHoHv4Q1EB4YRcY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mSpq7QR+5yjjDsy72DcirnHyuKVaXBjGenWMw18tSl3PBzagk7Gm7nXc+tmGm93DnPkp1mxEcmHAaNDsxBZFMev6dsV593e0avrytsftfSKyh6BWgnZnHuwC0C+LT5z1xiAiuTZ4EVfbqgpGGDEgEFoXOrHjlfblpN5aXBrHh/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sartura.hr; spf=pass smtp.mailfrom=sartura.hr; dkim=pass (2048-bit key) header.d=sartura.hr header.i=@sartura.hr header.b=QYsXm+9O; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sartura.hr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sartura.hr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sartura.hr header.i=@sartura.hr header.b="QYsXm+9O" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5a884ebba7dso9141260e87.0 for ; Fri, 15 May 2026 05:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura.hr; s=sartura; t=1778846407; x=1779451207; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ea/4RzxEzKT31bEDQIXyxVIvc8FvNcipfvT1OSWbCeE=; b=QYsXm+9OHv72imY6YDUTJ9DgAU+Qbnr+HFgH29Ntu05vgYzr4EAIaHTaZKZHAaT25N VaWRXNwPTDjcYX6zjs8u1/a8S+6FqRF+XNbWEyDoVACxmJcJjfp7yzWqBijqptof9IuN AFwNH94Zkhvvs3wEVzju+9Kd4UQYVEpbsjz4oGdXgdcvQVOaXEi2kaZGe+PIHImkJ++n rFuOvDKShD2DrlNeTxAf3UetLAhiNRUrs6EIpKBVbopVAwUmfcEGNyB69liK755RHmT9 FrzBEtQiesMPYgMcwwlxCYVA+q282W8Z2DybquJJDU0f0UtJqielvR282QHlmhfpa6UJ QPDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778846407; x=1779451207; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ea/4RzxEzKT31bEDQIXyxVIvc8FvNcipfvT1OSWbCeE=; b=VFTZ+1GQkVXfFmI/1tnFP5wbD22IXatQ5B2E6OlmdaEBHY+sTsuNI6jA77vGbmow4m iZ81widMjBCRVt2jZd3rG3lvzBdbj4nO4Aj3oj8DOpSufJ38FcsABLt16cwB+B/BVbmW EUh/gKCdv0jI+mC4mpIBEWnA1SFS78io/1fv6NP5KQuiExHx3uhos/fYAkNyOpiVm1Xu u5wybdQglvPHUWNMmHxCKBY2mK4hOyzsA73LSIWPUrAYzNkPjGBIndl8bl0jxeZU3vOC qVNpzyCGregPG/TLX82DMEb4VbmT+Nwqu7JMwKnZCyEQEPdpfSwB9dtZgwIWJ0SUy/gs RjjQ== X-Forwarded-Encrypted: i=1; AFNElJ+sQsJKdZlM2dMTGqqM5KjyhkSDomMTG8n/CTFztUIUv82K90QV5DfJEAK6S0osbBfR5a5MwT3jVGZ1YOg=@vger.kernel.org X-Gm-Message-State: AOJu0YzRKGkqAFH8hJCrN/HuPYCe9xMyAlL/IEDiX9WeXfcfnJYOPer3 4smDK4IhkqDMLTEeto+/VWwnhlCoyWLlBw/EXh9gjWRVT3IqXum5agGLhlhT1ed6scY= X-Gm-Gg: Acq92OF+2tGhZfANY2I4ssZo8gnOFI1ocWUyeePfE3jUOhL26+j/nke6sbwaDoeyH0H k5V0FKz6O5TrR0NTx/360mqfbM9JeiwIKyT1Kqi9xQ/zD6rt3NR/R+UyJz7eshFFQu3zEJLsytZ KbpdBBfYRTbQyMpSWM1Uzm1heKUKfM0Mr6MfdTPyOJ/muR5JV6MqCINSIoEGryX8j1zT5H9PLQq qacn9SGI8KSB09Z1gEtuHc0r4+dA0Y+Z1y8xonNv/4z19snwMEejujHENHMy2Kg3EWVLwGBZisa O8b/B+8gSi+TaMoiXfLzqOyTg1b0KXlz6wNeDgNAf7gL2hH1IARq3NOC5JjSwuqwwDuddtF5nAl +mTovNVpv0bffcPmkgh/UNayGfAkIwJhwTi/f3P0B8uBMiClmFsrfBa0RWe1DZ0R1GbD3dptRUD mj1Up/yg5PB3h4XQSI7e8PRqCXciGQWhZutiv5HIPsZ+LJ08V6YWOJhiyHZtM9TIi8vMMQdQ6yV WN3MJzqIV87t1PicgSP3axLRVMlNatw X-Received: by 2002:a05:6512:3c98:b0:5a9:163a:9ebc with SMTP id 2adb3069b0e04-5aa0e612da4mr1402039e87.19.1778846406756; Fri, 15 May 2026 05:00:06 -0700 (PDT) Received: from fedora (d-zg2-146.globalnet.hr. [213.149.37.146]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3945cb015f9sm14679631fa.32.2026.05.15.05.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 05:00:06 -0700 (PDT) From: Robert Marko X-Google-Original-From: Robert Marko To: srini@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev, horatiu.vultur@microchip.com, daniel.machon@microchip.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: luka.perkov@sartura.hr, Robert Marko Subject: [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Date: Fri, 15 May 2026 13:59:08 +0200 Message-ID: <20260515115954.701155-2-robimarko@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515115954.701155-1-robimarko@gmail.com> References: <20260515115954.701155-1-robimarko@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: 8bit From: Horatiu Vultur Microchip LAN969x provides OTP with the same control logic, only the size differs as LAN969x has 16KB of OTP instead of 8KB like on LAN966x. Signed-off-by: Horatiu Vultur Signed-off-by: Robert Marko --- Changes in v3: * Rebase onto current next-20260508 drivers/nvmem/Kconfig | 2 +- drivers/nvmem/lan9662-otpc.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 74ddbd0f79b0..78b648e14727 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -138,7 +138,7 @@ config NVMEM_JZ4780_EFUSE config NVMEM_LAN9662_OTPC tristate "Microchip LAN9662 OTP controller support" - depends on SOC_LAN966 || COMPILE_TEST + depends on SOC_LAN966 || ARCH_LAN969X || COMPILE_TEST depends on HAS_IOMEM help This driver enables the OTP controller available on Microchip LAN9662 diff --git a/drivers/nvmem/lan9662-otpc.c b/drivers/nvmem/lan9662-otpc.c index 56fc19f092a7..62d1d6381bf8 100644 --- a/drivers/nvmem/lan9662-otpc.c +++ b/drivers/nvmem/lan9662-otpc.c @@ -27,7 +27,6 @@ #define OTP_OTP_STATUS_OTP_CPUMPEN BIT(1) #define OTP_OTP_STATUS_OTP_BUSY BIT(0) -#define OTP_MEM_SIZE 8192 #define OTP_SLEEP_US 10 #define OTP_TIMEOUT_US 500000 @@ -176,7 +175,6 @@ static struct nvmem_config otp_config = { .word_size = 1, .reg_read = lan9662_otp_read, .reg_write = lan9662_otp_write, - .size = OTP_MEM_SIZE, }; static int lan9662_otp_probe(struct platform_device *pdev) @@ -196,6 +194,7 @@ static int lan9662_otp_probe(struct platform_device *pdev) otp_config.priv = otp; otp_config.dev = dev; + otp_config.size = (uintptr_t) device_get_match_data(dev); nvmem = devm_nvmem_register(dev, &otp_config); @@ -203,7 +202,14 @@ static int lan9662_otp_probe(struct platform_device *pdev) } static const struct of_device_id lan9662_otp_match[] = { - { .compatible = "microchip,lan9662-otpc", }, + { + .compatible = "microchip,lan9662-otpc", + .data = (const void *) SZ_8K, + }, + { + .compatible = "microchip,lan9691-otpc", + .data = (const void *) SZ_16K, + }, { }, }; MODULE_DEVICE_TABLE(of, lan9662_otp_match); -- 2.54.0