-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards/mpfs-icicle-kit: add initial support (RV64IMAC core) #16994
Draft
dylad
wants to merge
7
commits into
RIOT-OS:master
Choose a base branch
from
dylad:pr/draft/mpfs_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,463
−41
Conversation
This file contains 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
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
bors bot
added a commit
that referenced
this pull request
Mar 4, 2023
19341: Picolibc updates r=benpicco a=keith-packard ### Contribution description Minor updates to picolibc support for newer versions of picolibc, including 1.8. ### Testing procedure Here's the current build result for a board I happen to have on my bench right now: ``` $ make -C examples/blinky BOARD=nucleo-f103rb FEATURES_REQUIRED=picolibc ... /home/keithp/src/RIOT/sys/picolibc_syscalls_default/syscalls.c:319:1: error: unknown type name '_READ_WRITE_RETURN_TYPE' 319 | _READ_WRITE_RETURN_TYPE read(int fd, void *dest, size_t count) | ^~~~~~~~~~~~~~~~~~~~~~~ /home/keithp/src/RIOT/sys/picolibc_syscalls_default/syscalls.c:351:1: error: unknown type name '_READ_WRITE_RETURN_TYPE' 351 | _READ_WRITE_RETURN_TYPE write(int fd, const void *src, size_t count) | ^~~~~~~~~~~~~~~~~~~~~~~ ... ``` ### Description of changes 1. Fix the read/write return values (Picolibc 1.8 uses POSIX standard types now) 2. Add new symbols to linker scripts (Picolibc needs help dealing with TLS alignment) 3. Align stack and thread local storage block during thread setup. 19345: cpu/riscv_common: convert to uword_t usage r=benpicco a=dylad ### Contribution description This PR makes use of `uword_t` type in a few places in `cpu/riscv_common`. This should not have any effect on produced binaries. ### Testing procedure CI should be enough. ### Issues/PRs references Quickly adapt from #16994. It will help for 64 bits support one day ;) Co-authored-by: Keith Packard <[email protected]> Co-authored-by: Dylan Laduranty <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: build system
Area: Build system
Area: cpu
Area: CPU/MCU ports
Area: doc
Area: Documentation
Area: Kconfig
Area: Kconfig integration
Area: pkg
Area: External package ports
Area: sys
Area: System
Area: tests
Area: tests and testing framework
Platform: RISC-V
Platform: This PR/issue effects RISC-V-based platforms
State: don't stale
State: Tell state-bot to ignore this issue
State: WIP
State: The PR is still work-in-progress and its code is not in its final presentable form yet
Type: new feature
The issue requests / The PR implemements a new feature for RIOT
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.
Contribution description
This is a draft PR which adds support for the Microchip PolarFire SoC (MPFS) Icicle kit Engineering Sample board. This board features a quad RV64GC core + one RV64IMAC (and a whole FPGA fabric). Only the single RV64IMAC (Our first 64bits MCU !) support is added by this PR as the idea is to let Linux runs on the quad RV64GC alongside RIOT on the single RV64IMAC.
You can find more informations for the board on microchip/microsemi website and the SoC documentation is available here
This PR also adds a basic support for 64bits RISC-V architecture and the PLIC controller.
In the current state, only UART, GPIO and timer peripherals (all w/ IRQ support) are implemented. Others peripherals should be added in followup PR.
I used the baremetal SDK as RIOT pkg to include vendor files and lowlevel drivers, except interruptions management which is done by RIOT PLIC driver. (MPFS SDK link)
SoftConsole environment can be downloaded here but registration is required.
SoftConsole is not really needed but it provides the custom openOCD needed for the flashing part.
It will not longer be needed if openOCD support is upstreamed.
A lot of documentation is missing, but the board is an "usable shape". I'd like to use this draft PR to discuss some specific points like 64bits architecture for RIOT.
All comments and feedbacks are very welcome.
Testing procedure
Beware that
make flash
is currently unsupported as the openOCD fork provided by SoftConsole environment (the default Eclipse environment for baremetal development provided by Microchip) currently doesn't implement the flash driver. There is an additionnal tool that can be used for flashing the eNVM but I didn't find time to look at it yet.For now, RIOT only runs on the onboard LIM memory which is volatile. (One of the many reasons, this PR is a draft). Thus, in order to test any application, please use
make debug
for now. This command uses the combo openOCD/GDB to load the binary to the LIM memory.It is also needed to use the openOCD provided by SoftConsole for now. (I hope everything will be upstream at some point).
Regarding the toolchain, standard riscv-unknown-elf-gcc can be used in theory but I didn't test it as I am using the riscv-unknown-elf-gcc toolchain provided by the SoftConsole envinronment.
Example make command for flashing
tests/shell
onmpfs-icicle-kit-es
LIM memory.OPENOCD=/path/to/openocd/bin/openocd make BOARD=mpfs-icicle-kit-es -C tests/shell debug
Please expect (a lot of) compilations errors with
tests/
andexamples/
applications because of "cast from pointer to integer of different size". This is because we heavily use int to cast void argument (like callback argument). I made some fixes for a few tests application but I don't think this subject should be handled by this PR. Thus, it should be fix in another set of PRs.Issues/PRs references
None.
Many thanks to @polarfire-soc for providing me this awesome board !