summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add private header for ARM11 internals.Zachary T Welch2009-11-084-50/+74
| | | | | | | Reduces confusion about location of associated routines and reduces clutter in the arm11 header. Removes extra whitespace around the lines touched by these changes.
* ARM11: remove exports and forward declsZachary T Welch2009-11-082-164/+138
| | | | | Unneeded exports cause confusion about the module interfaces. Make almost everything static in the arm11.c module.
* ARM: minor simulator cleanupDavid Brownell2009-11-081-25/+49
| | | | | | | | Make several functions be static. Shrink some of the overlong lines. Use pure tab indents in some places that mixed in spaces. This gives a minor object code shrink (about 2% on amd64). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: fix (debug) message priorityDavid Brownell2009-11-081-1/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target.cfg: remove "-work-area-virt 0"David Brownell2009-11-0845-46/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantics of "-work-area-virt 0" (or phys) changed with the patch to require specifying physical or virtrual work area addresses. Specifying zero was previously a NOP. Now it means that address zero is valid. This patch addresses three related issues: - MMU-less processors should never specify work-area-virt; remove those specifications. Such processors include ARM7TDMI, Cortex-M3, and ARM966. - MMU-equipped processors *can* specify work-area-virt... but zero won't be appropriate, except in mischievous contexts (which hide null pointer exceptions). Remove those specs from those processors too. If any of those mappings is valid, someone will need to submit a patch adding it ... along with a comment saying what OS provides the mapping, and in which context. Example, say "works with Linux 2.6.30+, in kernel mode". (Note that ARM Linux doesn't map kernel memory to zero ...) - Clarify docs on that "-virt" and other work area stuff. Seems to me work-area-virt is quite problematic; not every operating system provides such static mappings; if they do, they're not in every MMU context... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Fix vsllink bulk out endpoint parsing.Zachary T Welch2009-11-071-1/+1
|
* Merge branch 'master' of ↵David Brownell2009-11-063-535/+498
|\ | | | | | | ssh://dbrownell@openocd.git.sourceforge.net/gitroot/openocd/openocd
| * Simplify nand indentation.Zachary T Welch2009-11-061-314/+287
| | | | | | | | | | Removes check covered by new nand_command_get_device_by_num helper. Reverses logic of probe check to further reduce indentation.
| * Improve flash indentation.Zachary T Welch2009-11-061-221/+210
| | | | | | | | | | Removes redundant tests and reverses backwards logic to reduce the indentation level in flash.c.
| * Fix arm11 vcr command parsing.Zachary T Welch2009-11-061-0/+1
| |
* | target: don't swap MMU/no-MMU work areasDavid Brownell2009-11-061-16/+17
|/ | | | | | | | | | | | | | | Resolve serious bug inserted by the "target: require working area for physical/virtual addresses to be specified" patch. It forced use of (invalid) virtual addresses when the MMU was disabled, and vice versa. Observed to break at least Cortex-M3, ARM926, ARM7TDMI whenever work areas are used, such as during bulk writes to flash, DDR2, SRAM, and so on. Also, fix overlong lines and whitespace goofs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: shrink offsetsDavid Brownell2009-11-056-8/+8
| | | | | | | | | | | | | | | | | | Move various embedded target structs to the beginnings of their containers ... pretty much the way C++ or Obj-C would for single inheritance. This shrinks code that accesses those embedded structs by letting common offsets use smaller instructions. Sample before/after sizes (on amd64): 17181 312 0 17493 4455 arm920t.o 16810 312 0 17122 42e2 arm920t.o Where the "after" is the smaller number, with this patch over the ones leveraging that embedding knowledge. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: other code uses the new inheritance/nesting schemeDavid Brownell2009-11-056-104/+78
| | | | | | | Remove most remaining uses of target->arch_info from ARM infrastructure, where it hasn't already been updated. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: use the new inheritance/nesting schemeDavid Brownell2009-11-054-125/+51
| | | | | | | Use target_to_armv7a() etc, replacing needless pointer traversals. Stop using X->arch_info scheme in most ARMv7-A and Cortex-A8 code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7TDMI uses the new inheritance/nesting schemeDavid Brownell2009-11-052-70/+28
| | | | | | | | | Use target_to_arm7_9(), replacing needless pointer traversals. Also: remove now-useless contents of arm7tdmi struct; it's almost ready to be removed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM720 uses the new inheritance/nesting schemeDavid Brownell2009-11-051-80/+30
| | | | | | | | Use target_to_arm720(), replacing needless pointer traversals and simplifying a bunch of nasty code. Stop setting arch_info for arm720 type parts, it's not used any longer. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* XScale uses the new inheritance/nesting schemeDavid Brownell2009-11-052-190/+118
| | | | | | | Use target_to_xscale(), replacing needless pointer traversals and simplifying a bunch of code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI uses the new inheritance/nesting schemeDavid Brownell2009-11-052-109/+33
| | | | | | | Replace needless pointer traversals and simplify. Also remove most remaining contents from arm9tdmi struct; it's almost removable. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM966 uses the new inheritance/nesting schemeDavid Brownell2009-11-051-52/+11
| | | | | | Use target_to_arm966(), replacing needless pointer traversals. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM926 uses the new inheritance/nesting schemeDavid Brownell2009-11-051-125/+46
| | | | | | | Use target_to_arm926(), replacing needless pointer traversals and simplifying a bunch of code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* FA526 uses the new inheritance/nesting schemeDavid Brownell2009-11-051-26/+7
| | | | | | Replace needless pointer traversals, simplify. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM920 uses the new inheritance/nesting schemeDavid Brownell2009-11-052-142/+71
| | | | | | | | Use target_to_arm920(), replacing needless pointer traversals and simplifying. Stop setting arm9tdmi->arch_info for arm920 type parts, it's not used any longer. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: use the new inheritance/nesting schemeDavid Brownell2009-11-054-135/+113
| | | | | | | | | | | | Use new target_to_cm3() and target_to_armv7m() inlines, instead of a series of x->arch_info conversions. Remove arch_info, since nothing uses it. Also fix an omission: the Cortex-M3 commands didn't verify that they were operating on that kind of target. Add comment about the ARMv7M version of that omission. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: provide container_of()David Brownell2009-11-0512-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | Provide a cleaner way to handle single inheritance of targets in C, using the same model Linux does: structs containing other structs, un-nested via calls to a "container_of()" macro that are packaged in typesafe inline functions. Targets already use this containment idiom, but make it much more complicated because they un-nest using embedded "void *" pointers ... in chains of up to five per target, which is all pure needless complication. (Example: arm92x core, arm9tdmi, arm7_9, armv4_5 ... on top of the base "target" class.) Applying this scheme consistently simplifies things, and gets rid of many error-prone untyped pointers. It won't change any part of the type model though -- it just simplifies things. (And facilitates more cleanup later on.) Rule of thumb: where there's an X->arch_info void* pointer, access to that pointer can and should be removed. It may be convenient to set up pointers to some of the embedded structs; and shrink their current "*_common" names (annoyingly long). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7TDMI: remove forward declsDavid Brownell2009-11-052-92/+88
| | | | | | | | | | | | The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Also shrink a few overly-long lines with function declarations or definitions; get rid of arm7tdmi_register_commands(), it's not needed (just delegated); minor whitespace declutter. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM720: remove exports and forward declsDavid Brownell2009-11-051-119/+95
| | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make all functions static. Add a short header comment. The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Remove unneeded indirection for the write_memory() method. Make a table static, remove a can't-happen case with nasty exit(). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* FA526: remove exports and forward declsDavid Brownell2009-11-051-60/+56
| | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI: remove forward declsDavid Brownell2009-11-052-58/+69
| | | | | | | | | | | The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Also shrink a few overly-long lines with function declarations or definitions. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM966: remove exports and forward declsDavid Brownell2009-11-052-59/+55
| | | | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Also remove needless arm966e_init_target(), in favor of the arm9tdmi routine to which it delegates its work. This saved over 100 bytes of code on x86_32. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM926: more cleanupDavid Brownell2009-11-051-37/+22
| | | | | | | | | | | | An init_target() wrapper isn't needed, and target_create() can shrink a bit. Add a header comment and some doxygen. Remove arm926ejs_catch_broken_irscan() which has been a NOP for quite a few months now, and in any case duplicates logic in the JTAG core to validate IR capture data. But force the capture mask to 0x0f, so those tests are most effective. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM920: remove exports and forward declsDavid Brownell2009-11-052-112/+150
| | | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. Add a short header comment. The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. This saved almost 900 bytes of code on x86_32; it seems the compiler can leverage its knowledge that these functions are not called from the outside world... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Improve str9xpec command argument parsing.Zachary T Welch2009-11-051-80/+44
|
* Improve str9x config command argument parsing.Zachary T Welch2009-11-051-11/+14
|
* Improve str7x config command argument parsing.Zachary T Welch2009-11-051-12/+9
|
* Improve stm32x.c command argument parsing.Zachary T Welch2009-11-051-35/+20
|
* Improve stellaris.c erase argument parsing.Zachary T Welch2009-11-051-7/+4
|
* Improve pic32mx.c command argument parsing.Zachary T Welch2009-11-051-30/+19
|
* Improve mflash.c command argument parsing.Zachary T Welch2009-11-051-6/+9
|
* Improve lpc3180_nand_controller.c parsing.Zachary T Welch2009-11-051-10/+15
| | | | | This fixes a memory leak in lpc3180_nand_device_command by reordering the malloc to occur after all parsing has completed.
* Improve lpc2900.c command argument parsing.Zachary T Welch2009-11-051-53/+36
|
* Improve lpc288x.c command argument parsing.Zachary T Welch2009-11-051-1/+1
|
* Improve lpc2000.c command argument parsing.Zachary T Welch2009-11-051-8/+5
|
* Improve cfi.c command argument parsing.Zachary T Welch2009-11-051-2/+6
|
* Improve avrf.c command argument parsing.Zachary T Welch2009-11-051-7/+4
|
* Improve orion_nand.c command argument parsing.Zachary T Welch2009-11-051-1/+1
|
* Improve davinci_nand.c command argument parsing.Zachary T Welch2009-11-051-5/+4
|
* Improve at91sam7.c command argument parsing.Zachary T Welch2009-11-051-20/+24
|
* Improve at91sam3.c command argument parsing.Zachary T Welch2009-11-051-11/+6
|
* Improve nand.c command argument parsing.Zachary T Welch2009-11-051-72/+53
|
* Improve flash.c command argument parsing.Zachary T Welch2009-11-051-68/+51
|