Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B257C636D4 for ; Wed, 15 Feb 2023 23:50:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB96885A65; Thu, 16 Feb 2023 00:49:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="Ap5Nc4M4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B64585A82; Thu, 16 Feb 2023 00:49:12 +0100 (CET) Received: from xvfrpbcd.outbound-mail.sendgrid.net (xvfrpbcd.outbound-mail.sendgrid.net [168.245.59.205]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A4F785A50 for ; Thu, 16 Feb 2023 00:48:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=bTpWYSdoTOg+6IyMb2LUVPLl3iigvLFeK5MdQU2pYYA=; b=Ap5Nc4M40ShNL5eJStGnx0gtaB8DfDE5YVQfMnlrtO24eftMdt0noM4ZkPSY9f+SwvWM vZNdDmhCrSN6pSjQL01AuEExzhaADauKc+n8AUcabNzf1WoMHEFoO2661mC69kai3LvQdi t4EGQ6V6krKIWau3rLl7VApfGZhGO1uCbwmFhYwAxJ4ctfSjn1SVzkE7OopJdvFlNOjVZz 63qhPIPRVrXI5S3hY4/h31vQDoit0PKBhELnXUlmO2GSVLuIIpZTgvx7LcXth7hNQLCFRp M/JKKt/fTdy4xa5PsVJgyjup/QNy6RyKeUJ6Ozsb/tborMhXmxiyBvHRRytTz2lQ== Received: by filterdrecv-7765ff4f7d-frztm with SMTP id filterdrecv-7765ff4f7d-frztm-1-63ED6F68-14 2023-02-15 23:48:56.860616491 +0000 UTC m=+449372.890371776 Received: from bionic.localdomain (unknown) by geopod-ismtpd-6-2 (SG) with ESMTP id dkx8trX9SAG6cGbMtEevMg Wed, 15 Feb 2023 23:48:56.276 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 00/11] rockchip: Add efuse and otp support to more SoCs Date: Wed, 15 Feb 2023 23:48:57 +0000 (UTC) Message-Id: <20230215234853.2624074-1-jonas@kwiboo.se> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h4IG39qcx17fJZgiD?= =?us-ascii?Q?8xLBdZ2vgN=2FFLArIWRaRJG57jV6+ciptYU4D8u7?= =?us-ascii?Q?QFC7Ec5gAgJA2pSeh1dCpBs97jRk9xl6spvDX97?= =?us-ascii?Q?U2SJCSjHfvaF19mfjEEx=2Fcqk8HfV2rZ=2FRTvBgbh?= =?us-ascii?Q?xHIOx2xD9mKKEkVj2dFKB1wUcceRVfOY4VHLE5?= To: Simon Glass , Philipp Tomsich , Kever Yang Cc: Alex Bee , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This series refactors and add support for more SoCs to the rockchip efuse and otp driver. Support is added for the following SoCs: - efuse: RK3036, RK3066, RK3128, RK3188, RK3228, RK3288 and RK3328 - otp: RK3568 and RK3588 This also changes so that eth1addr is also set when there is a ethernet1 alias in the fdt. And a small change so that ethernet addresses is set based on CONFIG_HASH and CONFIG_SHA256 instead of CONFIG_CMD_NET. I have only been able to test the efuse driver on RK3288, RK3328, RK3399 and the otp driver on RK3568 and RK3588. Information on the remaining SoCs is based on information at [1], [2] and in TRM. The final patch enables use of the otp driver for RK3568. To handle this SoCs unique cpuid offset a new const CFG_CPUID_OFFSET was added. Ideally, we should get this cpuid offset from the id node in the fdt. Maybe adding a custom ioctl that these drivers support and misc.c can call to get the cpuid. Something that can be improved in a future series. This series can also be found at [3]. [1] https://github.com/rockchip-linux/kernel/blob/release-3.10/arch/arm/mach-rockchip/efuse.c [2] https://github.com/rockchip-linux/kernel/blob/develop-5.10/drivers/nvmem/rockchip-otp.c [2] https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-efuse-otp Jonas Karlman (11): rockchip: otp: Refactor to use driver data and ops rockchip: otp: Add support for RK3568 rockchip: otp: Add support for RK3588 rockchip: otp: Add dump_otp debug command rockchip: efuse: Refactor to use driver data and ops rockchip: efuse: Add support for RK3288 and more rockchip: efuse: Add support for RK3328 rockchip: efuse: Add support for RK3128 rockchip: efuse: Add support for RK3036 rockchip: misc: Set eth1addr mac address rockchip: rk3568: Read cpuid from otp arch/arm/dts/rk356x-u-boot.dtsi | 12 ++ arch/arm/mach-rockchip/Kconfig | 2 + arch/arm/mach-rockchip/board.c | 2 +- arch/arm/mach-rockchip/misc.c | 10 +- drivers/misc/Kconfig | 4 - drivers/misc/rockchip-efuse.c | 333 +++++++++++++++++++++++------- drivers/misc/rockchip-otp.c | 230 +++++++++++++++++---- include/configs/rk3568_common.h | 3 + include/configs/rockchip-common.h | 2 + 9 files changed, 480 insertions(+), 118 deletions(-) -- 2.39.1