From patchwork Fri Aug 21 11:45:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 509477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E85021402C8 for ; Fri, 21 Aug 2015 21:49:17 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C118428C619; Fri, 21 Aug 2015 13:46:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from localhost (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id ABA9828C60E; Fri, 21 Aug 2015 13:44:58 +0200 (CEST) X-Virus-Scanned: at arrakis.dune.hu Received: from localhost.localdomain (dslb-088-073-024-154.088.073.pools.vodafone-ip.de [88.73.24.154]) by arrakis.dune.hu (Postfix) with ESMTPSA id 64DC828C601; Fri, 21 Aug 2015 13:44:41 +0200 (CEST) From: Jonas Gorski To: openwrt-devel@lists.openwrt.org Date: Fri, 21 Aug 2015 13:45:18 +0200 Message-Id: <1440157521-525-5-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org> References: <1440157521-525-1-git-send-email-jogo@openwrt.org> Subject: [OpenWrt-Devel] [PATCH 4/7] ipq806x: add support for retrieving macs from mtd X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Add support for mtd-mac-address for stmac. Signed-off-by: Jonas Gorski --- ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++++++++++++++++++++++ ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch create mode 100644 target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch diff --git a/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch new file mode 100644 index 0000000..68222ce --- /dev/null +++ b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch @@ -0,0 +1,35 @@ +From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 9 Aug 2015 12:53:55 +0200 +Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd + +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +@@ -284,6 +284,7 @@ static int stmmac_pltfr_probe(struct pla + struct stmmac_priv *priv = NULL; + struct plat_stmmacenet_data *plat_dat = NULL; + const char *mac = NULL; ++ u8 mtd_mac[ETH_ALEN] = { }; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + addr = devm_ioremap_resource(dev, res); +@@ -313,6 +314,15 @@ static int stmmac_pltfr_probe(struct pla + pr_err("%s: main dt probe failed", __func__); + return ret; + } ++ ++ if (!mac) { ++ ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac); ++ if (ret == -EPROBE_DEFER) ++ return ret; ++ ++ if (is_valid_ether_addr(&mtd_mac)) ++ mac = mtd_mac; ++ } + } + + /* Custom setup (if needed) */ diff --git a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch new file mode 100644 index 0000000..84c15c7 --- /dev/null +++ b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch @@ -0,0 +1,35 @@ +From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 9 Aug 2015 12:53:55 +0200 +Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd + +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +@@ -302,6 +302,7 @@ static int stmmac_pltfr_probe(struct pla + struct stmmac_priv *priv = NULL; + struct plat_stmmacenet_data *plat_dat = NULL; + const char *mac = NULL; ++ u8 mtd_mac[ETH_ALEN] = { }; + int irq, wol_irq, lpi_irq; + + /* Get IRQ information early to have an ability to ask for deferred +@@ -362,6 +363,15 @@ static int stmmac_pltfr_probe(struct pla + pr_err("%s: main dt probe failed", __func__); + return ret; + } ++ ++ if (!mac) { ++ ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac); ++ if (ret == -EPROBE_DEFER) ++ return ret; ++ ++ if (is_valid_ether_addr(&mtd_mac)) ++ mac = mtd_mac; ++ } + } + + /* Custom setup (if needed) */