add 16MB flash support for ar2315 (who knows...?)
authorFelix Fietkau <nbd@openwrt.org>
Tue, 20 Feb 2007 22:44:59 +0000 (22:44 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 20 Feb 2007 22:44:59 +0000 (22:44 +0000)
SVN-Revision: 6334

target/linux/atheros-2.6/files/arch/mips/atheros/ar5315.c
target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.c
target/linux/atheros-2.6/files/drivers/mtd/devices/spiflash.h

index 4e09fe01f0d1c7431bb57badbbe506b38790bd1d..0255ae3246c4686de7a02f1749d3739d97e0499d 100644 (file)
@@ -143,6 +143,7 @@ static __u8 spiflash_probe(void)
 #define STM_16MBIT_SIGNATURE    0x14
 #define STM_32MBIT_SIGNATURE    0x15
 #define STM_64MBIT_SIGNATURE    0x16
+#define STM_128MBIT_SIGNATURE   0x17
 
 
 static char __init *ar5315_flash_limit(void)
@@ -168,6 +169,9 @@ static char __init *ar5315_flash_limit(void)
                case STM_64MBIT_SIGNATURE:
                        flash_size = 0x00800000;
                        break;
+               case STM_128MBIT_SIGNATURE:
+                       flash_size = 0x01000000;
+                       break;
        }
 
        ar5315_spiflash_res[0].end = ar5315_spiflash_res[0].start + flash_size;
index 029f624eb961f084500454eae1f91b9ba23cf67d..75a59d6e8175f3b41c60d307f13cc3611924beb3 100644 (file)
@@ -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);
index e543e040fd3ca930a053646c9bd1cc2e200a30aa..ac0a93b97702099208cff5ff6d55a07b793adb12 100644 (file)
@@ -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
 
 #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