diff options
author | Paul Fertser <fercerpav@gmail.com> | 2013-07-29 17:22:07 +0400 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-08-07 21:02:51 +0000 |
commit | fccc55225a7f874ee9d795286e9d92dc051b5b9d (patch) | |
tree | 17397d8f71d554e3b2e64d3cfc47b60dd2746144 /src/flash/nor/Makefile.am | |
parent | d998ea40f3a323cfbc7b80d9c9d5057fbc76c6a9 (diff) | |
download | riscv-openocd-fccc55225a7f874ee9d795286e9d92dc051b5b9d.zip riscv-openocd-fccc55225a7f874ee9d795286e9d92dc051b5b9d.tar.gz riscv-openocd-fccc55225a7f874ee9d795286e9d92dc051b5b9d.tar.bz2 |
mdr32fx: support for Milandr's MDR32Fx internal flash memory
This adds example config and flash driver for russian Cortex-M3
microcontroller model.
Run-time tested on MDR32F9Q2I evaluation board; the flash driver
should be compatible with MDR32F2x (Cortex-M0) too but I lack hardware
to test.
There're no status bits at all, the datasheets specifies some delays
for flash operations instead. All being in <100us range, they're hard
to violate with JTAG, I hope. There're also no flash identification
registers so the flash size and type has to be hardcoded into the
config.
The flashing is considerably complicated because the flash is split
into pages, and each page consists of 4 interleaved non-consecutive
"sectors" (on MDR32F9 only, MDR32F2 is single-sectored), so the
fastest way is to latch the page and sector address and then write
only the part that should go into the current page and current sector.
Performance testing results with adapter_khz 1000 and the chip running
on its default HSI 8MHz oscillator:
When working area is specified, a target helper algorithm is used:
wrote 131072 bytes from file testfile.bin in 3.698427s (34.609 KiB/s)
This can theoretically be sped up by ~1.4 times if the helper
algorithm is fed some kind of "loader instructions stream" to allow
sector-by-sector writing.
Pure JTAG implementation (when target memory area is not available)
flashes all the 128k memory in 49.5s.
Flashing "info" memory region is also implemented, but due to the
overlapping memory addresses (resulting in incorrect memory map
calculations for GDB) it can't be used at the same time, so OpenOCD
needs to be started this way: -c "set IMEMORY true" -f
target/mdr32f9q2i.cfg
It also can't be read/verified because it's not memory-mapped anywhere
ever, and OpenOCD NOR framework doesn't really allow to provide a
custom handler that would be used when verifying.
Change-Id: I80c0632da686d49856fdbf9e05d908846dd44316
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1532
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/flash/nor/Makefile.am')
-rw-r--r-- | src/flash/nor/Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am index 45a0c97..080b847 100644 --- a/src/flash/nor/Makefile.am +++ b/src/flash/nor/Makefile.am @@ -21,6 +21,7 @@ NOR_DRIVERS = \ lpc288x.c \ lpc2900.c \ lpcspifi.c \ + mdr.c \ non_cfi.c \ ocl.c \ pic32mx.c \ |