openocd/tcl/chip/atmel/at91/sam9_smc.cfg
Antonio Borneo 573a39b36c tcl: add SPDX tag
For historical reasons, no license information was added to the
tcl files. This makes trivial adding the SPDX tag through script:
	fgrep -rL SPDX tcl | while read a;do \
	sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n
	}' $a;done

With no specific license information from the author, let's extend
the OpenOCD project license GPL-2.0-or-later to the files.

Change-Id: Ief3da306a6e1978de7dfb8f552f9ff23151f9944
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7030
Tested-by: jenkins
2022-06-24 21:54:12 +00:00

58 lines
1.4 KiB
INI

# SPDX-License-Identifier: GPL-2.0-or-later
# Setup register
#
# ncs_read_setup
# nrd_setup
# ncs_write_setup
# set nwe_setup
#
#
# Pulse register
#
# ncs_read_pulse
# nrd_pulse
# ncs_write_pulse
# nwe_pulse
#
#
# Cycle register
#
# read_cycle 0
# write_cycle 0
#
#
# Mode register
#
# mode
# tdf_cycles
proc sam9_smc_config { cs smc_config } {
;# Setup Register for CS n
set AT91_SMC_SETUP [expr {$::AT91_SMC + 0x00 + $cs * 0x10}]
set val [expr {$smc_config(nwe_setup) << 0}]
set val [expr {$val | $smc_config(ncs_write_setup) << 8}]
set val [expr {$val | $smc_config(nrd_setup)) << 16}]
set val [expr {$val | $smc_config(ncs_read_setup) << 24}]
mww $AT91_SMC_SETUP $val
;# Pulse Register for CS n
set AT91_SMC_PULSE [expr {$::AT91_SMC + 0x04 + $cs * 0x10}]
set val [expr {$smc_config(nwe_pulse) << 0}]
set val [expr {$val | $smc_config(ncs_write_pulse) << 8}]
set val [expr {$val | $smc_config(nrd_pulse) << 16}]
set val [expr {$val | $smc_config(ncs_read_pulse) << 24}]
mww $AT91_SMC_PULSE $val
;# Cycle Register for CS n
set AT91_SMC_CYCLE [expr {$::AT91_SMC + 0x08 + $cs * 0x10}]
set val [expr {$smc_config(write_cycle) << 0}]
set val [expr {$val | $smc_config(read_cycle) << 16}]
mww $AT91_SMC_CYCLE $val
;# Mode Register for CS n
set AT91_SMC_MODE [expr {$::AT91_SMC + 0x0c + $cs * 0x10}]
set val [expr {$smc_config(mode) << 0}]
set val [expr {$val | $smc_config(tdf_cycles) << 16}]
mww $AT91_SMC_MODE $val
}