]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/jedec_flash.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / drivers / mtd / jedec_flash.c
index 94e87cbf004b405cc8e5d9ad80ea2e109e109d79..226e1e418fe3a8a7229869fcff4164bbd1932d2d 100644 (file)
@@ -42,7 +42,7 @@
 #define MANUFACTURER_SST       0x00BF
 
 /* AMD */
-#define AM29DL800BB    0x22C8
+#define AM29DL800BB    0x22CB
 #define AM29DL800BT    0x224A
 
 #define AM29F800BB     0x2258
@@ -170,7 +170,7 @@ struct amd_flash_info {
 #define SIZE_8MiB   23
 
 static const struct amd_flash_info jedec_table[] = {
-#ifdef CFG_FLASH_LEGACY_256Kx8
+#ifdef CONFIG_SYS_FLASH_LEGACY_256Kx8
        {
                .mfr_id         = MANUFACTURER_SST,
                .dev_id         = SST39LF020,
@@ -186,7 +186,7 @@ static const struct amd_flash_info jedec_table[] = {
                }
        },
 #endif
-#ifdef CFG_FLASH_LEGACY_512Kx8
+#ifdef CONFIG_SYS_FLASH_LEGACY_512Kx8
        {
                .mfr_id         = MANUFACTURER_AMD,
                .dev_id         = AM29LV040B,
@@ -216,12 +216,44 @@ static const struct amd_flash_info jedec_table[] = {
                }
        },
 #endif
+#ifdef CONFIG_SYS_FLASH_LEGACY_512Kx16
+       {
+               .mfr_id         = MANUFACTURER_AMD,
+               .dev_id         = AM29LV400BB,
+               .name           = "AMD AM29LV400BB",
+               .uaddr          = {
+                       [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
+               },
+               .DevSize        = SIZE_512KiB,
+               .CmdSet         = CFI_CMDSET_AMD_LEGACY,
+               .NumEraseRegions= 4,
+               .regions        = {
+                       ERASEINFO(0x04000,1),
+                       ERASEINFO(0x02000,2),
+                       ERASEINFO(0x08000,1),
+                       ERASEINFO(0x10000,7),
+               }
+       },
+       {
+               .mfr_id         = MANUFACTURER_AMD,
+               .dev_id         = AM29LV800BB,
+               .name           = "AMD AM29LV800BB",
+               .uaddr          = {
+                       [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
+               },
+               .DevSize        = SIZE_1MiB,
+               .CmdSet         = CFI_CMDSET_AMD_LEGACY,
+               .NumEraseRegions= 4,
+               .regions        = {
+                       ERASEINFO(0x04000, 1),
+                       ERASEINFO(0x02000, 2),
+                       ERASEINFO(0x08000, 1),
+                       ERASEINFO(0x10000, 15),
+               }
+       },
+#endif
 };
 
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
-
 static inline void fill_info(flash_info_t *info, const struct amd_flash_info *jedec_entry, ulong base)
 {
        int i,j;
@@ -275,7 +307,7 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je
                debug ("erase_region_count = %d erase_region_size = %d\n",
                       erase_region_count, erase_region_size);
                for (j = 0; j < erase_region_count; j++) {
-                       if (sect_cnt >= CFG_MAX_FLASH_SECT) {
+                       if (sect_cnt >= CONFIG_SYS_MAX_FLASH_SECT) {
                                printf("ERROR: too many flash sectors\n");
                                break;
                        }