add preliminary support for the WRT160NL
authorGabor Juhos <juhosg@openwrt.org>
Mon, 25 May 2009 18:36:49 +0000 (18:36 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 25 May 2009 18:36:49 +0000 (18:36 +0000)
SVN-Revision: 16068

target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/config-2.6.28
target/linux/ar71xx/config-2.6.30
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h
target/linux/ar71xx/profiles/linksys.mk

index ba69e7d5ca3770ae1eae54c7c7c54a12ef2e0bc7..c7a6063422585c6af11b95b94daba29195721f59 100755 (executable)
@@ -55,6 +55,9 @@ ar71xx_board_name() {
        *WNR2000)
                name="wnr2000"
                ;;
+       *WRT160NL)
+               name="wrt160nl"
+               ;;
        *WRT400N)
                name="wrt400n"
                ;;
index 06e738110c7619bd174dacb49e300a40ff3ba2ff..f272070026a6e4ffaab57c3e003fd0a5ece8c6a1 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_AR71XX_MACH_TL_WR941ND=y
 CONFIG_AR71XX_MACH_UBNT=y
 CONFIG_AR71XX_MACH_WNR2000=y
 CONFIG_AR71XX_MACH_WP543=y
+CONFIG_AR71XX_MACH_WRT160NL=y
 CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_WDT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
index 464a45d9ee8fab6fddc291ac5cdf59a6abe76eed..9ee6f726969ef0587d0cbd7e1e5491248bba1bd4 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_AR71XX_MACH_TL_WR941ND=y
 CONFIG_AR71XX_MACH_UBNT=y
 CONFIG_AR71XX_MACH_WNR2000=y
 CONFIG_AR71XX_MACH_WP543=y
+CONFIG_AR71XX_MACH_WRT160NL=y
 CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_WDT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
index d5bffdc9b40d3e113e86d8bdfee35ae46ae45dee..0682e015a386b0a106280670acac38c8915b4ff6 100644 (file)
@@ -35,6 +35,10 @@ config AR71XX_MACH_WP543
        select MYLOADER
        default y
 
+config AR71XX_MACH_WRT160NL
+       bool "Linksys WRT160NL board support"
+       default y
+
 config AR71XX_MACH_WRT400N
        bool "Linksys WRT400N board support"
        default y
index a70cc2b24bc5265cb3548b91d95179f7347d57dd..720fddfdbe6952c349e40492a5c454a28b8c3743 100644 (file)
@@ -24,4 +24,5 @@ obj-$(CONFIG_AR71XX_MACH_TL_WR941ND)  += mach-tl-wr941nd.o
 obj-$(CONFIG_AR71XX_MACH_UBNT)         += mach-ubnt.o
 obj-$(CONFIG_AR71XX_MACH_WNR2000)      += mach-wnr2000.o
 obj-$(CONFIG_AR71XX_MACH_WP543)                += mach-wp543.o
+obj-$(CONFIG_AR71XX_MACH_WRT160NL)     += mach-wrt160nl.o
 obj-$(CONFIG_AR71XX_MACH_WRT400N)      += mach-wrt400n.o
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c
new file mode 100644 (file)
index 0000000..06cd05a
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ *  Linksys WRT160NL board support
+ *
+ *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  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.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+
+#include <asm/mips_machine.h>
+#include <asm/mach-ar71xx/ar71xx.h>
+
+#include "devices.h"
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition wrt160nl_partitions[] = {
+       {
+               .name           = "u-boot",
+               .offset         = 0,
+               .size           = 0x040000,
+               .mask_flags     = MTD_WRITEABLE,
+       } , {
+               .name           = "kernel",
+               .offset         = 0x040000,
+               .size           = 0x0e0000,
+       } , {
+               .name           = "filesytem",
+               .offset         = 0x120000,
+               .size           = 0x6c0000,
+       } , {
+               .name           = "nvram",
+               .offset         = 0x7e0000,
+               .size           = 0x010000,
+               .mask_flags     = MTD_WRITEABLE,
+       } , {
+               .name           = "ART",
+               .offset         = 0x7f0000,
+               .size           = 0x010000,
+               .mask_flags     = MTD_WRITEABLE,
+       } , {
+               .name           = "firmware",
+               .offset         = 0x040000,
+               .size           = 0x7a0000,
+       }
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
+static struct flash_platform_data wrt160nl_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+        .parts          = wrt160nl_partitions,
+        .nr_parts       = ARRAY_SIZE(wrt160nl_partitions),
+#endif
+};
+
+static struct spi_board_info wrt160nl_spi_info[] = {
+       {
+               .bus_num        = 0,
+               .chip_select    = 0,
+               .max_speed_hz   = 25000000,
+               .modalias       = "m25p80",
+               .platform_data  = &wrt160nl_flash_data,
+       }
+};
+
+static void __init wrt160nl_setup(void)
+{
+       /* TODO: ethernet, LEDs, buttons */
+
+       ar71xx_add_device_spi(NULL, wrt160nl_spi_info,
+                             ARRAY_SIZE(wrt160nl_spi_info));
+
+       ar71xx_add_device_usb();
+       ar91xx_add_device_wmac();
+}
+
+MIPS_MACHINE(AR71XX_MACH_WRT160NL, "Linksys WRT160NL", wrt160nl_setup);
index 9117e3063617a0a9e9bc6ee2182a1cf7619de381..bfc38c010fb8e4029258c3575c8976f82c2d5f0d 100644 (file)
@@ -77,6 +77,9 @@ static struct board_rec boards[] __initdata = {
        }, {
                .name           = "WNR2000",
                .mach_type      = AR71XX_MACH_WNR2000,
+       }, {
+               .name           = "WRT160NL",
+               .mach_type      = AR71XX_MACH_WRT160NL,
        }, {
                .name           = "WRT400N",
                .mach_type      = AR71XX_MACH_WRT400N,
index 9bf08433c3c3787e2fa101176fe01f5e1ae6e8f2..86272789bd81eefcd68d5267aaca893f4bf143c9 100644 (file)
@@ -132,6 +132,7 @@ extern unsigned long ar71xx_mach_type;
 #define AR71XX_MACH_AP81       18      /* Atheros AP81 */
 #define AR71XX_MACH_WRT400N    19      /* Linksys WRT400N */
 #define AR71XX_MACH_PB44       20      /* Atheros PB44 */
+#define AR71XX_MACH_WRT160NL   21      /* Linksys WRT160NL */
 
 /*
  * PLL block
index 8c7f30e5352e5bf211f652f52090073d443785a1..892637462887e2c029f5a661f7d675c49e4adafe 100644 (file)
@@ -5,6 +5,15 @@
 # See /LICENSE for more information.
 #
 
+define Profile/WRT160NL
+       NAME:=Linksys WRT160NL
+       PACKAGES:=kmod-ath9k hostapd-mini kmod-usb2
+endef
+
+define Profile/WRT160NL/Description
+       Package set optimized for the Linksys WRT160NL.
+endef
+
 define Profile/WRT400N
        NAME:=Linksys WRT400N
        PACKAGES:=kmod-ath9k hostapd-mini
@@ -14,4 +23,5 @@ define Profile/WRT400N/Description
        Package set optimized for the Linksys WRT400N.
 endef
 
+$(eval $(call Profile,WRT160NL))
 $(eval $(call Profile,WRT400N))