summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/.gitignore1
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/m25p80.c72
-rwxr-xr-xcleopatre/linux-2.6.25.10-spc300/scripts/cpincludes2
-rw-r--r--common/include/all_flash.h48
4 files changed, 34 insertions, 89 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/.gitignore b/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/.gitignore
new file mode 100644
index 0000000000..1b875abaf8
--- /dev/null
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/.gitignore
@@ -0,0 +1 @@
+all_flash.h
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/m25p80.c b/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/m25p80.c
index 2eb5fbf676..9a30546800 100644
--- a/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/m25p80.c
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/mtd/devices/m25p80.c
@@ -32,6 +32,8 @@
#include <asm/arch/nvram.h>
#endif
+#include "all_flash.h"
+
#define FLASH_PAGESIZE 256
@@ -544,75 +546,7 @@ struct flash_info {
* more flash chips. This current list focusses on newer chips, which
* have been converging on command sets which including JEDEC ID.
*/
-static struct flash_info __devinitdata m25p_data [] = {
-
- /* Atmel -- some are (confusingly) marketed as "DataFlash" */
- { "at25fs010", 0x1f6601, 32 * 1024, 4, SECT_4K, },
- { "at25fs040", 0x1f6604, 64 * 1024, 8, SECT_4K, },
-
- { "at25df041a", 0x1f4401, 64 * 1024, 8, SECT_4K, },
-
- { "at26f004", 0x1f0400, 64 * 1024, 8, SECT_4K, },
- { "at26df081a", 0x1f4501, 64 * 1024, 16, SECT_4K, },
- { "at26df161a", 0x1f4601, 64 * 1024, 32, SECT_4K, },
- { "at26df321", 0x1f4700, 64 * 1024, 64, SECT_4K, },
-
- /* Eon -- */
- { "en25q32", 0x1c3016, 64 * 1024, 64, },
- { "en25q64", 0x1c3017, 64 * 1024, 128, },
- { "en25q128", 0x1c3018, 64 * 1024, 256, },
-
- /* Macronix -- */
- { "mx25l3205d", 0xc22016, 64 * 1024, 64, SECT_4K, },
- { "mx25l6406e", 0xc22017, 64 * 1024, 128, SECT_4K, },
- { "mx25l128", 0xc22018, 64 * 1024, 256, SECT_4K, },
-
- /* Spansion -- single (large) sector size only, at least
- * for the chips listed here (without boot sectors).
- */
- { "s25sl004a", 0x010212, 64 * 1024, 8, },
- { "s25sl008a", 0x010213, 64 * 1024, 16, },
- { "s25sl016a", 0x010214, 64 * 1024, 32, },
- { "s25sl032a", 0x010215, 64 * 1024, 64, },
- { "s25sl064a", 0x010216, 64 * 1024, 128, },
-
- /* SST -- large erase sizes are "overlays", "sectors" are 4K */
- { "sst25vf040b", 0xbf258d, 64 * 1024, 8, SECT_4K, },
- { "sst25vf080b", 0xbf258e, 64 * 1024, 16, SECT_4K, },
- { "sst25vf016b", 0xbf2541, 64 * 1024, 32, SECT_4K, },
- { "sst25vf032b", 0xbf254a, 64 * 1024, 64, SECT_4K, },
-
- /* ST Microelectronics -- newer production may have feature updates */
- { "m25p05", 0x202010, 32 * 1024, 2, },
- { "m25p10", 0x202011, 32 * 1024, 4, },
- { "m25p20", 0x202012, 64 * 1024, 4, },
- { "m25p40", 0x202013, 64 * 1024, 8, },
- { "m25p80", 0, 64 * 1024, 16, },
- { "m25p16", 0x202015, 64 * 1024, 32, },
- { "m25p32", 0x202016, 64 * 1024, 64, },
- { "m25p64", 0x202017, 64 * 1024, 128, },
- { "m25p128", 0x202018, 256 * 1024, 64, },
-
- { "m45pe80", 0x204014, 64 * 1024, 16, },
- { "m45pe16", 0x204015, 64 * 1024, 32, },
-
- { "m25pe80", 0x208014, 64 * 1024, 16, },
- { "m25pe16", 0x208015, 64 * 1024, 32, SECT_4K, },
-
- { "n25q128", 0x20ba18, 64*1024, 256, SECT_4K },
-
- /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
- { "w25x10", 0xef3011, 64 * 1024, 2, },
- { "w25x20", 0xef3012, 64 * 1024, 4, },
- { "w25x40", 0xef3013, 64 * 1024, 8, },
- { "w25x80", 0xef3014, 64 * 1024, 16, },
- { "w25x16", 0xef3015, 64 * 1024, 32, },
- { "w25x32", 0xef3016, 64 * 1024, 64, },
- { "w25q32", 0xef4016, 64 * 1024, 64, },
- { "w25x64", 0xef3017, 64 * 1024, 128, },
- { "w25q64", 0xef4017, 64 * 1024, 128, },
- { "w25q128", 0xef4018, 64 * 1024, 256, },
-};
+static struct flash_info __devinitdata m25p_data[] = FLASH_ARRAY(LINUX);
#ifdef CONFIG_ARCH_SPC300
static struct flash_info __devinitdata m25pgeneric =
diff --git a/cleopatre/linux-2.6.25.10-spc300/scripts/cpincludes b/cleopatre/linux-2.6.25.10-spc300/scripts/cpincludes
index af9c76b351..601672f7eb 100755
--- a/cleopatre/linux-2.6.25.10-spc300/scripts/cpincludes
+++ b/cleopatre/linux-2.6.25.10-spc300/scripts/cpincludes
@@ -8,6 +8,8 @@ LINUX_INC=$1/include/asm-arm/arch-spc300
COMMON_INC=$1/../../common/include
COMMON_INC_ASM=$COMMON_INC/asm/arch
MKSIMAGE=$1/scripts/mksimage
+FLASH_DEVICE_DIR=$1/drivers/mtd/devices
+cp -p $COMMON_INC/all_flash.h $FLASH_DEVICE_DIR
cp -p $COMMON_INC/spid_img_desc.h $MKSIMAGE
cp -p -r $COMMON_INC_ASM/* $LINUX_INC
diff --git a/common/include/all_flash.h b/common/include/all_flash.h
index 972b2cedf0..059358abe8 100644
--- a/common/include/all_flash.h
+++ b/common/include/all_flash.h
@@ -24,20 +24,23 @@
#define FIELDS_OPENOCD(name, jedec, sector_sz, sector_nb, args...) \
name, jedec, sector_sz, sector_nb
+#define FIELDS_LINUX(name, jedec, sector_sz, sector_nb, flags, args...) \
+ name, jedec, sector_sz, sector_nb, flags
#define FLASH(type, args...) { GLUE(FIELDS_, type)(args) },
#define FLASH_ARRAY(t) { \
- /* Atmel */ \
- FLASH (t, "at25fs010", 0x1f6601, 32 * 1024, 4, ) \
- FLASH (t, "at25fs040", 0x1f6604, 64 * 1024, 8, ) \
+ /* Atmel
+ * -- some are (confusingly) marketed as "DataFlash". */ \
+ FLASH (t, "at25fs010", 0x1f6601, 32 * 1024, 4, SECT_4K) \
+ FLASH (t, "at25fs040", 0x1f6604, 64 * 1024, 8, SECT_4K) \
\
- FLASH (t, "at25df041a", 0x1f4401, 64 * 1024, 8, ) \
+ FLASH (t, "at25df041a", 0x1f4401, 64 * 1024, 8, SECT_4K) \
\
- FLASH (t, "at26f004", 0x1f0400, 64 * 1024, 8, ) \
- FLASH (t, "at26df081a", 0x1f4501, 64 * 1024, 16, ) \
- FLASH (t, "at26df161a", 0x1f4601, 64 * 1024, 32, ) \
- FLASH (t, "at26df321", 0x1f4700, 64 * 1024, 64, ) \
+ FLASH (t, "at26f004", 0x1f0400, 64 * 1024, 8, SECT_4K) \
+ FLASH (t, "at26df081a", 0x1f4501, 64 * 1024, 16, SECT_4K) \
+ FLASH (t, "at26df161a", 0x1f4601, 64 * 1024, 32, SECT_4K) \
+ FLASH (t, "at26df321", 0x1f4700, 64 * 1024, 64, SECT_4K) \
\
/* Eon */ \
FLASH (t, "en25q32", 0x1c3016, 64 * 1024, 64, ) \
@@ -45,24 +48,29 @@
FLASH (t, "en25q128", 0x1c3018, 64 * 1024, 256, ) \
\
/* Macronix */ \
- FLASH (t, "mx25l3205d", 0xc22016, 64 * 1024, 64, ) \
- FLASH (t, "mx25l64", 0xc22017, 64 * 1024, 128, ) \
- FLASH (t, "mx25l128", 0xc22018, 64 * 1024, 256, ) \
+ FLASH (t, "mx25l3205d", 0xc22016, 64 * 1024, 64, SECT_4K) \
+ FLASH (t, "mx25l6406e", 0xc22017, 64 * 1024, 128, SECT_4K) \
+ FLASH (t, "mx25l128", 0xc22018, 64 * 1024, 256, SECT_4K) \
\
- /* Spansion */ \
+ /* Spansion
+ * -- single (large) sector size only, at least
+ * for the chips listed here (without boot sectors).
+ */ \
FLASH (t, "s25sl004a", 0x010212, 64 * 1024, 8, ) \
FLASH (t, "s25sl008a", 0x010213, 64 * 1024, 16, ) \
FLASH (t, "s25sl016a", 0x010214, 64 * 1024, 32, ) \
FLASH (t, "s25sl032a", 0x010215, 64 * 1024, 64, ) \
FLASH (t, "s25sl064a", 0x010216, 64 * 1024, 128, ) \
\
- /* SST */ \
- FLASH (t, "sst25vf040b", 0xbf258d, 64 * 1024, 8, ) \
- FLASH (t, "sst25vf080b", 0xbf258e, 64 * 1024, 16, ) \
- FLASH (t, "sst25vf016b", 0xbf2541, 64 * 1024, 32, ) \
- FLASH (t, "sst25vf032b", 0xbf254a, 64 * 1024, 64, ) \
+ /* SST
+ * -- large erase sizes are "overlays", "sectors" are 4K. */ \
+ FLASH (t, "sst25vf040b", 0xbf258d, 64 * 1024, 8, SECT_4K) \
+ FLASH (t, "sst25vf080b", 0xbf258e, 64 * 1024, 16, SECT_4K) \
+ FLASH (t, "sst25vf016b", 0xbf2541, 64 * 1024, 32, SECT_4K) \
+ FLASH (t, "sst25vf032b", 0xbf254a, 64 * 1024, 64, SECT_4K) \
\
- /* Micron */ \
+ /* ST Microelectronics
+ * -- newer production may have feature updates. */ \
FLASH (t, "m25p05", 0x202010, 32 * 1024, 2, ) \
FLASH (t, "m25p10", 0x202011, 32 * 1024, 4, ) \
FLASH (t, "m25p20", 0x202012, 64 * 1024, 4, ) \
@@ -77,9 +85,9 @@
FLASH (t, "m45pe16", 0x204015, 64 * 1024, 32, ) \
\
FLASH (t, "m25pe80", 0x208014, 64 * 1024, 16, ) \
- FLASH (t, "m25pe16", 0x208015, 64 * 1024, 32, ) \
+ FLASH (t, "m25pe16", 0x208015, 64 * 1024, 32, SECT_4K) \
\
- FLASH (t, "n25q128", 0x20ba18, 64 * 1024, 256, ) \
+ FLASH (t, "n25q128", 0x20ba18, 64 * 1024, 256, SECT_4K) \
\
/* Winbond */ \
FLASH (t, "w25x10", 0xef3011, 64 * 1024, 2, ) \