mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
37f35f8c91
machine/rp2350: add support * add linker scripts for rp2350 * add bootloader * begin melding rp2040 and rp2350 APIs * add UART * add rp2350 boot patching * Fix RP2350 memory layout (#4626) * Remove rp2040-style second stage bootloader. * Add 'minimum viable' IMAGE_DEF embedded block * Create a pico2 specific target * Implement rp2350 init, clock, and uart support * Merge rp2 reset code back together * Separate chip-specific clock definitions * Clear pad isolation bit on rp2350 * Init UART in rp2350 runtime * Correct usb/serial initialization order * Implement jump-to-bootloader * test: add pico2 to smoketests --------- Signed-off-by: deadprogram <ron@hybridgroup.com> Co-authored-by: Matthew Mets <matt.mets@cibomahto.com> Co-authored-by: Matt Mets <matt@blinkinlabs.com> Co-authored-by: deadprogram <ron@hybridgroup.com>
32 lines
675 B
Go
32 lines
675 B
Go
//go:build rp2040 || rp2350
|
|
|
|
package machine
|
|
|
|
import (
|
|
"device/rp"
|
|
"unsafe"
|
|
)
|
|
|
|
var resets = (*rp.RESETS_Type)(unsafe.Pointer(rp.RESETS))
|
|
|
|
// resetBlock resets hardware blocks specified
|
|
// by the bit pattern in bits.
|
|
func resetBlock(bits uint32) {
|
|
resets.RESET.SetBits(bits)
|
|
}
|
|
|
|
// unresetBlock brings hardware blocks specified by the
|
|
// bit pattern in bits out of reset.
|
|
func unresetBlock(bits uint32) {
|
|
resets.RESET.ClearBits(bits)
|
|
}
|
|
|
|
// unresetBlockWait brings specified hardware blocks
|
|
// specified by the bit pattern in bits
|
|
// out of reset and wait for completion.
|
|
func unresetBlockWait(bits uint32) {
|
|
unresetBlock(bits)
|
|
for !resets.RESET_DONE.HasBits(bits) {
|
|
}
|
|
}
|