[Buildroot] Patch: new board Socrates Cyclone 5

Michał Łyszczek michal.lyszczek at gmail.com
Tue Aug 1 18:08:29 UTC 2017


W dniu 01.08.2017 o 13:21, Thomas Petazzoni pisze:
> Hello,
> 
> On Tue, 1 Aug 2017 13:07:11 +0200, Jan Viktorin wrote:
> 
>>> On Tue, Aug 01, 2017 at 10:53:03AM +0200, Thomas Petazzoni wrote:  
>>>> Hello,
>>>>
>>>> On Tue, 1 Aug 2017 09:54:56 +0200, Lionel Flandrin wrote:
>>>>     
>>>>> Can I access this preloader.bin somewhere? I could check if there's
>>>>> anything obviously special about it.    
>>>>
>>>> The preloader.bin is part of the patch that Michał sent:
>>>>
>>>>   https://patchwork.ozlabs.org/patch/795350/    
>>>
>>> Ah, I missed that, thank you for pointing it out.
>>>
>>> It's definitely a mkpimage file. A simple way to validate that is to
>>> check offset 0x40:
>>>
>>> @0x40: [41 53 30 31]     Magic ("AS01")
>>> @0x44: [00]              Version (v0 for Cyclone V)
>>> @0x45: [00]              Flags
>>> @0x46: [48 25]           Program length in words, so 38176B
>>> @0x48: [00 00]           Not used ("spare")
>>> @0x4a: [62 01]           Header checksum
>>>
>>> Then at the end of the file you have a 4 byte CRC which I haven't
>>> bothered to validate.
>>>
>>> So nothing out of the ordinary as far as I can tell. In particular I
>>> can't see anything ressembling a cryptographic signature at the
>>> beginning or end of the file. Looks like a regular u-boot SPL to me.
>>>
>>> I can't really say more about it, I don't have a Cyclone V board at
>>> the moment. My advice would be to validate that the SPL generated by  
>>
>> Hi, I've got a Socrates Cyclone V available and so I am able to test.
>> If there are any patches to test, I can probably help.
> 
> Michał original patch is at
> https://patchwork.ozlabs.org/patch/795350/, but I dislike having the
> prebuilt preloader.bin in the Buildroot tree. So if you can get that to
> work without having a pre-built binary in U-Boot, that'd be great.
> 
> Thanks!
> 
> Thomas
> 

Hi,

Sorry for confusion, by "signing" I meant using mkpimage to generate
header and CRC - no crypto magic here.

I tried flashing with genereted spl.crc but it didn't work, and it looks
like board never reaches SPL code - it hangs in boot rom (never reaches
code from sd card).

I have investigated it more and tried to compile uboot from altera's git
(https://github.com/altera-opensource/u-boot-socfpga ; tag v2017.07)

And I did:

make socfpga_cyclone5_config
make

I've also created valid mkpimage (using official one from altera), when
verifying mkpimage tool reports 4 valid images (all the same). In this
scenario cyclone still didn't boot up and hangs in boot rom and never
reaches spl code.

Jan Viktorin, you said you have socrates board, did you ever compile spl
manually for this board? It looks like I must be missing something.

Any ideas?

-- 
Best Regards
Łyszczek Michał

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170801/fbd561ae/attachment-0002.asc>


More information about the buildroot mailing list