From: Imre Kaloz <kaloz@openwrt.org>
Date: Sat, 27 Oct 2012 10:48:22 +0000 (+0000)
Subject: add support for Netgear WN802T
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=549d5a6e34cd2e8c3725b759ab7a9f87e70e7040;p=openwrt%2Fstaging%2Fansuel.git

add support for Netgear WN802T

SVN-Revision: 33963
---

diff --git a/target/linux/orion/config-3.3 b/target/linux/orion/config-3.3
index 6e19da90dc..a825c9cb0c 100644
--- a/target/linux/orion/config-3.3
+++ b/target/linux/orion/config-3.3
@@ -130,6 +130,7 @@ CONFIG_MACH_DT2=y
 # CONFIG_MACH_TS209 is not set
 # CONFIG_MACH_TS409 is not set
 # CONFIG_MACH_TS78XX is not set
+CONFIG_MACH_WN802T=y
 CONFIG_MACH_WNR854T=y
 CONFIG_MACH_WRT350N_V2=y
 CONFIG_MDIO_BOARDINFO=y
diff --git a/target/linux/orion/image/generic.mk b/target/linux/orion/image/generic.mk
index 0594ebffad..57624af668 100644
--- a/target/linux/orion/image/generic.mk
+++ b/target/linux/orion/image/generic.mk
@@ -44,6 +44,14 @@ endef
 define Image/BuildKernel
 ### Dummy comment for indented calls of Image/BuildKernel
 
+ ## Netgear WN802T: mach id 3306 (0x0cea)
+$(call Image/BuildKernel/ARM/zImage,wn802t,"\x0c\x1c\xa0\xe3\xea\x10\x81\xe3")
+$(call Image/BuildKernel/ARM/uImage,wn802t)
+ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)  # nothing more to do for a ramdisk build
+$(call Image/BuildKernel/JFFS2uImage,wn802t,$(ERASE_SIZE_WRT350Nv2),$(UIMAGE_FILE_NAME_WNR854T))
+$(call Image/Default/FileSizeCheck,$(KDIR)/wn802t-uImage.jffs2,$(shell expr $(KERNEL_MTD_SIZE) \* 1024))
+ endif
+
  ## Netgear WNR854T: mach id 1801 (0x0709)
 $(call Image/BuildKernel/ARM/zImage,wnr854t,"\x07\x1c\xa0\xe3\x09\x10\x81\xe3")
 $(call Image/BuildKernel/ARM/uImage,wnr854t)
@@ -106,6 +114,9 @@ define Image/Build
  ## Prepare rootfs
 $(call Image/Build/$(1),$(1))
 
+ ## Netgear WN802T
+$(call Image/Build/Default,$(1),wn802t,$(ERASE_SIZE_WRT350Nv2),$(KERNEL_MTD_SIZE),.jffs2,NG_WN802T)
+
  ## Netgear WNR854T
 $(call Image/Build/Default,$(1),wnr854t,$(ERASE_SIZE_WNR854T),$(KERNEL_MTD_SIZE),.jffs2,NG_WNR854T)
 
diff --git a/target/linux/orion/patches-3.3/210-wn802t_support.patch b/target/linux/orion/patches-3.3/210-wn802t_support.patch
new file mode 100644
index 0000000000..7fd908bc5d
--- /dev/null
+++ b/target/linux/orion/patches-3.3/210-wn802t_support.patch
@@ -0,0 +1,78 @@
+--- a/arch/arm/mach-orion5x/Kconfig
++++ b/arch/arm/mach-orion5x/Kconfig
+@@ -139,10 +139,13 @@ config MACH_MSS2
+ 	  Maxtor Shared Storage II platform.
+ 
+ config MACH_WNR854T
+-	bool "Netgear WNR854T"
++	bool "Netgear WNR854T / WN802T"
+ 	help
+ 	  Say 'Y' here if you want your kernel to support the
+-	  Netgear WNR854T platform.
++	  Netgear WNR854T or WN802T platform.
++
++config MACH_WN802T
++	def_bool MACH_WNR854T
+ 
+ config MACH_RD88F5181L_GE
+ 	bool "Marvell Orion-VoIP GE Reference Design"
+--- a/arch/arm/mach-orion5x/wnr854t-setup.c
++++ b/arch/arm/mach-orion5x/wnr854t-setup.c
+@@ -115,6 +115,15 @@ static struct dsa_platform_data wnr854t_
+ 	.chip		= &wnr854t_switch_chip_data,
+ };
+ 
++static struct dsa_chip_data wn802t_switch_chip_data = {
++	.port_names[2] = "wan",
++	.port_names[3] = "cpu",
++};
++
++static struct dsa_platform_data wn802t_switch_plat_data = {
++	.nr_chips	= 1,
++	.chip		= &wn802t_switch_chip_data,
++};
+ static void __init wnr854t_init(void)
+ {
+ 	/*
+@@ -128,7 +137,12 @@ static void __init wnr854t_init(void)
+ 	 * Configure peripherals.
+ 	 */
+ 	orion5x_eth_init(&wnr854t_eth_data);
+-	orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
++
++	if (machine_is_wn802t())
++		orion5x_eth_switch_init(&wn802t_switch_plat_data, NO_IRQ);
++	else
++		orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
++
+ 	orion5x_uart0_init();
+ 
+ 	orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE,
+@@ -167,7 +181,7 @@ static struct hw_pci wnr854t_pci __initd
+ 
+ static int __init wnr854t_pci_init(void)
+ {
+-	if (machine_is_wnr854t())
++	if (machine_is_wnr854t() || machine_is_wn802t())
+ 		pci_common_init(&wnr854t_pci);
+ 
+ 	return 0;
+@@ -178,6 +192,18 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
+ 	/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ 	.atag_offset	= 0x100,
+ 	.init_machine	= wnr854t_init,
++	.map_io		= orion5x_map_io,
++	.init_early	= orion5x_init_early,
++	.init_irq	= orion5x_init_irq,
++	.timer		= &orion5x_timer,
++	.fixup		= tag_fixup_mem32,
++	.restart	= orion5x_restart,
++MACHINE_END
++
++MACHINE_START(WN802T, "Netgear WN802T")
++	/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
++	.atag_offset	= 0x100,
++	.init_machine	= wnr854t_init,
+ 	.map_io		= orion5x_map_io,
+ 	.init_early	= orion5x_init_early,
+ 	.init_irq	= orion5x_init_irq,