early_printk working on actual hardware!

3 views
Skip to first unread message

Tim Ansell

unread,
Oct 1, 2017, 8:26:27 PM10/1/17
to linux...@googlegroups.com, Joel Stanley, Stafford Horne
Hi everyone!

This week we had a major breakthrough on getting Linux going on LiteX. We got output from early_printk working on the Opsis board running on the or1k! https://pastebin.com/S4j569dw

The issue with the or1k locking up in the bios was cause by libbase not respecting the "redzone". The solution was this small patch -> https://github.com/mithro/litex/commit/0797314ca1ae575197dcbef0a2c6d81293f3d4cb - The redzone is 128 bytes and we need 32*4 bytes to save the registers. The M-Labs guys have not hit this problem because clang doesn't use the redzone. I'm going to make it a little clearer and send it to Florent and M-Labs. I have not found a way to detect if the redzone is in use (nor its size). You can actually compile with "-mno-red-zone" to also fix the problem (which might be a better solution for understanding stack space?). 

Joel is now working on cleaning up the Linux patches and getting to userspace. We plan to send the patches up to Stafford as soon as we can.

The major patch needed apart from drivers to make LiteX work is support for EVBAR in head.S this is complicated by the fact we can't touch anything at the time we need to stash it -- currently I use a hack to stash EVBAR into r0 which the ABI says should be set to zero. See https://github.com/mithro/linux-litex/commit/edd416193fe9992cb9a512f325bc1e49f6aa673e

After that the LiteX UART and timer are the first two drivers that will also need to be finished. We have temporarily enabled the inbuilt or1k timer for now.

I'm now working on getting Linux to early printk on both the MimasV2 and the Arty boards.

With try and send through some instructions for replicate our results later today?

Tim 'mithro' Ansell
Reply all
Reply to author
Forward
0 new messages