npcx.cfg 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # script for Nuvoton NPCX Cortex-M4 Series
  3. # Adapt based on what transport is active.
  4. source [find target/swj-dp.tcl]
  5. # Set Chipname
  6. if { [info exists CHIPNAME] } {
  7. set _CHIPNAME $CHIPNAME
  8. } else {
  9. set _CHIPNAME npcx
  10. }
  11. # SWD DAP ID of Nuvoton NPCX Cortex-M4.
  12. if { [info exists CPUDAPID ] } {
  13. set _CPUDAPID $CPUDAPID
  14. } else {
  15. set _CPUDAPID 0x4BA00477
  16. }
  17. # Work-area is a space in RAM used for flash programming
  18. # By default use 32kB
  19. if { [info exists WORKAREASIZE] } {
  20. set _WORKAREASIZE $WORKAREASIZE
  21. } else {
  22. set _WORKAREASIZE 0x8000
  23. }
  24. if { [info exists FIUNAME]} {
  25. set _FIUNAME $FIUNAME
  26. } else {
  27. set _FIUNAME npcx.fiu
  28. }
  29. # Debug Adapter Target Settings
  30. swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUDAPID
  31. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  32. set _TARGETNAME $_CHIPNAME.cpu
  33. target create $_TARGETNAME cortex_m -endian little -dap $_CHIPNAME.dap
  34. $_TARGETNAME configure -work-area-phys 0x200c0000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  35. # Initial JTAG/SWD speed
  36. # For safety purposes, set for the lowest cpu clock configuration
  37. # 4MHz / 6 = 666KHz, so use 600KHz for it
  38. adapter speed 600
  39. # For safety purposes, set for the lowest cpu clock configuration
  40. $_TARGETNAME configure -event reset-start {adapter speed 600}
  41. # use sysresetreq to perform a system reset
  42. cortex_m reset_config sysresetreq
  43. # flash configuration
  44. set _FLASHNAME $_CHIPNAME.flash
  45. flash bank $_FLASHNAME npcx 0x64000000 0 0 0 $_TARGETNAME $_FIUNAME