diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-20 19:29:20 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-20 19:29:20 +0000 |
commit | 524b08c3fcf36eff5114363d4ed889432de1baff (patch) | |
tree | f89b678cd14ff74894b93a97d64c57e17abed82d /nuttx/arch/mips | |
parent | 8812170a7c584b80d8097cdcf6548857be98c30e (diff) | |
download | px4-firmware-524b08c3fcf36eff5114363d4ed889432de1baff.tar.gz px4-firmware-524b08c3fcf36eff5114363d4ed889432de1baff.tar.bz2 px4-firmware-524b08c3fcf36eff5114363d4ed889432de1baff.zip |
Updates to support the Mirtoo internal clocking
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4855 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/mips')
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-config.h | 19 | ||||
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-head.S | 2 | ||||
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h index f2ccd89b0..419cd5250 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h @@ -775,6 +775,25 @@ # error "Unknown board POSC mode" #endif +#undef CONFIG_PIC32MX_FNOSC +#if defined(BOARD_FNOSC_FRC) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRC +#elif defined(BOARD_FNOSC_FRCPLL) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRCPLL +#elif defined(BOARD_FNOSC_POSC) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_POSC +#elif defined(BOARD_FNOSC_POSCPLL) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_POSCPLL +#elif defined(BOARD_FNOSC_SOSC) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_SOSC +#elif defined(BOARD_FNOSC_LPRC) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_LPRC +#elif defined(BOARD_FNOSC_FRCDIV) +# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRCDIV +#else +# error "Unknown board FNOSC selection" +#endif + #undef CONFIG_PIC32MX_FCKSM #if defined(BOARD_POSC_SWITCH) # if defined(BOARD_POSC_FSCM) diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S index 2a6ef39a8..3e9cfeb46 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S @@ -617,7 +617,7 @@ devconfig2: DEVCFG2_UNUSED devconfig1: - .long DEVCFG1_FNOSC_POSCPLL | CONFIG_PIC32MX_FSOSCEN | \ + .long CONFIG_PIC32MX_FNOSC | CONFIG_PIC32MX_FSOSCEN | \ CONFIG_PIC32MX_IESO | CONFIG_PIC32MX_POSCMOD | \ CONFIG_PIC32MX_PBDIV | CONFIG_PIC32MX_FCKSM | \ CONFIG_PIC32MX_WDENABLE | DEVCFG1_UNUSED diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c index 9cf77fb50..d6bc6a812 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c @@ -63,7 +63,7 @@ /* Make sure that the selected clock parameters are sane */ -#define CALC_SYSCLOCK (((BOARD_POSC_FREQ / BOARD_PLL_IDIV) * BOARD_PLL_MULT) / BOARD_PLL_ODIV) +#define CALC_SYSCLOCK (((BOARD_PLL_INPUT / BOARD_PLL_IDIV) * BOARD_PLL_MULT) / BOARD_PLL_ODIV) #if CALC_SYSCLOCK != BOARD_CPU_CLOCK # error "Bad BOARD_CPU_CLOCK calculcation in board.h" #endif |