I have made the Netgear DGN3500 work as it should, but it required some
changes that would affect other hardware. If anyone out there has Lantiq
hardware supported in trunk, please try this patchset, in whole or in
part, and report back what works and what breaks. I'm attaching the
whole thing as a blob to this message, and splitting it into 5 patches
in the following ones.

Signed-off-by: Daniel Gimpelevich <[email protected]>
Index: target/linux/lantiq/config-default
===================================================================
--- target/linux/lantiq/config-default  (revision 36698)
+++ target/linux/lantiq/config-default  (working copy)
@@ -8,7 +8,6 @@
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_CEVT_R4K=y
-CONFIG_CEVT_R4K_LIB=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CPU_BIG_ENDIAN=y
 CONFIG_CPU_GENERIC_DUMP_TLB=y
@@ -22,8 +21,9 @@
 CONFIG_CPU_R4K_FPU=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
 CONFIG_CSRC_R4K=y
-CONFIG_CSRC_R4K_LIB=y
 # CONFIG_DEBUG_PINCTRL is not set
 CONFIG_DECOMPRESS_LZMA=y
 CONFIG_DMA_NONCOHERENT=y
@@ -50,6 +50,7 @@
 CONFIG_HAS_IOPORT=y
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
 CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_C_RECORDMCOUNT=y
 CONFIG_HAVE_DEBUG_KMEMLEAK=y
@@ -68,6 +69,7 @@
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_PERF_EVENTS=y
 CONFIG_HW_HAS_PCI=y
@@ -75,7 +77,6 @@
 CONFIG_HZ=250
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
-# CONFIG_I2C_MUX_PINCTRL is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_DOMAIN=y
@@ -86,8 +87,11 @@
 CONFIG_LANTIQ_WDT=y
 CONFIG_LANTIQ_XRX200=y
 CONFIG_LEDS_GPIO=y
+# CONFIG_LZO_COMPRESS is not set
+# CONFIG_LZO_DECOMPRESS is not set
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MIPS=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_MIPS_MACHINE is not set
 CONFIG_MIPS_MT_DISABLED=y
@@ -122,13 +126,12 @@
 # CONFIG_PCIE_LANTIQ is not set
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LANTIQ=y
+CONFIG_PERCPU_RWSEM=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PHYLIB=y
 CONFIG_PINCONF=y
 CONFIG_PINCTRL=y
-# CONFIG_PINCTRL_EXYNOS4 is not set
 CONFIG_PINCTRL_LANTIQ=y
-# CONFIG_PINCTRL_SAMSUNG is not set
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_PINCTRL_XWAY=y
 CONFIG_PINMUX=y
@@ -142,7 +145,6 @@
 CONFIG_SERIAL_LANTIQ=y
 # CONFIG_SOC_AMAZON_SE is not set
 # CONFIG_SOC_FALCON is not set
-# CONFIG_SOC_SVIP is not set
 CONFIG_SOC_TYPE_XWAY=y
 CONFIG_SOC_XWAY=y
 CONFIG_SWAP_IO_SPACE=y
Index: target/linux/lantiq/xway/config-default
===================================================================
--- target/linux/lantiq/xway/config-default     (revision 36698)
+++ target/linux/lantiq/xway/config-default     (working copy)
@@ -6,6 +6,7 @@
 CONFIG_INPUT_POLLDEV=y
 # CONFIG_ISDN is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_USBDEV=y
 CONFIG_M25PXX_USE_FAST_READ=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
Index: target/linux/lantiq/xway/target.mk
===================================================================
--- target/linux/lantiq/xway/target.mk  (revision 36698)
+++ target/linux/lantiq/xway/target.mk  (working copy)
@@ -3,7 +3,7 @@
 BOARDNAME:=XWAY
 FEATURES:=squashfs jffs2 atm
 
-DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug
+DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug linux-atm atm-esi
 
 define Target/Description
        Lantiq XWAY
Index: target/linux/lantiq/dts/DGN3500.dtsi
===================================================================
--- target/linux/lantiq/dts/DGN3500.dtsi        (revision 36698)
+++ target/linux/lantiq/dts/DGN3500.dtsi        (working copy)
@@ -2,7 +2,7 @@
 
 / {
        chosen {
-               bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+               bootargs-append = "console=ttyLTQ0,115200 init=/etc/preinit";
        };
 
        memory@0 {
@@ -112,6 +112,13 @@
                };
        };
 
