Rewrite chipid.c so that it contains just the USB and canbus id
manipulation code. Move the low-level chipid reading to bootrom.c.
Also, introduce a new bootrom_reboot_usb_bootloader() function in
bootrom.c so that the main.c code does not need to know the specifics
of rebooting into the bootrom.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The rp2350 chip requires a higher internal frequency, so choose a
value that works for both rp2040 and rp2350.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Load the interrupt vector table into ram at startup. This reduces the
chance of a flash cache access causing timing instability.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The rp2040 watchdog does not actually reset anything by default. The
psm_hw->wdsel field must be programmed to actually get a reset on a
watchdog failure. Program that field so the watchdog is usable.
Also, disable the watchdog before attempting a reboot into the
bootloader. Otherwise the machine may just reboot a second time due
to a missed watchdog event in the bootloader.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename this board API function to a more generic name. This is in
preparation for calling the function from the canbus code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support the rp2040 (as tested on a Raspberry Pi Pico board). This
adds basic uart, timer, gpio, and watchdog support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>