Commit Graph

27 Commits

Author SHA1 Message Date
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 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 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
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 7d31d475b6 USB: Add support for the 3rd DFU interface (RAM) 2011-08-15 21:40:09 +02:00
Harald Welte dd88fde8d2 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:57:01 +02:00
Harald Welte f2349ebe17 disable USB EP0 debugging 2010-11-14 23:01:04 +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
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 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 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 d61fac8fff - Add revision to USB descriptor
git-svn-id: https://svn.openpcd.org:2342/trunk@237 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-30 22:21:39 +00:00
laforge 7d1d85c02e add stub for later implementation of suspend/resume
git-svn-id: https://svn.openpcd.org:2342/trunk@236 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-30 22:18:42 +00:00
laforge 9f45ae4e59 - more accurate (and USB compliant) state transitions
- make gcc spit a bit less warnings


git-svn-id: https://svn.openpcd.org:2342/trunk@235 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-30 22:12:08 +00:00
laforge e9902c5680 - free all pending contexts when endpoint is being reset
- speed up usb processing by putting respective sections in RAM


git-svn-id: https://svn.openpcd.org:2342/trunk@234 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-30 14:01:59 +00:00
laforge 89c40594e7 - fix minor issues with USB string support
git-svn-id: https://svn.openpcd.org:2342/trunk@228 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-25 21:36:42 +00:00
laforge 5872753e2d - Include tool for Converting ASCII to UTF-16LE in C-Header
- Build UTF-16LE USB String descriptors from ASCII File
- Introduce USB String Descriptor to DFU and runtime firmware


git-svn-id: https://svn.openpcd.org:2342/trunk@227 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-25 21:23:52 +00:00
laforge a914cae281 use officially assigned usb vendor and product id's
git-svn-id: https://svn.openpcd.org:2342/trunk@225 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-25 14:50:05 +00:00
laforge 706ffa9f3b - move large rctx definitions to req_ctx.h
- add more fine-grained debugging macros in pcd_enumarate.c
- resolve race conditions between main-loop ep_refill and irq-triggered
  ep_refill by adding one irq-[b]locking variant
- consolidate endpoint reset code into reset_ep()
- add code to handle correct transmission and reception of usb transfers
  larger than endpoint size
- use new jump address (0x104000) in DFU Cstartup.S
- move main_usb to pcd subdirectory
- fix include/compile.h make dependencies
- make usb benchmark code use new large req_ctx


git-svn-id: https://svn.openpcd.org:2342/trunk@219 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-22 21:41:22 +00:00
laforge 514b0f72f5 - Add OpenPICC register definition (and USB command handling)
- Add automatic generation of include/compile.h with svn revision and compiletime
- Add openpcd_compile_version structure to obtain version via USB
- Move LED commands into new CMD_CLS_GENERIC family
- Update TODO
- Add support for large (2048 byte) request contexts in addition to 64byte
- Shrink req_ctx size by collapsing rx and tx buffer into one
- move definition of DFU_API_LOCATION to header file
- Implement large req_ctx aware USB transmit / refill routines
- Implement TX refilling for IRQ Endpoint
- Print version information at startup time
- move some generic req_ctx processing into usb_handler.c
- Some further work on DFU (still not finished)
- Only use '-Os' for DFU, use '-O2' for application code


git-svn-id: https://svn.openpcd.org:2342/trunk@208 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-20 11:44:10 +00:00
laforge ba56581054 fix location of dfu_api
git-svn-id: https://svn.openpcd.org:2342/trunk@199 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-20 00:33:46 +00:00
laforge 32985a29c1 add GPL disclaimer to all C files that I wrote
git-svn-id: https://svn.openpcd.org:2342/trunk@195 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-13 16:23:52 +00:00
laforge a97e460bea Completely separate DFU from application program, we now have a real bootloader.
DFU occupies 0x00100000 - 0x00100fff in flash, application starts at 0x00101000.
DFU also occupies the first couple of bytes in SRAM, application starts at 0x00200024.

In order to produce a samba-flashable image, first build dfu.bin by typing 
'make -f Makefule.dfu', succeeded by 'make TARGET=... DEBUG=... BOARD=...' and then 
concatenating the two files together, e.g. cat dfu.bin main_reqa.bin > flash.bin.

Actual flashing via DFU is still not operational, but will be implemented next


git-svn-id: https://svn.openpcd.org:2342/trunk@194 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-13 16:02:52 +00:00
laforge d256545b2f move to new directory
git-svn-id: https://svn.openpcd.org:2342/trunk@191 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
2006-09-12 17:35:30 +00:00