13 Commits

Author SHA1 Message Date
Kevin O'Connor
f6718291b7 rp2040: Add rp2350 bootrom based chipid and reboot to bootloader code
This adds the bootrom code needed to implement "reboot into
bootloader" and "chipid" capabilities.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-11-14 11:24:47 -05:00
Kevin O'Connor
8a203cf2cb rp2040: Move chipid reading to bootrom.c
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>
2024-11-14 11:24:47 -05:00
Kevin O'Connor
06bb49f135 rp2040: Initial rp2350 support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-11-14 11:17:52 -05:00
Kevin O'Connor
61f81bdb26 rp2040: Use a higher USB PLL internal frequency
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>
2024-11-14 11:17:52 -05:00
Kevin O'Connor
405935f918 rp2040: Rename rp2040_link.lds.S to rpxxxx_link.lds.S
This is in preparation for rp2350 support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-11-13 14:25:59 -05:00
Kevin O'Connor
f1982edcd5 rp2040: Load vectortable into ram
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>
2024-01-25 11:05:11 -05:00
Kevin O'Connor
fe0fc29616 rp2040: Move watchdog code to new watchdog.c file
Move the watchdog code to its own file so that it is easier to disable
it for development builds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-14 19:21:25 -05:00
Kevin O'Connor
8977c4e764 rp2040: Fix watchdog enable
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>
2022-11-19 10:13:50 -05:00
Kevin O'Connor
6485ff800b rp2040: Support CanBoot as bootloader
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-08 09:53:04 -05:00
Kevin O'Connor
18ff84aa04 usb_cdc: Rename usb_request_bootloader() to bootloader_request()
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>
2022-07-29 11:40:54 -04:00
Kevin O'Connor
c5667193c9 rp2040: Initial USB support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor
59fe878241 rp2040: Add initial adc support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor
045bfa4e8d rp2040: Add initial support for the rp2040 mcu
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>
2021-07-04 10:11:02 -04:00