diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-05-25 18:36:49 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-05-25 18:36:49 +0000 |
commit | 315fb2270ee2813321c78f33ec4ad60ad7ec44a4 (patch) | |
tree | 07b7abe63bcd7c3fa390b7605eb48054ee6934c6 /target/linux/ar71xx/files/arch | |
parent | 6262f561d3cbc0d63a39ba8e059ffd38cae20a8e (diff) |
[ar71xx] add preliminary support for the WRT160NL
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16068 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch')
5 files changed, 92 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig b/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig index d5bffdc9b4..0682e015a3 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig @@ -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 diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/Makefile b/target/linux/ar71xx/files/arch/mips/ar71xx/Makefile index a70cc2b24b..720fddfdbe 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/Makefile @@ -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 index 0000000000..06cd05aa2f --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c @@ -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); diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c index 9117e30636..bfc38c010f 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c @@ -78,6 +78,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, }, { diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h index 9bf08433c3..86272789bd 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h @@ -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 |