aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/at91sam3.c
AgeCommit message (Collapse)Author
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-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>
2012-03-06SAM3: Add missing architecture names for SAM3S and SAM3NAttila Kinali
Change-Id: Ie2177487d4315219eb364db360cb7f88d2720783 Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/494 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-06SAM3S: correct flash sector sizes.Attila Kinali
Lock region count and sector sizes did not match datasheet. (see 6500C-ATARM-8FE11 "SAM3S Series Datasheet", Table 7-1) Change-Id: Ic511802f96ed03856467a24a6736349205a0576a Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/493 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-29Fix assert to check flash programming offsetAttila Kinali
The assert introduced in 00c864835149a96b431fc8f31dd89542d88fd383 checks whether the programming offset equals to page_size of the flash, while it wants to check whether the offset is a multiple of the page_size. Change-Id: I794d021951a28c1cc520b5eea5d500f097721b06 Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/482 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
2012-02-06build: cleanup src/flash/nor directorySpencer Oliver
Change-Id: Ic299de969ce566282c055ba4dd8b94892c4c4311 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/420 Tested-by: jenkins
2012-01-12cmd: add missing usage varSpencer Oliver
Change-Id: I0f05d643b0801b19cc3beb88f0d12d7e4c83ef9c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/356 Tested-by: jenkins
2012-01-12build: remove unused variablesSpencer Oliver
detected by clang. Change-Id: Id9effcc5437870f37fecd33803f7753c6eca53d6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/361 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-01-04Change return value on error.Mathias K
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-10Work around silicon bug in the SAM3 family flash waitstatesAttila Kinali
* Add flash waitstate support for Atmel SAM3 chips. * Set default waitstates to 6, to workaround a silicon bug in the SAM3 family This code has been tested on SAM3U4, SAM3N4 and SAM3N1 based on Change-Id: I477446f9bfb3e910ea3e2414a6e9a75beb14a214 by Jim Norris <u17263@att.net> Change-Id: I8d360080f6968979ca5e197ad638282cadd18fb7 Signed-off-by: Attila Kinali <attila@kinali.ch> Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/128 Tested-by: jenkins
2011-11-07at91sam3: fix warningsØyvind Harboe
- reduce scope of variables - assert on post condition to fix clang warning Change-Id: Id91038f73a632f9688ba52c9c34eae923626e770 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/160 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-17Add the SAM3N familly to the chip_details tableAttila Kinali
Change-Id: Ic122d324eacf6e667ed6008ebb84708be944222c Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/29 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-08-21Fix Sam3u flash bank 1 issueolivier Schonken
2011-03-30at91sam3: Modified cidr comparisson to ignore version bitsOlivier Schonken
production processor versions increment, thus the version bits should be ignored for future proofing. e.g. Engineering sample version == 0x00, production version 0x01
2011-03-17Fix a bunch of typos.Uwe Hermann
Fix a bunch of typos. Most are in code comments, so nothing should break. UNKOWN_COMMAND and CMD_UNKOWN are not used elsewhere, so correcting the spelling should also not break anything.
2011-01-26Fixed small mistakes in at91sam3 info commandThomas Schmid
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-01-09nit: more LOG_* \n fixesEric Wetzel
Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages Remove LOG_INFO_N LOG_INFO_N was only used once and had a \n at the end Change LOG_USER_N calls that end with \n to LOG_USER
2011-01-05nit: do not add \n at end of LOG_ERROREric Wetzel
Fixed in many other places, and submitted in response to Øyvind's invitation.
2010-12-29warning: fix warning where GCC didn't catch a doubly declared global structureØyvind Harboe
Why hasn't earlier versions of GCC caught this? Bug? Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-11-17FLASH/NOR: Remove useless file at91sam3.hAntonio Borneo
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-09-20warnings: fix alignment warningsØyvind Harboe
These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-25at91sam3s* supportOlaf Lüke
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-17nor/at91sam3: replace helper membufAntonio Borneo
Helper ./src/helper/membuf.c is only used in at91sam3.c 1) Replace membuf with LOG_* 2) The original code in sam3_GetDetails() invalidates all the buffered output of sam3_GetInfo(). The new code skips sam3_GetInfo() if its output should not be printed. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-05-16NOR: add read() callback to struct flash_driverAntonio Borneo
Final target is to force bus_width size during CFI flash read. In this first step I need to replace default flash read with flash specific implementation. This patch introduces: - flash_driver_read() layer; - default_flash_read(), backward compatible; - read() callback in struct flash_driver; - proper initialization in every flash_driver instance. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-02-28ARMv7M: use software breakpoints for algorithmsSpencer Oliver
- armv7m_run_algorithm now requires all algorithms to use a software breakpoint at their exit address - updated all algorithms to support this Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-01-29NOR: cleanup driver declsDavid Brownell
Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-09src/flash/nor: usage/help/doc updatesDavid Brownell
Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace; shrink a few overlong lines; fix some bad indents. Add TODO list entry re full support for NAND/NOR bank names. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-04remove target.h from flash.hZachary T Welch
The flash.h header does not require the target.h header file, but its implementation source files do. Move it to flash/nor/imp.h.
2009-12-03change #include "flash.h" to <flash/flash.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "flash.h" the following form should be used. #include <flash/flash.h> The exception is from .c files in the same directory.
2009-12-03change #include "types.h" to <helper/types.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "types.h" the following form should be used. #include <helper/types.h> The exception is from .c files in the same directory.
2009-12-03change #include "time_support.h" to <helper/time_support.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "time_support.h" the following form should be used. #include <helper/time_support.h> The exception is from .c files in the same directory.
2009-12-03change #include "membuf.h" to <helper/membuf.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "membuf.h" the following form should be used. #include <helper/membuf.h> The exception is from .c files in the same directory.
2009-12-02move nor drivers to src/flash/norZachary T Welch
Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'.