rp2040: add chipid support

The rp2040 doesn't have a chip ID, but the flash chip connected does. We
can get this ID by asking the flash chip directly, but doing so requires
disengaging the XIP layer, performing the interrogation of the flash
chip, and then re-enabling the XIP layer. This gives us a 64-bit unique
ID that we can use as our USB serial number.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
This commit is contained in:
Lasse Dalegaard
2021-07-04 10:24:29 +02:00
committed by Kevin O'Connor
parent 0597210cb9
commit ba958468b7
5 changed files with 171 additions and 4 deletions

View File

@@ -10,5 +10,8 @@ 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);
#endif // internal.h