Skip to content
Snippets Groups Projects
  1. Feb 02, 2020
  2. Nov 03, 2019
    • rahix's avatar
      feat(epicardium): Add a proper mutex implementation · 9a5a46cd
      rahix authored
      
      In the current firmware, different locking mechanisms a littered around
      the code-base.  Among them are bare FreeRTOS mutexes and the hw-locks.
      The callers for these often specify timeouts but don't make much effort
      in A) picking robust values for the timeout and B) recovering gracefully
      from a timeout happening.  Most of the time, we return -EBUSY to _Python
      code_.  This is really really bad API design.  The firmware needs to
      have enough integrity to ensure these situations can't ever occur.
      
      To combat this, add a new locking primitive: The `struct mutex`.  The
      intention is to replace all other locking and synchronization APIs with
      this one.  This will provide one central place to debug any sort of
      locking issues.
      
      The `struct mutex` API is based on a few assumptions about locking.
      Those are detailed in `Documentation/epicardium/mutex.rst`, which is
      part of this commit.  The most important one is:
      
          Locking can **never** fail.
      
      By requiring this to be true, we eliminate the need for drivers to
      contain (often incorrect) logic for dealing with locking fails.  This
      should drastically improve the stability of the firmware in regards to
      lock-related bugs.
      
      This commit does not introduce any functional changes yet.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      9a5a46cd
  3. Oct 05, 2019
    • rahix's avatar
      feat(epicardium): Add a panic() function · 1536da34
      rahix authored
      
      In unrecoverable situations we should provide a common way to output the
      cause of the error and then reset the CPU.  The panic() function is
      mean to be exactly that.  It outputs the error-cause, stack-trace, and
      firmware revision, accompanied by a link to the issue-tracker to
      encourage people to report the error.  After a timeout of ~1.5s it
      resets the CPU and reboots.
      
      Future Work:
      
       - Right now, the stack-trace only has a depth of one which is the
         return address from where panic() was called.  In the future it might
         make sense to provide a deeper stack-trace if a robust implementation
         is possible.
       - Integration of @msgctl's faultscreen (!79) so users who don't have
         the serial console open at all times can also see what happened.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      1536da34
  4. Oct 04, 2019
  5. Sep 14, 2019
  6. Aug 31, 2019
  7. Aug 28, 2019
    • swym's avatar
      feat(epicardium): read card10.cfg · f1d63669
      swym authored and rahix's avatar rahix committed
      Adds simple config parser along with config_ API that:
      
      - supports default values for options
      - allows typed querying of config values
      - types supported: boolean, integer, floating point and string
      
      unknown options are ignored and LOG_WARNed on the console
      f1d63669
  8. Aug 24, 2019
    • swym's avatar
      feat(epicardium): Add ESB module · 9b0fd54f
      swym authored and rahix's avatar rahix committed
      usb/epc_usb
      ====
      Contains device-independent USB implementation, services MAXUSB stack
      and is given the actual USB descriptors & callbacks on initialization.
      Handles USB events and configures/deconfigures the device accordingly
      during the USB setup procedure.
      
      usb/mass_storage & cdcacm
      ====
      Contain device-specific implementations, service MAXUSB's device class
      APIs for cdcacm and mass storage.
      Here, mass storage is independent of the underlying storage device.
      
      modules/usb
      ====
      Public apic_usb API, configuration and storage device management.
      Defines the actual USB device descriptors and services the upc_usb API.
      
      If we want to add SD card functionality, this would be the place to add
      it.
      9b0fd54f
  9. Aug 23, 2019
  10. Aug 22, 2019
  11. Aug 20, 2019
  12. Aug 19, 2019
  13. Aug 17, 2019
  14. Aug 15, 2019
    • rahix's avatar
      feat(epicardium): Add core 1 lifecycle · b7c0b608
      rahix authored
      
      This commit introduces a lifecycle for core 1.  Based on the new loading
      system, a few APIs are made available to control the payload running on
      core 1.  These are:
      
      1. From core 1 (Pycardium, L0dable):
      
          - `epic_exec(name)` API Call:  Request loading of a new payload by
            name.  If the file does not exist, the call will return with an
            error code.  Otherwise, control will go to the new payload.
          - `epic_exit(retcode)` API Call:  Return from payload
            unconditionally.  This call should be called whenever a payload is
            done or when it has hit an unrecoverable error.  On `epic_exit`,
            Epicardium will reset the core back into the menu.
      
      2. From inside Epicardium:
      
          - `epic_exec(name)`: This is **not** the same as the API call, as it
            needs a different implementation underneath.  It will load a new
            payload and wait until this load actually completed (synchroneous).
          - `return_to_menu()`: Return core 1 to the menu script no matter
            what it is currently doing.  This call is asynchroneous and will
            return immediately after scheduling the lifecycle task.  This task
            will then take care of actually performing the load.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      b7c0b608
    • rahix's avatar
      feat(epicardium): Add module for hardware init · be09c127
      rahix authored
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      be09c127
    • rahix's avatar
      chore(epicardium): Move dispatcher into own module · 5f794074
      rahix authored
      
      Also add a mutex around API calls in preparation for future changes.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      5f794074
  15. Aug 09, 2019
    • swym's avatar
      feat(fatfs): Implement global FLASH lock · 6d1686e0
      swym authored and rahix's avatar rahix committed
      - Implement de-initialization
      - Wrap filesystem operations in semaphore
      - Introduce EpicFileSystem object and move epic_file_FOO(...)
        imlementations into efs_FOO(EpicFileSystem*, ...) functions.
      - epic_file_FOO(...) functions are now wrappers around the _fs_
        functions, but lock and unlock the global filesystem object before &
        after calls.  This way, all efs_ functions can assume that the
        necessary lock has been acquired.
      - libff: don't use FF_FS_REENTRANT, our own FS lock is enough
      6d1686e0
  16. Aug 06, 2019
  17. Aug 02, 2019
  18. Jul 29, 2019
  19. Jul 22, 2019
  20. Jul 21, 2019
  21. Jul 20, 2019
  22. Jul 16, 2019
  23. Jul 11, 2019
  24. Jul 08, 2019
  25. Jul 05, 2019
Loading