diff --git a/arch/arm/src/sam34/chip/sam4cm_vectors.h b/arch/arm/src/sam34/chip/sam4cm_vectors.h index 09b4f30fca..9afd594ef9 100644 --- a/arch/arm/src/sam34/chip/sam4cm_vectors.h +++ b/arch/arm/src/sam34/chip/sam4cm_vectors.h @@ -64,7 +64,7 @@ UNUSED(SAM_IRQ_RESERVED_7) /* Vector 16+7: Reserved */ VECTOR(sam_uart0, SAM_IRQ_UART0) /* Vector 16+8: Universal Asynchronous Receiver Transmitter 0 */ UNUSED(SAM_IRQ_RESERVED_9) /* Vector 16+9: Reserved */ -//VECTOR(sam_smc, SAM_IRQ_SMC) /* Vector 16+10: Static Memory Controller */ + UNUSED(SAM_IRQ_RESERVED_10) /* Vector 16+10: Unused */ VECTOR(sam_pioa, SAM_IRQ_PIOA) /* Vector 16+11: Parallel I/O Controller A */ VECTOR(sam_piob, SAM_IRQ_PIOB) /* Vector 16+12: Parallel I/O Controller B */ UNUSED(SAM_IRQ_RESERVED_13) /* Vector 16+13: Reserved */ diff --git a/arch/arm/src/sam34/chip/sam_pmc.h b/arch/arm/src/sam34/chip/sam_pmc.h index 6ad528d5a1..c22c2f0bf0 100644 --- a/arch/arm/src/sam34/chip/sam_pmc.h +++ b/arch/arm/src/sam34/chip/sam_pmc.h @@ -414,19 +414,19 @@ /* PMC Programmable Clock Register (0,1,2) */ #define PMC_PCK_CSS_SHIFT (0) /* Bits 0-2: Master Clock Source Selection */ -#define PMC_PCK_CSS_MASK (7 << PMC_PCK_CSS_MASK) -# define PMC_PCK_CSS_SLOW (0 << PMC_PCK_CSS_MASK) /* Slow Clock */ -# define PMC_PCK_CSS_MAIN (1 << PMC_PCK_CSS_MASK) /* Main Clock */ -# define PMC_PCK_CSS_PLLA (2 << PMC_PCK_CSS_MASK) /* PLLA Clock */ +#define PMC_PCK_CSS_MASK (7 << PMC_PCK_CSS_SHIFT) +# define PMC_PCK_CSS_SLOW (0 << PMC_PCK_CSS_SHIFT) /* Slow Clock */ +# define PMC_PCK_CSS_MAIN (1 << PMC_PCK_CSS_SHIFT) /* Main Clock */ +# define PMC_PCK_CSS_PLLA (2 << PMC_PCK_CSS_SHIFT) /* PLLA Clock */ -#if defined(CONFIG_ARCH_CHIP_SAM4S) -# define PMC_PCK_CSS_PLLB (3 << PMC_PCK_CSS_MASK) /* PLLB Clock */ +#if defined(CONFIG_ARCH_CHIP_SAM4CM) || defined(CONFIG_ARCH_CHIP_SAM4S) +# define PMC_PCK_CSS_PLLB (3 << PMC_PCK_CSS_SHIFT) /* PLLB Clock */ #elif defined(CONFIG_ARCH_CHIP_SAM3X) || defined(CONFIG_ARCH_CHIP_SAM3A) || \ defined(CONFIG_ARCH_CHIP_SAM3U) -# define PMC_PCK_CSS_UPLL (3 << PMC_PCK_CSS_MASK) /* UPLL Clock */ +# define PMC_PCK_CSS_UPLL (3 << PMC_PCK_CSS_SHIFT) /* UPLL Clock */ #endif -# define PMC_PCK_CSS_MCK (4 << PMC_PCK_CSS_MASK) /* Master Clock */ +# define PMC_PCK_CSS_MCK (4 << PMC_PCK_CSS_SHIFT) /* Master Clock */ #define PMC_PCK_PRES_SHIFT (4) /* Bits 4-6: Programmable Clock Prescaler */ #define PMC_PCK_PRES_MASK (7 << PMC_PCK_PRES_SHIFT) diff --git a/arch/arm/src/sam34/sam_clockconfig.c b/arch/arm/src/sam34/sam_clockconfig.c index fa830a2fb5..46c10c4704 100644 --- a/arch/arm/src/sam34/sam_clockconfig.c +++ b/arch/arm/src/sam34/sam_clockconfig.c @@ -239,16 +239,16 @@ static inline void sam_pmcsetup(void) //putreg32(PMC_PMMR_MASK, SAM_PMC_PMMR); #endif + /* Setup PLLA and wait for LOCKA */ + + putreg32(BOARD_CKGR_PLLAR, SAM_PMC_CKGR_PLLAR); + sam_pmcwait(PMC_INT_LOCKA); + #ifdef CONFIG_ARCH_CHIP_SAM4CM /* Setup PLLB and wait for LOCKB */ putreg32(BOARD_CKGR_PLLBR, SAM_PMC_CKGR_PLLBR); sam_pmcwait(PMC_INT_LOCKB); -#else - /* Setup PLLA and wait for LOCKA */ - - putreg32(BOARD_CKGR_PLLAR, SAM_PMC_CKGR_PLLAR); - sam_pmcwait(PMC_INT_LOCKA); #endif #ifdef CONFIG_USBDEV