drivers: hwinfo: Don't disable CLOE on SAM3x seies

CLOE (Code Loop Optimization) does not exist on SAM3x.
Make the EEFC_FMR_CLOE disable depending on CONFIG_SOC_SERIES_SAM3X.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
This commit is contained in:
Alexander Wachter 2020-02-20 13:33:09 +01:00 committed by Carles Cufí
commit a22f0ac1ab

View file

@ -73,7 +73,13 @@ static int hwinfo_sam_init(struct device *arg)
/* Disable code loop optimization and sequential code optimization. */
fmr = efc->EEFC_FMR;
#ifndef CONFIG_SOC_SERIES_SAM3X
efc->EEFC_FMR = (fmr & (~EEFC_FMR_CLOE)) | EEFC_FMR_SCOD;
#else
/* SAM3x does not have loop optimization (EEFC_FMR_CLOE) */
efc->EEFC_FMR |= EEFC_FMR_SCOD;
#endif
/* Read the device ID using code in RAM */
hwinfo_sam_read_device_id();