Commit Graph

28 Commits

Author SHA1 Message Date
Harald Welte
3f5e3ddffc Change directory structure to align with Atmel softpack
This way we can easily check with 'diff' for differences in our code and
Atmel softpack.  Also, this layout is more suitable for building various
different firmware images (e.g. factory-test, dfu-loader, main
application) for a variety of different boards (simtrace, owhw, qmod).
2017-02-27 14:24:11 +01:00
Harald Welte
7ed6f3bc37 WIP: Introduce USB DFU code from my at91lib DFU port 2017-02-27 09:28:34 +01:00
Harald Welte
6732248f71 Add support for board version reading via ADC 2017-02-10 19:19:48 +01:00
Harald Welte
83207e0cad Add 'mdelay()' function to busy-wait for given number of milli-seconds 2017-02-03 22:22:17 +01:00
Harald Welte
fb3f308f2f board_lowlevel: Clean up PLLA configuration
The PLL setting doesn't depend on the 'qmod' board type but on the
combination of the BOARD_MAINOSC and BOARD_MCK #defines.  So let's
remove the '#ifdef qmod' from the equation.

The only 'qmod' specific part is whether or not to use the internal xtal
oscillator or not.
2017-01-12 18:16:23 +01:00
Harald Welte
7861132fad qmod: Don't violate PLL minimum output frequency
Table 42-31 ofd DOC6500 states that the minimum output frequency of the
PLL is 60 MHz.   The existing qmod code violated this by configuring the
PLL multiplier output to 12*4 = 48 MHz.  Let's use 12*8 = 96 and then
divide that by two to get to the desired 48 MHz.

This might help to resolve the non-working USB on the qmod so far.
2017-01-12 11:07:04 +01:00
Harald Welte
a02b641650 Add support for 'qmod' (quad-modem) board
You can compile the firmware for this new target using 'make
BOARD=qmod'.

The QMOD differs from simtrace+owhw in terms of low-level
initialization, as it has an external 12MHz clock at XIN, thus bypasses
the main oscillator and needs different PLL configuration.
2016-08-21 18:32:12 +02:00
Harald Welte
372f4cc7ba board_lowlevel: Use LED definitions from board.h
... this is more portable.
2016-03-16 22:22:57 +01:00
Harald Welte
7abdb51f8f ringbuffer: Make ring buffer access irq-save
We have to temporarily disable nterrupts when performing rinbuffer
operations, as the ring buffer is used both from IRQ as well as process
context.
2016-03-16 22:22:54 +01:00
Harald Welte
1605564489 ensure USB config numbers always start from 1
Depending on which features (and thus USB configurations) are included
in the firmware, we need to re-define the ordering of the configuration
numbers, as the Atmel USBD driver simply assumes that configurations are
numbered 1..N without any gaps in the sequence.
2016-03-16 20:45:10 +01:00
Harald Welte
40901a0f14 various printf/debug output improvements
... among those is a rotor (\|/-) that is printed by the main loop,
so one can observe if the main loop is still executing or the system
is somehow stuck.
2016-03-16 20:45:09 +01:00
Harald Welte
5e00400a05 board_lowlevel.c: Improve main oscillator initialization
* ensure the PB8/PB9 pins are actually not in GPIO mode, which they
  apparently are on boot-up
* ensure that neither pull-up nor pull-down are enabled on PB8/PB9
* ensure we first start the oscillator, before selecting it

The sum of the above changes seems to make oscillator start-up much more
reliable than before.  The time needed for initialization is now pretty
stable, and the occasional 15-20second clock stabiliziation has not been
observed with this change.
2016-03-16 20:45:09 +01:00
Harald Welte
fde250a54b uart_console.c: Don't redefine constants from board.h 2016-03-02 10:33:11 +01:00
Harald Welte
4678388c3c board_lowlevel: More comments about clock initialization 2016-02-29 19:45:59 +01:00
Harald Welte
390760a006 add board/owhw.c 2016-02-27 16:23:46 +01:00
Christina Quast
4a30a3700b Remove PR define, replace with TRACE_DEBUG
The define PR was introduced to switch quickly between TRACE levels
for specific debug print messages.

Now, it all became debug output, since it is not needed in normal
operation.
2015-05-08 15:34:45 +02:00
Christina Quast
ddb1e7be1a cciddriver.c: Removed loop waiting for host on CCID_Read 2015-04-21 23:02:43 +02:00
Christina Quast
b85f140636 iso7816_4.c: Removed time guard 2015-04-18 15:05:43 +02:00
Christina Quast
4b8149363a iso7816_4.c: CLK div differs for Master and Slave
Attention: Each init function has to enable and disable receiver and
transmitter on its own!
2015-04-17 18:50:25 +02:00
Christina Quast
68cc859870 iso7816_4.c: Moved around lines, only sniffer works 2015-04-16 11:08:32 +02:00
Christina Quast
ec9c09e9b9 Moved global Usart state into usart struct 2015-04-16 10:45:39 +02:00
Christina Quast
fd069dce73 iso7816_4.c: Increased max interations 2015-04-12 13:32:12 +02:00
Christina Quast
e24b9ace89 ISO7816_Init: Initialized with USART
* ISO7816_Init: Takes Usart_info and CLK_SLAVE/CLK_MASTER as param
* ISO7816_SendChar, ISO7816_GetChar: Usart_info is passed
* ISO7816_Set_Reset_Pin function for CCID part
* iso7816_4.c: BOARD_ISO7816_BASE_USART replaced by USART_SIM
* Redundant _ISO7816_Init, _ISO7816_SendChar, _ISO7816_GetChar
    functions removed
* All simtrace modes use iso7816_4.c functions instead of redefined
    _ISO7816_xxx functions
2015-04-10 17:44:49 +02:00
Christina Quast
3eab56e079 ISO7816_Init with more parameters, slave/master clock 2015-04-10 15:38:49 +02:00
Christina Quast
bf464ae566 Moved ccid related files to bord related folders 2015-04-09 19:47:45 +02:00
Christina Quast
c870b52233 iso7816: Hold RST line low for longer time period
Based on the sniff with a logic analyzer the time when the RST line
is holded low by simtrace is too short.
A better timeout value should be searched for later anyways.
2015-04-09 13:31:58 +02:00
Christina Quast
b0bbb1b52e Removed sym links, replaced them with actual folders 2015-04-07 20:04:19 +02:00
Christina Quast
5a67c0fef3 Renamed main folder to firmware 2015-04-07 18:24:06 +02:00