aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/xmc4xxx.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2015-11-29 02:01:29 +0100
committerPaul Fertser <fercerpav@gmail.com>2015-12-18 18:17:06 +0000
commit9693316463b7019c7674d6173e230069e61bf7af (patch)
tree38e20a0016b057d6f9a2d0b0bb655c4cc335778a /src/flash/nor/xmc4xxx.c
parente3a81e2e7bd533d1fbb048d9573d89483da6e830 (diff)
downloadriscv-openocd-9693316463b7019c7674d6173e230069e61bf7af.zip
riscv-openocd-9693316463b7019c7674d6173e230069e61bf7af.tar.gz
riscv-openocd-9693316463b7019c7674d6173e230069e61bf7af.tar.bz2
xmc4xxx: Add XMC4800 support
Tested with EES-AA chip revision on Relax EtherCAT Kit. Change-Id: I457f24d242e0674d1f446c03a329efadff754d6a Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3132 Tested-by: jenkins Reviewed-by: Jeff Ciesielski <jeffciesielski@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'src/flash/nor/xmc4xxx.c')
-rw-r--r--src/flash/nor/xmc4xxx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/flash/nor/xmc4xxx.c b/src/flash/nor/xmc4xxx.c
index d4242a2..9212e43 100644
--- a/src/flash/nor/xmc4xxx.c
+++ b/src/flash/nor/xmc4xxx.c
@@ -181,6 +181,7 @@
/* Flash controller configuration values */
#define FLASH_ID_XMC4500 0xA2
+#define FLASH_ID_XMC4800 0x92
#define FLASH_ID_XMC4100_4200 0x9C
#define FLASH_ID_XMC4400 0x9F
@@ -251,6 +252,10 @@ static const unsigned int sector_capacity_12[12] = {
16, 16, 16, 16, 16, 16, 16, 16, 128, 256, 256, 256
};
+static const unsigned int sector_capacity_16[16] = {
+ 16, 16, 16, 16, 16, 16, 16, 16, 128, 256, 256, 256, 256, 256, 256, 256
+};
+
static int xmc4xxx_write_command_sequence(struct flash_bank *bank,
struct xmc4xxx_command_seq *seq,
int seq_len)
@@ -285,6 +290,9 @@ static int xmc4xxx_load_bank_layout(struct flash_bank *bank)
case 12:
capacity = sector_capacity_12;
break;
+ case 16:
+ capacity = sector_capacity_16;
+ break;
default:
LOG_ERROR("Unexpected number of sectors, %d\n",
bank->num_sectors);
@@ -373,6 +381,10 @@ static int xmc4xxx_probe(struct flash_bank *bank)
bank->num_sectors = 12;
LOG_DEBUG("XMC4xxx: XMC4500 detected.");
break;
+ case FLASH_ID_XMC4800:
+ bank->num_sectors = 16;
+ LOG_DEBUG("XMC4xxx: XMC4800 detected.");
+ break;
default:
LOG_ERROR("XMC4xxx: Unexpected flash ID. got %02" PRIx8,
flash_id);
@@ -971,6 +983,15 @@ static int xmc4xxx_get_info_command(struct flash_bank *bank, char *buf, int buf_
break;
}
break;
+ case 0x800:
+ dev_str = "XMC4800";
+
+ switch (rev_id) {
+ case 0x1:
+ rev_str = "EES-AA";
+ break;
+ }
+ break;
default:
snprintf(buf, buf_size,