-
-
Notifications
You must be signed in to change notification settings - Fork 80
[EV3] Initial MMU enablement #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dlech
reviewed
Aug 1, 2025
Collaborator
Author
|
Done. I added a |
These transfers allow reading "characteristics" which would otherwise be exchanged over BLE GATT. They contain information about the firmware version and hub capabilities. Also move the bRequest values into pbio/protocol.h so they can be shared
In order to be able to detect disconnection, we cannot force device mode in the PHY. Forcing device mode overrides the analog comparators used to detect VBUS. Not forcing device mode should be fine because device mode is the default (enabling host mode requires setting DEVCTL.SESSION explicitly, and the ID pin is explicitly disconnected on the EV3 PCB.)
This handles Pybricks commands, status flag reporting, and timeouts. stdout is not yet handled.
This replaces the old stopgap stdout logic with stdio over USB
Without this timer, if the hub state doesn't change and the user program doesn't output anything, the hub won't be able to detect that the host software has closed (because it never sends anything which could time out). Keeping this state reasonably up-to-date is important for the hub auto-power-off functionality.
The EV3 technically has an IO port power control, but it doesn't only control the main peripheral ports but also the ADC and USB. It also doesn't require quirk handling to be able to power-cycle the ports. Make this feature compile-time optional rather than having dummy values. This was previously silently dereferencing a null pointer.
Otherwise this dereferences a null pointer.
The MMU was being previously left on by U-boot. Turn it off before starting the system.
This creates an identity mapping for only the valid bits of the address space. It also adds logic to the exception handler to print out fault addresses. This currently marks the entire address space as uncacheable. Drivers will need to be updated to take caches into account before we can mark RAM as cacheable.
This makes sure that we can never take a TLB miss penalty when accessing MMIO or local RAM. These "lockdown" TLB entries are not used by general-purpose operating systems like Linux, and they are entirely separate from the "normal" TLB entries.
The actual faulting instruction for these exceptions is offset (due to CPU pipelining in this core, later as part of compatibility). Print the actual faulting instruction address so that the developer doesn't have to manually subtract 8.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code enables the MMU and configures it to trap very-invalid memory accesses. It also currently marks the entire address space as uncacheable until drivers can be updated to properly flush data out of cache.
Previously, U-boot was leaving the MMU enabled, with page tables at the end of DRAM at 0xC3FF0000
This also fixes some invalid pointers that were discovered along the way.