# Copyright 2023 hpmicro # SPDX-License-Identifier: BSD-3-Clause flash bank xpi0 hpm_xpi 0x80000000 0x1000000 1 1 $_TARGET0 0xF3040000 proc init_clock {} { $::_TARGET0 riscv dmi_write 0x39 0xF4002000 $::_TARGET0 riscv dmi_write 0x3C 0x1 $::_TARGET0 riscv dmi_write 0x39 0xF4002000 $::_TARGET0 riscv dmi_write 0x3C 0x2 $::_TARGET0 riscv dmi_write 0x39 0xF4000800 $::_TARGET0 riscv dmi_write 0x3C 0xFFFFFFFF $::_TARGET0 riscv dmi_write 0x39 0xF4000810 $::_TARGET0 riscv dmi_write 0x3C 0xFFFFFFFF $::_TARGET0 riscv dmi_write 0x39 0xF4000820 $::_TARGET0 riscv dmi_write 0x3C 0xFFFFFFFF $::_TARGET0 riscv dmi_write 0x39 0xF4000830 $::_TARGET0 riscv dmi_write 0x3C 0xFFFFFFFF echo "clocks has been enabled!" } $_TARGET0 configure -event reset-init { init_clock } $_TARGET0 configure -event gdb-attach { reset halt }