Conversation
Yes, the microkit dbg puts only works in debug mode.
Just confirming you are using the smp-debug MICROKIT_CONFIG? If it's SMP it should be at least doing PSCI calls - do you see a PSCI version printed? I don't know what would be causing the PSCI calls to not work. |
Ah, OK, I didn't check that userland example uses microkit_dbg_puts(), sorry. I assumed a musl printf()...
I see the PSCI version printed. But now I suspect that CPU1 is just silently failing to start due to the missing 1:1 2 MB MMU mapping. I did not observe the same way of failing with the elfloader, but with branch buffers you never know :) thank you Christian |
Hmm, I'd be surprised if the MMU mapping is the problem as you aren't seeing any output from CPU1. We have (admittedly a hack) where after exiting UBoot we disable the MMU & caches and then just before starting seL4 we setup the page tables. If you see no output from CPU1 at all then it means something else is likely going wrong. Are you able to add a print at the end of the example output from PSCI booting on the odroidc4 |
Hello, I finally managed to get SMP working. However, simply changing the MMU mapping to exclude secure memory was not sufficient (but necessary); I also needed to map those regions as Normal Non-Cacheable and Inner Shareable (for the print_lock synchronisation variable) Another issue I encountered is that, for reasons I do not yet understand, my compiler does not correctly expand the atomic builtins. I'll check different versions or check the -cpu flags, but as a temporary workaround, to confirm the status I used inline asm stlr/ldar instructions instead. Seems like there are still some checks to do around the cpu synchronisation barriers. As a result, this patch will require some other preparatory PRs. |
Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
|
Hi! Just trying to test this out locally with the STM32 boards you sent us. We run into the following isues using the TF-A the boards come with on their SD card, that they set Also — the microkit project has its own manual (see manual.md), which should be updated with instructions to get the appropriate image. |
Either you run a very old version of TF-A (EL2 support was introduced a couple of year ago), or you run a 32bit build of seL4 (64bit u-boot does a mode switch to boot 32bit binary kernel). Can you double check please ? You can also rebuild TF-A from an alternate buildroot from bootlin https://github.com/bootlin/buildroot-external-st It is less updated and featured than the OSTL Yocto distribution , but perfectly enough for our needs
ok |
We run the version that came on the SD card with the boards, which seems to have been built in 2024. By "EL2 support was introduced a couple of year ago" do you mean in the STM32 version of TF-A?" I know we have other boards that are much older than boot in EL2 from TF-A. Anyhow, OK — I guess we need to reflash the SD cards with more appropriate versions of the firmware. I think it would be helpful to mention this briefly in the manual. |
sorry, I used the wrong wording: s/introduced/enabled.
OK. Another caveat that I noticed is that TF-A enables a watchdog. If it is not re-armed by a iwdg driver (e.g by the Linux VM), native seL4 applications with lot of traces in debug mode might not complete in time. edit: tell me if you need help, I can send you a raw file ready to flash in between. |
Hello,
This is a preliminary version enabling STM32MP2 support for Microkit. I am not yet familiar with all build options, so I may have missed some aspects. The SDK is built as follows:
python3 build_sdk.py --sel4=$KERNEL --boards=stm32mp2It has been tested with the following examples: hello, arm_smc, and passive_server, using this build command:
Remaining work / questions:
A quick look at util64.S:mmu_enable() suggests that we probably need to align with PR #244 before testing.
I have not yet figured out how to enable SMP/PSCI support.
It appears to be enabled when smp_cores is defined in the build script, but I do not see yet execution reaching arm_secondary_cpu_entry_asm()...
I am not seeing any UART output in release mode for the examples above.
Is it expected that UART output for PDs is only available in debug builds ?
Thank you for any comment/suggestion