Skip to content
Permalink
Browse files

soc: same70: Get CPU clock frequency from DTS

The SoC initialization code used system clock frequency
as a CPU clock frequency. This commit corrects that by
obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
  • Loading branch information...
pizi-nordic authored and carlescufi committed Apr 11, 2019
1 parent 8d6f6ba commit 6dca31d78a4fc878b1eb266d5b7610cb4c24e193
Showing with 2 additions and 1 deletion.
  1. +1 −0 soc/arm/atmel_sam/same70/dts_fixup.h
  2. +1 −1 soc/arm/atmel_sam/same70/soc.h
@@ -9,6 +9,7 @@
/* SoC level DTS fixup file */

#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_CPU_CLOCK_FREQUENCY DT_ARM_CORTEX_M7_0_CLOCK_FREQUENCY

#define DT_NUM_MPU_REGIONS DT_ARM_ARMV7M_MPU_E000ED90_ARM_NUM_MPU_REGIONS

@@ -118,7 +118,7 @@
#define DMA_PERID_TC3_RX 43

/** Processor Clock (HCLK) Frequency */
#define SOC_ATMEL_SAM_HCLK_FREQ_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define SOC_ATMEL_SAM_HCLK_FREQ_HZ DT_ARM_CORTEX_M7_0_CLOCK_FREQUENCY
/** Master Clock (MCK) Frequency */
#define SOC_ATMEL_SAM_MCK_FREQ_HZ \
(SOC_ATMEL_SAM_HCLK_FREQ_HZ / CONFIG_SOC_ATMEL_SAME70_MDIV)

0 comments on commit 6dca31d

Please sign in to comment.
You can’t perform that action at this time.