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>
This commit is contained in:
Kevin O'Connor
2024-10-29 11:51:29 -04:00
parent 58541a799e
commit 8a203cf2cb
4 changed files with 120 additions and 108 deletions

View File

@@ -51,7 +51,7 @@ bootloader_request(void)
try_request_canboot();
// Use the bootrom-provided code to reset into BOOTSEL mode
if (CONFIG_MACH_RP2040)
reset_to_usb_boot(0, 0);
bootrom_reboot_usb_bootloader();
}