add preliminary support for the WRT160NL

SVN-Revision: 16068
This commit is contained in:
Gabor Juhos 2009-05-25 18:36:49 +00:00
parent 1fe8e242f2
commit f6e6a733f5
9 changed files with 107 additions and 0 deletions

View file

@ -55,6 +55,9 @@ ar71xx_board_name() {
*WNR2000)
name="wnr2000"
;;
*WRT160NL)
name="wrt160nl"
;;
*WRT400N)
name="wrt400n"
;;

View 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

View 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

View 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

View 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

View file

@ -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);

View 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,

View 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

View 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))