<div dir="ltr">All this said, note that the HiFive is no more open, today, than your average ARM SOC; and it is much less open than, e.g., Power. I realize there was a lot of hope in the early days that RISC-V implied "openness" but as we can see that is not so. There's blobs in HiFive. <div><br></div><div>Open instruction sets do not necessarily result in open implementations. An open implementation of RISC-V will require a commitment on the part of a company to opening it up at all levels, not just the instruction set.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 22, 2018 at 6:12 AM Shawn <<a href="mailto:citypw@gmail.com">citypw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jun 22, 2018 at 7:01 PM, Jonathan Neuschäfer<br>
<<a href="mailto:j.neuschaefer@gmx.net" target="_blank">j.neuschaefer@gmx.net</a>> wrote:<br>
> On Fri, Jun 22, 2018 at 03:04:06PM +0800, Shawn wrote:<br>
>> Hi Jonathan,<br>
>><br>
>> On Thu, Jun 21, 2018 at 7:48 PM, Jonathan Neuschäfer<br>
> [...]<br>
>> > With the unfinished coreboot port, I want it to look like this (although<br>
>> > *a lot* of work has to be done on coreboot first, and I'm currently not<br>
>> > actively working on that, for a few months):<br>
>> ><br>
>> >   MSEL (ROM0) -> ZSBL (ROM1) -> coreboot (+bbl?) -> Linux,  or<br>
>> >   MSEL (ROM0) -> coreboot (+bbl?) -> Linux<br>
>> ><br>
>> > ZSBL can be skipped, so you don't need to run closed source ROM code, at<br>
>> > least as far as the hardware is concerned.<br>
>> ><br>
>> Is ZSBL really can be skipped? I thought it was part of internal ROM<br>
>> inside the chip.<br>
><br>
> Yes. If you set the MSEL switches to 0001, the code in the MSEL ROM<br>
> (aka. ROM0) jumps directly into the memory-mapped SPI flash, instead of<br>
> into the big ROM1, where ZSBL is.<br>
><br>
> Coreboot doesn't yet support this mode, but the hardware allows it.<br>
><br>
>> > (And note that this is just the situation on this particular SoC. Other<br>
>> > SoCs from SiFive or other vendors may boot differently.)<br>
>> ><br>
>> Well, if FSBL is the place where coreboot comes into play, we might<br>
>> only have two options: 1, Reversing the FSBL which is ~9k assembly LOC<br>
>> 2, SiFive make the FSBL open source( I don't see any reason why they<br>
>> don't do it if they intend to build an open eco-system for RISC-V).<br>
><br>
> A high-level list of tasks that FSBL performs is in the manual[1]:<br>
><br>
>   • Switch core frequency to 1 GHz (or 500 MHz if TLCLKSEL =1) by<br>
>     configuring and running off the on-chip PLL<br>
>   • Configure DDR PLL, PHY, and controller<br>
>   • Set GEM GXL TX PLL to 125 MHz and reset it<br>
>   • If there is an external PHY, reset it<br>
>   • Download BBL from a partition with GUID type<br>
>     2E54B353-1271-4842-806F-E436D6AF69851<br>
>   • Scan the OTP for the chip serial number<br>
>   • Copy the embedded DTB to DDR, filling in FSBL version, memory<br>
>     size, and MAC address<br>
>   • Enable 15 of the 16 L2 ways (this removes almost all of the L2<br>
>     LIM memory)<br>
>   • Jump to DDR memory (0x8000_0000)<br>
><br>
> Initializing the PLLs and reading the OTP ROM should be easy enough<br>
> because both are documented in, I think, sufficient detail.<br>
><br>
> Section 20.3 describes the initialization sequence for the DRAM<br>
> controller, but leaves out the values for the register for "memory<br>
> timing settings, PAD mode configuration, initialization, and training."<br>
> It says: "Please contact SiFive directly to determine the complete<br>
> register settings for your application."<br>
><br>
> I will ask on the forum.<br>
><br>
> Assuming that SiFive will tell us the values of the missing<br>
> configuration registers, I don't think we need to reverse-engineer FSBL.<br>
><br>
That's good to know and it's very helpful. We've been studying how to<br>
make coreboot work on Hifve Unleashed. If the reversing is not<br>
necessary, that'd be save a lot of time especially the decompiler for<br>
RISC-V doesn't exist yet. Thanks for the info.<br>
<br>
<br>
-- <br>
GNU powered it...<br>
GPL protect it...<br>
God blessing it...<br>
<br>
regards<br>
Shawn<br>
<br>
-- <br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mailman/listinfo/coreboot</a></blockquote></div>