summaryrefslogtreecommitdiff
path: root/ports/litex
AgeCommit message (Collapse)Author
2021-03-15run code formatting scriptmicroDev
2021-02-11merge from upstream; complicated webusb mergeDan Halbert
2021-02-04usb descriptors all set; rework of enabling for USB devicesDan Halbert
2021-01-24CIRCUITPY_* switches for JSON, RE, etc. Doc cleanupDan Halbert
2020-12-29Merge pull request #3888 from microDev1/fix-reset-pinJeff Epler
FIX : common_hal_reset_pin()
2020-12-28Merge pull request #3878 from xobs/fomu-fixes-6.0.0Scott Shawcroft
Fomu fixes for 6.0.0
2020-12-28update common_hal_reset_pin()microDev
2020-12-24litex: move more critical code to RAMSean Cross
The XIP SPI flash on Fomu is slow, which results in certain operations taking a long time. This becomes a problem for time-critical operations such as USB. Move various calls into RAM to improve performance. This includes the call to __modsi3 and __udivsi3 which are used by the supervisor handler to determine if periodic callbacks need to be run. This finishes fixing #3841 Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-24litex: ensure we don't re-enable interrups during ISRSean Cross
During an interrupt handler, interrupts are implicitly disabled. They will be re-enabled when the interrupt handler returns. Due to some changes that were made, varous calls will re-enable interrupts after they're finished. Examples of this include calling `CALLBACK_CRITICAL_END` and getting the number of ticks with `port_get_raw_ticks()`. This patch prevents this from happening by doing two things: 1. Use standard calls in `port_get_raw_ticks()` to disable and re-enable interrupts, preventing nesting issues, and 2. Increase the nesting count inside `isr()`, reflecting the implicit call that is made by hardware when an interrupt is handled This helps to address #3841. Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-17Merge pull request #3752 from jepler/gcc10Dan Halbert
build: Update to gcc10
2020-12-15-ftree-vrp better diagnostics on -Os builds; -fno-inline-functions for -O2; ↵Dan Halbert
fix struct init in HCI bleio
2020-12-08Add `board_deinit` for use with sleepScott Shawcroft
This changes lots of files to unify `board.h` across ports. It adds `board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to deinit the board before deep sleeping (even when pretending.) Deep sleep is now a two step process for the port. First, the port should prepare to deep sleep based on the given alarms. It should set alarms for both deep and pretend sleep. In particular, the pretend versions should be set immediately so that we don't miss an alarm as we shutdown. These alarms should also wake from `port_idle_until_interrupt` which is used when pretending to deep sleep. Second, when real deep sleeping, `alarm_enter_deep_sleep` is called. The port should set any alarms it didn't during prepare based on data it saved internally during prepare. ESP32-S2 sleep is a bit reorganized to locate more logic with TimeAlarm. This will help it scale to more alarm types. Fixes #3786
2020-12-02Merge pull request #3612 from gamblor21/bus_deviceScott Shawcroft
Moving Adafruit_CircuitPython_BusDevice to core
2020-12-02Merge pull request #3767 from dhalbert/sleepScott Shawcroft
Initial alarm and sleep PR: time alarms with light and deep sleep; PinAlarms not yet implemented
2020-12-01address review commentsDan Halbert
2020-12-01Merge branch 'main' into bus_deviceMark
2020-11-28Add movable allocation system.Christian Walther
This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap. By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review.
2020-11-26deep sleep working; deep sleep delay when connectedDan Halbert
2020-11-25merge from upstream + wipDan Halbert
2020-11-22wipDan Halbert
2020-11-21wip: ResetReason to microcontroller.cpuDan Halbert
2020-11-11Removing from smaller buildsgamblor21
2020-10-27Add check for invalid io, function to disable all alarmsmicroDev
2020-10-27Add description of alarm modulesmicroDev
2020-10-15no _bleio for litex; ESP32S2 defines BIT() alreadyDan Halbert
2020-10-14Merge pull request #3554 from gamblor21/move_ordereddictDan Halbert
Moved ORDEREDDICT define to central location
2020-10-13Moved ORDEREDDICT define to central locationgamblor21
2020-10-12Finer grained, per port tick lockingScott Shawcroft
Fixes #3504 hopefully.
2020-09-28Add some NORETURN attributesJeff Epler
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom: ``` int find_unused_slot(void) { // precondition: you already verified that a slot was available for (int i=0; i<NUM_SLOTS; i++) { if( slot_free(i)) { return i; } } safe_mode_reset(MICROPY_FATAL_ERROR); } ``` However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN. So I started by teaching the compiler that reset_into_safe_mode never returned. This leads at least one level deeper due to reset_cpu needing to be a NORETURN function. Each port is a little different in this area. I also marked reset_to_bootloader as NORETURN. Additional notes: * stm32's reset_to_bootloader was not implemented, but now does a bare reset. Most stm32s are not fitted with uf2 bootloaders anyway. * ditto cxd56 * esp32s2 did not implement reset_cpu at all. I used esp_restart(). (not tested) * litex did not implement reset_cpu at all. I used reboot_ctrl_write. But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested). reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added. * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added. * In several places, NVIC_SystemReset is redeclared with NORETURN applied. This is accepted just fine by gcc. I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared. * the stub safe_mode reset simply aborts. This is used in mpy-cross.
2020-07-24Merge pull request #15 from adafruit/mainDavePutz
update from main
2020-07-24Finish common-hal pin APILucian Copeland
2020-07-23Changes to optimization optionroot
2020-07-22Changes to add compiler optimization optionroot
2020-07-21Add option for higher optimization levelsroot
2020-07-15supervisor: factor supervisor_background_tasks from sundry portsJeff Epler
2020-07-15supervisor: factor out, Handle USB via background callbackJeff Epler
2020-07-06Add license to some obvious files.Diego Elio Pettenò
2020-07-01Merge pull request #3083 from tannewt/esp32s2_busioJeff Epler
Add busio support for the ESP32-S2
2020-06-26Use NULL for deinited DigitalInOutScott Shawcroft
This fixes a Display issue where no backlight pin is given but it's still deinitialized.
2020-06-26sdcardio: implement new library for SD card I/OJeff Epler
Testing performed: That a card is successfully mounted on Pygamer with the built in SD card slot This module is enabled for most FULL_BUILD boards, but is disabled for samd21 ("M0"), litex, and pca10100 for various reasons.
2020-06-25I2CPeripheral: Rename class and its moduleJeff Epler
This is an incompatible change.
2020-06-23supervisor.mk: Compute USB_DEVICES; remove from boards and portsJeff Epler
Since Actions passed on the previous commit, where this computed value was checked against the specified value (if any), this is no net change, except that we no longer need to specify it for particular boards or ports.
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-02litex: remove call to `board_init()`Sean Cross
These calls were all moved into `main.c`, however this call was not removed from litex. As a result, litex was calling `board_init()` twice. This is currently not a problem, as `fomu` is able to be initialized twice without issue, however future boards may have issue with this. This fixes #2991. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-28A number of small ESP32S2 fixes:Scott Shawcroft
* Fix flash writes that don't end on a sector boundary. Fixes #2944 * Fix enum incompatibility with IDF. * Fix printf output so it goes out debug UART. * Increase stack size to 8k. * Fix sleep of less than a tick so it doesn't crash.
2020-05-20Update digitalio api for other portsScott Shawcroft
2020-05-15Initial ESP32S2 port.Scott Shawcroft
Basic blinky works but doesn't check pins.
2020-05-05refactor countio based on feedbackDaniel Pollard
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-27Merge pull request #2817 from jepler/stm-linker-scriptsDan Halbert
Standardize on FLASH_FIRMWARE section name in linker scripts