From patchwork Thu Dec 14 15:36:20 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: 13493203 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 DCC2DC4332F for ; Thu, 14 Dec 2023 15:37:03 +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=SUbwfI6mi5MuTKitZhvDR8UiTu7eSEE1to/BDFoDV9U=; b=fAQyfheTb+JbEm LySawGSnlWqO/Oitv5rMEb8HAp34HNVL8+OqLNoJujg4Y0NAxni5dz6ncpMVb4/qVsS+HWfJsTJzk ePCHW/I6deOeXF5zYWlb4p5SyDMND1WPTZWUcCpOK8kNt/rmUl3jKBSn3jFdOZo4pDm9GDmjDYpHz 6Jb3lsxKc9kml1DYswC5FHdwdi/xvUwt3ZloFrZAF6BLaR0AflW64hEqmMo7bf/8bbtEhWpVGLIpK +wKxOLOmhMEK2UGeOsz/BzqnR+bYi0pmuVPsfVUfAcZ94eSSmmrBGQf5CyrPxlo7a0C8RyUbjcO3+ nDkqAPmLh+L7+mZfZOqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDnlK-000glz-1h; Thu, 14 Dec 2023 15:36:34 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDnlH-000gku-0j; Thu, 14 Dec 2023 15:36:32 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-551d5cd1c5fso1525115a12.0; Thu, 14 Dec 2023 07:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702568187; x=1703172987; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7aoTw4OzsLC4RfHyhEqd9IMSyhLj1y7UIdS2DuMa/Jw=; b=B9tCwqByBChQ5jROW6U324bkqykJKk+V4JQcnLkx1J6fngWbAC3GDprEzuQNuDmdLD JfsH2Qk9kfl+RGeKFIMAe0PPuEMWAj1qLvT2CVh2uPSlJoozBfBmRIXKunEXhpGifkN1 rYjf7FJldjyoYCoYaqCmJdd8R9Fe6W4AmQPlZfFN+DBrYOA2Dxf2mda8UmZdpTRS6aFy JcPSSRgAqUqOWlaU81FuVtPTbqJcD0r4pyCso0rfeBqYynZQlKz3BzzjYzkNIGLe23SV FUrKOOvQOx28wu/Mn8ywW50q5Wz0XCWoRDvfcegNN70HIcl7elcytrLdj0QhTQ/C5TB5 PtMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702568187; x=1703172987; 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=7aoTw4OzsLC4RfHyhEqd9IMSyhLj1y7UIdS2DuMa/Jw=; b=WRVh/IuebzkHg7+Fg1w0gRL24RbxmB7by0ml5LJpyw3/TJ3mvYkFMEbfN1ROagk8LX 7pOao3Gk1kOoJBdG+u2PzyEf/2TZFF84oFL3BaSEtoFJIutQqqHllsK6dVr6+QLiH93B umq1XjNz7o50FZetfnQ2TDb6tKwfYMxYMggXux17Cv4L+KkEmr8CgPPcMfohfW4AXc/Q sojIi1FXCNB3Ysq8hdijcu+9LYhKt7o3ASuERBC0IZsue2pXwQ06nEuiZoycpQU+VjEh rO1Cqg1bGY30Ls9IlU8dMFfyLs8Pf5T0XwcXwaDDdw4rJJ6AHYOXhc42zaP7OC06t8nH wFYg== X-Gm-Message-State: AOJu0YzXD7fevDJUwnKOFyWa+RTQDgACe7ot5ipCBy0Ym5nlVlV1bAu3 r0fgANgk/Wseu9mH4w/kKORm06LHYEg= X-Google-Smtp-Source: AGHT+IGpJEjbt5Kw87AvVHEmj7Sqpfrh6cn5IZWW6q5OWiB43w0Gdk/CJyr7aaNhgpvuSEwj4xh7tw== X-Received: by 2002:a50:9f4e:0:b0:551:c796:78d0 with SMTP id b72-20020a509f4e000000b00551c79678d0mr3884602edf.27.1702568187199; Thu, 14 Dec 2023 07:36:27 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b0055265d5f3c6sm910575edb.24.2023.12.14.07.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:36:26 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Srinivas Kandagatla , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, u-boot@lists.denx.de, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RFC] dt-bindings: nvmem: u-boot,env: add any-name MAC cells compatible Date: Thu, 14 Dec 2023 16:36:20 +0100 Message-Id: <20231214153620.23998-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231214_073631_269694_A56F6C4A X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. 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 So far we had a property for "ethaddr" NVMEM cell containing base Ethernet MAC address. The problem is vendors often pick non-standard names for storing MAC(s) (other than "ethaddr"). A few names were noticed over years: 1. "wanaddr" (Edimax, ELECOM, EnGenius, I-O DATA, Sitecom) 2. "et1macaddr" (ASUS) 3. "eth1addr" (Buffalo) 4. "athaddr" (EnGenius) 5. "baseMAC" (Netgear) 6. "mac" (Netgear) 7. "mac_addr" (Moxa) and more ("HW_LAN_MAC", "HW_WAN_MAC", "INIC_MAC_ADDR", "LAN_MAC_ADDR", "RADIOADDR0", "RADIOADDR1", "WAN_MAC_ADDR", "lan1_mac_addr", "wanmac", "wmac1", "wmac2"). It doesn't make sense to add property for every possible MAC cell name. Instead allow specifying cells with "mac" compatible. Signed-off-by: Rafał Miłecki --- List of devices and their U-Boot MAC variables: alphanetworks,asl56026) wanmac asus,rt-ac65p) et1macaddr asus,rt-ac85p) et1macaddr belkin,f9k1109v1) HW_WAN_MAC + HW_LAN_MAC buffalo,ls220de) eth1addr buffalo,ls421de) eth1addr checkpoint,l-50) lan1_mac_addr dovado,tiny-ac) INIC_MAC_ADDR dovado,tiny-ac) LAN_MAC_ADDR + WAN_MAC_ADDR edimax,ra21s) wanaddr edimax,rg21s) wanaddr elecom,wrc-2533ghbk-i) wanaddr elecom,wrc-2533ghbk2-t) wanaddr engenius,ecb1200) athaddr engenius,ecb1750) athaddr engenius,epg5000) wanaddr engenius,epg600) wanaddr engenius,esr1200) wanaddr engenius,esr1750) wanaddr engenius,esr600) wanaddr engenius,esr600h) wanaddr engenius,esr900) wanaddr enterasys,ws-ap3705i) RADIOADDR0 + RADIOADDR1 iodata,wn-ac1167dgr) wanaddr iodata,wn-ac1167gr) wanaddr iodata,wn-ac1600dgr) wanaddr iodata,wn-ac1600dgr2) wanaddr iodata,wn-ac733gr3) wanaddr iodata,wn-ag300dgr) wanaddr iodata,wnpr2600g) wanaddr moxa,awk-1137c) mac_addr netgear,wax220) mac netgear,wndap620) baseMAC netgear,wndap660) baseMAC ocedo,panda) wmac1 + wmac2 sitecom,wlr-7100) wanaddr sitecom,wlr-8100) wanaddr .../devicetree/bindings/nvmem/u-boot,env.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml index 0006f022d0af..68214b96f5c9 100644 --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml @@ -67,6 +67,34 @@ properties: description: The first argument is a MAC address offset. const: 1 +patternProperties: + ".*": + allOf: + - if: + type: object + then: + properties: + compatible: + enum: + - mac + - if: + properties: + compatible: + contains: + const: mac + then: + description: + Ethernet interfaces base MAC address. + + properties: + compatible: true + + "#nvmem-cell-cells": + description: The first argument is a MAC address offset. + const: 1 + + additionalProperties: false + additionalProperties: false examples: @@ -90,6 +118,11 @@ examples: mac: ethaddr { #nvmem-cell-cells = <1>; }; + + wanaddr { + compatible = "mac"; + #nvmem-cell-cells = <1>; + }; }; }; - |