Commit Graph

35 Commits

Author SHA1 Message Date
Harald Welte
6dfcf70f63 qmod: Start with _HUB_RESET=0 -> HUB_RESET=1 (not in reset)
Booting with the hub reset active would in turn cut our own power
supply as the hub disables all downstream port power in that case.
2017-01-11 22:23:13 +01:00
Harald Welte
f9a182d24d qmod: breal the command loop when 'U' is pressed and proceed to USB init 2017-01-11 22:22:16 +01:00
Harald Welte
afbb747170 qmod: do not automatically clear _HUB_RESET after EEPROM write
we'd rather have explicit control over that
2017-01-11 22:21:28 +01:00
Harald Welte
e07aed6543 qmod: debug menu: Add 'U' command to proceed to USB 2016-12-22 22:32:15 +01:00
Harald Welte
396354cbdb qmod: debug menu: make sure to always print something 2016-12-22 22:29:57 +01:00
Harald Welte
006b16ddc2 quad-modem: Add debug console commands for debugging 2016-12-22 21:29:41 +01:00
Harald Welte
e974fbb9e5 Issue ST12_PRTPWR_OVERRIDE before putting hub in reset
When we reset the hub, the hub will actively drvie the PRTPWR signal of
the SITMRACE12 low, resulting in the SAM3 being shut off.  If we want to
"survive" this, we need to set the OVERRIDE before we go into reset.

Right now, we never release the signal again, keeping ST12 enabled
permanently, which is of course not what we want in general.
2016-10-19 19:36:07 +02:00
Harald Welte
15e026ec34 qmod: Set PIN_PRTPWR_OVERRIDE to output/low 2016-10-11 17:46:09 +02:00
Harald Welte
4e3b9a5140 qmod: attempt to swithc the DN/DP wires of the SAM3 2016-09-05 14:04:43 +02:00
Harald Welte
67415e3385 HACK: Add EEPROM writing at boot of SAM3 on qmod
This is not for production use, but just for hardware verification
2016-09-01 20:57:56 +02:00
Harald Welte
226b40aba4 WIP: bit-banging I2C support for EEPROM access on QMOD
for now, it just continuously reads the EEPROM bytes and dumps them to
the serial console for testing.
2016-08-21 19:33:24 +02:00
Harald Welte
3bafe43376 dynamically dispatch USART IRQs
The different modes (configurations) will have different interrupt
handlers, so we need to dispatch them via config_func_ptrs
2016-03-20 18:19:12 +01:00
Harald Welte
8ee15dbc2a read SAM3S unique serial number at start and print it 2016-03-20 16:00:39 +01:00
Harald Welte
cf1c19abe0 src_simtrace/main: debug/trace logging improvements 2016-03-20 15:18:18 +01:00
Harald Welte
04e37a8481 firmware/main: Disable the rotor unless TRACE_DEBUG 2016-03-20 15:18:03 +01:00
Harald Welte
2315e6ba07 ensure git version ends up in firmware image 2016-03-19 21:37:55 +01:00
Harald Welte
7dd3dfd992 convert all src_simtrace code to kernel coding style
Let's use the Osmocom standard, based on the Linux kernel standard:
tab-indent and 8-charracter tab width.
2016-03-16 20:45:10 +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
072daddf98 main.c: Only call the configure() function of a configuration if it exists 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
ebbb645f4b req_ctx: Fix allocation (allocate 1 block, not all) and call _init() 2016-02-29 17:57:51 +01:00
Harald Welte
54cb3d017f host_communication/card_emu: adapt to nwe req_ctx / queuing paradignm 2016-02-29 14:12:40 +01:00
Harald Welte
2a6d3afd6c re-introduce req_ctx buffers into the host communication 2016-02-28 19:29:14 +01:00
Harald Welte
2fb5996d30 owhw: fix GPIO definitions (output low level by default) 2016-02-28 12:34:26 +01:00
Harald Welte
8d6a5d8f89 move USBDDriverCallbacks_ConfigurationChanged() to main.c
This alows us to mark simtrace_config as static variable and keep all
code related to this variable local to main.c
2015-11-07 18:27:05 +01:00
Harald Welte
d4c1421c91 conf_func: Mark const and static.
const saves RAM, and static avoids namespace pollution.
2015-11-07 18:25:46 +01:00
Harald Welte
fefd571701 conf_func: Use named struct initializers and named array subscripts
As part of this, we also do away with the '-1' based array subscripts
2015-11-07 18:25:19 +01:00
Harald Welte
15d72cc631 add some comments on the conf_func members 2015-11-07 18:19:06 +01:00
Christina Quast
3d8c093cb2 main: Increase timeout for USB configured state
When the timeout was too small, the main function would infinitely
loop around, restarting the board and waiting for the USB interface
to get configured. But since configuration seems to take more than
one second, it rarely succeeded.
Increasing the timeout makes the USB configuration finish in the
first try.
2015-06-24 16:02:52 +02:00
Christina Quast
560ade3239 main.c: Removed TC_Start/_Stop (was commented out)
Removed FIXME comment
Removed TC_Start, TC_Stop function call, which was commented out anyways.
2015-05-08 16:45:28 +02:00
Christina Quast
9dbf1c90ac main.c: Set green LED when USB is configured 2015-05-06 08:46:32 +02:00
Christina Quast
2379ac8e32 main.c: Removed double declaration of var i 2015-04-16 11:09:37 +02:00
Christina Quast
de68867402 main.c: Reset board if USB not configured 2015-04-12 15:20:57 +02:00
Christina Quast
95d6616ba1 Split init into configure and init
* Implemented configure, init, exit functions:
    When a configuration is changed, interrupts for reset pins
    should be disabled

* Moved variables shared between code files to simtrace.h
2015-04-09 22:38:47 +02:00
Christina Quast
e2dddd5885 Renamed simtrace_src to src_simtrace 2015-04-09 17:40:48 +02:00