Commit Graph

69 Commits

Author SHA1 Message Date
Harald Welte 373c172ab8 convert from u_int*_t to uint*_t
Change-Id: I33f6383535c5860b833f7ccb9bea122d38f28e3f
2017-03-17 22:20:04 +01:00
Min Xu 478c2332b7 Allow some USB interrupts to be handled during dbgu_append 2014-11-11 22:30:55 +01:00
Min Xu 8701086cac Retrieve + print previous PC from stack to debug wdog/spurious IRQ
Retrive previous PC from the stack before entering specific interrupt
handler routines.  Allow user to trace where interrupt occured: e.g.
WatchDog and Spurious interrupt

Prior to this change, spurious interrupt would occur so much (observed
via gdb/remote debug) so it appears that the board stalled.  Once a
custom spurious interrupt installed, the code continues after the
interrupt instead of re-entering the interrupt.
2014-11-11 22:30:55 +01:00
Min Xu 9662f2830a change number + qty of small/large req_ctx 2014-11-11 22:30:54 +01:00
Min Xu 4b98ba5d1c pcd_enumerate: More complete USB endpoint resetting 2014-11-11 22:30:54 +01:00
Min Xu 3cd467a8ef req_ctx: Keep statistic about number of req_ctx in given state
... and print this from a debug statement.
2014-11-11 22:30:54 +01:00
Min Xu 04403a7c8b usbcmd_generic: Add missing \r to DEBUGP() 2014-11-11 22:30:54 +01:00
Min Xu 82cb631bf9 watchdog: print watchdog expiration even in non-debug builds 2014-11-11 22:30:54 +01:00
Min Xu e39637e1b8 pcd_enumerate: Avoid disabling interrupt during endpoint refill
The old implementation has a big local_irq_save() / restore() around the
endpoint re-fill routine.  This disables interrupts for a long time,
psossibly causing lost interrupts.

The new implementation works around this by disabling the USB (UDP)
interrupt only, rather than disabling all interrupts on the system.
2014-11-11 22:30:54 +01:00
Min Xu ca4e80551b dbgu: make debug routines re-entrant 2014-11-11 22:30:54 +01:00
Min Xu ec975220d0 req_ctx: Change number of small / large req_ctx 2014-11-11 22:30:54 +01:00
Min Xu b6b2c7d482 req_ctx: avoid loop iterations by introducing per-state queues
In order to speed up the lookup of req_ctx, we keep per-state queues
rather than iterating over all the request contexts that exist again and
again.
2014-11-11 22:30:54 +01:00
Min Xu 40def0ab1a change req_ctx sizes large 2048->1000; small 128->270 2014-11-11 22:30:53 +01:00
Min Xu 3b7035dcd9 req_ctx: Use consistent numeric range for REQ_CTX_STATE
... which will allow us to check for invalid states by a simple
'greater than' check later on.
2014-11-11 22:30:53 +01:00
Harald Welte 4c0cf591b0 wdt: make sure WDT doesn't fire inadvertently
We have to set WDD and WDV to the same value to avoid watchdog errors
2012-03-22 23:33:07 +01:00
Harald Welte 94143382bf disable logging of PIO status in PIO interrupt routine 2012-03-22 15:03:10 +01:00
Holger Hans Peter Freyther ebf16b4ddf usb: Do not send ZLP when we have filled the window
Only send the ZLP if we send less data than was required/asked for
by the host and it is a multiple of the bMaxPacketSize0 (which is
hardcoded to 8 right now).

This is completing the change done in fe88b83e80 to
fix SIMtrace attached to OSX and not regress on windows.

Introduce another parameter to udp_ep0_send_data to specify the window
size (wLength) or if not available the default from USB 2.0 specification.
2011-12-14 15:16:54 +01:00
Harald Welte ea85282e09 DBGU: Print Reset controller Status Register on boot
This helps us to discover _why_ the CPU has been rebooted.
2011-08-15 21:40:35 +02:00
Harald Welte 7d31d475b6 USB: Add support for the 3rd DFU interface (RAM) 2011-08-15 21:40:09 +02:00
Harald Welte e3d1fd9bbd DFU: add third 'alternate configuration' for RAM load
This will allow us to load code directly into RAM without going through
flash.
2011-07-30 02:08:36 +02:00
Harald Welte 5a8cd9feca add new RUN_FROM_RAM run-mode for direct DFU-to-RAM support 2011-07-30 00:37:04 +02:00
Harald Welte a23eefc6dc USB driver: use the DFU-provided function to send EP0 data
There is no point in replicating the functionality that already
exists in the DFU section of the flash
2011-07-07 17:43:55 +02:00
Harald Welte cda126a7ef simtrace: add support for the analog bus switch 2011-06-16 21:16:13 +02:00
Harald Welte 6492c2959c req_ctx: Increase size of small req_ctx to 128 and have 16 instead of 8
This is required to deal with bursts in SIM comminication while using
the SIMTRACE firmware
2010-11-18 23:06:43 +01:00
Harald Welte f2349ebe17 disable USB EP0 debugging 2010-11-14 23:01:04 +01:00
Harald Welte b27e18619f Use smaller number of request contexts on a SAM64 2010-11-13 21:07:06 +01:00
laforge 4dc2cb5b49 * move usb descriptors into separate file (src/os/usb_descriptors_openpcd.h)
* add USB HID skeleton


