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: 5745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp703960wrd; Wed, 22 Feb 2023 09:27:29 -0800 (PST) X-Google-Smtp-Source: AK7set+WOYi0gwrNAGrhZ4R8Vc0V6mO4K/chNOIZDJE0gqer5mVExpwa6h9qaZRUJuyCP4RMDiL5 X-Received: by 2002:a05:6402:398:b0:4ae:eab6:9fac with SMTP id o24-20020a056402039800b004aeeab69facmr9587883edv.32.1677086849283; Wed, 22 Feb 2023 09:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677086849; cv=none; d=google.com; s=arc-20160816; b=T3IROSDrfoFFUO2pb5SOcEwTIUvOWDanjDq5PpKWrluM7U7mL9Qcq9lTTi0VTA667b JoU/Y0JkBDHGA8/aiBfhNYm2DIlXl3GaDknulVd29+0XLVmJYN7CQPXGeHLsQb1PLkjF yNchyw8NxY2X6a6mrMQ8J5zmN4/LAbgLEL2XcxsAhRXoob8lRvK5l2a6DPBW7zwrXPXc /VchzRSQCVvIwJsv4ANdk7MFrGtiwDciTt7bKhs8gwJ0Kg/WYFrsjPfIyu1LwIqg3wu3 0xTUvMB+GiHTjaiFSoEjbiMsdWd/Arq98DiE/3ULxDnRjBCkgYeqCHIi6aUeFrAIElgO sQpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LgHb4LTNou/T4gwWZDZG1bAr2SS3s1D2HvmIKlyTtyo=; b=xit6j4Fcp+qZJvjCYj+QrPKfelN3GyVB/B/q6E3OkAmGLEAIYkFRBC7QNiaGIEvNcK cQ0uUggVvdamdM0ICpXS0V6anp/tdXAIKaIwFbO3J/Zr2DqfkNO2O86Crpw4Ah4o4PFd OQDG0F81db/Uazkas1T9L1JcQdQFru2z798Xtyc2ad0reuoJjfW5L3mWCub37QfG4lKH dFKVjcJNkCvTBvY2Gs7v+HFElAl9+ehKAL7FXPmsb+ZcwqZBivzEOPnUrgu0GSkttEbk wvYe/B7Fy1J3A4G20+pMUm9mZWGeCY5NQjEswYXF2fvTkE7ulSvQdy/gskTAzkFYDUOb p9xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cuqTIWse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a50ee02000000b004ace62d6ea9si1554080eds.529.2023.02.22.09.27.06; Wed, 22 Feb 2023 09:27:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cuqTIWse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232679AbjBVRXZ (ORCPT + 99 others); Wed, 22 Feb 2023 12:23:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232558AbjBVRXR (ORCPT ); Wed, 22 Feb 2023 12:23:17 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73693124; Wed, 22 Feb 2023 09:23:15 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id e9so8563861ljn.9; 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=hpBToqMl5YWhKZp0yQ4opSlUPvkmds8JqQQznwyYEclbPcYJXQEN/sA05ss/8zhtxp zUFoFqO5Dn8AtBwIncl/ugdE9Wa+gKMQ6z10utPqwGL0LHBoFOZgY63BGQZdn84eDepb 3E7tvKDZ7V1ugUcXUUPMi1A+GbiCgfcolGtZUkQflSdKRc6Q930O99uLE/oGCZuCJhNK xjGNpimjmXkcUcREvrDWSZH5yq1HFRfhWvTSbmYtmKAXl/Qpbd24+PW9/CydhNA+BR0B 2J9bOpSqE5fNPb11ppZWXgdfSoHYcVU7ap4bxa3Dp3HVVqmE0OeE/c5cdfkW8hl9O9Gl LjfA== X-Gm-Message-State: AO0yUKWbxzW8ksRIOZkat3OQPGwFuDYKXqWatx/ULfe3E5Nos7h5BpiT dEDya4/McqIjAYllXzx7W0E= 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-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758553020135717980?= X-GMAIL-MSGID: =?utf-8?q?1758553020135717980?= 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(-)