Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6069989rdb; Thu, 14 Dec 2023 07:36:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfMFzqaeEAxrC80ZDY/naClTkAuX1k29J12fJf1L8W6NoJaxYQBpd4ZFWWfmlK9YYlBimC X-Received: by 2002:a17:902:e74d:b0:1ce:6669:3260 with SMTP id p13-20020a170902e74d00b001ce66693260mr10667160plf.67.1702568201173; Thu, 14 Dec 2023 07:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702568201; cv=none; d=google.com; s=arc-20160816; b=s9Nm63UaT597/a0I6LYAfEkAtjgXinNKVKrqID/f/OlCmn2lX+zHhPhAG1Nf3Nr8OF qD+TZdcZCLbqUKqP0xM3gYeRSQX7XfemizLWgeOza0GjIJvwK1azCrY6bvRqaRVHQRRp ccqjqiyi1w2npea8d0ueVndZfRL+LhJjD463tnE1gUOjvNHL8mRk/L1ZGdMw+zsa5tsq ZG1hi3LLuenRUwgm9J9etcQcxzPGOWlBL2/1VY4gYx0a1MM0zyYmoucK04Jjcr1Qt6ly zZxWAJuYGj+C8PzXj0PnEa0KuA8AQGiJI5UBE5BpP7cw3yiCiDMbMGTyd7M0fZjiBafn P2IA== 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i10-20020a170902eb4a00b001d376b290ccsi441949pli.35.2023.12.14.07.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:36:41 -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 1A42E833488D; Thu, 14 Dec 2023 07:36:38 -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 + 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 ); 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?q?Rafa=C5=82=20Mi=C5=82ecki?= 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?q?Rafa=C5=82=20Mi=C5=82ecki?= 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: 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:38 -0800 (PST) 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>; + }; }; }; - | -- 2.35.3