16z: Fix option bits; adjust system clock frequency

This commit is contained in:
Gregory Nutt 2014-01-23 12:06:57 -06:00
parent 07d12a800d
commit 86fd6af866
3 changed files with 21 additions and 31 deletions

View File

@ -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_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_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 *******************************************************************
*

View File

@ -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
***************************************************************************/

View File

@ -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