From: John Crispin Date: Tue, 15 May 2012 09:38:02 +0000 (+0000) Subject: adds zyxel p2601hnfx support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=07dca108a96bcdb4e375d3a3f3b5e9701d661940;p=openwrt%2Fstaging%2Fstintel.git adds zyxel p2601hnfx support Signed-off-by: Luka Perkov SVN-Revision: 31734 --- diff --git a/target/linux/lantiq/ar9/config-default b/target/linux/lantiq/ar9/config-default index ce21adf42e..6a74179013 100644 --- a/target/linux/lantiq/ar9/config-default +++ b/target/linux/lantiq/ar9/config-default @@ -19,6 +19,7 @@ CONFIG_LANTIQ_MACH_FRITZ_AR9=y # CONFIG_LANTIQ_MACH_GIGASX76X is not set CONFIG_LANTIQ_MACH_NETGEAR=y CONFIG_LANTIQ_MACH_WBMR=y +CONFIG_LANTIQ_MACH_P2601HNFX=y # CONFIG_LANTIQ_VRX200 is not set CONFIG_MDIO_BOARDINFO=y # CONFIG_MLX4_CORE is not set diff --git a/target/linux/lantiq/ar9/profiles/005-zyxel.mk b/target/linux/lantiq/ar9/profiles/005-zyxel.mk new file mode 100644 index 0000000000..8b1384c675 --- /dev/null +++ b/target/linux/lantiq/ar9/profiles/005-zyxel.mk @@ -0,0 +1,7 @@ +define Profile/P2601HNFX + NAME:=P2601HNFX - ZyXEL P-2601HN-Fx + PACKAGES:= kmod-usb-dwc-otg kmod-rt2800-usb wpad-mini \ + kmod-ltq-dsl-firmware-b-ar9 +endef + +$(eval $(call Profile,P2601HNFX)) diff --git a/target/linux/lantiq/danube/config-default b/target/linux/lantiq/danube/config-default index 417f090fc2..673360fed6 100644 --- a/target/linux/lantiq/danube/config-default +++ b/target/linux/lantiq/danube/config-default @@ -19,6 +19,7 @@ CONFIG_LANTIQ_MACH_EASY50712=y 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_VRX200 is not set CONFIG_MDIO_BOARDINFO=y # CONFIG_MLX4_CORE is not set diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnf1.c b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnf1.c deleted file mode 100644 index 98c118135e..0000000000 --- a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnf1.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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) 2010 John Crispin - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "../machtypes.h" -#include "devices.h" -#include "../dev-gpio-leds.h" -#include "dev-dwc_otg.h" - - -static struct mtd_partition p2601hnf1_partitions[] __initdata = -{ - { - .name = "uboot", - .offset = 0x0, - .size = 0x20000, - }, -/* { - .name = "uboot_env", - .offset = 0x20000, - .size = 0x20000, - }, -*/ { - .name = "linux", - .offset = 0x020000, - .size = 0xfc0000, - }, - { - .name = "board_config", - .offset = 0xfe0000, - .size = 0x20000, - }, -}; - -static struct physmap_flash_data p2601hnf1_flash_data __initdata = { - .nr_parts = ARRAY_SIZE(p2601hnf1_partitions), - .parts = p2601hnf1_partitions, -}; - -static struct gpio_led p2601hnf1_leds_gpio[] __initdata = { - { .name = "soc:red:power", .gpio = 29, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:yellow:phone", .gpio = 64, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:green:phone", .gpio = 65, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:yellow:wlan", .gpio = 66, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:green:power", .gpio = 67, .active_low = 1, .default_trigger = "default-on" }, - { .name = "soc:red:internet", .gpio = 68, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:green:internet", .gpio = 69, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:green:dsl", .gpio = 70, .active_low = 1, .default_trigger = "default-off" }, - { .name = "soc:green:wlan", .gpio = 71, .active_low = 1, .default_trigger = "default-off" }, -}; - -static struct gpio_button -p2601hnf1_gpio_buttons[] /*__initdata*/ = { - { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 53, .active_low = 1, }, - { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 1, .gpio = 54, .active_low = 1, }, -}; - -static struct ltq_eth_data ltq_eth_data = { - .mii_mode = PHY_INTERFACE_MODE_RMII, -}; - -static void __init -p2601hnf1_init(void) -{ - -#define P2601HNF1_USB 9 - - ltq_register_gpio_stp(); - ltq_add_device_gpio_leds(-1, ARRAY_SIZE(p2601hnf1_leds_gpio), p2601hnf1_leds_gpio); - ltq_register_gpio_buttons(p2601hnf1_gpio_buttons, ARRAY_SIZE(p2601hnf1_gpio_buttons)); - ltq_register_nor(&p2601hnf1_flash_data); - ltq_register_etop(<q_eth_data); - xway_register_dwc(P2601HNF1_USB); - - // enable the ethernet ports on the SoC -// ltq_w32((ltq_r32(LTQ_GPORT_P0_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P0_CTL); -// ltq_w32((ltq_r32(LTQ_GPORT_P1_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P1_CTL); -// ltq_w32((ltq_r32(LTQ_GPORT_P2_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P2_CTL); -} - -MIPS_MACHINE(LANTIQ_MACH_P2601HNF1, - "P2601HNF1", - "ZyXEL P-2601HN-F1", - p2601hnf1_init); - diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnfx.c b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnfx.c new file mode 100644 index 0000000000..ea7e6e8900 --- /dev/null +++ b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-p2601hnfx.c @@ -0,0 +1,104 @@ +/* + * 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) 2010 John Crispin + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "../machtypes.h" +#include "devices.h" +#include "../dev-gpio-leds.h" +#include "dev-dwc_otg.h" + + +static struct mtd_partition p2601hnfx_partitions[] __initdata = +{ + { + .name = "uboot", + .offset = 0x0, + .size = 0x20000, + }, +/* { + .name = "uboot_env", + .offset = 0x20000, + .size = 0x20000, + }, +*/ { + .name = "linux", + .offset = 0x020000, + .size = 0xfc0000, + }, + { + .name = "board_config", + .offset = 0xfe0000, + .size = 0x20000, + }, +}; + +static struct physmap_flash_data p2601hnfx_flash_data __initdata = { + .nr_parts = ARRAY_SIZE(p2601hnfx_partitions), + .parts = p2601hnfx_partitions, +}; + +static struct gpio_led p2601hnfx_leds_gpio[] __initdata = { + { .name = "soc:red:power", .gpio = 29, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:yellow:phone", .gpio = 64, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:green:phone", .gpio = 65, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:yellow:wlan", .gpio = 66, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:green:power", .gpio = 67, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:internet", .gpio = 68, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:green:internet", .gpio = 69, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:green:dsl", .gpio = 70, .active_low = 1, .default_trigger = "default-off" }, + { .name = "soc:green:wlan", .gpio = 71, .active_low = 1, .default_trigger = "default-off" }, +}; + +static struct gpio_button +p2601hnfx_gpio_buttons[] /* __initdata */ = { + { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 53, .active_low = 1, }, + { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 1, .gpio = 54, .active_low = 1, }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_RMII, +}; + +static void __init +p2601hnfx_init(void) +{ +#define P2601HNFX_USB 9 + + ltq_register_gpio_stp(); + ltq_add_device_gpio_leds(-1, ARRAY_SIZE(p2601hnfx_leds_gpio), p2601hnfx_leds_gpio); + ltq_register_gpio_buttons(p2601hnfx_gpio_buttons, ARRAY_SIZE(p2601hnfx_gpio_buttons)); + ltq_register_nor(&p2601hnfx_flash_data); + ltq_register_etop(<q_eth_data); + xway_register_dwc(P2601HNFX_USB); + + // enable the ethernet ports on the SoC +// ltq_w32((ltq_r32(LTQ_GPORT_P0_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P0_CTL); +// ltq_w32((ltq_r32(LTQ_GPORT_P1_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P1_CTL); +// ltq_w32((ltq_r32(LTQ_GPORT_P2_CTL) & ~(1 << 17)) | (1 << 18), LTQ_GPORT_P2_CTL); +} + +MIPS_MACHINE(LANTIQ_MACH_P2601HNFX, + "P2601HNFX", + "ZyXEL P-2601HN-Fx", + p2601hnfx_init); diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 280a0d182e..9d59935b5a 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -157,15 +157,18 @@ endif 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/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/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/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) $(call Image/BuildKernel/Template,NONE) endef @@ -173,6 +176,7 @@ endef 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/BuildEVA/$(1),$(1),FRITZ7320) $(call Image/Build/$(1),$(1),NONE) $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs diff --git a/target/linux/lantiq/patches-3.3/206-machtypes.patch b/target/linux/lantiq/patches-3.3/206-machtypes.patch index c964488322..7b891e464a 100644 --- a/target/linux/lantiq/patches-3.3/206-machtypes.patch +++ b/target/linux/lantiq/patches-3.3/206-machtypes.patch @@ -1,6 +1,6 @@ --- a/arch/mips/lantiq/machtypes.h +++ b/arch/mips/lantiq/machtypes.h -@@ -20,6 +20,36 @@ enum lantiq_mach_type { +@@ -20,6 +20,39 @@ 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 */ @@ -34,12 +34,15 @@ + + /* Buffalo */ + LANTIQ_MACH_WBMR, /* WBMR-HP-G300H */ ++ ++ /* ZyXEL */ ++ LANTIQ_MACH_P2601HNFX, /* ZyXEL P-2601HN-Fx */ }; #endif --- a/arch/mips/lantiq/xway/Kconfig +++ b/arch/mips/lantiq/xway/Kconfig -@@ -6,6 +6,30 @@ config LANTIQ_MACH_EASY50712 +@@ -6,6 +6,34 @@ config LANTIQ_MACH_EASY50712 bool "Easy50712 - Danube" default y @@ -59,6 +62,10 @@ + bool "WBMR-HP-G300H" + default y + ++config LANTIQ_MACH_P2601HNFX ++ bool "P2601HNFX" ++ default y ++ +config LANTIQ_MACH_FRITZ_VR9 + bool "FRITZ3370" + default y @@ -72,7 +79,7 @@ choice --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile -@@ -2,3 +2,9 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s +@@ -2,3 +2,10 @@ 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 @@ -82,6 +89,7 @@ +obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o +obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o +obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o ++obj-$(CONFIG_LANTIQ_MACH_P2601HNFX) += mach-p2601hnfx.o --- a/arch/mips/lantiq/falcon/Kconfig +++ b/arch/mips/lantiq/falcon/Kconfig @@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000 diff --git a/target/linux/lantiq/vr9/config-default b/target/linux/lantiq/vr9/config-default index c2fe001ebf..d6ff259350 100644 --- a/target/linux/lantiq/vr9/config-default +++ b/target/linux/lantiq/vr9/config-default @@ -21,6 +21,7 @@ CONFIG_LANTIQ_MACH_FRITZ_VR9=y # CONFIG_LANTIQ_MACH_GIGASX76X is not set # CONFIG_LANTIQ_MACH_NETGEAR is not set # CONFIG_LANTIQ_MACH_WBMR is not set +# CONFIG_LANTIQ_MACH_P2601HNFX is not set CONFIG_LANTIQ_VRX200=y CONFIG_M25PXX_USE_FAST_READ=y CONFIG_MDIO_BOARDINFO=y