diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-01-23 12:06:57 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-01-23 12:06:57 -0600 |
commit | 0f41a4f53d274cecef9b85652e2e916cf8bb6eeb (patch) | |
tree | 660f8eafb1ee884d2f0c4f22d3d2d1c19387c3c0 /nuttx/arch/z16 | |
parent | ab692e74533ac5a7ccabe589a09640da5705377e (diff) | |
download | nuttx-0f41a4f53d274cecef9b85652e2e916cf8bb6eeb.tar.gz nuttx-0f41a4f53d274cecef9b85652e2e916cf8bb6eeb.tar.bz2 nuttx-0f41a4f53d274cecef9b85652e2e916cf8bb6eeb.zip |
16z: Fix option bits; adjust system clock frequency
Diffstat (limited to 'nuttx/arch/z16')
-rw-r--r-- | nuttx/arch/z16/src/z16f/chip.h | 32 | ||||
-rw-r--r-- | nuttx/arch/z16/src/z16f/z16f_clkinit.c | 13 | ||||
-rwxr-xr-x | nuttx/arch/z16/src/z16f/z16f_head.S | 9 |
3 files changed, 22 insertions, 32 deletions
diff --git a/nuttx/arch/z16/src/z16f/chip.h b/nuttx/arch/z16/src/z16f/chip.h index e8cfba560..b5fbc8edf 100644 --- a/nuttx/arch/z16/src/z16f/chip.h +++ b/nuttx/arch/z16/src/z16f/chip.h @@ -95,26 +95,28 @@ #define Z16F_FLOPTION2 rom char _flash_option2 _At 0x2 #define Z16F_FLOPTION3 rom char _flash_option3 _At 0x3 -#define Z16F_FLOPTION0_EXTRNRC _HX8(00) /* Bits 6-7: OSC_SEL */ -#define Z16F_FLOPTION0_LOWFREQ _HX8(40) -#define Z16F_FLOPTION0_MEDFREQ _HX8(80) -#define Z16F_FLOPTION0_MAXPWR _HX8(c0) -#define Z16F_FLOPTION0_WDTRES _HX8(20) /* Bit 5 */ -#define Z16F_FLOPTION0_WDTA0 _HX8(10) /* Bit 4 */ -#define Z16F_FLOPTION0_VBOA0 _HX8(08) /* Bit 3 */ -#define Z16F_FLOPTION0_DBGUART _HX8(04) /* Bit 2 */ -#define Z16F_FLOPTION0_FWP _HX8(02) /* Bit 1 */ -#define Z16F_FLOPTION0_RP _HX8(01) /* Bit 0 */ - -#define Z16F_FLOPTION1_RESVD _HX8(f8) /* Bits 3-7: reserved */ +#define Z16F_FLOPTION0_OSCSEL _HX8(c0) /* Bits 6-7: OSC_SEL */ +#define Z16F_FLOPTION0_EXTRNRC _HX8(00) /* 00: On-chip oscillator with ext RC networks */ +#define Z16F_FLOPTION0_LOWFREQ _HX8(40) /* 01: Min. power with very low frequency crystals */ +#define Z16F_FLOPTION0_MEDFREQ _HX8(80) /* 10: Medium power with medium frequency crystals */ +#define Z16F_FLOPTION0_MAXPWR _HX8(c0) /* 11: Maximum power with high frequency crystals */ +#define Z16F_FLOPTION0_WDTRES _HX8(20) /* Bit 5: WDT Reset */ +#define Z16F_FLOPTION0_WDTA0 _HX8(10) /* Bit 4: WDT Always On */ +#define Z16F_FLOPTION0_VBOA0 _HX8(08) /* Bit 3: Voltage Brown-Out Protection Always On */ +#define Z16F_FLOPTION0_DBGUART _HX8(04) /* Bit 2: Debug UART Enable */ +#define Z16F_FLOPTION0_FWP _HX8(02) /* Bit 1: Flash Write Protect */ +#define Z16F_FLOPTION0_RP _HX8(01) /* Bit 0: Read Protect */ + +#define Z16F_FLOPTION1_RESVD _HX8(f8) /* Bits 3-7: Reserved */ #define Z16F_FLOPTION1_MCEN _HX8(04) /* Bit 2: Motor control pins enable */ -#define Z16F_FLOPTION1_OFFH _HX8(02) /* High side OFF */ -#define Z16F_FLOPTION1_OFFL _HX8(01) /* Low side OFF */ +#define Z16F_FLOPTION1_OFFH _HX8(02) /* Bit 1: High side OFF */ +#define Z16F_FLOPTION1_OFFL _HX8(01) /* Bit 0: Low side OFF */ #define Z16F_FLOPTION2_RESVD _HX8(ff) /* Bits 0-7: reserved */ -#define Z16F_FLOPTION3_RESVD _HX8(bf) /* Bits 0-5,7: reserved */ +#define Z16F_FLOPTION3_ROMLESS _HX8(80) /* Bit 7: ROMLESS 16 Select */ #define Z16F_FLOPTION3_NORMAL _HX8(40) /* Bit 6: 1:Normal 0:Low power mode */ +#define Z16F_FLOPTION3_RESVD _HX8(3f) /* Bits 0-5: Reserved */ /* Memory areas ******************************************************************* * diff --git a/nuttx/arch/z16/src/z16f/z16f_clkinit.c b/nuttx/arch/z16/src/z16f/z16f_clkinit.c index 3fd001b0b..d125d6143 100644 --- a/nuttx/arch/z16/src/z16f/z16f_clkinit.c +++ b/nuttx/arch/z16/src/z16f/z16f_clkinit.c @@ -55,19 +55,6 @@ extern _Erom unsigned long SYS_CLK_SRC; extern _Erom unsigned long SYS_CLK_FREQ; #define _DEFCLK ((unsigned long)&SYS_CLK_FREQ) -/* Setup FLASH options at address 0x00000000 */ - -#if 0 /* Setup in z16f_head.S */ -Z16F_FLOPTION0 = (Z16F_FLOPTION0_MAXPWR|Z16F_FLOPTION0_WDTRES|\ - Z16F_FLOPTION0_WDTA0|Z16F_FLOPTION0_VBOA0|\ - Z16F_FLOPTION0_DBGUART|Z16F_FLOPTION0_FWP|\ - Z16F_FLOPTION0_RP); -Z16F_FLOPTION1 = (Z16F_FLOPTION1_RESVD|Z16F_FLOPTION1_MCEN|\ - Z16F_FLOPTION1_OFFH|Z16F_FLOPTION1_OFFL); -Z16F_FLOPTION2 = Z16F_FLOPTION2_RESVD; -Z16F_FLOPTION3 = (Z16F_FLOPTION3_RESVD|Z16F_FLOPTION3_NORMAL); -#endif - /*************************************************************************** * Private Functions ***************************************************************************/ diff --git a/nuttx/arch/z16/src/z16f/z16f_head.S b/nuttx/arch/z16/src/z16f/z16f_head.S index db757d6d7..5c31de8f2 100755 --- a/nuttx/arch/z16/src/z16f/z16f_head.S +++ b/nuttx/arch/z16/src/z16f/z16f_head.S @@ -40,6 +40,7 @@ #include <nuttx/config.h> #include <arch/irq.h> +#include <arch/board/board.h> #include "common/up_internal.h" /************************************************************************** @@ -85,10 +86,10 @@ define FOPTIONSEG, SPACE=ROM, ORG=0 segment FOPTIONSEG - db %FF - db %FF - db %FF - db %FF + db BOARD_FLOPTION0 + db BOARD_FLOPTION1 + db BOARD_FLOPTION2 + db BOARD_FLOPTION3 /************************************************************************** * vectors |