Lines Matching +full:flash +full:- +full:id
4 * SPDX-License-Identifier: Apache-2.0
26 /* On the Atmel SAM SoC series, the device id is located in the flash
27 * controller. The controller can either present the flash area containing
28 * the code, the unique identifier or the user signature area at the flash
29 * location. Therefore the function reading the device id must be executed
31 * code each time the device id is requested, we do this at boot time at save
32 * the 128-bit value into RAM.
37 uint8_t *flash = (uint8_t *)CONFIG_FLASH_BASE_ADDRESS; in hwinfo_sam_read_device_id() local
40 /* Switch the flash controller to the unique identifier area. The flash in hwinfo_sam_read_device_id()
44 efc->EEFC_FCR = EEFC_FCR_FKEY_PASSWD | EEFC_FCR_FCMD_STUI; in hwinfo_sam_read_device_id()
45 while ((efc->EEFC_FSR & EEFC_FSR_FRDY) == EEFC_FSR_FRDY) { in hwinfo_sam_read_device_id()
49 /* Copy the 128-bit unique ID. We cannot use memcpy as it would in hwinfo_sam_read_device_id()
50 * execute code from flash. in hwinfo_sam_read_device_id()
53 sam_uid[i] = flash[i]; in hwinfo_sam_read_device_id()
56 /* Switch back the controller to the flash area and wait for it to in hwinfo_sam_read_device_id()
59 efc->EEFC_FCR = EEFC_FCR_FKEY_PASSWD | EEFC_FCR_FCMD_SPUI; in hwinfo_sam_read_device_id()
60 while ((efc->EEFC_FSR & EEFC_FSR_FRDY) != EEFC_FSR_FRDY) { in hwinfo_sam_read_device_id()
75 fmr = efc->EEFC_FMR; in hwinfo_sam_init()
78 efc->EEFC_FMR = (fmr & (~EEFC_FMR_CLOE)) | EEFC_FMR_SCOD; in hwinfo_sam_init()
81 efc->EEFC_FMR |= EEFC_FMR_SCOD; in hwinfo_sam_init()
84 /* Read the device ID using code in RAM */ in hwinfo_sam_init()
88 efc->EEFC_FMR = fmr; in hwinfo_sam_init()
90 /* Re-enable interrupts */ in hwinfo_sam_init()