summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-11-13 08:09:40 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-11-13 08:09:40 +0000
commitc6fe02930cf170067e7b6c68d8fbd8e3bc13e915 (patch)
tree376e0b646724ac9408be5cb3f55a3806792339a6 /src
parent1297aafb40e2b1eeaf2e695c928f09a91b5ed429 (diff)
downloadopenocd_libswd-c6fe02930cf170067e7b6c68d8fbd8e3bc13e915.tar.gz
openocd_libswd-c6fe02930cf170067e7b6c68d8fbd8e3bc13e915.tar.bz2
openocd_libswd-c6fe02930cf170067e7b6c68d8fbd8e3bc13e915.tar.xz
openocd_libswd-c6fe02930cf170067e7b6c68d8fbd8e3bc13e915.zip
krzysztof.dziuba Gazeta.pl <krzysztof.dziuba@gazeta.pl> - to add support for flashing of TMS470R1A384
git-svn-id: svn://svn.berlios.de/openocd/trunk@1166 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/flash/tms470.c87
1 files changed, 86 insertions, 1 deletions
diff --git a/src/flash/tms470.c b/src/flash/tms470.c
index c7107b86..0c992a1e 100644
--- a/src/flash/tms470.c
+++ b/src/flash/tms470.c
@@ -95,6 +95,42 @@ const flash_sector_t TMS470R1A288_BANK1_SECTORS[] = {
#define TMS470R1A288_BANK1_NUM_SECTORS \
(sizeof(TMS470R1A288_BANK1_SECTORS)/sizeof(TMS470R1A288_BANK1_SECTORS[0]))
+const flash_sector_t TMS470R1A384_BANK0_SECTORS[] = {
+ {0x00000000, 0x00002000, -1, -1},
+ {0x00002000, 0x00002000, -1, -1},
+ {0x00004000, 0x00004000, -1, -1},
+ {0x00008000, 0x00004000, -1, -1},
+ {0x0000C000, 0x00004000, -1, -1},
+ {0x00010000, 0x00004000, -1, -1},
+ {0x00014000, 0x00004000, -1, -1},
+ {0x00018000, 0x00002000, -1, -1},
+ {0x0001C000, 0x00002000, -1, -1},
+ {0x0001E000, 0x00002000, -1, -1},
+};
+
+#define TMS470R1A384_BANK0_NUM_SECTORS \
+ (sizeof(TMS470R1A384_BANK0_SECTORS)/sizeof(TMS470R1A384_BANK0_SECTORS[0]))
+
+const flash_sector_t TMS470R1A384_BANK1_SECTORS[] = {
+ {0x00020000, 0x00008000, -1, -1},
+ {0x00028000, 0x00008000, -1, -1},
+ {0x00030000, 0x00008000, -1, -1},
+ {0x00038000, 0x00008000, -1, -1},
+};
+
+#define TMS470R1A384_BANK1_NUM_SECTORS \
+ (sizeof(TMS470R1A384_BANK1_SECTORS)/sizeof(TMS470R1A384_BANK1_SECTORS[0]))
+
+const flash_sector_t TMS470R1A384_BANK2_SECTORS[] = {
+ {0x00040000, 0x00008000, -1, -1},
+ {0x00048000, 0x00008000, -1, -1},
+ {0x00050000, 0x00008000, -1, -1},
+ {0x00058000, 0x00008000, -1, -1},
+};
+
+#define TMS470R1A384_BANK2_NUM_SECTORS \
+ (sizeof(TMS470R1A384_BANK2_SECTORS)/sizeof(TMS470R1A384_BANK2_SECTORS[0]))
+
/* ---------------------------------------------------------------------- */
int tms470_read_part_info(struct flash_bank_s *bank)
@@ -193,7 +229,56 @@ int tms470_read_part_info(struct flash_bank_s *bank)
}
break;
- default:
+ case 0x2d:
+ part_name = "TMS470R1A384";
+
+ if ((bank->base >= 0x00000000) && (bank->base < 0x00020000))
+ {
+ tms470_info->ordinal = 0;
+ bank->base = 0x00000000;
+ bank->size = 128 * 1024;
+ bank->num_sectors = TMS470R1A384_BANK0_NUM_SECTORS;
+ bank->sectors = malloc(sizeof(TMS470R1A384_BANK0_SECTORS));
+ if (!bank->sectors)
+ {
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+ (void)memcpy(bank->sectors, TMS470R1A384_BANK0_SECTORS, sizeof(TMS470R1A384_BANK0_SECTORS));
+ }
+ else if ((bank->base >= 0x00020000) && (bank->base < 0x00040000))
+ {
+ tms470_info->ordinal = 1;
+ bank->base = 0x00020000;
+ bank->size = 128 * 1024;
+ bank->num_sectors = TMS470R1A384_BANK1_NUM_SECTORS;
+ bank->sectors = malloc(sizeof(TMS470R1A384_BANK1_SECTORS));
+ if (!bank->sectors)
+ {
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+ (void)memcpy(bank->sectors, TMS470R1A384_BANK1_SECTORS, sizeof(TMS470R1A384_BANK1_SECTORS));
+ }
+ else if ((bank->base >= 0x00040000) && (bank->base < 0x00060000))
+ {
+ tms470_info->ordinal = 2;
+ bank->base = 0x00040000;
+ bank->size = 128 * 1024;
+ bank->num_sectors = TMS470R1A384_BANK2_NUM_SECTORS;
+ bank->sectors = malloc(sizeof(TMS470R1A384_BANK2_SECTORS));
+ if (!bank->sectors)
+ {
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+ (void)memcpy(bank->sectors, TMS470R1A384_BANK2_SECTORS, sizeof(TMS470R1A384_BANK2_SECTORS));
+ }
+ else
+ {
+ LOG_ERROR("No %s flash bank contains base address 0x%08x.", part_name, bank->base);
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+ break;
+
+ default:
LOG_WARNING("Could not identify part 0x%02x as a member of the TMS470 family.", part_number);
return ERROR_FLASH_OPERATION_FAILED;
}