Message ID | 20231214153620.23998-1-zajec5@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8633784dys; Thu, 14 Dec 2023 07:36:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKS4sBIU6Ps2vBEdo7e7bXM5SCG/PVN7gDWkvXr4XiVbyLhV3ASwD3oEhEuNC2+43M+QUY X-Received: by 2002:a17:903:32c5:b0:1d3:6419:ca60 with SMTP id i5-20020a17090332c500b001d36419ca60mr1829865plr.92.1702568195655; Thu, 14 Dec 2023 07:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702568195; cv=none; d=google.com; s=arc-20160816; b=BxPT9yl7CraIyc3wZWJNMvJFQpuHJ1Ku9RzDbdVGvCFF/XW/Df47faxx+Jbu6kZ1Xn DM0BHsIt8fpEgndyPpUidv9+qi0qp/eJiRjrRvwTdDJsa1FQf3PRR4Xo23T5b6iZpoRe NSFR1Afa5j3DVX3k0hP324ZcjX1+5FrKP3jfgON5POmhDwOZRT6I6bzRwLs0gQ2jSL9b +ifgEKpfRH4PZQQ9i2Kgb7cAW8baH26QH4vCVpmjQlaiQrQsQ+Ttr+ki2Fv3FPzwguSk gWOmP+txenDFemFFMknTENSulQ/tkNZWz/VApEEewc3GRCiDPOUvIg3gAtCHKOUur1aM nuyg== 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=7aoTw4OzsLC4RfHyhEqd9IMSyhLj1y7UIdS2DuMa/Jw=; fh=EMM36rE4qHLveuIVgWR72QcVGfOLi/Z2YW4pp88v3Xk=; b=0ZQ4JpBdkt/CG/G95nMx7RMNyPXEyaa8iyLRCpWbAJ8EEQbF3wdXsnJ7V2Q+JSTzfj L07vV5adU0pDJt1jmMCwButLly0sNvzf3R6HHxx9m0dOKrEcXoW2bIt0ux2AO+D5tvop VHnYI5o3UtghQhG0yFgeWXqIZuot5UTksM2UwKY5UsYOIjEa5PwDSctZxLCAHMw1JmpV XFcjMrrXDO3K8tO6Le5QWI82nPfPO/dWn0VDEDHOd0f/oPumdmHwkZJRvjYaEaCUTrB1 yQEhWMb+ishSQlOZRoSe8adV18MeeuwziTkz2F/+5QJN39j2+TYkY7zRwZlgcLnoHm/6 WNNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RjmpqTCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n17-20020a170902e55100b001d362b90468si1760295plf.286.2023.12.14.07.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:36:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RjmpqTCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 65D97833488D; Thu, 14 Dec 2023 07:36:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573822AbjLNPgY (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Thu, 14 Dec 2023 10:36:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573809AbjLNPgW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Dec 2023 10:36:22 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB8E123; Thu, 14 Dec 2023 07:36:29 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-551ee7d5214so1490906a12.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=vger.kernel.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=RjmpqTCpKZBYp+BtMtLQdkOxlJgT4ZjAXNx2+0DAPhHiQD7WSZNSw4JhlzhmVTwvR0 jBSRDIG0XbeATgHIqCvecBoRKhLcajvpMDBDIc32QnfZdPcOI0g6VaviRnioJjfVrOLA 0rI0uLK9vcRxIzSq4JfbsFyxIl+fPTxHQjds2FI4d7zjYspP/23zNt9OnSuAiKZN6AH6 LXzA84WF1bzcHBMocyKaU0PIlVBALUd7lphRa0MwaAGopZOTmCPWCPTFMKvxv81LXG6c zZrZK6iYZu/FQJ7FDMMv+E8f4U4KmyrhqoPmaEn/m5Q7iTQqkl/AYKyGqM4jeGQ/JR42 lriw== 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=LOoZxEU3Gqa3PgvUMNJRvNa1afp4X0ufIiGOBE1FItQGPR6hcQq2M42hnUhj7UMf1y r1Ma7MX/+cpE/+K/tJkNoAE4QZjhPO+X8HymU7P7pnts0jvsL/wwiFcHe/TtvVr1ygk8 p5/ZUkeue+PHB/4HuqRAvCK+DaOgrtox2coEnbsoXM7/gD41WM6r62/HRmknOmN0QFYn NaWCeMA3QiUHfKn/4g/XUE2TBLn1H1Sjig/2j/UPKeAkEfSFtZtzfATuBTmlyBz/3wB/ U6n+yaRRZEtPUSjbxALGhJvNeFU4MkFIKdR8cQhzB6hdD152BwiRoFdbjPwovEYfNXSr UrWQ== X-Gm-Message-State: AOJu0YwnaoFwlzXpocENptopouT/v61e7fAVX1gWGHQJyBg0A2R4kgkW BpjXazGfomzFvH9KaUtP3yI= 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?= <zajec5@gmail.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, 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?= <rafal@milecki.pl> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 07:36:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785272148452738156 X-GMAIL-MSGID: 1785272148452738156 |
Series |
[RFC] dt-bindings: nvmem: u-boot,env: add any-name MAC cells compatible
|
|
Commit Message
Rafał Miłecki
Dec. 14, 2023, 3:36 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl> 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 <rafal@milecki.pl> --- 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(+)
Comments
Hi Rafał, On Thu, 14 Dec 2023 at 08:36, Rafał Miłecki <zajec5@gmail.com> wrote: > > From: Rafał Miłecki <rafal@milecki.pl> > > 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 <rafal@milecki.pl> > --- > 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(+) > Are these upstream U-Boots, or just vendor forks? Regards, Simon
On 14.12.2023 22:27, Simon Glass wrote: > On Thu, 14 Dec 2023 at 08:36, Rafał Miłecki <zajec5@gmail.com> wrote: >> >> From: Rafał Miłecki <rafal@milecki.pl> >> >> 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 <rafal@milecki.pl> >> --- >> 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(+) >> > > Are these upstream U-Boots, or just vendor forks? I guess most of those devices don't have upstream U-Boot support. Please note that while upstreaming vendors changes would be great in most cases it doesn't happen. Most vendors sadly don't care and most end users don't have enough time for that. In practice we often stick with vendor provided bootloader to flash and boot self build Linux system (like OpenWrt). I'm not sure if/how does it help with this PATCH but please note that upstream U-Boot code also supports few extra variables. There is generic eth_env_get_enetaddr_by_index() that supports variables like "<%s><%d>addr" and "<%s>addr". Right now it's used only for "eth<%d>addr" and "ethaddr" so that mostly limits us to "ethaddr", "eth1addr", "eth2addr" and "eth3addr". From some rare cases: there are also "usbnet_devaddr" and "wolpassword". So given that U-Boot oficially supports at least 6 env variables for MAC and there are many used with custom U-Boots and firmwares this binding would help a lot.
On 18/12/2023 23:02, Rafał Miłecki wrote: > On 14.12.2023 22:27, Simon Glass wrote: >> On Thu, 14 Dec 2023 at 08:36, Rafał Miłecki <zajec5@gmail.com> wrote: >>> >>> From: Rafał Miłecki <rafal@milecki.pl> >>> >>> 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 <rafal@milecki.pl> >>> --- >>> 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(+) >>> >> >> Are these upstream U-Boots, or just vendor forks? > > I guess most of those devices don't have upstream U-Boot support. Please We do not document properties used in all possible projects, like vendor forks. Only upstream U-Boot matters. > note that while upstreaming vendors changes would be great in most cases > it doesn't happen. Most vendors sadly don't care and most end users > don't have enough time for that. In practice we often stick with vendor > provided bootloader to flash and boot self build Linux system (like > OpenWrt). > > I'm not sure if/how does it help with this PATCH but please note that > upstream U-Boot code also supports few extra variables. > > There is generic eth_env_get_enetaddr_by_index() that supports variables > like "<%s><%d>addr" and "<%s>addr". Right now it's used only for > "eth<%d>addr" and "ethaddr" so that mostly limits us to "ethaddr", > "eth1addr", "eth2addr" and "eth3addr". > > From some rare cases: there are also "usbnet_devaddr" and "wolpassword". > > So given that U-Boot oficially supports at least 6 env variables for > MAC and there are many used with custom U-Boots and firmwares this > binding would help a lot. Please limit this to upstream U-Boot. Drop all custom and firmware ones. Then, just fix upstream U-Boot to have only one property... Best regards, Krzysztof
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>; + }; }; }; - |