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

@@ -17,6 +17,7 @@ src-y += rp2040/main.c rp2040/gpio.c rp2040/adc.c generic/crc16_ccitt.c
src-y += generic/armcm_boot.c generic/armcm_irq.c generic/armcm_reset.c
src-y += generic/timer_irq.c rp2040/timer.c rp2040/bootrom.c
src-$(CONFIG_USBSERIAL) += rp2040/usbserial.c generic/usb_cdc.c
src-$(CONFIG_USBSERIAL) += rp2040/chipid.c
src-$(CONFIG_SERIAL) += rp2040/serial.c generic/serial_irq.c
# rp2040 stage2 building