<commit_before># Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# nuvoton-m4 devices support both JTAG and SWD transports.
#

source [find target/swj-dp.tcl]

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME npcx5m5g
}

if { [info exists ENDIAN] } {
   set  _ENDIAN $ENDIAN
} else {
   set  _ENDIAN little
}

# Work-area is a space in RAM used for flash programming
# By default use 16kB
if { [info exists WORKAREASIZE] } {
   set  _WORKAREASIZE $WORKAREASIZE
} else {
   set  _WORKAREASIZE 0x8000
}

#jtag scan chain
if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x4BA00477
}

#jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position \
		$_CHIPNAME.cpu -work-area-phys 0x200C0000 \
		-work-area-size $_WORKAREASIZE

# JTAG speed
adapter_khz 100

adapter_nsrst_delay 100
if {$using_jtag} {
 jtag_ntrst_delay 100
}

# use srst to perform a system reset
cortex_m reset_config srst

#reset configuration
reset_config trst_and_srst

$_TARGETNAME configure -event reset-start {
	echo "NPCX5M5G Reset..."
	adapter_khz 1000
	halt
}
<commit_msg>flash_ec: openocd-related fix for npcx.cfg<commit_after># Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# nuvoton-m4 devices support both JTAG and SWD transports.
#

source [find target/swj-dp.tcl]

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME npcx5m5g
}

if { [info exists ENDIAN] } {
   set  _ENDIAN $ENDIAN
} else {
   set  _ENDIAN little
}

# Work-area is a space in RAM used for flash programming
# By default use 16kB
if { [info exists WORKAREASIZE] } {
   set  _WORKAREASIZE $WORKAREASIZE
} else {
   set  _WORKAREASIZE 0x8000
}

#jtag scan chain
if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x4BA00477
}

#jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position \
		$_CHIPNAME.cpu -work-area-phys 0x200C0000 \
		-work-area-size $_WORKAREASIZE

# JTAG speed
adapter_khz 100

adapter_nsrst_delay 100
if {[using_jtag]} {
 jtag_ntrst_delay 100
}

# use srst to perform a system reset
cortex_m reset_config srst

#reset configuration
reset_config trst_and_srst

$_TARGETNAME configure -event reset-start {
	echo "NPCX5M5G Reset..."
	adapter_khz 1000
	halt
}

{'fraction_non_alphanumeric': 0.07838983050847458, 'fraction_numerical': 0.03248587570621469, 'mean_word_length': 3.8262350936967633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6680464', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1060, 'n_words': 336}