From patchwork Fri May 10 08:24:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Duan X-Patchwork-Id: 1097894 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="SIAmou0W"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 450jt21C4Dz9sBp for ; Fri, 10 May 2019 18:24:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727230AbfEJIYI (ORCPT ); Fri, 10 May 2019 04:24:08 -0400 Received: from mail-eopbgr10057.outbound.protection.outlook.com ([40.107.1.57]:25819 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727156AbfEJIYF (ORCPT ); Fri, 10 May 2019 04:24:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ypVf1RAo+conpxFWNSV5B9XfuX0wzX/1uSowUE65D+g=; b=SIAmou0WtVu+9+XR4WQ0Cs/y1TvOS4Vn5wRv9niwurxNhrzh4Ah7yc/Ukj8pNjQDGK9FBslSf1TUlYJQ9U0g3Frv8bMqPOodyvE7vtokJb3cgZRBKFaBlRoIV0sifZudUmTz6UlY1X4UP61tG8Pj+TD8IeOeP1XXtU/6id0OkM8= Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com (52.134.5.23) by VI1PR0402MB2815.eurprd04.prod.outlook.com (10.172.255.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Fri, 10 May 2019 08:24:01 +0000 Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df]) by VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df%6]) with mapi id 15.20.1878.022; Fri, 10 May 2019 08:24:01 +0000 From: Andy Duan To: "davem@davemloft.net" CC: "netdev@vger.kernel.org" , "ynezz@true.cz" , "john@phrozen.org" , "bgolaszewski@baylibre.com" , Andy Duan Subject: [PATCH net 1/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order Thread-Topic: [PATCH net 1/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order Thread-Index: AQHVBwm4BewhjCi/Zkaqy4SJng2qbg== Date: Fri, 10 May 2019 08:24:00 +0000 Message-ID: <1557476567-17397-2-git-send-email-fugang.duan@nxp.com> References: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> In-Reply-To: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0212.apcprd02.prod.outlook.com (2603:1096:201:20::24) To VI1PR0402MB3600.eurprd04.prod.outlook.com (2603:10a6:803:a::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=fugang.duan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85b36509-3390-4bdb-fd93-08d6d520dae1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR0402MB2815; x-ms-traffictypediagnostic: VI1PR0402MB2815: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0033AAD26D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(396003)(366004)(39860400002)(189003)(30594003)(199004)(11346002)(486006)(26005)(6436002)(305945005)(2616005)(6116002)(3846002)(68736007)(316002)(7736002)(386003)(6506007)(6486002)(102836004)(446003)(186003)(2906002)(6916009)(50226002)(54906003)(1730700003)(66066001)(66556008)(36756003)(8676002)(66946007)(66476007)(64756008)(76176011)(2351001)(81156014)(476003)(5660300002)(73956011)(86362001)(66446008)(81166006)(14454004)(478600001)(8936002)(25786009)(5640700003)(256004)(14444005)(6512007)(52116002)(71190400001)(71200400001)(2501003)(53936002)(4326008)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB2815; H:VI1PR0402MB3600.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: j/slM9JAKV/GOB6Yj5/U5/3oIEUB35cmAJx1MrdFZrl0Bau+DKsYGShRUBPQOIruUr7HEJxwnEjtRCeIuezEy0OkNscvqfV+f+54XtSZiznkBVsCAD9efrHZf8euB1IO2AOampGOjzT+rGGJt8bYaKRZlyL3/kRJc2WK3X3dQlbCytNROi9BwE4/IF0xynn+A4EG9ItMcMb04VM0DpAORUKaA4hRAf0Mic+b8u7MBli5TTbI3rGYz54PNBnMtrJeA6gZuU843wb0+fM28Gl6yA5+RO97940QKza14BynKWE2p6iGb6bS/9CtdxvbGoIwRTjUu0Swe3bpaUgIm74Iag2jJiQP7ERFgeXTs/xUVRX3FIa38E89FTZtCHm8W5ChS9GmYwjgV31Jra3v3gY62zjIBuJkwlUtOBdTfuARhj8= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85b36509-3390-4bdb-fd93-08d6d520dae1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2019 08:24:01.0149 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2815 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ethernet controller driver call .of_get_mac_address() to get the mac address from devictree tree, if these properties are not present, then try to read from nvmem. For example, read MAC address from nvmem: of_get_mac_address() of_get_mac_addr_nvmem() nvmem_get_mac_address() i.MX6x/7D/8MQ/8MM platforms ethernet MAC address read from nvmem ocotp eFuses, but it requires to swap the six bytes order. The patch add optional property "nvmem_macaddr_swap" to swap macaddr bytes order. Signed-off-by: Fugang Duan --- net/ethernet/eth.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 4b2b222..0a0986b 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -583,8 +583,10 @@ EXPORT_SYMBOL(eth_platform_get_mac_address); int nvmem_get_mac_address(struct device *dev, void *addrbuf) { struct nvmem_cell *cell; - const void *mac; + const unsigned char *mac; + unsigned char macaddr[ETH_ALEN]; size_t len; + int i = 0; cell = nvmem_cell_get(dev, "mac-address"); if (IS_ERR(cell)) @@ -596,14 +598,27 @@ int nvmem_get_mac_address(struct device *dev, void *addrbuf) if (IS_ERR(mac)) return PTR_ERR(mac); - if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { - kfree(mac); - return -EINVAL; + if (len != ETH_ALEN) + goto invalid_addr; + + if (dev->of_node && + of_property_read_bool(dev->of_node, "nvmem_macaddr_swap")) { + for (i = 0; i < ETH_ALEN; i++) + macaddr[i] = mac[ETH_ALEN - i - 1]; + } else { + ether_addr_copy(macaddr, mac); } - ether_addr_copy(addrbuf, mac); + if (!is_valid_ether_addr(macaddr)) + goto invalid_addr; + + ether_addr_copy(addrbuf, macaddr); kfree(mac); return 0; + +invalid_addr: + kfree(mac); + return -EINVAL; } EXPORT_SYMBOL(nvmem_get_mac_address); From patchwork Fri May 10 08:24:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Duan X-Patchwork-Id: 1097895 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="BKIkDLgp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 450jt42qRlz9sBp for ; Fri, 10 May 2019 18:24:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbfEJIYL (ORCPT ); Fri, 10 May 2019 04:24:11 -0400 Received: from mail-eopbgr10057.outbound.protection.outlook.com ([40.107.1.57]:25819 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727351AbfEJIYJ (ORCPT ); Fri, 10 May 2019 04:24:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UuYkKE9Bz5/f8ezob2AHey3cbRutfMWigjnjyzbJGtw=; b=BKIkDLgpK9F0vXhYiFZn37R28Hai/Hl/++M15rvboqtwKYEJwqBRtn+pBhLPbXijJ6yctyDOp/mu1IA227pdmYeqllWr4C8Py92q//gtlzXoxSNYg/alDRktRIsoG4mdHs35Psitr1flM+dQYtQSSfAJkO2Tbb16stz0l98NF7g= Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com (52.134.5.23) by VI1PR0402MB2815.eurprd04.prod.outlook.com (10.172.255.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Fri, 10 May 2019 08:24:03 +0000 Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df]) by VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df%6]) with mapi id 15.20.1878.022; Fri, 10 May 2019 08:24:03 +0000 From: Andy Duan To: "davem@davemloft.net" CC: "netdev@vger.kernel.org" , "ynezz@true.cz" , "john@phrozen.org" , "bgolaszewski@baylibre.com" , Andy Duan Subject: [PATCH net 2/3] of_net: add property "nvmem-mac-address" for of_get_mac_addr() Thread-Topic: [PATCH net 2/3] of_net: add property "nvmem-mac-address" for of_get_mac_addr() Thread-Index: AQHVBwm64QpngfTPuUW2xDFkk+Lk0w== Date: Fri, 10 May 2019 08:24:03 +0000 Message-ID: <1557476567-17397-3-git-send-email-fugang.duan@nxp.com> References: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> In-Reply-To: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0212.apcprd02.prod.outlook.com (2603:1096:201:20::24) To VI1PR0402MB3600.eurprd04.prod.outlook.com (2603:10a6:803:a::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=fugang.duan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0595174-25df-4fa1-d30d-08d6d520dc67 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR0402MB2815; x-ms-traffictypediagnostic: VI1PR0402MB2815: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0033AAD26D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(396003)(366004)(39860400002)(189003)(199004)(11346002)(486006)(26005)(6436002)(305945005)(2616005)(6116002)(3846002)(68736007)(316002)(7736002)(386003)(6506007)(6486002)(102836004)(446003)(186003)(2906002)(6916009)(50226002)(54906003)(1730700003)(66066001)(66556008)(36756003)(8676002)(4744005)(66946007)(66476007)(64756008)(76176011)(2351001)(81156014)(476003)(5660300002)(73956011)(86362001)(66446008)(81166006)(14454004)(478600001)(8936002)(25786009)(5640700003)(256004)(6512007)(52116002)(71190400001)(71200400001)(2501003)(53936002)(4326008)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB2815; H:VI1PR0402MB3600.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Eh+H8bEND/z/ImbIV04ADauUhcMSSh9DjFvMxWxHGkF8GrCTPTx1MsL++VTzzOF2o+zEz+ShRbJqSWkxIA2Cwkvd7rPraPS87vOSMN3fkBnbdi4CzkL7U2RdGVMypj1eKaiLhgt+zLTMVXpU9cfrWzVxD5Lf/7hWSeyMOaAJeYCledYObhLOKKeGIbAJmSmgDE4iSY/iw2BwztF3eh4Ez0LeM91y4l//Y/MioSt5KpGXkAmr4wO5jEQmvL+tl8q/bGD7PksW2EGFbfDktRrT5Ua35FgZOvs2Me5T14HMOCSo7pRLW12dM00PnNXGuATAKzNy35DEcJoUF1D1e3kX9R7mCbhVEsMgCIijfVuID/c97Tuu+eMZT1+vrxuxTNMEL3qECTfFcmRrHkqNKKKl674CnA1F232KTBbMC+I+XAY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0595174-25df-4fa1-d30d-08d6d520dc67 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2019 08:24:03.8099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2815 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If MAC address read from nvmem cell and it is valid mac address, .of_get_mac_addr_nvmem() add new property "nvmem-mac-address" in ethernet node. Once user call .of_get_mac_address() to get MAC address again, it can read valid MAC address from device tree in directly. Signed-off-by: Fugang Duan --- drivers/of/of_net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c index 9649cd5..5071241 100644 --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c @@ -125,6 +125,10 @@ const void *of_get_mac_address(struct device_node *np) if (addr) return addr; + addr = of_get_mac_addr(np, "nvmem-mac-address"); + if (addr) + return addr; + return of_get_mac_addr_nvmem(np); } EXPORT_SYMBOL(of_get_mac_address); From patchwork Fri May 10 08:24:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Duan X-Patchwork-Id: 1097897 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="i/LCvEvM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 450jtJ4ht2z9sND for ; Fri, 10 May 2019 18:24:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727369AbfEJIYO (ORCPT ); Fri, 10 May 2019 04:24:14 -0400 Received: from mail-eopbgr10057.outbound.protection.outlook.com ([40.107.1.57]:25819 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727156AbfEJIYN (ORCPT ); Fri, 10 May 2019 04:24:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OQddC6LdF+ln5q73ivv7ybpsgzLAOLU8565qqlkd+DQ=; b=i/LCvEvMnHzT7DXKQhOBV2Heg9rHxPCFRbE+GcqutX704emhFqdGAkfUmvLC9U49Lq55/c9+PERXsJfOehbypTQxxf+YtkhsubR5vpK+vyXETlXlreTYeyg8kW72IfelieaWOzBbKjaaW3G3OliPwVUGb1bZ5N6oT1a9gormQd8= Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com (52.134.5.23) by VI1PR0402MB2815.eurprd04.prod.outlook.com (10.172.255.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Fri, 10 May 2019 08:24:06 +0000 Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df]) by VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::9889:fa82:4172:14df%6]) with mapi id 15.20.1878.022; Fri, 10 May 2019 08:24:06 +0000 From: Andy Duan To: "davem@davemloft.net" CC: "netdev@vger.kernel.org" , "ynezz@true.cz" , "john@phrozen.org" , "bgolaszewski@baylibre.com" , Andy Duan Subject: [PATCH net 3/3] dt-bindings: doc: add new properties for of_get_mac_address from nvmem Thread-Topic: [PATCH net 3/3] dt-bindings: doc: add new properties for of_get_mac_address from nvmem Thread-Index: AQHVBwm7Z3/Q/s5Ic0ut6ydV531w8A== Date: Fri, 10 May 2019 08:24:06 +0000 Message-ID: <1557476567-17397-4-git-send-email-fugang.duan@nxp.com> References: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> In-Reply-To: <1557476567-17397-1-git-send-email-fugang.duan@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0212.apcprd02.prod.outlook.com (2603:1096:201:20::24) To VI1PR0402MB3600.eurprd04.prod.outlook.com (2603:10a6:803:a::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=fugang.duan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1b87802-e8e0-464c-11b0-08d6d520de13 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR0402MB2815; x-ms-traffictypediagnostic: VI1PR0402MB2815: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0033AAD26D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(396003)(366004)(39860400002)(189003)(199004)(11346002)(486006)(26005)(6436002)(305945005)(2616005)(6116002)(3846002)(68736007)(316002)(7736002)(386003)(6506007)(6486002)(102836004)(446003)(186003)(2906002)(6916009)(50226002)(54906003)(1730700003)(66066001)(66556008)(36756003)(8676002)(66946007)(66476007)(64756008)(76176011)(2351001)(81156014)(476003)(5660300002)(73956011)(86362001)(66446008)(81166006)(14454004)(478600001)(8936002)(25786009)(5640700003)(256004)(14444005)(6512007)(52116002)(71190400001)(71200400001)(2501003)(53936002)(4326008)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB2815; H:VI1PR0402MB3600.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: aovYeSPQ1tlF+2wAt1xkFNHOCCQ3nqGg0OzvJzxn7T9wg7uqmwmkbTjf1cjWD9y/30Y7zJkEz+jkVka+75Fz0SgmCBQFL4ianGKoMz3beJKOuVTavHTTiLFrpB0x3dMyPru+JPHx/nTqBG23Uq+7rAF11i0IAtYs0QV3c7FO+niviwfe3k1bjPxJrtRWg8r2BB7G2J42OUvezB+Yv1XdjYZRd66HCjdog6ErYG618tBCWS1lpbClHOb/ssxazk5mvqY525Mbpve+EuY9/RYXVUcWTjPpYQTHeIlRTb3xQDccWBQgaW1t7BCc9YFQwbsK16SPqPFl87ACwHM5YVaIvu/oPWz+nGZ7Qlr+gQPGcNR2g/HYLmLLWL47/aCoSbQ8P9LQfxAt85syhXZXRA9/4w9VtaiFNTqsO7TkQ8t/MwY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1b87802-e8e0-464c-11b0-08d6d520de13 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2019 08:24:06.4067 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2815 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently, of_get_mac_address supports NVMEM, some platforms MAC address that read from NVMEM efuse requires to swap bytes order, so add new property "nvmem_macaddr_swap" to specify the behavior. If the MAC address is valid from NVMEM, add new property "nvmem-mac-address" in ethernet node. Update these two properties in the binding documentation. Signed-off-by: Fugang Duan --- Documentation/devicetree/bindings/net/ethernet.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ethernet.txt b/Documentation/devicetree/bindings/net/ethernet.txt index e88c364..921364a 100644 --- a/Documentation/devicetree/bindings/net/ethernet.txt +++ b/Documentation/devicetree/bindings/net/ethernet.txt @@ -10,8 +10,11 @@ Documentation/devicetree/bindings/phy/phy-bindings.txt. property; - local-mac-address: array of 6 bytes, specifies the MAC address that was assigned to the network device; +- nvmem-mac-address: array of 6 bytes, specifies the MAC address that was + read from nvmem-cells and dynamically add the property in device node; - nvmem-cells: phandle, reference to an nvmem node for the MAC address - nvmem-cell-names: string, should be "mac-address" if nvmem is to be used +- nvmem_macaddr_swap: swap bytes order for the 6 bytes of MAC address - max-speed: number, specifies maximum speed in Mbit/s supported by the device; - max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than the maximum frame size (there's contradiction in the Devicetree