efm32.cfg 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. #
  3. # Silicon Labs (formerly Energy Micro) EFM32 target
  4. #
  5. # Note: All EFM32 chips have SWD support, but only newer series 1
  6. # chips have JTAG support.
  7. #
  8. source [find target/swj-dp.tcl]
  9. if { [info exists CHIPNAME] } {
  10. set _CHIPNAME $CHIPNAME
  11. } else {
  12. set _CHIPNAME efm32
  13. }
  14. # Work-area is a space in RAM used for flash programming
  15. # By default use 2kB
  16. if { [info exists WORKAREASIZE] } {
  17. set _WORKAREASIZE $WORKAREASIZE
  18. } else {
  19. set _WORKAREASIZE 0x800
  20. }
  21. if { [info exists CPUTAPID] } {
  22. set _CPUTAPID $CPUTAPID
  23. } else {
  24. if { [using_jtag] } {
  25. set _CPUTAPID 0x4ba00477
  26. } {
  27. set _CPUTAPID 0x2ba01477
  28. }
  29. }
  30. swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  31. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  32. adapter speed 1000
  33. set _TARGETNAME $_CHIPNAME.cpu
  34. target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
  35. $_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  36. set _FLASHNAME $_CHIPNAME.flash
  37. flash bank $_FLASHNAME efm32 0 0 0 0 $_TARGETNAME
  38. flash bank userdata.flash efm32 0x0FE00000 0 0 0 $_TARGETNAME
  39. flash bank lockbits.flash efm32 0x0FE04000 0 0 0 $_TARGETNAME
  40. if {![using_hla]} {
  41. # if srst is not fitted use SYSRESETREQ to
  42. # perform a soft reset
  43. cortex_m reset_config sysresetreq
  44. }