aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2012-09-26Added SPIFI flash driver, algorithms, and docsGeorge Harris
Added a flash driver designed to allow program/erase of memory-mapped SPI flash chips for LPC43xx/LPC18xx family micros. This driver includes three algorithms - erase, write, and SPIFI peripheral initialization (to allow memory-mapped access after a reset). The driver has been added to the flash driver table (drivers.c), and the OpenOCD documentation has been updated to include the flash driver configuration command. Change-Id: I79f4ff8f1f07de4e5f2fe4f8c23aeb903f868514 Signed-off-by: George Harris <george@luminairecoffee.com> Reviewed-on: http://openocd.zylin.com/783 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-26SPI nor drivers refactorGeorge Harris
Moved common SPI flash driver code (device table, common commands) into flash/nor/spi.c and spi.h. Updated flash/nor/stmsmi.c to reflect this refactor. Change-Id: I141644b0af71d3835f29f06dd15b505a00e5b6ec Signed-off-by: George Harris <george@luminairecoffee.com> Reviewed-on: http://openocd.zylin.com/782 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-07stlink: issue error for stm32 option writingSpencer Oliver
The stlink interface currently does not support 16bit read/writes. Until a fix is included we issue a error that this is unsupported. Change-Id: I4552cf2bd3b29e90ecc905325b743c08e2b92d67 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/808 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-07flash: fix sam3 page read/write address computation errorChuen Chou
In at91sam3.c for Atmel SAM3 flash support, there are arithmetic errors in the functions sam3_page_read() and sam3_page_write(). Address locations are computed incorrectly due to an extra addition operation. This leads to memory locations being skipped during flash writes and reads. Smaller programs are written successfully into flash, with memory gaps, while larger programs of legitimate size fail because the skipped memory is not utilized and therefore unavailable. The changes address this condition, and have been tested with an Atmel SAM3X-EK evaluation board. Change-Id: I9ea3b9ed0130b71cbc32b2294e31a6a2bc71b47a Signed-off-by: Chuen Chou <zhouquan27@gmail.com> Reviewed-on: http://openocd.zylin.com/806 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Pic32mx: make row programming work with any offsetSalvador Arroyo
In function pic32mx_write_block() if the parameter offset is not a multiple of row size the row offset (offset % row_size) will be ignored by the flash controller, shifting the code to the beginning of the row. Word programming gets it right. Change-Id: I134913e3d533688f791bbcb0c6e8983524197f3c Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/796 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29kinetis: bugfix in kinetis_write() fallback pathAndreas Fritiofson
Offset calculation into buffer was wrong and code would read outside buffer if count was not a multiple of four. Change-Id: Ied625b10221423d5a5f25d27ce1edd8c2c3eca8a Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/749 Reviewed-by: Peter Stuge <peter@stuge.se> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29kinetis: ensure flash writes are not truncatedChristopher Kilgour
The number if longwords or "sections" (Freescale term) written for a Kinetis flash write (4, 8, or 16 bytes depending on the part density/granularity) are now rounded up to ensure there are no truncations when the desired write is not a multiple of the minimum write size. Change-Id: I8db40a8769d8ac5393a46cbf4e5ff0df82faf916 Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/738 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Patch: Make pic32mx unlock work at higher scan frequenciesSalvador Arroyo
For example in a pic32mx220, pic32mx unlock don't work if adapter_khz is set to 5000 or more. A short delay after asserting reset fix the problem. Change-Id: I62e493edfcea585c36c8de77a969cebac7227b96 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/790 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24cfi: fix type-punning warnings in cfi_spansion_write_blockAndreas Fritiofson
Retest the condition when needed, instead of abusing the common_magic field as a flag. There are only two options here. Either it's an armv7m or it's another arm. is_arm(...) will return true even for armv7m, so it's imperative to check in the right order. Change-Id: Ic227f19f7babf1b0b0fe075f9a3abc4eabc7d5f1 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/779 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24build: fix clang warningsMartin Nowak
Change-Id: I3c6a63a18034535f0a8c2c62ba8a708f09d7839b Signed-off-by: Martin Nowak <dawg@dawgfoto.de> Reviewed-on: http://openocd.zylin.com/765 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24flash: remove lpc2000 clang warningsSpencer Oliver
By Initialising the param_table we remove the clang warning's. We are also make sure we are not passing any rogue values to lpc2000_iap_call. Change-Id: Idb3b0077d1dae5f03dedab1d46d01140fe9ffb10 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/777 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24tcl: fix potential memory leaksSpencer Oliver
Reorder to allocate all memory after COMMAND_PARSE_NUMBER call. This removes a clang warning about un-released memory Change-Id: I8dbeb664a6467077157015bd879bc0aefc5e8614 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/776 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24build: fix memory leaksSpencer Oliver
Fix the memory leaks found by clang-3.1 Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/775 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24flash: fix FC_FLEX_RAM class code pathSpencer Oliver
If the flash class was defined as FC_FLEX_RAM then this would always drop through to the default handler. This bug was found by clang, so untested. Change-Id: I2d9fe6415dd216728a145519400f7b9ef1bd3c3a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/773 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-08-01flash: stm32f1x: Pad odd byte writes early to avoid 16-bit writesAndreas Fritiofson
For odd byte counts, stm32x_write() pads the last byte and writes it using a discrete 16-bit access. The stlink debugger can't issue 16-bit writes so it fails for odd byte writes. This patch changes stm32x_write() to pad odd byte writes into a new buffer and use the normal code path with a single block write. The fallback path, when working area cannot be allocated, has to use 16-bit writes though which means that sufficient working area is required for stlink and odd byte writes. Change-Id: I4c5dc456300b6e1056f76b0095be8aceee3e954f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/756 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: reduce code duplication in stm32 flash probeAndreas Fritiofson
Remove a lot of the repetitive code in stm32f1x flash probe by converting the large if-selector to a switch, moving the common checks outside it and concentrating the failure handling to a single point. Do the same with stm32f2x and stm32lx for consistency. Change-Id: Ic0ecfb1533c49f5d2108cda5fd20c8372d7c71ef Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/746 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: fix stm32 flash driver typo'sSpencer Oliver
Change-Id: I37f3fee063d7f8729e057dcfe8904651790439e6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/745 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: handle zero when reading stm32 flash size regSpencer Oliver
Some variants read 0 for the flash size register, rather than failing lets assume we have max flash fitted. Change-Id: Ie1fb4e73606f49268a6fd5921c3aef75bc4790d3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/744 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: stm32l handle flash size read failureSpencer Oliver
Rather than failing if the flash size reg cannot be read lets assume we have the max flash size fitted. It is quite common on early ST silicon to not correct support this register. Change-Id: Ife058d60ae0027faad2c929ebd5b7fe2ef27234d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/743 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: add stm32l Revision X supportSpencer Oliver
Revision X is not mentioned in the latest RM0038 rev5, however it has been confirmed correct by ST using ST-LINK Utilty. Change-Id: I65210e512ea25818a1d0d3b223502ebd7535b29d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/742 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-30flash: don't write to FLASH_CR in stm32x_write_blockAndreas Fritiofson
It's unnecessary and prevents reusing this function to fix option byte writes. Also try to disable flash writing after an error. Change-Id: Ib5a7b768a1523e6b8da1555126fef4c1e60ab083 Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/479 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-07-11flash: add stm32f3x supportSpencer Oliver
add support for the new stm32f3x family from stmicro: http://www.st.com/stm32f3 Change-Id: Icd1db95bb2767d9c0ecef24deefa92b4fdaa4f14 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/735 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-06-26topic: flash: description/id added for ATSAM3SD8CMike Crowe
New flash description for ATSAM3SD8C used on SAM3S-EK2 development boards. Name used is "at91sam3sd8c" and chipid is 0x29ab0a60. Mirrors description of other similar parts. Change-Id: I7fc4b82e7969451645ab067223663f08b76d866b Signed-off-by: Mike Crowe <mpcrowe@gmail.com> Reviewed-on: http://openocd.zylin.com/684 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-06-26Changed SAM4S Erase for effective Sector eraseOlivier Schonken
In the previous iteration, the page counter for erases would not be updated with the erase size. This patch keeps the page counter synced with the sector counter. Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Change-Id: I95e56a3257b2ad8301c9f28167b842fa6466334f Reviewed-on: http://openocd.zylin.com/686 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-06-26kinetis: update support for all program flash granularitiesChristopher Kilgour
Updates the Kinetis NOR flash support to handle all known block and sector sizes. Previously only 2kiB sectors were hard-coded, now all four known combinations non-volatile sector sizes are supported. The premise of separating Kinetis Program Flash (PFLASH) from FlexNVM is also introduced. This means each "block" of flash (in Freescale terms) is treated as a bank in OpenOCD. Correspondingly, the existing board configuration for the TWR-K60M512 eval system is updated to recognize two banks instead of one. A board config for the TWR-K60F120M is also added. Bank and sector erase and programming has been checked with both of the mentioned eval boards. Change-Id: Iae2d10ebf8f548d0a3698df5430bbbe1ccadc58a Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/663 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Jan Dakinevich <jan.dakinevich@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-06-26AT91SAM7 Flash: fixed redundant assignation warningMirela Tauciuc
Change-Id: Iffacdce9ce90c4ea7e0c8647860a0056b952f387 Signed-off-by: Mirela Tauciuc <mirela.tauciuc@gmail.com> Reviewed-on: http://openocd.zylin.com/691 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-05-21flash/nor/driver.h: typo fixChristopher Kilgour
Change-Id: Ie260f3c38b648e66958c014658bb6860171a7cc9 Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/653 Tested-by: jenkins Reviewed-by: Bill Traynor <wmat@alphatroop.com> Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-05-14flash: blank check use default_flash_blank_checkSpencer Oliver
Use default_flash_blank_check, this will use the much faster blank_check_memory handler if supported - 15x quicker on stm32f4. Otherwise it will fall back to using the slower default_flash_mem_blank_check. Change-Id: Ia231b3e95468c9e92594dbdbe1fa2d69e1506fc3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/632 Tested-by: jenkins
2012-05-14flash: fix protect check for pic32mx1x/2x familySpencer Oliver
Change-Id: Ib2692d8b79e52cd40f429008047494aa7f552984 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/612 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-05-14cfi: fix write_bank segfault with spansion flash on armv7mAurelien Jacobs
cfi_spansion_write_block() passes an arm_algorithm struct to target_run_algorithm() which in turn calls armv7m_start_algorithm() which expect an armv7m_algorithm struct. As armv7m_algorithm is bigger than arm_algorithm, when armv7m_start_algorithm() writes in the struct, it overrun the buffer, writting junk on the stack, which latter on generates a segfault. This patch ensure we use a properly sized armv7m_algorithm struct when the target is an armv7m. Change-Id: I4ab67c15ae4bb72454414a81b92a4231dcdb2239 Signed-off-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-on: http://openocd.zylin.com/623 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-05-14cfi: fix cfi arch check regressionSpencer Oliver
seems 9933fa334de551096674d4044ed7ac2152213e8b introduce a regression if the target was anything other than armv4_5 or armv7m. Just check that we have an arm target. Change-Id: I67c05138e5be2952ee92e9bfa15e1d050844462a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/615 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org>
2012-05-14cfi: check supported archSpencer Oliver
check that the cfi driver supports the current target arch. Change-Id: I8a95908684de67bf1657d1956f2573662a641cc1 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/614 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org>
2012-05-14build: use generic name for arm_algorithm varsSpencer Oliver
This makes the code a bit easier to read as arm_algorithm can refer to other arch's, not just armv4_5. Change-Id: I78c99d40f34cda04e06f2daee75b48ff40a1d23d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/613 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-08flash: use correct stm32f0 flash size registerSpencer Oliver
The stm32f0 parts use a different address then the rest of the family. Add a function that returns the correct FLASH_SIZE reg depending on variant. Change-Id: Idb41580f7162f395b347cec034d6b745847326b7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/601 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-04build: remove clang unused variable assignment warningsSpencer Oliver
Change-Id: Ibe5254704d6cd879a318a82c4f50d9da3c14276c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/600 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-04build: remove clang unused variable increments warningsSpencer Oliver
Change-Id: Ib755474aa46f7233495fae1947bc27cd0b2d6b4f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/599 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-04-30flash: update stm32f0x version infoSpencer Oliver
Change-Id: Iab0962021e6243d1df3e7c647654a51b4bf50d72 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/578 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-04-26SAM3X - Added support for at91sam3x8h-ES, fixed CIDR for ES2 and productionOlivier Schonken
The first available devkits for the at91sam3x8h had the ES device populated. The ES device had an error in the CIDR, specifically in the last byte of which the upper 3 bits identifies the chip family - cortex-m3, arm7tdmi etc. The problem was fixed on the ES2 devices - Thanks to Pat Hickey for giving me the heads-up. Change-Id: I13dd7fbe0cffaf76f948188c9459dc3cf4435570 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/575 Tested-by: jenkins Reviewed-by: Jim Norris <u17263@att.net> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-04-26topic: Added support for the SAM4S variantsOlivier Schonken
Atmel introduced 6 new Cortex-M4 processors on 2011-10-26 SAM4S16C - 1024KB flash LQFP100/BGA100 SAM4S16B - 1024KB flash LQFP64/QFN64 SAM4S16A - 1024KB flash LQFP48/QFN48 SAM4S8C - 512KB flash LQFP100/BGA100 SAM4S8B - 512KB flash LQFP64/QFN64 SAM4S8A - 512KB flash LQFP48/QFN48 The SAM4S processors still suffer from the "6 waitstates needed to program device" errata. Other relevant changes are: 1. Address of flash memory starts at 0x400000. 2. EWP (Erase page and write page) only works for the first two 8KB "sectors" 3. Because of the EWP not working for all the sectors, normal page writes have to be used. The default_flash_blank_check is used to check if lockregions should be erased. 4. The EA (Erase All) command takes 7.3s to complete. (Previous timeout was 500 ms) 5. There are 128 lockable regions of 8KB each. Implemented default blank checking, and page erase for load_image scenarios. This is to compensate for the EWP flash commands only working on the first 2 8KB sectors. Change-Id: I7c5a52b177f7849a107611fd0f635fc416cfb724 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/528 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-04-24topic: Fixed a clang Dead assignment warning.Linus Tolke
The value returned from target_write_buffer is still ignored. Change-Id: Icb49d4d1313a5e4f7df68d3f122a5f81cfa0604a Signed-off-by: Linus Tolke <linus@tigris.org> Reviewed-on: http://openocd.zylin.com/596 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-13STM32L: Write partial-page flash data after full-page dataMathias K
The target address for the partial data needs to be bumped past the full page data. Otherwise, the partial data overwrites the start of the flash block. Change-Id: I1246b2fa8acbdb8193edcf7029309f11d1c6069c Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/555 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-04-10topic: add reset functions for SWDSimon Qian
Add swd_init_reset and swd_add_reset. Add adapter_assert_reset and adapter_deassert_reset, and call them instead of JTAG reset functions. Change-Id: Ib2551c6fbb45513e0ae0dc331cfe3ee3f922298a Signed-off-by: Simon Qian <simonqian.openocd@gmail.com> Reviewed-on: http://openocd.zylin.com/526 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-30topic: Flash support for Pic32mx1xx/2xxSalvador Arroyo
Change-Id: I496cb745fb1eb5c9159471838013b8d19418f5c0 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/500 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-19Add warn message if no flash bank found for the current image address.Mathias K
Add a warn message to inform the user that something is wrong with the flash settings or command parameters. Change-Id: Ia55868b2abf2a17845e51620b0f29b2809d841c2 Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/280 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-14flash: Fix flash write algorithm on pflash only devices.Mathias K
This patch fix the slow flash write issue on pflash only devices. The Family Reference Manual says: For devices with FlexNVM: FlexRAM For devices with program flash only: Programming acceleration RAM So the acceleration RAM is available for the flash section command on this device. Change-Id: If6541a23a4457c5ed8858848a145f35cac63138b Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/509 Tested-by: jenkins Reviewed-by: Tomas Frydrych <tf+openocd@r-finger.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-13topic: Added support for the SAM3X/A variantsOlivier Schonken
Atmel introduced 7 new Cortex-M3 processors on 2012-02-28 SAM3X4C - 256KB flash SAM3X4E - 256KB flash SAM3X8C - 512KB flash SAM3X8E - 512KB flash SAM3X8H (Only on dev-kit - not in production...) - 512KB flash SAM3A4C - 256KB flash SAM3A8C - 256KB flash The SAM3X/A processors still suffer from the "6 waitstates needed to program device" errata. The CIDR address for the SAM3X/A processors are different from the other SAM3 processors. Unfortunately, the chip identification register is not at a constant address across all of the SAM3 series'. As a consequence, a simple heuristic is used to find where it's at... If the contents at the first address is zero, then we know that the second address is where the chip id register is. We can deduce this because for those SAM's that have the chip id @ 0x400e0940, the first address, 0x400e0740, is located in the memory map of the Power Management Controller (PMC). Furthermore, the address is not used by the PMC. So when read, the memory controller returns zero. Another interesting change is the flash bank address for flash bank 1. It is not fixed at 0x00100000 like the Sam3U. Bank 1 of the at91sam3a/x series starts at 0x00080000 + half the total flash size. Thus for the 256KB devices Bank 1 is located at 0x000A0000, and for the 512KB devices Bank 1 is located at 0x000C0000. The configuration files for the SAM3X/A processors will follow Change-Id: I6c3a707c00e05d993a2ad1d5a423f23b37ffd553 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/505 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-11flash: retire unused eCos flash driverØyvind Harboe
even the AT91EB40a's flash is covered by CFI and nobody ever submitted any other drivers based on eCos code. It's just possible that this idea was missing documentation and "marketing", but it's in git if somebody wants to resurrect it. Change-Id: I66449aa6e0997301f9d67f28098789bfc891d6e9 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/502 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-03-06flash: stm32f1x: add a couple missing stm32x_get_flash_regSzymon Modzelewski
Change-Id: I163de2c1bd962e7ea9ca6c741c1c62224c210677 Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com> Reviewed-on: http://openocd.zylin.com/486 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-06flash: Additional check for NULL in str9xpec enable_turboFredrik Hederstierna
Change-Id: Ifde8783b27c64e4a4bbea180cfa2c86f6a9fe49a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/496 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-03-06SAM3: Remove unused reference to SUPC registersAttila Kinali
The SUPC (Supply Controller) registers are on different base addresses on different SAM3 chips: SAM3U: 0x400e1210 SAM3N: 0x400e1410 SAM3S: 0x400e1410 This creates a problem with the sam3_reg_list array which is const, but would need to be changed at runtime to account for this variability. As this register is not used anywhere, it's simplest to just remove it. Change-Id: I987eb371648d826aa6d5e9de18d38c7bb66d6fca Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/495 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>