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: 80208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp950684vqo; Thu, 6 Apr 2023 04:33:13 -0700 (PDT) X-Google-Smtp-Source: AKy350b5wVyVO/+K6J6O7b4MTiqk4ZGxARvo2swmVefFvbCDcv4YBQuht+0Ms3sy0PocRmyZq8Wa X-Received: by 2002:a17:906:5a83:b0:931:c99c:480 with SMTP id l3-20020a1709065a8300b00931c99c0480mr6475610ejq.69.1680780793515; Thu, 06 Apr 2023 04:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680780793; cv=none; d=google.com; s=arc-20160816; b=Z8cA65NUIUqrQ11VorE6YInGuJYqB+vHh4UhOPRCQSQJEmLjmjawjAErYKgnEY1k1+ 3y+b3lzwz8tAq0o44NDHnFL8ALnGRh59UYZtE7HZtMB8P79yZLutIn0Ic+VZkVsIgTwH ABw//WsQ+86P0svSQ7o9mRyIG1OrQXTAXT9MZUylHy3O0GddHnIiFb1EoX7HoqgR1lIp oU4fJl+WlDjn2VoHfxKHQpvEfboh2RCpRWoW1jl2ajoFvCgsktOzZ7P+QFCfHNFga45x RKPVRaCxxqNHBKw5Fi2jM1zML8VuID2Dn6lbuCZzekoC3ak+r7wFd3r5+06UvU6V+9A2 DKbA== 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=/gb/p8Phn+9Nf7rsHXJphZe6NkAx5/VMdhxR1tnG5eo=; b=RTghITM0WFJA7WifS9aTCfapASByzrAoQmXPQ/78D1EBKF/LFsIipc3382BEIdypUI dJaCAGvv46hnNPZgTnpflI9hZVgEmRML6GKpwdXM0NIz5t2ugY5mR4Xjtv4qK9njAF/t WtIxV8cdX0QwMItWskkIDxWexC4hUo1odyiJt/y8BS7W1uuZV3b1vSLK08en1HXI55UO fGYSwQcWwH8F4rVkyqmn6Oz8jfCg02U+F9JqGobArlF0wHB81QtB32Z/PflZpHL8kHQr jf96dkcHOoC5HtNk2V8pV92GmELuje6aL0b7NXrtt/52edA0LfwVBOVnv83bXV1yp5/p pOHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pCQkgJ0D; 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 r12-20020a056402034c00b005026a8a0df5si912388edw.254.2023.04.06.04.32.49; Thu, 06 Apr 2023 04:33:13 -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=20210112 header.b=pCQkgJ0D; 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 S236814AbjDFLI6 (ORCPT + 99 others); Thu, 6 Apr 2023 07:08:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjDFLI5 (ORCPT ); Thu, 6 Apr 2023 07:08:57 -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 0212E61BF; Thu, 6 Apr 2023 04:08:56 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id h25so50329148lfv.6; 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=kEiAjfhLnxkrrGhjXIhD6tDFhkhf9fzeQh6x/Ezc4y+QYb2ELR65fUullRqyhBbZ1m 5TBW48mbGivP1RX0HhhfmSMbMSkUFCTg6uHeBXCX6IPLyB2nfulmWGgrun8ZMUrnltGR hqJYLaosm7UUV7OsLjAuWKxeO/0Lw5uL7lCowIe90wxM4kAEOBRy6WhOzdQpwpg7/a3A 36zDYbUszQtgIBHJqoV833mdLijFUh7C+bOJ4GDXB0JNDC/5RUV3+dAk0UDeh371L46s c0GYQcmJ75PbFCjzuoY+FbKNQOc6YcN2eWHYxHko1VTl3w0Ldfrbh178ogLz2IhI5FG5 WC4g== X-Gm-Message-State: AAQBX9dOlA+fTPuPDVuay6Uc5VjxQX6jMNAioaLmZLelpgKQvZFcSUd/ Bjga8dCi+0Dm06BwgY4oGB3Cwcp9P54= 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-Spam-Status: No, score=0.1 required=5.0 tests=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=unavailable 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?1762426401571058927?= X-GMAIL-MSGID: =?utf-8?q?1762426401571058927?= 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