# Copyright (c) 2021,2025 HPMicro # SPDX-License-Identifier: BSD-3-Clause # if { [info exists CHIPNAME] } { set _CHIP $CHIPNAME } else { set _CHIP hpm6750 } set _CPUTAPID 0x1000563D jtag newtap $_CHIP cpu -irlen 5 -expected-id $_CPUTAPID set _TARGET0 $_CHIP.cpu0 target create $_TARGET0 riscv -chain-position $_CHIP.cpu -coreid 0 $_TARGET0 configure -work-area-phys 0x00000000 -work-area-size 0x20000 -work-area-backup 0 targets $_TARGET0 source [file join [file dirname [info script]] hpm_common.cfg] source [file join [file dirname [info script]] hpm_common_csr.cfg] proc release_core1 {} { set chip_rev [sba_read_mem 0x2001FF00] if {$chip_rev != 0x56010100 } { # set start point for core1 sba_write_mem 0xF4002C08 0x20016284 } else { sba_write_mem 0xF4002C08 0x2001660c } # set boot flag for core1 sba_write_mem 0xF4002C0C 0xC1BEF1A9 # release core1 sba_write_mem 0xF4002C00 0x1000 } set _TARGET1 $_CHIP.cpu1 target create $_TARGET1 riscv -chain-position $_CHIP.cpu -coreid 1 $_TARGET1 configure -work-area-phys 0x00000000 -work-area-size 0x20000 -work-area-backup 0 $_TARGET1 configure -event examine-start { release_core1 } $_TARGET1 configure -event reset-deassert-pre { $::_TARGET0 arp_poll release_core1 } proc reset_soc {} { sba_write_mem 0xF40C001C 24000000 }