diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-09-09 14:05:24 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-09-09 14:05:24 +0000 |
commit | d90a416bf560ef0d43c337a5fd32d0b3ceca3e7a (patch) | |
tree | 035cabb99de3a610ac4bdc57696022e11e79c88f /target/linux/ar71xx/files/arch/mips | |
parent | 9b0f8cd2506e65aa8be8a2024b5e21f4ee97b6e2 (diff) | |
download | master-187ad058-d90a416bf560ef0d43c337a5fd32d0b3ceca3e7a.tar.gz master-187ad058-d90a416bf560ef0d43c337a5fd32d0b3ceca3e7a.tar.bz2 master-187ad058-d90a416bf560ef0d43c337a5fd32d0b3ceca3e7a.zip |
ar71xx: define MTD partitions for RB2011
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33345 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c index 4f44ef4a3b..d3fa051977 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c @@ -11,6 +11,10 @@ #include <linux/phy.h> #include <linux/platform_device.h> #include <linux/ar8216_platform.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/spi/spi.h> +#include <linux/spi/flash.h> #include <asm/mach-ath79/ar71xx_regs.h> @@ -19,6 +23,43 @@ #include "dev-m25p80.h" #include "machtypes.h" +#define RB_ROUTERBOOT_OFFSET 0x0000 +#define RB_ROUTERBOOT_SIZE 0xb000 +#define RB_HARD_CFG_OFFSET 0xb000 +#define RB_HARD_CFG_SIZE 0x1000 +#define RB_BIOS_OFFSET 0xd000 +#define RB_BIOS_SIZE 0x2000 +#define RB_SOFT_CFG_OFFSET 0xf000 +#define RB_SOFT_CFG_SIZE 0x1000 + +static struct mtd_partition rb2011_spi_partitions[] = { + { + .name = "routerboot", + .offset = RB_ROUTERBOOT_OFFSET, + .size = RB_ROUTERBOOT_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "hard_config", + .offset = RB_HARD_CFG_OFFSET, + .size = RB_HARD_CFG_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "bios", + .offset = RB_BIOS_OFFSET, + .size = RB_BIOS_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "soft_config", + .offset = RB_SOFT_CFG_OFFSET, + .size = RB_SOFT_CFG_SIZE, + } +}; + +static struct flash_platform_data rb2011_spi_flash_data = { + .parts = rb2011_spi_partitions, + .nr_parts = ARRAY_SIZE(rb2011_spi_partitions), +}; + static struct ar8327_pad_cfg rb2011_ar8327_pad0_cfg = { .mode = AR8327_PAD_MAC_RGMII, .txclk_delay_en = true, @@ -65,7 +106,7 @@ static void __init rb2011_gmac_setup(void) static void __init rb2011_setup(void) { - ath79_register_m25p80(NULL); + ath79_register_m25p80(&rb2011_spi_flash_data); rb2011_gmac_setup(); |