Message ID | 20230421084312.27932-1-zajec5@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp920149vqo; Fri, 21 Apr 2023 01:56:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxzMbXYdXaBIguFo3y0QY6ej8OQF669NSCQ8sPlNBLkYXLokY6mtmo3Ud/O2J8eBlghz+X X-Received: by 2002:a17:90a:ea8e:b0:23d:29c7:916f with SMTP id h14-20020a17090aea8e00b0023d29c7916fmr4414627pjz.32.1682067370738; Fri, 21 Apr 2023 01:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682067370; cv=none; d=google.com; s=arc-20160816; b=PRCqJ/Br+XiHopyp6f03WvCdZp+ZJqg0ASARZ3tpro3HIxfBLvu57GN8S12qlaSf8N J4u3A9YWwA0S2HtlMzWqaQzA730rreeFPwt1WyNl+qj2PV/520maTW6kC0DtBVmhLazw nO3nK4xoBUylZ+TT0OKnazRKGe2d5clZfi6BDDJkM6EMepNPWzk6jQK5WkgBE46KhU6w tEvmFUVqYzUJaNIlyt6W9V/aOS6N/8C0onbpG5/0A8jrGApcI0XP0ZT5+BvnVkbeB27D lpeWbr4RXU16SFWFPE1bZtjMYYIqEXsDyCATCQ8SNZOI3L0E/vJBBeyWOFkq3zoUm8Qk qemQ== 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=q07rsXa0P3xMWWHi6ZkgnJ3NXlI5ysIigcoD7BCQBmY=; b=ciI5XCO5Ky27Se47eY9cMZvc57xBfyv1ttPF/bEyMzE83A6A5tnuB39AYkpr9AQXWu mGUIemwtrHqWenvAoKDE8oy84YlPsbbcv+/NIV3fqq1Z7a/zDIkPCl/+54/6VqoV9j2F N/Il9r9Qd+o7goDv1Pfahn4MCKvdUJUvuaW0KPgmozyeXb6gDsx4FV86WufDsfdG7pj1 Rrefn63gtSOoWCYZX12Q2sRH2Ry8LA+uYminwLbWIRzughW2HTbju7Fxet4vL2i4USVC tIAYSAv/SlYbICnP2cyTGaFQJ1U3x6taWl5cgvojCFmInh2qiM9j6u8GjGqI+m4tlRs2 gy/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=PbJFPgJY; 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 nk15-20020a17090b194f00b00247023fdbcbsi6534931pjb.186.2023.04.21.01.55.55; Fri, 21 Apr 2023 01:56:10 -0700 (PDT) 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=20221208 header.b=PbJFPgJY; 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 S231786AbjDUIoY (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Fri, 21 Apr 2023 04:44:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbjDUInx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Apr 2023 04:43:53 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E77A5F7; Fri, 21 Apr 2023 01:43:26 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4ec8eca56cfso1455867e87.0; Fri, 21 Apr 2023 01:43:26 -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=aAS6aIlCCoOdfqzD86EnD2m2Q5BHaiq6Tz4mcu7A/A7Npv4Bsh6jBeqyovGP1nHf/C zjPC+fYD0HdjWI50c9PhOKAZ+/F8GfR6M04EiTT9+owh/fd1NqTH/YytAYEmrC6IHthu Elknaz3fd+efsIV0wnTkihyLkczYdk8auGnjfltZtIu35OdUHtsTYCxEYYIGZrnVRkbE DIdG39ekT2+/GdGa8dyH07bO0ivxf6ioqOO5opc0q74o9sdSFk/UZ/VlprlMI6If4tek D2ySH2QYZB59wskZzNzJA0gdZoa98RKHzZMi3BngKwc3/Spw8wc6UXnqCR3kH3LbAPTk QGkA== X-Gm-Message-State: AAQBX9fhREsDt5cFqDuDk8vEN7VMQ/EKoC1mXk0+QoDprSgbm0JgBk9W lb0WeYmbLy/XbDWRaM55pARDAyAAdVo= 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?= <zajec5@gmail.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Florian Fainelli <f.fainelli@gmail.com>, Hauke Mehrtens <hauke@hauke-m.de>, 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?= <rafal@milecki.pl>, Rob Herring <robh@kernel.org> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 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, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763775475526477900?= X-GMAIL-MSGID: =?utf-8?q?1763775475526477900?= |
Series |
[V2,1/3] dt-bindings: nvmem: brcm,nvram: add #nvmem-cell-cells for MACs
|
|
Commit Message
Rafał Miłecki
April 21, 2023, 8:43 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl> 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 <rafal@milecki.pl> Reviewed-by: Rob Herring <robh@kernel.org> --- V2: Add additionalProperties: false --- .../devicetree/bindings/nvmem/brcm,nvram.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Comments
On 21/04/2023 09:43, Rafał Miłecki wrote: > From: Rafał Miłecki <rafal@milecki.pl> > > 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 <rafal@milecki.pl> > Reviewed-by: Rob Herring <robh@kernel.org> > --- Applied thanks, --srini > 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 >
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