From patchwork Fri Apr 21 08:43:10 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: 13219638 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 D48CFC7618E for ; Fri, 21 Apr 2023 08:44:17 +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=Ps4PRzsEdVUPArbFiR43s9cPFMT2X8ENKsC5B7kEe/g=; b=b3kas1REPmpKkH 3EMlgYhnABJDfJz3vzYdP+P3L7dkCzI9wt4u1ypcQL9NOa6LLDl19d6ge7ephgWRtaSH+744JHpWe RCCewy8Tg5V/sDIzD8z1wy2N7/TbPO4ze/0cdVbJmLvaFowjYmJslIF0yQDw3skP9sQ1GEwllWXqy 4IdfJiLoPeT3OaGDsoYXtqAZp0jx78Pl06VhcJQTeNg83m8U7s7eBV2gV8M9LxvKHO9ds0FnGIhew NRzxi+Btxa8Dc7NuZzVc3MTn2ULpi/3BVoQ96cvCiQ93psGKBflx8wJ6+dHcvlGqIVQre8qp+1/qy 6mG9w3tTrtz6ECRjReVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMX-00A856-2R; Fri, 21 Apr 2023 08:43:25 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMU-00A83k-21 for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2023 08:43:23 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4edcc885d8fso1446297e87.1 for ; Fri, 21 Apr 2023 01:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682066600; x=1684658600; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=q07rsXa0P3xMWWHi6ZkgnJ3NXlI5ysIigcoD7BCQBmY=; b=PbJFPgJYz2j7H8aC5DGrJSCltkrWgy6Tczn61IFq+5XnUsOWi0Y5rysFYXkGfcn655 VjqCm8/2asTg3T/IFGQuOh9efjWxyvQkZER7A2shbSxhjCxb9giOOLitDwcHIq0B4euG oIe5794WpvAVvpxSUw+Do+pMYzeoLuwnU3azKwo0ptA57BOEtwnnklEyFLly037jrzQZ wK9nScxwGkIR4iyd9Aiczjq5+IHdYUsZ/MwspcL01YdS0+pZ56zrb0/bmFJrp4BhLp9c LcgEgxkztVVzCIHWSTjyz+dYFB9e/F27Vqs22jMqY8yr0vPjOcj1OVj9VjouZw1RaCXa pM9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682066600; x=1684658600; 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=q07rsXa0P3xMWWHi6ZkgnJ3NXlI5ysIigcoD7BCQBmY=; b=gdx8rFcZ8Ndh8PzpwAFQtcOHMgQoThVDrP8apkShJjws0qRbQQRdxqOeFHE5HECiG0 TNGtYeLsxqZVrt/L2hOUcMU8LBpcmd8ihJSvKrR1jwITef3o1WeLYv9NWD8NnMgU9cAH i2MOkSo7Uz7f2ico33VJgEnqYMmw41G9lsCpghV8nTaLQyPDQm0ll97V0yRx+6RHFdww xTNv1i4OApBXt91B9mcFl+uVKAuTc2X+S0RFY2qkohCLvsjkE2I/Ojv1ApKQ3V+Yn5F4 v6+6aIg22QoMdY3LEyILTe+QYpwNk+Cc7T02M8hH4tcIqsHHHHNQwKUkuXb45NgB6LsF pTVQ== X-Gm-Message-State: AAQBX9clFZ9kCyHcsVpDFdJPN/T395weXNP7YaNSGn7GC7HT9MtVg/8m NvlSHTNnRNhhVreARLV4dPk= X-Google-Smtp-Source: AKy350Zd2FsPKoohNLaADDdv68ecefoIYa24LgDA2RlBbS9Fy1vzVwkD/aXlpB4D8TlAhGTT9RVYxA== X-Received: by 2002:a05:6512:376c:b0:4ec:5648:70e4 with SMTP id z12-20020a056512376c00b004ec564870e4mr1183935lft.12.1682066599596; Fri, 21 Apr 2023 01:43:19 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b004edc16dbdfasm480721lfk.119.2023.04.21.01.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 01:43:18 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla Cc: Florian Fainelli , Hauke Mehrtens , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring Subject: [PATCH V2 1/3] dt-bindings: nvmem: brcm,nvram: add #nvmem-cell-cells for MACs Date: Fri, 21 Apr 2023 10:43:10 +0200 Message-Id: <20230421084312.27932-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-20230421_014322_660622_4B2D8DBD X-CRM114-Status: GOOD ( 12.59 ) 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 Broadcom's NVRAM contains MACs for Ethernet interfaces. Those MACs are usually base addresses that are also used for calculating other MACs. For example if a router vendor decided to use gmac0 it most likely programmed NVRAM of each unit with a proper "et0macaddr" value. That is a base. Ethernet interface is usually connected to switch port. Switch usually includes few LAN ports and a WAN port. MAC of WAN port gets calculated as relative address to the interface one. Offset varies depending on device model. Wireless MACs may also need to be calculated using relevant offsets. To support all those scenarios let MAC NVMEM cells be referenced with an index specifying MAC offset. Disallow additionalProperties while at it. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring --- V2: Add additionalProperties: false --- .../devicetree/bindings/nvmem/brcm,nvram.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml b/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml index 36def7128fca..13412af7f046 100644 --- a/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml +++ b/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml @@ -36,14 +36,29 @@ properties: et0macaddr: type: object description: First Ethernet interface's MAC address + properties: + "#nvmem-cell-cells": + description: The first argument is a MAC address offset. + const: 1 + additionalProperties: false et1macaddr: type: object description: Second Ethernet interface's MAC address + properties: + "#nvmem-cell-cells": + description: The first argument is a MAC address offset. + const: 1 + additionalProperties: false et2macaddr: type: object description: Third Ethernet interface's MAC address + properties: + "#nvmem-cell-cells": + description: The first argument is a MAC address offset. + const: 1 + additionalProperties: false unevaluatedProperties: false From patchwork Fri Apr 21 08:43:11 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: 13219639 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 31E44C77B75 for ; Fri, 21 Apr 2023 08:44:19 +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:References:In-Reply-To: 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: List-Owner; bh=ujvmfYa1xutviENEnh5mtbcOCW0hbziWxTTrMYsbf30=; b=hPBHsyJiwSSR9M iPX69Xm3lOXud7wHXcafAPgdTFIkW2TWpMwFJ+Ip64PqEKXH8QaegoJ7o7BRH2TA05CEOpYjUC8RK RsGxqjH77FAiPi0WpaDcyIX42Fmsz254c4r1fDoo+iTSpVg9nlgAp2zahXujmhJOfKAqV0zoJPuPv 1KrbLNjxNwfGZgT/cisf18a7TGn4VFIsVbr6IbjB52G9vGri4BpRrV+jZDfDiGsjtolYJ1ZOJE1Cn D+GWG+OVHULPDRBHyZgIkjDCBUk/nmimoSNGUXd9wVLhtaSC80CC6j8oCFCZ2n6f7QFVE+mo3gCkr QJnLjH3HdIZ4xvwsCWAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMd-00A86Q-3A; Fri, 21 Apr 2023 08:43:32 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMW-00A83y-19 for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2023 08:43:25 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4ec8399e963so1426127e87.1 for ; Fri, 21 Apr 2023 01:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682066602; x=1684658602; 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=wfYMOG8gPlyg4Z3cWn2F4o0SjxhHFN6Ihcum8cR5Xlk=; b=a+41VRsBYTq/V/MhxS4NncMUAaeaB+X7nipm5u7gcYrjjGhOf20sOA3+NqCjD7GWjS COQujy7krMnzNLKyYCGK8t5TfWwsCHzsucl05eZxHbpgLBCeg7b4+5K3bc8rfjgcI+Ne bs6ICN/bPGr1VRm8xsNBy/4/uUy40ITOsRLY97wBb1SO3V/zs5Sf9ZuTiN4H6fWTyt2o 8C0GoLdN8d3s0EDjpjU9/L0v54kLzSptqJJB51KWJX+grW2HyUgWIojifEerJsNRHsp1 kgD8iky9NeMRrq5E/HmvrILuhoZB5hmyXQ9A6nlB/6ZbNa0f400kcc3mr4TcVVa7i1Cj BOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682066602; x=1684658602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wfYMOG8gPlyg4Z3cWn2F4o0SjxhHFN6Ihcum8cR5Xlk=; b=gU7UPJXHowsQnVDI2xndzsV4VoeLo5CGtvMwo81/wuUgiwHY+/ZKi9h21Q/rDmI76s ngHodtsgvgwrVdwA8q62xZPOhrWf7UnmUWpvX4KYtaOmi9L2oTXYmKcozBCU8Zsn11rc BHUvV6fQK3zQ6UPPgwF0eJsnNDNvLVh7IIx+eby9CApfsao5ywnBsqSjAoSimRd539wy DUYvCBwN+Epc5XcAP9r6P9j2u0giYkxMYRkwg7hI8YFi5jLtH6kRuxHu7LorE78qU9gN 3dQEGt2gzPqF9ZcWt0k/QjtiT9UhkkBMcTKLpEK0K+nBJ05h8GzVkA9G5Xfn2/J2zaSL TExA== X-Gm-Message-State: AAQBX9ccMUoai7VtFXKWHyqss7OYpnKYhHQWPOTGUPaf0Q+u5609D5n+ tmjBtrcuO4kLLa9Fg5TsILw= X-Google-Smtp-Source: AKy350ah6s/GHGWSiKmHFzEyCAr9Dac0vpwQM2CEfN9P6MLOH0UyDwlWNTmr7FY3MEzznuGyXjpKXQ== X-Received: by 2002:ac2:4e52:0:b0:4ea:fac4:8ef2 with SMTP id f18-20020ac24e52000000b004eafac48ef2mr910330lfr.64.1682066601602; Fri, 21 Apr 2023 01:43:21 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b004edc16dbdfasm480721lfk.119.2023.04.21.01.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 01:43:21 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla Cc: Florian Fainelli , Hauke Mehrtens , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2 2/3] nvmem: brcm_nvram: add .read_post_process() for MACs Date: Fri, 21 Apr 2023 10:43:11 +0200 Message-Id: <20230421084312.27932-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421084312.27932-1-zajec5@gmail.com> References: <20230421084312.27932-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230421_014324_393203_7E3ED469 X-CRM114-Status: GOOD ( 15.26 ) 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 1. Parse ASCII MAC format into byte based 2. Calculate relative addresses based on index argument Signed-off-by: Rafał Miłecki --- drivers/nvmem/Kconfig | 1 + drivers/nvmem/brcm_nvram.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index b291b27048c7..688b70ba4826 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -55,6 +55,7 @@ config NVMEM_BRCM_NVRAM tristate "Broadcom's NVRAM support" depends on ARCH_BCM_5301X || COMPILE_TEST depends on HAS_IOMEM + select GENERIC_NET_UTILS help This driver provides support for Broadcom's NVRAM that can be accessed using I/O mapping. diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c index 39aa27942f28..4567c597c87f 100644 --- a/drivers/nvmem/brcm_nvram.c +++ b/drivers/nvmem/brcm_nvram.c @@ -4,6 +4,8 @@ */ #include +#include +#include #include #include #include @@ -42,6 +44,25 @@ static int brcm_nvram_read(void *context, unsigned int offset, void *val, return 0; } +static int brcm_nvram_read_post_process_macaddr(void *context, const char *id, int index, + unsigned int offset, void *buf, size_t bytes) +{ + u8 mac[ETH_ALEN]; + + if (bytes != 3 * ETH_ALEN - 1) + return -EINVAL; + + if (!mac_pton(buf, mac)) + return -EINVAL; + + if (index) + eth_addr_add(mac, index); + + ether_addr_copy(buf, mac); + + return 0; +} + static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data, size_t len) { @@ -75,6 +96,13 @@ static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data, priv->cells[idx].offset = value - (char *)data; priv->cells[idx].bytes = strlen(value); priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); + if (!strcmp(var, "et0macaddr") || + !strcmp(var, "et1macaddr") || + !strcmp(var, "et2macaddr")) { + priv->cells[idx].raw_len = strlen(value); + priv->cells[idx].bytes = ETH_ALEN; + priv->cells[idx].read_post_process = brcm_nvram_read_post_process_macaddr; + } } return 0; From patchwork Fri Apr 21 08:43:12 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: 13219640 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 EA1FDC77B78 for ; Fri, 21 Apr 2023 08:44:19 +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:References:In-Reply-To: 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: List-Owner; bh=zz9nPCeFt89zLX4dfRX2/8AkH2hMGm40oYnZSIqCBVc=; b=GZDIfAI6zW/xL6 vOtr1Je3IXLvUibAdirgNtv+WFjK4ZU2Oapc9NYB7cqG4ND/Z6qik0apHZWyyR1w0QgJqKsWBLq/i m06VptF5gXCAXH32YIbmX62h9qjYKyc5c3xRHlchg5GURpXeKIff0KYpCuauvjOuM3AEzapGJJiQu NGpQcTGqRZ3I32kclEeAkfan9vQ8ARGF2tLl3AYQ1IVRZX70uHhQA2n48UvwTSwkgw+EfandYEprw Ndv0muBBTeeefbFh4X9MkrF7XQCD5qNXMlZ4iCANaILmKFT+aMaWKQS4cmJu5uTglHmR3vkKa8HjZ GWA5WrMhAOC23DmFVXGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMe-00A86n-38; Fri, 21 Apr 2023 08:43:32 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppmMX-00A84Z-2r for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2023 08:43:27 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4ec8133c59eso1401095e87.0 for ; Fri, 21 Apr 2023 01:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682066603; x=1684658603; 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=gvGmFR5di2sik7RBLdOP/KeRkjaQDZZlALHIAzFWnQk=; b=lZgG/9a5Jc/r7LaEpPZhh6Kh2EI401N+EdCAEdxS1ZeYDJ9Pj1/Cc+6Bpv7+ZphX3x XEhmuTTiKKGyQkrPMAhwFjyXMQTjcpw0tck6kIC9evpFucRu4mRhSs+8yh3aTWHjagSH eJTaqtuhvqbM42jvAAFvHdxMUZqvUbwFwB8nAzUgHw8aMJn5wyLVTlDArHTVNGXby1z4 QymzgryUaxPnl8P5wSmYCjB5ueryYvn/Lt2XZtTTP/mP6hoyQikOspdRbxe+XQ5TVvCy 0xUE1DUUgVHOhugnD/7qrUhnIpjWkjxrDUtLj9IVDDU3wNL8iI6pFAGB3+fVFy4oZ+jO nlIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682066603; x=1684658603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gvGmFR5di2sik7RBLdOP/KeRkjaQDZZlALHIAzFWnQk=; b=eFsJlR55xRr0yepgQplUh05Xi/FM05PA0Vd9qnHKdJ8NztySc1VSEsb2WP4picu0FT E+XLLdESbA1h6lRRTUe9mdxiU4Jqv5GerJPmD8GyE1krO4lqKlSbJ20qjcA1gPEuZNAh ygZntBjxbdGTaHiMYIbYnkP3WuoODzQk7LfZyuLAiC/pUffIPCsPUxwP/KhjIEqbZep6 JioOqTJ2HDJqg1ijBO2gNAJUe76Mi93h17/hozgOKt+V3iSSnAk5JKyK/0x7KW7WmRQx VAeptL3eHzx732ilqk3QQIt6aAnUDRmVB+BXOVmoutvtzNgoQ17i4rHi98nYB3y3O0TA 0Jfw== X-Gm-Message-State: AAQBX9fdqa1Nz/kAdDaal8CKQEd44PmmcauSqlKG9dAU88KMPS/5dAn/ bww2N+lQLQ3rx7wXFsjZbwk= X-Google-Smtp-Source: AKy350aISo20GAPNVBrXfh/unQT0OP7EDE6k1y/Q60ms4Bh+MvtraUkgSHPtS15tDRn4mlL6XlTE3Q== X-Received: by 2002:a05:6512:20e:b0:4eb:1527:e29d with SMTP id a14-20020a056512020e00b004eb1527e29dmr1221705lfo.52.1682066603523; Fri, 21 Apr 2023 01:43:23 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b004edc16dbdfasm480721lfk.119.2023.04.21.01.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 01:43:22 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla Cc: Florian Fainelli , Hauke Mehrtens , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2 3/3] ARM: dts: BCM5301X: Specify WAN port MAC address for Luxul XWR-3150 Date: Fri, 21 Apr 2023 10:43:12 +0200 Message-Id: <20230421084312.27932-3-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421084312.27932-1-zajec5@gmail.com> References: <20230421084312.27932-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230421_014325_938509_0C22336D X-CRM114-Status: GOOD ( 15.51 ) 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 It needs to be calculated based on the base Ethernet interface one. Signed-off-by: Rafał Miłecki --- This PATCH is a proof of concept that can go separately through the ARM DT tree. I'd actually suggest that. There are more .dts files I'll want to update. Srini: can you just take the first 2 patches from this series? --- arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts index 60a2c441d5bd..2dd05f4dce92 100644 --- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts @@ -27,6 +27,7 @@ nvram@1eff0000 { reg = <0x1eff0000 0x10000>; et0macaddr: et0macaddr { + #nvmem-cell-cells = <1>; }; }; @@ -76,7 +77,7 @@ button-restart { }; &gmac0 { - nvmem-cells = <&et0macaddr>; + nvmem-cells = <&et0macaddr 0>; nvmem-cell-names = "mac-address"; }; @@ -119,6 +120,8 @@ port@3 { port@4 { reg = <4>; label = "wan"; + nvmem-cells = <&et0macaddr 5>; + nvmem-cell-names = "mac-address"; }; port@5 {