From patchwork Thu Apr 6 11:08:02 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: 13203168 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 CE6F2C76196 for ; Thu, 6 Apr 2023 11:09:54 +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=cqEKC4pMxZdDq9jKwYCmARpnZDrSEQ/eP7cjXCFQyaE=; b=uQDji63bxx+PUh Q5ZRzZe2FillvC5M4doU1uEJ5WI+PT3vO6C30B+EMpzxBzuKlaz0gG0P9fjkvwKgNT46Ybv9EOmWo zznKWibPupVYtbairwH7vQDQoMrIZA5KmZt0DcPxl2+n1y/uIvEUOAy2OA4tiTMizrhsFD8upuPP+ phl86HEvTEdsf6CeBadahNxM7kvAOKz4ifKcVEDYvEnoIMa1Pv/h82GkNKtquRXZ+faxRkhao91oy zNGi02vWfzYuTc84Btg7moWg+dlTKMNtneveTx5HTGl+CJi5wvvk58328VWWHLYRyAQ9ura/z66Fo hVIUA1zSZBzYx99mnmyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkNUD-0077UD-2q; Thu, 06 Apr 2023 11:09:01 +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 1pkNUB-0077SQ-0L for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2023 11:09:00 +0000 Received: by mail-lf1-x12f.google.com with SMTP id y15so50308664lfa.7 for ; Thu, 06 Apr 2023 04:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680779334; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/gb/p8Phn+9Nf7rsHXJphZe6NkAx5/VMdhxR1tnG5eo=; b=pCQkgJ0DMSDKS7q2DKALshhL0nUMLxnufHTTeu60Vz20LWnRfEVfnKMoYTYj+0aVTC 8pF9zic8cgYW/s98jAw9oAdccbwJsFZ1vOgO9joDXycTsZQiEzbKPWBSyFcQppuF2rtZ pYCphKV+MnEIQOHgFHD4zrWimK+SOYAFKXCck/JJkdyOKjhxZMAwyAWSaCAl/1Ro156l /0jsAGKhDjVv0jaMDOX2aRg7nIesUMcgh5A1VUSWQ5gBJEVFum/i7SGI1wXH/CXkU7Vv fVG7/YpYzFKE/Z3BxtU1xU9OZ7HEK+FQFKoE3mq0/1Ok2fCQUNglW/Zznq3tFm9tKSen 9xCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680779334; 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=/gb/p8Phn+9Nf7rsHXJphZe6NkAx5/VMdhxR1tnG5eo=; b=cnFd6OaIRq+LoiJyHskQKdcYj+kfP6DrVeXM086mWjYfuuSf4EkAUfLdAfgbxpms1l 5ZDGggYfGsRQMk4OU3uuYjSkIvYXogucDba7zLd0cdwvAD/GFLs2ZSQBXtdKBSFx3D9F lcDdUHEwz01Ia8VS9AYcIzD+mHs3AbTm47FoLxmb35FsGfKvs9dhcCeIgr4FmkViFRWp pwfEAXjw2yQWS0OA2F+xbAo7JGebCm5Gngvcx79hrEsde+GIToVvhYclFXQOUEEjFfJ0 Vc2ptRGKomuwWvk8+SGV2/AkY8LQURaN1t8nWOqfaJNB/uz1JisXX2XPko27Q0fqm95Z vxng== X-Gm-Message-State: AAQBX9ci4AfbfS8XbBMZb4Y99rPXKKagqG04Q2jyYYwG/e+W/x1LxTGe 4wxL4ZDJ/GXepasfLLFw3Us= X-Google-Smtp-Source: AKy350Ysp6avI4wzgpDGJnJtHgUBZzokgK4EHBgLxVb8sWq9dms3IaDHErcwEi7Hv7EXosqggHnUgg== X-Received: by 2002:a05:6512:951:b0:4e9:bafc:88d0 with SMTP id u17-20020a056512095100b004e9bafc88d0mr2486708lft.23.1680779333817; Thu, 06 Apr 2023 04:08:53 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id r26-20020ac252ba000000b004e048852377sm218667lfm.263.2023.04.06.04.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 04:08:53 -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 1/3] dt-bindings: nvmem: brcm,nvram: add #nvmem-cell-cells for MACs Date: Thu, 6 Apr 2023 13:08:02 +0200 Message-Id: <20230406110804.12024-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-20230406_040859_141162_D3DA6D73 X-CRM114-Status: GOOD ( 12.70 ) 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. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring --- .../devicetree/bindings/nvmem/brcm,nvram.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml b/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml index 36def7128fca..a921e05cc544 100644 --- a/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml +++ b/Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml @@ -36,14 +36,26 @@ 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 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 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 unevaluatedProperties: false From patchwork Thu Apr 6 11:08:03 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: 13203169 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 DEC73C7618D for ; Thu, 6 Apr 2023 11:09:55 +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=LyLu2e15cyml2H hNPLrNSogfNvO5qqFJnglbkLUITEII4w+QCFKRcZM2/C/5/7vbVlPaa0pEmehkpl2DFenwKFveLcZ 9XT6+o5rvTusvQ1FaRSBqlGvHzjuafoA342KZIr7WRrKP9pcTOcbnxsIrlGZu3BEUlwr0ey+a8NJP 7llS8gcpOosj+g+1+2Y0UqJ+rGefFPrvVPwP1SDWXHdWW7DvwBi2rY4KQq598J4Lzzdb0SO+xb/u/ fFpwFBVmk9TRixD/D8OVHI3ldcvrIajz/3YDdbnbIrfgoKKpos/O4bNLTU6wPbU0F1g73YmhqTSNI bNBYGhZArgOImAs5DRxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkNUH-0077V9-0C; Thu, 06 Apr 2023 11:09:05 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pkNUC-0077Sa-0d for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2023 11:09:01 +0000 Received: by mail-lf1-x131.google.com with SMTP id h25so50329213lfv.6 for ; Thu, 06 Apr 2023 04:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680779336; 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=p6OqGU8gW0fCJlDL00V8f51dUiscXEsiSaD5vmQO1isPXkmvIh9KT8CDihdJexXbVQ q3tgHgG4DpF06psRjl2A0IwVsn7JX5nomaufOSyqRqwv5ek93yeBNotwx9a7jv2Hx3jX huraJ/iQLlQk0axSQbJnfik5t4ssW1sNuwAp2CLylhKbUT1vphXZg7hswQOtf6gru7og GYKjDGlUc94LMNNxr2vHX0t+Yyy/c0JvLlFUDELjqewTug0YBn0HwusAej3sAMJBsd0/ dSR0LlkVSh/BpSwUfX0PVU1Q562PEQvh67dmT7x5Sp4gYIPmyP5w/qIVOiReOYL5Wmcq sa8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680779336; 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=lDwHb/ig9bNc/y31cVXI/GKrNWVWw7ENUzTMyFpypciPPy18xx6lz5M3X1tcDd1gMJ jIM9PhMjN3FCp1pTQeCnEbGQ/em6s7nvfFVE5f/ohjmmzxt1ZI/BhP0A+SJ8ynOGMqIt JYyCq6kOLX4of6g/ZSwT98v216bsCc45WdBdk71etyGVlWKl3hewmyJNvYE4TMW7PKG7 lV7R6ipI6mTZBB2ssQ/oCApdBuatHmEcau8B22iDTbj8xPzO9s5Vf85qiBOlHfxRa8ZI RM556UywXQCgpvuAUpwy1/zkLxKBBK12f0J9swihPTSppQ3BoWBg1tCnD5L0m9Fepura K3+Q== X-Gm-Message-State: AAQBX9cqZf/QONMpZ83Z7iGLB2KEzUUmFOkz/T5r/VFru6HF2GRbhNcZ ffj18Zqy1X+JPhUlL6vhkrQ= X-Google-Smtp-Source: AKy350bEbAhBNNx9rxCddQ6y4IbOjg+2Hy5K6Gk/hqrMHBDrixOMNKnmkaniICT90Ogxfil+NedGuA== X-Received: by 2002:ac2:4a63:0:b0:4ea:e262:e551 with SMTP id q3-20020ac24a63000000b004eae262e551mr2417608lfp.31.1680779335666; Thu, 06 Apr 2023 04:08:55 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id r26-20020ac252ba000000b004e048852377sm218667lfm.263.2023.04.06.04.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 04:08:55 -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 2/3] nvmem: brcm_nvram: add .read_post_process() for MACs Date: Thu, 6 Apr 2023 13:08:03 +0200 Message-Id: <20230406110804.12024-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406110804.12024-1-zajec5@gmail.com> References: <20230406110804.12024-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230406_040900_233219_A4A588D4 X-CRM114-Status: GOOD ( 15.19 ) 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 Thu Apr 6 11:08:04 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: 13203170 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 21B36C77B6E for ; Thu, 6 Apr 2023 11:09:57 +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=FINlAf14zI0VyP KNKlAKKn3m33qcdJ15brl8bnWJND+7TljkDZW0ah/9uB8mW2prlGMWZT1ZzrlXaA6F2KjpDey2fdx KJT5BEfdDNoeKIcwgotnOWpF50Nqi30QVXgx6fxXyS9nrWPGChANxLD3BEN3x4xqO+7aKA3TMx+FO rkbcZyUgaWdayUzK3LUWVdpbWuWXoRDB93Gk0zJN0CKZ6N7/eHF2GVjmVugSaHbGXCwGTuxJI55k7 dtQ6Wn0J9QsZ3MNVPhRtvzAP5ELbGH5AVZ/vivK/kvEIqSuKuI7rvqV+wLDf8V+Aq2nGVSSfZpbtJ a6WBj6crbjgDrz5bOJ1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkNUI-0077Va-0J; Thu, 06 Apr 2023 11:09:06 +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 1pkNUC-0077SQ-37 for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2023 11:09:02 +0000 Received: by mail-lf1-x12f.google.com with SMTP id y15so50308973lfa.7 for ; Thu, 06 Apr 2023 04:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680779340; 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=ao57XiWUibLYquPdos2FQfTnS7PDp4fRz7WDvmBVwry8vdNjEDUiEmAcI7jkqt7Rt/ tDaLAkBdRAC1WKmzjpeMa1lo11uRzyVgrKMbKLc3JcMj/GkqGnXWjkQC1zFOjKnnECsz nVX6aiWTFarnsAAyzTSjFhRmuANSYNGU+kKnAFogS5GqR7VYGwMW1H5CkXMUtCG10nwx vF3UsJFDuAHwTYtqCBV6kJYxmTxgod1TED92CBw0UiO4NCMr5xkgnqXLNtmqhoKv1ou/ YHLSQwUXCD8kMAwxel703A/kfForyNImw+0stN7QzUkhbhmB20FPs/2ldKl8EBgc4AGa K52Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680779340; 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=1A0Bq+9ugwHRLMgnE83PaB/dMN2tvoUZjp5SIlZMTVO9Hjx+JmKZMQfMVQuVlHtX/c odeQpbl3nhyhCtrNqQNu5DrEqP+0vVqS+OsoUiEYFEk0o4HoeAXed4dpw2xoaS6tTC+L f7GIlikheJoQ4Q285LYZXBfCXSK1cxBtNECLgQmvTPliJyHAIqkscGJPsgCKENe5XiS0 Md+5ezXTwwROsVYC8M555T5bMdOJOuEjYXIVxmTbcoccapYY8NHDbPPiLoI2TA9WCVEa pED06uSlMo99zFu4FMRtBaIrFgMRa5uOLreOI8Uo5NiiMCqcWp86oQhevd6H86iuGLXY WStw== X-Gm-Message-State: AAQBX9eaPZbYzxVbjjjcAkxtGQRB4GFtFdB+McrX04NRHIU4JJtFB3zu wD4xT/TQ80DKngvhil9QPic= X-Google-Smtp-Source: AKy350YiEAMb49gHFQPlKUUaEKEJ1rx2G2QINX9BCYS+LCn/wRFkt+q9Q5JA8ZUFCb2sccpQIKjouw== X-Received: by 2002:ac2:4910:0:b0:4eb:ddb:d03f with SMTP id n16-20020ac24910000000b004eb0ddbd03fmr2268881lfi.62.1680779340223; Thu, 06 Apr 2023 04:09:00 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id r26-20020ac252ba000000b004e048852377sm218667lfm.263.2023.04.06.04.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 04:08:59 -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 3/3] ARM: dts: BCM5301X: Specify WAN port MAC address for Luxul XWR-3150 Date: Thu, 6 Apr 2023 13:08:04 +0200 Message-Id: <20230406110804.12024-3-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406110804.12024-1-zajec5@gmail.com> References: <20230406110804.12024-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230406_040901_011166_20B6DE3F X-CRM114-Status: GOOD ( 15.42 ) 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 {