+       ath9k_eep {
+               compatible = "ath9k,eeprom";
+               ath,eep-flash = <2 0xf000>;
+               ath,pci-slot = <14>;
+               ath,eep-swap;
+       };
+
        rtl8366rb {
                compatible = "rtl8366rb";
                gpio-sda = <&gpio 35 0>;
@@ -144,7 +151,7 @@
        gpio-leds {
                compatible = "gpio-leds";
                internet {
-                       label = "inernet";
+                       label = "internet";
                        gpios = <&gpio 2 1>;
                };
                dsl {
@@ -158,7 +165,6 @@
                power {
                        label = "power";
                        gpios = <&gpio 34 1>;
-                       default-state = "on";
                };
                power2 {
                        label = "power2";
Index: target/linux/lantiq/patches-3.8/0304-MIPS-cmdline.patch
===================================================================
--- target/linux/lantiq/patches-3.8/0304-MIPS-cmdline.patch     (revision 0)
+++ target/linux/lantiq/patches-3.8/0304-MIPS-cmdline.patch     (revision 0)
@@ -0,0 +1,14 @@
+Index: linux-3.8.12/drivers/of/fdt.c
+===================================================================
+--- linux-3.8.12.orig/drivers/of/fdt.c 2013-05-07 20:33:25.000000000 -0700
++++ linux-3.8.12/drivers/of/fdt.c      2013-05-23 02:20:52.688781310 -0700
+@@ -677,6 +677,9 @@
+       p = of_get_flat_dt_prop(node, "bootargs", &l);
+       if (p != NULL && l > 0)
+               strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
++      p = of_get_flat_dt_prop(node, "bootargs-append", &l);
++      if (p != NULL && l > 0)
++              strlcat(data, p, min(strlen(data) + (int)l, COMMAND_LINE_SIZE));
+ 
+       /*
+        * CONFIG_CMDLINE is meant to be a default in case nothing else
Index: 
target/linux/lantiq/patches-3.8/0037-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
===================================================================
--- 
target/linux/lantiq/patches-3.8/0037-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
    (revision 36698)
+++ 
target/linux/lantiq/patches-3.8/0037-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
    (working copy)
@@ -19,8 +19,10 @@
  create mode 100644 arch/mips/lantiq/xway/pci-ath-fixup.c
  create mode 100644 arch/mips/lantiq/xway/rt_eep.c
 
---- /dev/null
-+++ b/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h
+Index: linux-3.8.12/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-3.8.12/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h     
2013-05-23 19:40:28.323008317 -0700
 @@ -0,0 +1,6 @@
 +#ifndef _PCI_ATH_FIXUP
 +#define _PCI_ATH_FIXUP
@@ -28,9 +30,11 @@
 +void ltq_pci_ath_fixup(unsigned slot, u16 *cal_data) __init;
 +
 +#endif /* _PCI_ATH_FIXUP */
---- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
-+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
-@@ -90,5 +90,8 @@ int xrx200_gphy_boot(struct device *dev,
+Index: linux-3.8.12/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
+===================================================================
+--- linux-3.8.12.orig/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h      
2013-05-23 19:39:58.682861338 -0700
++++ linux-3.8.12/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h   
2013-05-23 19:40:28.323008317 -0700
+@@ -90,5 +90,8 @@
  extern void ltq_pmu_enable(unsigned int module);
  extern void ltq_pmu_disable(unsigned int module);
  
@@ -39,8 +43,10 @@
 +
  #endif /* CONFIG_SOC_TYPE_XWAY */
  #endif /* _LTQ_XWAY_H__ */
---- a/arch/mips/lantiq/xway/Makefile
-+++ b/arch/mips/lantiq/xway/Makefile
+Index: linux-3.8.12/arch/mips/lantiq/xway/Makefile
+===================================================================
+--- linux-3.8.12.orig/arch/mips/lantiq/xway/Makefile   2013-05-23 
19:40:28.247007941 -0700
++++ linux-3.8.12/arch/mips/lantiq/xway/Makefile        2013-05-23 
21:48:16.965035065 -0700
 @@ -1,3 +1,6 @@
  obj-y := prom.o sysctrl.o clk.o reset.o dma.o gptu.o dcdc.o
  
@@ -48,9 +54,11 @@
 +obj-$(CONFIG_PCI) += ath_eep.o rt_eep.o pci-ath-fixup.o
 +
  obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
---- /dev/null
-+++ b/arch/mips/lantiq/xway/ath_eep.c
-@@ -0,0 +1,206 @@
+Index: linux-3.8.12/arch/mips/lantiq/xway/ath_eep.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-3.8.12/arch/mips/lantiq/xway/ath_eep.c       2013-05-23 
21:38:32.758138144 -0700
+@@ -0,0 +1,246 @@
 +/*
 + *  Copyright (C) 2011 Luca Olivetti <[email protected]>
 + *  Copyright (C) 2011 John Crispin <[email protected]>
@@ -69,7 +77,10 @@
 +#include <linux/ath5k_platform.h>
 +#include <linux/ath9k_platform.h>
 +#include <linux/pci.h>
++#include <linux/err.h>
++#include <linux/mtd/mtd.h>
 +#include <pci-ath-fixup.h>
++#include <lantiq_soc.h>
 +
 +extern int (*ltq_pci_plat_dev_init)(struct pci_dev *dev);
 +struct ath5k_platform_data ath5k_pdata;
@@ -88,32 +99,50 @@
 +int __init of_ath9k_eeprom_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
-+      struct resource *eep_res, *mac_res;
++      struct resource *eep_res, *mac_res = NULL;
 +      void __iomem *eep, *mac;
 +      int mac_offset;
-+      u32 mac_inc = 0, pci_slot = 0;
++      u32 mac_inc = 0, pci_slot = 0, mtd_addr[2];
 +      int i;
 +      u16 *eepdata, sum, el;
++      struct mtd_info *the_mtd;
++      size_t flash_readlen;
 +
-+      eep_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+      mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++      if (of_property_read_u32_array(np, "ath,eep-flash", mtd_addr, 2) == 0 &&
++                              (the_mtd = get_mtd_device(NULL, mtd_addr[0]))
++                              != ERR_PTR(-ENODEV)) {
++              i = mtd_read(the_mtd, mtd_addr[1],
++                              sizeof(ath9k_pdata.eeprom_data), &flash_readlen,
++                              (void *) ath9k_pdata.eeprom_data);
++              put_mtd_device(the_mtd);
++              if ((sizeof(ath9k_pdata.eeprom_data) != flash_readlen) || i) {
++                      dev_err(&pdev->dev, "failed to load eeprom from mtd\n");
++                      return -ENODEV;
++              }
++      } else {
++              eep_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++              mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 +
-+      if (!eep_res) {
-+              dev_err(&pdev->dev, "failed to load eeprom address\n");
-+              return -ENODEV;
++              if (!eep_res) {
++                      dev_err(&pdev->dev, "failed to load eeprom address\n");
++                      return -ENODEV;
++              }
++              if (resource_size(eep_res) != ATH9K_PLAT_EEP_MAX_WORDS) {
++                      dev_err(&pdev->dev, "eeprom has an invalid size\n");
++                      return -EINVAL;
++              }
++
++              eep = ioremap(eep_res->start, resource_size(eep_res));
++              memcpy_fromio(ath9k_pdata.eeprom_data, eep,
++                              ATH9K_PLAT_EEP_MAX_WORDS);
 +      }
-+      if (resource_size(eep_res) != ATH9K_PLAT_EEP_MAX_WORDS) {
-+              dev_err(&pdev->dev, "eeprom has an invalid size\n");
-+              return -EINVAL;
-+      }
 +
-+      eep = ioremap(eep_res->start, resource_size(eep_res));
-+      memcpy_fromio(ath9k_pdata.eeprom_data, eep, ATH9K_PLAT_EEP_MAX_WORDS);
-+
 +      if (of_find_property(np, "ath,eep-swap", NULL)) {
 +              ath9k_pdata.endian_check = true;
-+
 +              dev_info(&pdev->dev, "endian check enabled.\n");
++              for (i = 0; i < ATH9K_PLAT_EEP_MAX_WORDS; i++)
++                      ath9k_pdata.eeprom_data[i] =
++                                      swab16(ath9k_pdata.eeprom_data[i]);
 +      }
 +
 +      if (of_find_property(np, "ath,eep-csum", NULL)) {
@@ -137,7 +166,9 @@
 +              }
 +              mac = ioremap(mac_res->start, resource_size(mac_res));
 +              memcpy_fromio(athxk_eeprom_mac, mac, 6);
-+      } else {
++      } else if (ltq_get_eth_mac())
++              memcpy(athxk_eeprom_mac, ltq_get_eth_mac(), 6);
++      else {
 +              dev_warn(&pdev->dev, "using random mac\n");
 +              random_ether_addr(athxk_eeprom_mac);
 +      }
@@ -176,7 +207,7 @@
 +{
 +      return platform_driver_probe(&ath9k_eeprom_driver, 
of_ath9k_eeprom_probe);
 +}
-+arch_initcall(of_ath9k_eeprom_init);
++late_initcall(of_ath9k_eeprom_init);
 +
 +
 +static int ath5k_pci_plat_dev_init(struct pci_dev *dev)
@@ -188,30 +219,45 @@
 +int __init of_ath5k_eeprom_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
-+      struct resource *eep_res, *mac_res;
++      struct resource *eep_res, *mac_res = NULL;
 +      void __iomem *eep, *mac;
 +      int mac_offset;
-+      u32 mac_inc = 0;
++      u32 mac_inc = 0, mtd_addr[2];
 +      int i;
++      struct mtd_info *the_mtd;
++      size_t flash_readlen;
 +
-+      eep_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+      mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++      if (of_property_read_u32_array(np, "ath,eep-flash", mtd_addr, 2) == 0 &&
++                              (the_mtd = get_mtd_device(NULL, mtd_addr[0]))
++                              != ERR_PTR(-ENODEV)) {
++              i = mtd_read(the_mtd, mtd_addr[1],
++                              sizeof(ath5k_eeprom_data), &flash_readlen,
++                              (void *) ath5k_eeprom_data);
++              put_mtd_device(the_mtd);
++              if ((sizeof(ath5k_eeprom_data) != flash_readlen) || i) {
++                      dev_err(&pdev->dev, "failed to load eeprom from mtd\n");
++                      return -ENODEV;
++              }
++      } else {
++              eep_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++              mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 +
-+      if (!eep_res) {
-+              dev_err(&pdev->dev, "failed to load eeprom address\n");
-+              return -ENODEV;
++              if (!eep_res) {
++                      dev_err(&pdev->dev, "failed to load eeprom address\n");
++                      return -ENODEV;
++              }
++              if (resource_size(eep_res) != ATH5K_PLAT_EEP_MAX_WORDS) {
++                      dev_err(&pdev->dev, "eeprom has an invalid size\n");
++                      return -EINVAL;
++              }
++
++              eep = ioremap(eep_res->start, resource_size(eep_res));
++              memcpy_fromio(ath5k_eeprom_data, eep, ATH5K_PLAT_EEP_MAX_WORDS);
 +      }
-+      if (resource_size(eep_res) != ATH5K_PLAT_EEP_MAX_WORDS) {
-+              dev_err(&pdev->dev, "eeprom has an invalid size\n");
-+              return -EINVAL;
-+      }
 +
-+      eep = ioremap(eep_res->start, resource_size(eep_res));
-+      memcpy_fromio(ath5k_eeprom_data, eep, ATH5K_PLAT_EEP_MAX_WORDS);
-+
 +      if (of_find_property(np, "ath,eep-swap", NULL))
-+              for (i = 0; i < (ATH5K_PLAT_EEP_MAX_WORDS >> 1); i++)
-+                              ath5k_eeprom_data[i] = 
swab16(ath5k_eeprom_data[i]);
++              for (i = 0; i < ATH5K_PLAT_EEP_MAX_WORDS; i++)
++                      ath5k_eeprom_data[i] = swab16(ath5k_eeprom_data[i]);
 +
 +      if (!of_property_read_u32(np, "ath,mac-offset", &mac_offset)) {
 +              memcpy_fromio(athxk_eeprom_mac, (void*) ath5k_eeprom_data, 6);
@@ -222,7 +268,9 @@
 +              }
 +              mac = ioremap(mac_res->start, resource_size(mac_res));
 +              memcpy_fromio(athxk_eeprom_mac, mac, 6);
-+      } else {
++      } else if (ltq_get_eth_mac())
++              memcpy(athxk_eeprom_mac, ltq_get_eth_mac(), 6);
++      else {
 +              dev_warn(&pdev->dev, "using random mac\n");
 +              random_ether_addr(athxk_eeprom_mac);
 +      }
@@ -256,9 +304,11 @@
 +{
 +      return platform_driver_probe(&ath5k_eeprom_driver, 
of_ath5k_eeprom_probe);
 +}
-+device_initcall(of_ath5k_eeprom_init);
---- /dev/null
-+++ b/arch/mips/lantiq/xway/eth_mac.c
++late_initcall(of_ath5k_eeprom_init);
+Index: linux-3.8.12/arch/mips/lantiq/xway/eth_mac.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-3.8.12/arch/mips/lantiq/xway/eth_mac.c       2013-05-23 
19:40:28.323008317 -0700
 @@ -0,0 +1,76 @@
 +/*
 + *  Copyright (C) 2012 John Crispin <[email protected]>
@@ -336,8 +386,10 @@
 +      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
+Index: linux-3.8.12/arch/mips/lantiq/xway/pci-ath-fixup.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-3.8.12/arch/mips/lantiq/xway/pci-ath-fixup.c 2013-05-23 
21:43:52.131721830 -0700
 @@ -0,0 +1,109 @@
 +/*
 + *  Atheros AP94 reference board PCI initialization
@@ -426,7 +478,7 @@
 +      dev->revision = val & 0xff;
 +      dev->class = val >> 8; /* upper 3 bytes */
 +
-+      pr_info("pci %s: fixup info: [%04x:%04x] revision %02x class %#08x\n", 
++      pr_info("pci %s: fixup info: [%04x:%04x] revision %02x class %#08x\n",
 +              pci_name(dev), dev->vendor, dev->device, dev->revision, 
dev->class);
 +
 +      pci_read_config_word(dev, PCI_COMMAND, &cmd);
@@ -448,8 +500,10 @@
 +      ath_fixups[ath_num_fixups].cal_data = cal_data;
 +      ath_num_fixups++;
 +}
---- /dev/null
-+++ b/arch/mips/lantiq/xway/rt_eep.c
+Index: linux-3.8.12/arch/mips/lantiq/xway/rt_eep.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-3.8.12/arch/mips/lantiq/xway/rt_eep.c        2013-05-23 
19:40:28.323008317 -0700
 @@ -0,0 +1,60 @@
 +/*
 + *  Copyright (C) 2011 John Crispin <[email protected]>
@@ -511,9 +565,11 @@
 +      return platform_driver_probe(&ralink_eeprom_driver, 
of_ralink_eeprom_probe);
 +}
 +device_initcall(of_ralink_eeprom_init);
---- a/drivers/net/ethernet/lantiq_etop.c
-+++ b/drivers/net/ethernet/lantiq_etop.c
-@@ -826,7 +826,8 @@ ltq_etop_init(struct net_device *dev)
+Index: linux-3.8.12/drivers/net/ethernet/lantiq_etop.c
+===================================================================
+--- linux-3.8.12.orig/drivers/net/ethernet/lantiq_etop.c       2013-05-23 
19:40:28.183007628 -0700
++++ linux-3.8.12/drivers/net/ethernet/lantiq_etop.c    2013-05-23 
19:40:28.323008317 -0700
+@@ -826,7 +826,8 @@
  
        ltq_etop_change_mtu(dev, 1500);
  
@@ -523,7 +579,7 @@
        if (!is_valid_ether_addr(mac.sa_data)) {
                pr_warn("etop: invalid MAC, using random\n");
                random_ether_addr(mac.sa_data);
-@@ -885,8 +886,7 @@ static const struct net_device_ops ltq_e
+@@ -885,8 +886,7 @@
        .ndo_tx_timeout = ltq_etop_tx_timeout,
  };
  
@@ -533,7 +589,7 @@
  {
        struct net_device *dev;
        struct ltq_etop_priv *priv;
-@@ -950,7 +950,9 @@ ltq_etop_probe(struct platform_device *p
+@@ -950,7 +950,9 @@
        priv->tx_irq = irqres[0].start;
        priv->rx_irq = irqres[1].start;
        priv->mii_mode = of_get_phy_mode(pdev->dev.of_node);
@@ -544,3 +600,13 @@
  
        priv->clk_ppe = clk_get(&pdev->dev, NULL);
        if (IS_ERR(priv->clk_ppe))
+Index: linux-3.8.12/arch/mips/pci/pci-lantiq.c
+===================================================================
+--- linux-3.8.12.orig/arch/mips/pci/pci-lantiq.c       2013-05-23 
21:48:46.669182357 -0700
++++ linux-3.8.12/arch/mips/pci/pci-lantiq.c    2013-05-23 21:49:14.053318145 
-0700
+@@ -260,4 +260,4 @@
+       return ret;
+ }
+ 
+-arch_initcall(pcibios_init);
++late_initcall(pcibios_init);
Index: target/linux/lantiq/ase/target.mk
===================================================================
--- target/linux/lantiq/ase/target.mk   (revision 36698)
+++ target/linux/lantiq/ase/target.mk   (working copy)
@@ -3,7 +3,7 @@
 BOARDNAME:=Amazon-SE
 FEATURES:=squashfs jffs2 atm
 
-DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl 
kmod-ltq-dsl-ase ltq-dsl-app
+DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools 
br2684ctl kmod-ltq-dsl-ase ltq-dsl-app
 
 define Target/Description
        Lantiq ASE
Index: target/linux/lantiq/base-files/lib/preinit/42_athfix
===================================================================
--- target/linux/lantiq/base-files/lib/preinit/42_athfix        (revision 36698)
+++ target/linux/lantiq/base-files/lib/preinit/42_athfix        (working copy)
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-. /lib/functions/lantiq.sh
-
-init_atheeprom() {
-       local board=$(lantiq_board_name)
-       case $board in
-       "Netgear DGN3500B")
-               echo "- loading eeprom -"
-               dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 
count=4
-               echo 0 > /sys/bus/pci/slots/0000\:00\:0e.0/power
-               sleep 1
-               echo 1 > /sys/bus/pci/rescan
-               ;;
-       esac
-}
-
-boot_hook_add preinit_essential init_atheeprom
-
Index: target/linux/lantiq/base-files/etc/diag.sh
===================================================================
--- target/linux/lantiq/base-files/etc/diag.sh  (revision 36698)
+++ target/linux/lantiq/base-files/etc/diag.sh  (working copy)
@@ -6,6 +6,27 @@
 status_led="power"
 
 set_state() {
+       [ -d /sys/class/leds/power2/ ] && {
+
+               case "$1" in
+               preinit)
+                       led_set_attr "power2" "trigger" "heartbeat"
+                       ;;
+               init)
+                       status_led_on
+                       ;;
+               failsafe)
+                       led_off "power2"
+                       status_led_set_timer 100 100
+                       ;;
+               done)
+                       status_led_on
+                       led_off "power2"
+                       ;;
+               esac
+               return
+       }
+
        case "$1" in
        preinit)
                status_led_set_heartbeat
Index: target/linux/lantiq/base-files/etc/uci-defaults/01_leds
===================================================================
--- target/linux/lantiq/base-files/etc/uci-defaults/01_leds     (revision 36698)
+++ target/linux/lantiq/base-files/etc/uci-defaults/01_leds     (working copy)
@@ -9,7 +9,7 @@
 
 [ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" 
"phy0tpt"
 [ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1"
-[ -e "/sys/class/leds/dsl" ] &&        ucidef_set_led_netdev "dsl" "dsl" "dsl" 
"pppoe-wan"
+[ -e "/sys/class/leds/internet" ] &&   ucidef_set_led_netdev "internet" 
"internet" "internet" "pppoe-wan"
 
 for a in `ls /sys/class/leds/`; do
        grep -q "\[none\]" /sys/class/leds/$a/trigger
Index: target/linux/lantiq/base-files/etc/uci-defaults/02_network
===================================================================
--- target/linux/lantiq/base-files/etc/uci-defaults/02_network  (revision 36698)
+++ target/linux/lantiq/base-files/etc/uci-defaults/02_network  (working copy)
@@ -72,6 +72,11 @@
 VG3503J)
        ucidef_set_interface_lan 'eth0 eth1'
        ;;
+DGN3500*)
+       ucidef_set_interface_lan "eth0.1"
+       ucidef_add_switch "switch0" "1" "1"
+       ucidef_add_switch_vlan "switch0" "1" "3 2 1 0 5t"
+       ;;
 esac
 
 [ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" 
"$encaps" "$payload"
Index: target/linux/lantiq/base-files/etc/init.d/esi
===================================================================
--- target/linux/lantiq/base-files/etc/init.d/esi       (revision 0)
+++ target/linux/lantiq/base-files/etc/init.d/esi       (revision 0)
@@ -0,0 +1,7 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013 OpenWrt.org
+
+START=19
+start() {
+       esi $(printf '%X' $((1+0x$(tr -d : </sys/class/net/eth0/address)))) 
2>/dev/null || :
+}

Property changes on: target/linux/lantiq/base-files/etc/init.d/esi
___________________________________________________________________
Added: svn:executable
   + *




_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to