Add basic configuration for new board ZTE H201L. Still missing are button and led...
authorJohn Crispin <john@openwrt.org>
Sun, 27 May 2012 16:02:16 +0000 (16:02 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 27 May 2012 16:02:16 +0000 (16:02 +0000)
Signed-off-by: Luka Perkov <openwrt@lukaperkov.net>
SVN-Revision: 31908

target/linux/lantiq/ar9/config-default
target/linux/lantiq/ar9/profiles/006-zte.mk [new file with mode: 0644]
target/linux/lantiq/danube/config-default
target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-h201l.c [new file with mode: 0644]
target/linux/lantiq/image/Makefile
target/linux/lantiq/patches-3.3/206-machtypes.patch
target/linux/lantiq/vr9/config-default

index ae5086fb11585756e81d01718a671eff4ca00f0a..0ed3f4abf7749cdef49f295f87d6db63aba2e668 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_LANTIQ_MACH_FRITZ_AR9=y
 CONFIG_LANTIQ_MACH_NETGEAR=y
 CONFIG_LANTIQ_MACH_WBMR=y
 CONFIG_LANTIQ_MACH_P2601HNFX=y
+CONFIG_LANTIQ_MACH_H201L=y
 # CONFIG_LANTIQ_VRX200 is not set
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MTD_BLOCK2MTD=y
diff --git a/target/linux/lantiq/ar9/profiles/006-zte.mk b/target/linux/lantiq/ar9/profiles/006-zte.mk
new file mode 100644 (file)
index 0000000..c83890f
--- /dev/null
@@ -0,0 +1,7 @@
+define Profile/H201L
+  NAME:=H201L - ZTE ZXV10
+  PACKAGES:= kmod-usb-dwc-otg kmod-ath9k-htc wpad-mini \
+        kmod-ltq-dsl-firmware-b-ar9
+endef
+
+$(eval $(call Profile,H201L))
index dc2a8cb35f78c68bd878ac87c8dcd99ea7da213e..990f857069865877896fc98a16e209f7f0e3fdaf 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_LANTIQ_MACH_GIGASX76X=y
 # CONFIG_LANTIQ_MACH_NETGEAR is not set
 # CONFIG_LANTIQ_MACH_WBMR is not set
 # CONFIG_LANTIQ_MACH_P2601HNFX is not set
+# CONFIG_LANTIQ_MACH_H201L is not set
 # CONFIG_LANTIQ_VRX200 is not set
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_PCI=y
diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-h201l.c b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-h201l.c
new file mode 100644 (file)
index 0000000..86101f5
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ *  Copyright (C) 2012 Luka Perkov <openwrt@lukaperkov.net>
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/gpio.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/input.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/if_ether.h>
+#include <linux/etherdevice.h>
+#include <linux/string.h>
+
+#include <lantiq_soc.h>
+#include <lantiq_platform.h>
+#include <dev-gpio-leds.h>
+#include <dev-gpio-buttons.h>
+
+#include "../machtypes.h"
+#include "devices.h"
+#include "dev-dwc_otg.h"
+
+static u8 ltq_ethaddr[6] = { 0 };
+
+static int __init
+setup_ethaddr(char *str)
+{
+       if (!mac_pton(str, ltq_ethaddr))
+               memset(ltq_ethaddr, 0, 6);
+       return 0;
+}
+__setup("ethaddr=", setup_ethaddr);
+
+static struct mtd_partition h201l_partitions[] __initdata =
+{
+       {
+               .name   = "uboot",
+               .offset = 0x0,
+               .size   = 0x20000,
+       },
+       {
+               .name   = "uboot_env",
+               .offset = 0x20000,
+               .size   = 0x10000,
+       },
+       {
+               .name   = "linux",
+               .offset = 0x30000,
+               .size   = 0x7d0000,
+       },
+};
+
+static struct physmap_flash_data h201l_flash_data __initdata = {
+       .nr_parts       = ARRAY_SIZE(h201l_partitions),
+       .parts          = h201l_partitions,
+};
+
+static struct gpio_led
+h201l_leds_gpio[] __initdata = {
+};
+
+static struct gpio_keys_button
+h201l_gpio_keys[] __initdata = {
+};
+
+static struct ltq_eth_data ltq_eth_data = {
+       .mii_mode       = PHY_INTERFACE_MODE_RMII,
+};
+
+static void __init
+h201l_init(void)
+{
+       ltq_register_gpio_stp();
+       ltq_register_nor(&h201l_flash_data);
+       ltq_add_device_gpio_leds(-1, ARRAY_SIZE(h201l_leds_gpio), h201l_leds_gpio);
+       ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(h201l_gpio_keys), h201l_gpio_keys);
+
+       if (!is_valid_ether_addr(ltq_ethaddr))
+               random_ether_addr(ltq_ethaddr);
+
+       memcpy(&ltq_eth_data.mac.sa_data, ltq_ethaddr, 6);
+       ltq_register_etop(&ltq_eth_data);
+
+       xway_register_dwc(-1);
+}
+
+MIPS_MACHINE(LANTIQ_MACH_H201L,
+                       "H201L",
+                       "ZTE ZXV10 H201L",
+                       h201l_init);
index 9d59935b5a9c567a93f409af593fd0018c7adf96..29cfc1d7e38ba624cfdac9d8a937716a233021e2 100644 (file)
@@ -158,17 +158,20 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y)
 Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline))
 Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline))
 Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline))
+Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline))
 Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline))
 
 Image/Build/Profile/WBMR=$(call Image/Build/$(1),$(1),WBMR)
 Image/Build/Profile/DGN3500B=$(call Image/Build/$(1),$(1),DGN3500B)
 Image/Build/Profile/P2601HNFX=$(call Image/Build/$(1),$(1),P2601HNFX)
+Image/Build/Profile/H201L=$(call Image/Build/$(1),$(1),H201L)
 Image/Build/Profile/FRITZ7320=$(call Image/BuildEVA/$(1),$(1),FRITZ7320)
 
 define Image/BuildKernel/Profile/Generic
        $(call Image/BuildKernel/Template,WBMR,$(xway_cmdline))
        $(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline))
        $(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline))
+       $(call Image/BuildKernel/Template,H201L,$(xway_cmdline))
        $(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline))
        $(call Image/BuildKernel/Template,NONE)
 endef
@@ -177,6 +180,7 @@ define Image/Build/Profile/Generic
        $(call Image/Build/$(1),$(1),WBMR)
        $(call Image/Build/$(1),$(1),DGN3500B)
        $(call Image/Build/$(1),$(1),P2601HNFX)
+       $(call Image/Build/$(1),$(1),H201L)
        $(call Image/BuildEVA/$(1),$(1),FRITZ7320)
        $(call Image/Build/$(1),$(1),NONE)
        $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs
index 7b891e464acf017b0fa9d29a5c488cebad8e82a5..f6f24ea4b4a50ede4832dcc0b3960ac34f03c6ec 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/lantiq/machtypes.h
 +++ b/arch/mips/lantiq/machtypes.h
-@@ -20,6 +20,39 @@ enum lantiq_mach_type {
+@@ -20,6 +20,42 @@ enum lantiq_mach_type {
        LANTIQ_MACH_EASY98000,          /* Falcon Eval Board, NOR Flash */
        LANTIQ_MACH_EASY98000SF,        /* Falcon Eval Board, Serial Flash */
        LANTIQ_MACH_EASY98000NAND,      /* Falcon Eval Board, NAND Flash */
 +
 +      /* ZyXEL */
 +      LANTIQ_MACH_P2601HNFX,          /* ZyXEL P-2601HN-Fx */
++
++      /* ZTE */
++      LANTIQ_MACH_H201L,              /* ZTE ZXV10 H201L */
  };
  
  #endif
 --- a/arch/mips/lantiq/xway/Kconfig
 +++ b/arch/mips/lantiq/xway/Kconfig
-@@ -6,6 +6,34 @@ config LANTIQ_MACH_EASY50712
+@@ -6,6 +6,38 @@ config LANTIQ_MACH_EASY50712
        bool "Easy50712 - Danube"
        default y
  
 +      bool "P2601HNFX"
 +      default y
 +
++config LANTIQ_MACH_H201L
++      bool "H201L"
++      default y
++
 +config LANTIQ_MACH_FRITZ_VR9
 +      bool "FRITZ3370"
 +      default y
@@ -79,7 +86,7 @@
  choice
 --- a/arch/mips/lantiq/xway/Makefile
 +++ b/arch/mips/lantiq/xway/Makefile
-@@ -2,3 +2,10 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s
+@@ -2,3 +2,11 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s
  
  obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
  obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
@@ -90,6 +97,7 @@
 +obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
 +obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
 +obj-$(CONFIG_LANTIQ_MACH_P2601HNFX) += mach-p2601hnfx.o
++obj-$(CONFIG_LANTIQ_MACH_H201L) += mach-h201l.o
 --- a/arch/mips/lantiq/falcon/Kconfig
 +++ b/arch/mips/lantiq/falcon/Kconfig
 @@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000
index f264f15420fddee398c76c56d37212f9af610b62..ff2c2e2c4578be6bc902afbc5542e2d676432813 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_LANTIQ_MACH_FRITZ_VR9=y
 # CONFIG_LANTIQ_MACH_NETGEAR is not set
 # CONFIG_LANTIQ_MACH_WBMR is not set
 # CONFIG_LANTIQ_MACH_P2601HNFX is not set
+# CONFIG_LANTIQ_MACH_H201L is not set
 CONFIG_LANTIQ_VRX200=y
 CONFIG_M25PXX_USE_FAST_READ=y
 CONFIG_MDIO_BOARDINFO=y