diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-30 22:29:20 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-30 22:29:20 +0200 |
commit | 82125db510b46a0bae1cfe6df769bf671f446790 (patch) | |
tree | c954c5c2a689e6cb2d24c9680778578aae7cedfe /at91lib | |
parent | e927ad57bee4deb1cec236559f2c082342621f4f (diff) |
at91lib: go throguh LowlevelInit even after DFU loader
this makes sure the PLL is set up the way at91lib expects it
Diffstat (limited to 'at91lib')
-rw-r--r-- | at91lib/boards/simtrace/board.h | 3 | ||||
-rw-r--r-- | at91lib/boards/simtrace/board_cstartup.S | 7 | ||||
-rw-r--r-- | at91lib/boards/simtrace/board_lowlevel.c | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/at91lib/boards/simtrace/board.h b/at91lib/boards/simtrace/board.h index 22ca0ea..8e8290d 100644 --- a/at91lib/boards/simtrace/board.h +++ b/at91lib/boards/simtrace/board.h @@ -232,7 +232,8 @@ /// - PINS_ISO7816
/// Smartcard detection pin
-#define PIN_SMARTCARD_CONNECT {1 << 8, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_INPUT, PIO_DEFAULT}
+#define PIN_SMARTCARD_CONNECT {1 << 8, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_INPUT, \
+ PIO_PULLUP|PIO_DEGLITCH}
/// PIN used for reset the smartcard
#define PIN_ISO7816_RSTMC {1 << 7, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
/// Pins used for connect the smartcard
diff --git a/at91lib/boards/simtrace/board_cstartup.S b/at91lib/boards/simtrace/board_cstartup.S index 0752c29..384333d 100644 --- a/at91lib/boards/simtrace/board_cstartup.S +++ b/at91lib/boards/simtrace/board_cstartup.S @@ -130,6 +130,7 @@ resetHandler: /* Set pc to actual code location (i.e. not in remap zone) */
ldr pc, =1f
+#endif /* flash_dfu */
/* Perform low-level initialization of the chip using LowLevelInit() */
1:
@@ -138,12 +139,6 @@ resetHandler: ldr r0, =LowLevelInit
mov lr, pc
bx r0
-#else
- /* explicitly disable the watchdog timer */
- ldr r0, =AT91C_BASE_WDTC
- mov r1, #AT91C_WDTC_WDDIS
- str r1, [r0, #4]
-#endif /* flash_dfu */
/* Initialize the relocate segment */
ldr r0, =_efixed
diff --git a/at91lib/boards/simtrace/board_lowlevel.c b/at91lib/boards/simtrace/board_lowlevel.c index 392b77d..d9b1da8 100644 --- a/at91lib/boards/simtrace/board_lowlevel.c +++ b/at91lib/boards/simtrace/board_lowlevel.c @@ -149,8 +149,10 @@ void LowLevelInit(void) // Watchdog initialization
AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS;
+#if !defined(flash_dfu)
// Remap the internal SRAM at 0x0
BOARD_RemapRam();
+#endif
// Disable RTT and PIT interrupts (potential problem when program A
// configures RTT, then program B wants to use PIT only, interrupts
|