git-svn-id: https://svn.openpcd.org:2342/trunk@426 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2008-02-23 13:19:06 +00:00
meri d10804d38f make sure that WDT_DEBUG is undefined
git-svn-id: https://svn.openpcd.org:2342/trunk@305 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2007-04-10 21:34:27 +00:00
meri 4d1e8b3ce4 decreased USB debug verbosity to allow full debug code inclusion
git-svn-id: https://svn.openpcd.org:2342/trunk@301 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2007-04-10 17:58:34 +00:00
meri 98f3bcf710 added watchdog time support and debouncing on power-cycle
git-svn-id: https://svn.openpcd.org:2342/trunk@297 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2007-04-10 17:46:11 +00:00
meri bc0c068425 added several new USB commands: remote reset, API version and read/write volatile flash environment
git-svn-id: https://svn.openpcd.org:2342/trunk@295 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2007-04-10 17:39:51 +00:00
meri f21e08aa9f moved flash code to seperate file
git-svn-id: https://svn.openpcd.org:2342/trunk@294 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2007-04-10 17:34:53 +00:00
laforge 7bdd263579 - iterate over all PIO, not only starting from 27 ?!?
- add debug message when registering callback


git-svn-id: https://svn.openpcd.org:2342/trunk@287 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-12-18 15:18:19 +00:00
laforge b7722bed0c add void AT91F_DBGU_Fini prototype to header file
git-svn-id: https://svn.openpcd.org:2342/trunk@284 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-12-18 12:33:25 +00:00
laforge 6c6b1878f4 - add new DAC driver (instead of poti) for PICC
- DFU: put all DEBUG_ defines in "#ifdef DEBUG" enclosure
- alter GPIO defines for new OpenPICC v0.4 prototype
- add new AT91F_DBGU_Fini() function
- take care of new inverted USB pullip in OpenPICC v0.4 prototype
- fix typo in 'opicc_reg_write' macro
- add some more PICC related SSC code
NOTE: this firmware is the first version that will _NOT_ run on a OpenPICC v0.3 anymore!
(All changes by Henryk Ploetz)


git-svn-id: https://svn.openpcd.org:2342/trunk@283 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-12-18 12:32:48 +00:00
laforge 28eb4a57d9 - add svn:ignore property to make 'svn st' output more realistic
- remove old copy+paste+edit port of parts of librfid
- add ability to directly link librfid.a from mainline librfid
- make usb string descriptors optional again (config.h)
- fix TC_CDIV to reset correctly on swtrig (For OpenPICC)
- temporarily re-implement ep0_send_data() in pcd_enumerate.c
- make UDP_PUPv4 switching conditional to PCD
- introduce DEBUG_UNBUFFERED define in dbgu.c
- fix some signed/unsigned/typecast related compiler warnings
- remove dead code from src/os/led.c
- implement a 'mdelay' and 'usleep' stub function (FIXME!)
- rename rc632_... functions into opcd_rc632_... to avoid confusion
- introduce new 'main_librfid' TARGET
- make main_{reqa,analog} work with librfid rather than old code
- introduce mroe debugging options for FIQ handler code in Cstartup_app
- lots of PICC work that doesn't need comments now


git-svn-id: https://svn.openpcd.org:2342/trunk@266 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-15 20:21:40 +00:00
laforge d1dd3611ea v0.4 of the readers uses a different pin for the USB pullup
git-svn-id: https://svn.openpcd.org:2342/trunk@261 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-04 17:56:57 +00:00
laforge a2f768dd5f - add read of serial number via usb
git-svn-id: https://svn.openpcd.org:2342/trunk@260 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-04 17:55:17 +00:00
laforge f796b3e49a - first working tested version if system_irq demux
- fix minor issues with PIT timer code
- make new led blinkcode implementation work


git-svn-id: https://svn.openpcd.org:2342/trunk@257 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-04 01:38:04 +00:00
laforge 0d69fadb71 move udp irq/refill back to flash for now
git-svn-id: https://svn.openpcd.org:2342/trunk@256 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-04 01:35:08 +00:00
laforge 904f944d0d reduce number of large request contexts to four, should be sufficient for now
git-svn-id: https://svn.openpcd.org:2342/trunk@255 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-04 01:34:40 +00:00
laforge d9c442272b - we have to respond with a STALL to SET_CONFIGURATION
- add a comment about this strange fact
- some code cleanup
- add missing 'break' after end of GET_DESCRIPTOR USB_DT_DEVICE


git-svn-id: https://svn.openpcd.org:2342/trunk@253 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-03 15:27:01 +00:00
laforge bfff30bfec - add proper system interrupt (shared) demultiplexing code
- port debug unit, watchdog timer, periodic interval timer to system_irq.c


git-svn-id: https://svn.openpcd.org:2342/trunk@252 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 21:45:43 +00:00
laforge 2b55faec5a synchronize bit clock based on software trigger (needed for cdiv_sync)
git-svn-id: https://svn.openpcd.org:2342/trunk@251 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 21:44:32 +00:00
laforge f1cae2aa9e - add command to read rc632 serial number via USB
git-svn-id: https://svn.openpcd.org:2342/trunk@250 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 21:44:06 +00:00
laforge e2432d0574 re-define REQ_CTX_STATE_FREE != 0 to detect bugs
git-svn-id: https://svn.openpcd.org:2342/trunk@247 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 20:34:07 +00:00
laforge 2fa1074157 initialize req_ctx state as free.
git-svn-id: https://svn.openpcd.org:2342/trunk@246 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 20:33:38 +00:00
laforge 833d0d5ec2 clean up dbgu startup printout
git-svn-id: https://svn.openpcd.org:2342/trunk@245 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 20:33:09 +00:00
laforge fabe00c6f2 split irq handler in two parts to make it callable from FIQ
git-svn-id: https://svn.openpcd.org:2342/trunk@244 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 20:32:56 +00:00
laforge 6c0b462a2c - finish implementation of timers based on PIT
- add [untested] code for timer-based LED blink codes


git-svn-id: https://svn.openpcd.org:2342/trunk@242 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-10-01 19:23:15 +00:00