From patchwork Wed Feb 22 17:22:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13149388 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E9BBC636D6 for ; Wed, 22 Feb 2023 17:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DXu0eP+oQNbAq3yIeQgA8DdkVXWaQIfliZgki5SHC+c=; b=C8DT68BP93i/wr j9LdGi2uFAHrhwcuVuteQWH4fYNJutF9lmBDlh8vXsbCeZiDrrnWfU+mN/XtqAaHIHEcND5/kLWYo F9X1ApUblVcCD5VzNlYiDyCEpoF2uAljTjVO2fXfs0GERXx35SBaJqpmycgxjR8EHnIffw2B/Y+Wr XSJLNCdmIQhGVjaL/LBsJGnSaIkYB9JIbV86z3dgtdPuq5md2cnFtNjOQ1H7voM6E04K7hsfPDXnj 0bP6xoLII3w4uKE/7zcMVXDpxigV1sTuHEy016Dt0yyqCCLE9YiLHtZAsIkW4bHsF980Z4DApsP7U 8bHPs+AMsEbQP6/z3fWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUspr-00DCPC-Qv; Wed, 22 Feb 2023 17:23:19 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUspo-00DCNt-PB for linux-arm-kernel@lists.infradead.org; Wed, 22 Feb 2023 17:23:18 +0000 Received: by mail-lj1-x236.google.com with SMTP id j17so8771036ljq.11 for ; Wed, 22 Feb 2023 09:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LgHb4LTNou/T4gwWZDZG1bAr2SS3s1D2HvmIKlyTtyo=; b=cuqTIWse5qx2sN8ejcmchMPEuaSlrGt9z4HkUkR65iRc/Ex4L8YE8Xc0SHh6GqLY2K RNVAEGeb5nWU9hg6IXeT2PECD1/8btD7B0wtugdnholzLaNVZifh9cnZwZVUHVjvNIvS LGPNS4EQuF6BgueXdQo7/LG4Rju+LTTfeNnDLwVJNmIPv1ZD6W6hH+vBmMjqcQfpIxnw 7Y92P/bxVPQeYXGLh92Geo74JtO3qYOGnvOteoqifJuWCRGrf1mIPnrMUrOCICMyI9bi IMgg8GyvCf5+7si1LU2zV/GLh3kOD6yVkebYjpYy0k9CnJaSwRBG9zwKdtmSV78NBGKP AlUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LgHb4LTNou/T4gwWZDZG1bAr2SS3s1D2HvmIKlyTtyo=; b=dEw9YDfXUgHbNAjtFZph6rgwm9ZrMdspWshLRBSWwqCFNx4+yQsPshUruwqQ4QsrvU jcBdogXP2lTcxma9C7hptdlHrmqM8fjgHPQB4jJ051roNogae3AwDfL0D48klKzX6QpP 4WPBi+M7H+MyQK5ZHGqijZbeNRm4Y43hZQR0qMp1aFwN9k8+ypYna/gLJfWgDN/zvchY +tWTzMDz45IAH42J0ymT7UGb3wCrQm1dnfkh1V7cdy9ZyVIuvvky76wgK2uSzjw9QiSf Vgou0SdpjCjITRi+dDlhcGuLNMcLC6oaSZ62TreBbwE2tJJhnQY+LCGVJt1s8uk/D8aR YgZg== X-Gm-Message-State: AO0yUKVkfutya58QSn3lS88bvfM4OdIPSWqscrnTjywCgvV3Uiwk7naj yZFx1OkWIuhmxaxFUQt2O3A= X-Google-Smtp-Source: AK7set/KWDvPSuMOkojBZB4RaqhrJysKCZKevJPXANsg0HBsYaa6OJZG6Ye7zg0PxpTbLNyKiuY/1g== X-Received: by 2002:a05:651c:2051:b0:295:74f5:fcaa with SMTP id t17-20020a05651c205100b0029574f5fcaamr3070632ljo.32.1677086593514; Wed, 22 Feb 2023 09:23:13 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id p2-20020a2e93c2000000b0029477417d80sm721513ljh.85.2023.02.22.09.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:23:13 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Miquel Raynal , Michael Walle , gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, u-boot@lists.denx.de, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 0/4] nvmem: cell post-processing & U-Boot env MAC support Date: Wed, 22 Feb 2023 18:22:41 +0100 Message-Id: <20230222172245.6313-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230222_092316_840348_C6AFB9D8 X-CRM114-Status: GOOD ( 11.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki U-Boot environment variables are stored using ASCII format. One of important entries is "ethaddr" which contains base MAC address. That NVMEM cell requires some extra processing when reading: 1. ASCII needs translating into binary MAC format 2. Final MAC needs to be calculated depending on cell index This patchset was originally based on top of layouts implementation which sadly ended up dropped for now. To proceed I rebased it on top of the current NVMEM subsystem code. Michael's patch has applied cleanly and this approach *will not* make U-Boot env transition to layouts any harder so I believe it's fine to take those patches without waiting for layouts updated implementation. Michael Walle (1): nvmem: core: add per-cell post processing Rafał Miłecki (3): nvmem: core: allow nvmem_cell_post_process_t callbacks to adjust buffer dt-bindings: nvmem: u-boot,env: add MAC's #nvmem-cell-cells nvmem: u-boot-env: post-process "ethaddr" env variable .../devicetree/bindings/nvmem/u-boot,env.yaml | 7 +++- drivers/nvmem/Kconfig | 1 + drivers/nvmem/core.c | 38 +++++++++++++++---- drivers/nvmem/imx-ocotp.c | 8 ++-- drivers/nvmem/u-boot-env.c | 25 ++++++++++++ include/linux/nvmem-provider.h | 7 +++- 6 files changed, 71 insertions(+), 15 deletions(-)