1. 10 Dec, 2016 1 commit
    • ROOL's avatar
      Build fix · ff0f490e
      ROOL authored
      Admin:
        Requires NetBSD-1_17
      ff0f490e
  2. 15 Jun, 2016 1 commit
    • Jeffrey Lee's avatar
      Issue CLREX on return from the FIQ handler · 66844ced
      Jeffrey Lee authored
      Detail:
        s/regaccess - Issue CLREX on return from the FIQ handler, just in case we start using exclusive access instructions from within the handler. Update PSR manipulation code to use CPS in preference to MSR.
      Admin:
        Tested on Raspberry Pi
      
      
      Version 0.28. Tagged as 'DWCDriver-0_28'
      66844ced
  3. 02 May, 2016 1 commit
  4. 27 Mar, 2016 2 commits
  5. 04 Mar, 2016 2 commits
    • ROOL's avatar
      Revert accidental commits · 49ab6570
      ROOL authored
      Admin:
        These changes are currently subject to rework via the normal submissions channel.
      49ab6570
    • John Ballance's avatar
      Fixes to get isochronous transfer in DWCDriver (Raspberry Pi)` · 8722f4da
      John Ballance authored
      Detail:
      
      Changes to the RISC OS part of the DWCDriver (Raspberry Pi) necessary to get isochronous transfers working on a pi.
      
      DWCDriver.c.cmodule
      DWCDriver.c.dwc_otg_riscos
      DWCDriver.c.softc_device
      DWCDriver.h.dwc_otg_riscos
      
      Admin:
      submitted by Colin Granville
      tested on pi
      
      Version 0.25. Tagged as 'DWCDriver-0_25'
      8722f4da
  6. 11 Dec, 2015 1 commit
  7. 18 Nov, 2015 1 commit
  8. 15 Nov, 2015 1 commit
  9. 07 Oct, 2015 1 commit
    • Jeffrey Lee's avatar
      Update to 'FIQ FSM' USB driver · 10052c0c
      Jeffrey Lee authored
      Detail:
        Makefile, dwc/* - Updated to latest-ish code from Raspberry Pi github (rev c8baa9702c). Includes the 'FIQ FSM' USB driver, which replaces the older 'FIQ fix'. Note that many files appear to have no functional changes - just trailing whitespace removal to keep things in sync with github.
        Makefile - add DEBUGLIBS back into the debug libs listing to fix debug builds
        c/cmodule - Update to work with new FIQ FSM flags
        c/dwc_otg_riscos - Update to work with new FIQ FSM flags. Update initialisation procedure. Change IRQ handling to try both the HCD & CIL interrupt handlers (HCD can claim interrupt is handled when there's still a CIL interrupt pending). Disable support for falling back to IRQ if the FIQ vector is claimed by someone else - will need new implementation to cope with starting & stopping the FIQ FSM.
        s/regaccess - Update FIQ veneer & install routine to allow operation with either the dwc_otg_fiq_fsm or dwc_otg_fiq_nop functions.
      Admin:
        Tested on Raspberry Pi 1 & 2
      
      
      Version 0.21. Tagged as 'DWCDriver-0_21'
      10052c0c
  10. 21 Aug, 2015 1 commit
    • Robert Sprowson's avatar
      Don't reach into USBDriver's back pocket · 88a7fa72
      Robert Sprowson authored
      cmodule.c:
        Use USBDriver.h from interface exports
      Makefile:
        Remove duplicated libs from debug build
        Remove relative reference to NetBSD component from VPATH
      !MkDebug:
        Select debug target so the right compiler switches are used
      Built, but not tested.
      
      Version 0.20. Tagged as 'DWCDriver-0_20'
      88a7fa72
  11. 28 Mar, 2015 1 commit
    • Jeffrey Lee's avatar
      Fix error handling when transfers fail to start · 39e2d3a4
      Jeffrey Lee authored
      Detail:
        c/softc_device - Fix softc_device_start() to call usb_transfer_complete() with the appropriate status code if a transfer fails to start - returning the status to the caller isn't enough. Also tweak debug output and add extra safety checks to timeout cancellation.
      Admin:
        Tested on Raspberry Pi
      
      
      Version 0.19. Tagged as 'DWCDriver-0_19'
      39e2d3a4
  12. 31 Oct, 2014 1 commit
    • Robert Sprowson's avatar
      Build fix · 1d60fab9
      Robert Sprowson authored
      Having updated the central 'usb.h' to include some of the more recent definitions this has created a clash here.
      UHF_PORT_L1 isn't 5 according to the USB 2.0 spec, but since the only use of it in DWCDriver is wrapped in CONFIG_USB_DWC_OTG_LPM which isn't enabled in this port, just delete it.
      UHF_C_PORT_L1 is now defined in 'usb.h', delete local copy.
      UHF_PORT_HIGH_SPEED remains. In fact, it looks like the ported driver got confused when responding to GET_PORT_STATUS as it builds the status word out of bitmasks defined for hub feature manipulation (UHF) not port status (UPS) which are different number spaces. Oops.
      
      Version 0.18. Tagged as 'DWCDriver-0_18'
      1d60fab9
  13. 18 Oct, 2014 1 commit
  14. 08 Jul, 2014 1 commit
    • Jeffrey Lee's avatar
      Enable part two of the FIQ fix · 1bec5bff
      Jeffrey Lee authored
      Detail:
        This enables support for the code which handles split transactions in the FIQ handler. This requires some extra logic to allow the FIQ handler to gracefully terminate its state machine when we need to release our hold on the FIQ vector.
        c/dwc_otg_riscos - Update FIQ claim/release functions to initialise and terminate fiq_split_enable. Make FIQ usage bools static const as nothing needs to change them at runtime.
        h/dwc_otg_riscos - Remove unused use_fiq_fix extern
        dwc/driver/c/dwc_otg_hcd_intr - Modify fiq_hcintr_handle() to allow for graceful termination - when terminating, suppress adding new xfers to the schedule and instead force the IRQ handler to deal with them
      Admin:
        Tested on Raspberry Pi
        Thrashing Service_ClaimFIQ/Service_ReleaseFIQ didn't result in any obvious problems while split xfers were occuring
      
      
      Version 0.16. Tagged as 'DWCDriver-0_16'
      1bec5bff
  15. 19 Jun, 2014 1 commit
    • Jeffrey Lee's avatar
      Enable part one of the FIQ fix · db8357fa
      Jeffrey Lee authored
      Detail:
        This change enables the basic 'FIQ fix', where SOF interrupts are handled by a FIQ handler and all other interrupts are delegated to IRQ.
        During testing it was observed that when the FIQ fix was enabled, what appears to be the host-side VCHIQ process would randomly die. It could take anywhere from several seconds (including during ROM init) or several hours for this to happen.
        After much investigation it looks like the cause was the use of the MPHI peripheral as a mechanism to trigger an IRQ from the FIQ handler. Changing the code in dwc_otg_hcd_handle_intr() so that it 'flushes' MPHI more often (after every interrupt instead of after every 60) seemed to reduce the problem, while changing the IRQ generation mechanism to use a different IRQ source (e.g. timer) made the crash go away entirely
        In the end I've settled on the compromise of using the MPHI peripheral, but in a way in which we only need to poke it once on startup, instead of once for every desired IRQ. Once we have it generating an IRQ we then rely on masking/unmasking the IRQ in the interrupt controller to get the desired effect of downgrading FIQs to IRQs. See the RISCOS_FIQ_DOWNGRADE #define.
        Changed files:
        - c/cmodule - Use symbolic constant for the USB controller ID instead of a magic number. Get the MPHI details from HAL_USBControllerInfo. Pay attention to Service_ClaimFIQ/Service_ReleaseFIQ and enable/disable the FIQ fix as appropriate.
        - c/dwc_common_riscos - Disable some debug functions which were accidentally left in non-debug builds. Change work queue/tasklet thread initialisation to fix a deadlock issue seen on reboot.
        - c/dwc_otg_riscos - Set up the MPHI and enable/disable the FIQ handler as required
        - cmhg/modhead - Pay attention to Service_ClaimFIQ/Service_ReleaseFIQ
        - dwc/driver/c/dwc_otg_hcd_intr, dwc/driver/h/dwc_otg_mphi_fix - RISCOS_FIQ_DOWNGRADE code
        - dwc/dwc_common_port/h/dwc_os - Make sure __DWC_WARN, __DWC_ERROR, DWC_EXCEPTION are compiled out in non-debug builds
        - h/dwc_otg_riscos - declare extra functions/variables related to FIQ fix
        - s/regaccess - Routine to install the FIQ handler on the FIQ vector, and simple HAL call wrapper
      Admin:
        Tested on Raspberry Pi
        Requires Kernel-5_35-4_79_2_227, BCM2835-0_34
      
      
      Version 0.15. Tagged as 'DWCDriver-0_15'
      db8357fa
  16. 01 Jun, 2014 1 commit
    • Jeffrey Lee's avatar
      Fix to allow building against NetBSD-0_85 · 689a0ad0
      Jeffrey Lee authored
      Detail:
        c/cmodule - Don't use NetBSD/build/service.h, it no longer exists. Use the exported USB/USBDevFS.h instead. Fix service call reason codes to use USBDevFS names.
      Admin:
        Tested in BCM2835 ROM build
        Build output is binary-identical to previous version
        Requires NetBSD-0_85
      
      
      Version 0.14. Tagged as 'DWCDriver-0_14'
      689a0ad0
  17. 06 May, 2014 1 commit
  18. 29 Apr, 2014 1 commit
  19. 26 Apr, 2014 1 commit
    • Jeffrey Lee's avatar
      Update to latest code from Raspberry Pi github · a17ef0c8
      Jeffrey Lee authored
      Detail:
        Makefile, dwc/* - Updated to latest code from Raspberry Pi github (rev e0001dd59d). Includes the fabled 'FIQ fix' code, although the code isn't yet enabled in the RISC OS version of the driver.
        c/cmodule - Add extra flags for controlling driver behaviour, as required by the new core code
        c/dwc_otg_riscos - Add some missing driver parameters (although we leave them at default). Handle DWC_E_SHUTDOWN xfer errors, which will now be produced when the driver is shutting down
        c/softc_device - Disable interrupts around dwc_otg_hcd_urb_enqueue, to mirror behaviour of Linux code (previously, it was the responsibility of the DWC code to disable interrupts for the appropriate part of the operation)
        s/regaccess - Add some extra IRQ/memory barrier functions required by the new code (mainly the FIQ fix). Make DWC_MODIFY_REG32 operate atomicly (mirrors change in Linux version)
      Admin:
        Tested on Raspberry Pi
      
      
      Version 0.11. Tagged as 'DWCDriver-0_11'
      a17ef0c8
  20. 30 Mar, 2013 1 commit
    • Jeffrey Lee's avatar
      Fix hang on boot · 07e72b27
      Jeffrey Lee authored
      Detail:
        c/cmodule - Add a re-entrancy check to USB driver initialisation; due to recent kernel changes we're now getting the "USBDriver has started" service call during the middle of our call to USBDriver_Register (called from our own initialisation callback). Without the re-entrancy check the system was getting confused and sending a duff transfer request to DWCDriver, resulting in a hang somewhere in the driver logic.
      Admin:
        Tested on Raspberry Pi
        Machine no longer stops after "mod init done" is displayed
      
      
      Version 0.10. Tagged as 'DWCDriver-0_10'
      07e72b27
  21. 17 Sep, 2012 1 commit
    • Jeffrey Lee's avatar
      Update to version 3.00 of DWC_otg · d854b974
      Jeffrey Lee authored
      Detail:
        This big batch of changes brings us in line with rev 70428950df of the Raspberry Pi Linux github.
        Briefly:
        * Deleted HTML docs as they're a waste of space
        * Dropped the SOF fix (which we never used anyway)
        * Dropped our implementation of the microframe scheduling patch, in favour of their implementation
        * Updated to version 3.00 of the DWC sources. Hard to tell what useful changes this brings, due to API tweaks resulting in pretty much every file being littered with changes.
      Admin:
        Tested on Raspberry Pi with high processor vectors
        This new version seems like it might be a bit more sensitive to insufficient power supplies. Beware!
      
      
      Version 0.09. Tagged as 'DWCDriver-0_09'
      d854b974
  22. 04 Aug, 2012 1 commit
    • Jeffrey Lee's avatar
      Fix aborts on reset/*rmkill USBDriver · 75f42235
      Jeffrey Lee authored
      Detail:
        c/cmodule, cmhg/modhead - Don't shutdown DWC layer during Service_USBDriver_Dying. Instead, only do it during Service_ModulePostFinal/Service_PreReset(/module finialisation). Also during Service_PreReset, deregister with USBDriver. This ensures we're deregistered with USBDriver before we shut down the DWC layer, and so don't have to worry about receiving events from USBDriver after the DWC layer is shut down.
        c/dwc_common_riscos, c/dwc_otg_riscos, h/dwc_common_riscos - Improve handling of DWC endpoint disable callbacks. The memory block for the endpoint now has a flag set in its header when a callback is pending, allowing us to avoid double-free situations if both ourselves and the DWC layer decide to free the endpoint.
        c/softc_root - Correct some debug messages
        dwc/driver/c/dwc_otg_hcd - Fix qh_list_free to use DWC_LIST_FOREACH_SAFE (as dwc_otg_hcd_qh_remove_and_free will remove entries from the list) - fixes potential double-free if a non-empty list is being freed
        dwc/driver/c/dwc_otg_hcd_intr - Fix building of debug builds
      Admin:
        Tested in Pi ROM with high processor vectors
        Resets and killing/reiniting USBDriver now works properly
      
      
      Version 0.08. Tagged as 'DWCDriver-0_08'
      75f42235
  23. 02 Aug, 2012 1 commit
    • Jeffrey Lee's avatar
      Fix mutex implementation · 2c8ed4d4
      Jeffrey Lee authored
      Detail:
        c/dwc_common_riscos - Mutex lock/trylock functions had defective logic that would have resulted in them ignoring the lock state of the mutex and claiming it while it was still in use by another thread.
      Admin:
        Tested on Raspberry Pi with high processor vectors
      
      
      Version 0.07. Tagged as 'DWCDriver-0_07'
      2c8ed4d4
  24. 22 Jul, 2012 1 commit
    • Jeffrey Lee's avatar
      Incorporate patch to add support for scheduling of transfers on a per-microframe basis · 153b386d
      Jeffrey Lee authored
      Detail:
        Makefile, dwc/driver/c/dwc_otg_hcd, dwc/driver/c/dwc_otg_hcd_intr, dwc/driver/c/dwc_otg_hcd_queue, dwc/driver/h/dwc_otg_hcd - Adapted the microframe scheduling patch at http://git.denx.de/?p=linux-denx.git;a=commit;h=9796e39e7a513d8a4acde759ec5d0023645143d8 to work with our newer version of the DWC driver. Enabled by SCHEDULE_PATCH #define.
        dwc/driver/c/dwc_otg_hcd_ddma - Fix up descriptor DMA support to compile (but not run properly) when the scheduling patch is active
        dwc/dwc_common_port/h/dwc_os - Provide local_irq_save() and local_irq_restore() implementations, as used by the scheduling patch
      Admin:
        Tested on Raspberry Pi with high processor vectors
        Appears to fix problems with devices becoming unresponsive once too many periodic transfers are active (e.g. too many interrupt pipes open)
      
      
      Version 0.06. Tagged as 'DWCDriver-0_06'
      153b386d
  25. 21 Jul, 2012 1 commit
    • Jeffrey Lee's avatar
      Track latest developments on Raspberry Pi github · c0223aea
      Jeffrey Lee authored
      Detail:
        Makefile, c/cmodule, h/module, dwc/driver/c/dwc_otg_driver, dwc/driver/c/dwc_otg_hcd, dwc/driver/c/dwc_otg_hcd_ddma, dwc/driver/c/dwc_otg_hcd_intr, dwc/driver/c/dwc_otg_hcd_linex, dwc/driver/h/dwc_otg_hcd, dwc/dwc_common_port/c/dwc_common_linux - Track latest developments on Raspberry Pi github. Includes fixes for buffer overruns when unexpectedly receiving too much data, and changes to allow SOF interrupt spam to be reduced.
        c/dwc_common_riscos - Make sure we always round up delay values when converting from msec to csec. Avoids issues with high frequency timers (e.g. SOF re-enable timer) hogging all the CPU time. May be the cause of some other bad behaviour that I've experienced in the past?
      Admin:
        Tested on Raspberry Pi with high processor vectors
        Note - SOF fix is currently disabled, as it was causing too many interrupt packets (e.g. mouse clicks) to be lost. Probable cause is that we're running the SOF re-enable timer at 100Hz instead of 1kHz. May be worth investigating moving all timer/thread scheduling over to a HAL timer which can provide us a 1kHz ticker interrupt.
      
      
      Version 0.05. Tagged as 'DWCDriver-0_05'
      c0223aea
  26. 24 Jun, 2012 1 commit
    • Jeffrey Lee's avatar
      Update to latest code from Raspberry Pi github. Improve debugging. Fix race... · eb6b48ef
      Jeffrey Lee authored
      Update to latest code from Raspberry Pi github. Improve debugging. Fix race condition that could lead to timeout callbacks inappropriately firing.
      
      Detail:
        Makefile, dwc/* - Updated to latest code from Raspberry Pi github. Tweaks specific to Broadcom hardware have been placed in BCM2835 #ifdef's to allow them to easily be identified/controlled if we need the driver to support different SoCs in future
        c/cmodule, c/dwc_common_riscos, c/port, c/softc_device, h/cmodule - Improved debugging code
        c/softc_device - Schedule timeout before starting transfer instead of after. Fixes issue where a transfer that completes inbetween dwc_otg_hcd_urb_enqueue() and callout_reset() would result in the timeout being enabled even though the transfer is already complete
        s/triggercbs - Synced with latest USBDriver version for consistency
      Admin:
        Tested on Raspberry Pi with high processor vectors
        Fixes some, if not all, stability issues
      
      
      Version 0.04. Tagged as 'DWCDriver-0_04'
      eb6b48ef
  27. 15 Jun, 2012 1 commit
    • Jeffrey Lee's avatar
      Add memory barriers to register reads/writes. Reduce frequency of memory allocations. · 5ae117ef
      Jeffrey Lee authored
      Detail:
        s/regaccess - New file containing assembler register access routines, with memory barriers to protect against the BCM2835 AXI bus returning device loads out-of-order
        Makefile, dwc/dwc_common_port/h/dwc_os - Updated to use register access functions instead of inline code
        c/dwc_common_riscos - Added a simple bucket-and-chain data structure to dwc_alloc/dwc_free, to collect free memory blocks and allow them to be reused later, to reduce the load on the heap manager.
      Admin:
        Tested in BCM2835 ROM
      
      
      Version 0.03. Tagged as 'DWCDriver-0_03'
      5ae117ef
  28. 06 Jun, 2012 1 commit
    • Jeffrey Lee's avatar
      Misc housekeeping · fb5f8bf6
      Jeffrey Lee authored
      Detail:
        Makefile, !MkDebug,fd7 - Debug version of module can now be built just be passing "DEBUG=TRUE" to amu
        c/cmodule - Only accept USB controllers if HAL_USBControllerInfo says the struct size is an exact match with what we expect
        c/dwc_otg_riscos - Remove incorrect comment; both dwc_dma_alloc and malloc_contig zero memory
        s/bufman - Delete unused file
        s/call_veneer, s/triggercbs - Use Entry/EXIT macros to avoid single-reg LDM/STM performance warnings. Convert tabs to spaces.
      Admin:
        Tested in BCM2835 ROM
      
      
      Version 0.02. Tagged as 'DWCDriver-0_02'
      fb5f8bf6
  29. 03 Jun, 2012 2 commits
    • Jeffrey Lee's avatar
      Add initial version of DWCDriver - USB driver for Synopsys DWC OTG controllers · 6b7ce280
      Jeffrey Lee authored
      Detail:
        A fairly simple wrapper for Synopsys's open source "DWC_otg" Linux driver, based around a GPL-free version of the DWC_otg 2.90a sources received from the Raspberry Pi foundation.
        Instead of interfacing with the Linux USB stack a new host interface layer has been implemented to allow it to talk to the standard BSD-derived RISC OS stack.
        RTSupport is used to provide the threading functionality that the DWC driver relies upon.
        Interesting files:
        - c/cmodule, h/cmodule - Main module frontend
        - c/dwc_common_riscos, h/dwc_common_riscos - Implementation of the OS support layer required by the DWC driver
        - c/dwc_otg_riscos, h/dwc_otg_riscos - Core code for the BSD driver implementation, driver init/shutdown, and for handling calls from the DWC host driver to us
        - c/port - Some support functions required by BSD-style code inherited from the other USB drivers
        - c/softc_device - Code to handle requests from the BSD layer to attached USB devices
        - c/softc_root - Code to handle requests from the BSD layer to the controller root hub
        - dwc/doc/* - Original Synopsys release notes & user guide pdfs
        - dwc/driver/*, dwc/dwc_common_port/* - Synopsys code and documentation. A few tweaks were required to allow it to compile under Norcroft, but otherwise it's functionally equivalent to the original sources.
      Admin:
        Tested in BCM2835 ROM
        There are a few loose ends still to tidy up (search for "DWCTODO"), mainly regarding implementation of Isochronous support, but otherwise the driver seems stable enough for daily use.
      
      
      Version 0.01. Tagged as 'DWCDriver-0_01'
      6b7ce280
    • Jeffrey Lee's avatar
      created by srccommit. · 1c125993
      Jeffrey Lee authored
      1c125993