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

@@ -14,11 +14,8 @@ void enable_pclock(uint32_t reset_bit);
int is_enabled_pclock(uint32_t reset_bit);
uint32_t get_pclock_frequency(uint32_t reset_bit);
void gpio_peripheral(uint32_t gpio, int func, int pull_up);
void reset_to_usb_boot(uint32_t gpio_activity_pin_mask
, uint32_t disable_interface_mask);
void connect_internal_flash(void);
void flash_exit_xip(void);
void flash_flush_cache(void);
void bootrom_reboot_usb_bootloader(void);
void bootrom_read_unique_id(uint8_t *out, uint32_t maxlen);
// Force a function to run from ram
#define UNIQSEC __FILE__ "." __stringify(__LINE__)