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