aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch')
-rw-r--r--target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch53
1 files changed, 1 insertions, 52 deletions
diff --git a/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
index 6cf1b7c9cd..7a97815b54 100644
--- a/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
+++ b/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
@@ -335,7 +335,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+device_initcall(of_ath5k_eeprom_init);
--- /dev/null
+++ b/arch/mips/lantiq/xway/eth_mac.c
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
+ *
@@ -345,8 +345,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ */
+
+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/of_platform.h>
+#include <linux/if_ether.h>
+
+static u8 eth_mac[6];
@@ -363,55 +361,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ return !eth_mac_set;
+}
+early_param("ethaddr", setup_ethaddr);
-+
-+int __init of_eth_mac_probe(struct platform_device *pdev)
-+{
-+ struct device_node *np = pdev->dev.of_node;
-+ struct resource *mac_res;
-+ void __iomem *mac;
-+ u32 mac_inc = 0;
-+
-+ if (eth_mac_set) {
-+ dev_err(&pdev->dev, "mac was already set by bootloader\n");
-+ return -EINVAL;
-+ }
-+ mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+
-+ if (!mac_res) {
-+ dev_err(&pdev->dev, "failed to load mac\n");
-+ return -EINVAL;
-+ }
-+ if (resource_size(mac_res) != 6) {
-+ dev_err(&pdev->dev, "mac has an invalid size\n");
-+ return -EINVAL;
-+ }
-+ mac = ioremap(mac_res->start, resource_size(mac_res));
-+ memcpy_fromio(eth_mac, mac, 6);
-+
-+ if (!of_property_read_u32(np, "mac-increment", &mac_inc))
-+ eth_mac[5] += mac_inc;
-+
-+ return 0;
-+}
-+
-+static struct of_device_id eth_mac_ids[] = {
-+ { .compatible = "lantiq,eth-mac" },
-+ { /* sentinel */ }
-+};
-+
-+static struct platform_driver eth_mac_driver = {
-+ .driver = {
-+ .name = "lantiq,eth-mac",
-+ .owner = THIS_MODULE,
-+ .of_match_table = of_match_ptr(eth_mac_ids),
-+ },
-+};
-+
-+static int __init of_eth_mac_init(void)
-+{
-+ return platform_driver_probe(&eth_mac_driver, of_eth_mac_probe);
-+}
-+device_initcall(of_eth_mac_init);
--- /dev/null
+++ b/arch/mips/lantiq/xway/pci-ath-fixup.c
@@ -0,0 +1,118 @@