From: Lionel Flandrin Date: Tue, 1 Aug 2017 12:02:48 +0200 Subject: [Buildroot] Patch: new board Socrates Cyclone 5 In-Reply-To: <20170801105303.48d9fcb3@windsurf.home> References: <20170730151502.6e99d720@windsurf.lan> <20170801075456.ir2ubcdo2h3n5r5l@ed> <20170801105303.48d9fcb3@windsurf.home> Message-ID: <20170801100248.smfxvyhxk624nnwq@ed> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net 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 u-boot does contain a valid mkpimage header. Since there are no standard extensions (Altera uses ".bin" for everything) it's easy to use the wrong file by mistake. I think buildroot's file should end in ".crc" (the ".bin" generated by u-boot is the raw u-boot binary and can't be used as-is). There's also the possibility of an error during flashing (truncated file or something similar). If the mkpimage CRC is invalid the ROM will bail out. So make sure you give the correct file size to your flasher. If everything else fails it should be possible to debug the boot sequence with the JTAG, see if the CPU jumps into the SPL code at some point. If it does then clearly it's the SPL that's bogus, otherwise it's the boot ROM refusing to load it for some reason. Here are some docs regarding "bare metal" debugging: https://rocketboards.org/foswiki/view/Documentation/UsingDS5HeadlessDebuggerWithAlteraSoCs > And the very reason why I opened up this thread is because it's not > great to have pre-built bootloader images in the Buildroot tree. I agree completely. > Best regards, > > Thomas -- Lionel Flandrin -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: