From a22f0ac1abb819929d127cf8d832db981c7c6c05 Mon Sep 17 00:00:00 2001 From: Alexander Wachter Date: Thu, 20 Feb 2020 13:33:09 +0100 Subject: [PATCH] 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 --- drivers/hwinfo/hwinfo_sam.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwinfo/hwinfo_sam.c b/drivers/hwinfo/hwinfo_sam.c index ed5cb2c3b70..2408d8a0a6a 100644 --- a/drivers/hwinfo/hwinfo_sam.c +++ b/drivers/hwinfo/hwinfo_sam.c @@ -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();