summaryrefslogtreecommitdiff
path: root/target/linux/atheros-2.6/files/drivers/mtd/devices
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-02-20 22:44:59 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-02-20 22:44:59 +0000
commit5a3f291f1a5b8eee2d49c4034afb48f1c48fa4c5 (patch)
tree200590bf4658961b19058d775a1038d751cf9d24 /target/linux/atheros-2.6/files/drivers/mtd/devices
parente6a49e7bd0849e0d5b281a5e3b0e661e26973704 (diff)
add 16MB flash support for ar2315 (who knows...?)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6334 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/atheros-2.6/files/drivers/mtd/devices')
-rw-r--r--target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c6
-rw-r--r--target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h11
2 files changed, 15 insertions, 2 deletions
diff --git a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c
index 029f624eb9..75a59d6e81 100644
--- a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c
+++ b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c
@@ -84,7 +84,8 @@ struct flashconfig {
{ STM_1MB_BYTE_COUNT, STM_1MB_SECTOR_COUNT, STM_1MB_SECTOR_SIZE, 0x0},
{ STM_2MB_BYTE_COUNT, STM_2MB_SECTOR_COUNT, STM_2MB_SECTOR_SIZE, 0x0},
{ STM_4MB_BYTE_COUNT, STM_4MB_SECTOR_COUNT, STM_4MB_SECTOR_SIZE, 0x0},
- { STM_8MB_BYTE_COUNT, STM_8MB_SECTOR_COUNT, STM_8MB_SECTOR_SIZE, 0x0}
+ { STM_8MB_BYTE_COUNT, STM_8MB_SECTOR_COUNT, STM_8MB_SECTOR_SIZE, 0x0},
+ { STM_16MB_BYTE_COUNT, STM_16MB_SECTOR_COUNT, STM_16MB_SECTOR_SIZE, 0x0}
};
/* Mapping of generic opcodes to STM serial flash opcodes */
@@ -215,6 +216,9 @@ spiflash_probe_chip (void)
case STM_64MBIT_SIGNATURE:
flash_size = FLASH_8MB;
break;
+ case STM_128MBIT_SIGNATURE:
+ flash_size = FLASH_16MB;
+ break;
default:
printk (KERN_WARNING "%s: Read of flash device signature failed!\n", module_name);
return (0);
diff --git a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h
index e543e040fd..ac0a93b977 100644
--- a/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h
+++ b/target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h
@@ -17,7 +17,8 @@
#define FLASH_2MB 2
#define FLASH_4MB 3
#define FLASH_8MB 4
-#define MAX_FLASH 5
+#define FLASH_16MB 5
+#define MAX_FLASH 6
#define STM_PAGE_SIZE 256
@@ -57,6 +58,11 @@
#define STM_M25P64_SECTOR_COUNT 128
#define STM_M25P64_SECTOR_SIZE 0x10000
+#define STM_128MBIT_SIGNATURE 0x17
+#define STM_M25P128_BYTE_COUNT 16777216
+#define STM_M25P128_SECTOR_COUNT 256
+#define STM_M25P128_SECTOR_SIZE 0x10000
+
#define STM_1MB_BYTE_COUNT STM_M25P80_BYTE_COUNT
#define STM_1MB_SECTOR_COUNT STM_M25P80_SECTOR_COUNT
#define STM_1MB_SECTOR_SIZE STM_M25P80_SECTOR_SIZE
@@ -69,6 +75,9 @@
#define STM_8MB_BYTE_COUNT STM_M25P64_BYTE_COUNT
#define STM_8MB_SECTOR_COUNT STM_M25P64_SECTOR_COUNT
#define STM_8MB_SECTOR_SIZE STM_M25P64_SECTOR_SIZE
+#define STM_16MB_BYTE_COUNT STM_M25P128_BYTE_COUNT
+#define STM_16MB_SECTOR_COUNT STM_M25P128_SECTOR_COUNT
+#define STM_16MB_SECTOR_SIZE STM_M25P128_SECTOR_SIZE
/*
* ST Microelectronics Opcodes for Serial Flash