SPL bad magic at boot in the MLO file

202 views
Skip to first unread message

Micka

unread,
Jun 17, 2016, 12:16:55 PM6/17/16
to Robert Nelson, beagl...@googlegroups.com
Hi, when the board boot, I've the message that tell me : 

bad magic. and after a deep research, it come from the SPL :

common/spl/spl_mmc.c

        if (image_get_magic(header) != IH_MAGIC) {
                puts("bad magic\n");


how can i fix that ? 

Micka,

Micka

unread,
Jun 17, 2016, 12:19:08 PM6/17/16
to Robert Nelson, beagl...@googlegroups.com
I've compiled the uboot again and again, and it doesn't change anything when I replace the old MLO file :

dd if=./MLO of=${DISK} count=1 seek=1 bs=128k


Robert Nelson

unread,
Jun 17, 2016, 12:23:33 PM6/17/16
to Micka, beagl...@googlegroups.com
On Fri, Jun 17, 2016 at 11:18 AM, Micka <micka...@gmail.com> wrote:
> I've compiled the uboot again and again, and it doesn't change anything when
> I replace the old MLO file :
>
> dd if=./MLO of=${DISK} count=1 seek=1 bs=128k
>
>
>
> Le ven. 17 juin 2016 à 18:16, Micka <micka...@gmail.com> a écrit :
>>
>> Hi, when the board boot, I've the message that tell me :
>>
>> bad magic. and after a deep research, it come from the SPL :
>>
>> common/spl/spl_mmc.c
>>


//if (image_get_magic(header) != IH_MAGIC) {
// puts("bad magic\n");
// }

fixed!

Regards,

--
Robert Nelson
https://rcn-ee.com/

Micka

unread,
Jun 17, 2016, 12:32:08 PM6/17/16
to Robert Nelson, beagl...@googlegroups.com
Lol, ok 

But what went wrong ?  It's checking a magic number to prevent something broken.

Can I write back the correct magic number ? 

I found that in this file : arch/powerpc/cpu/mpc8xx/start.S

it write somewhere the magic number : 0x27051956

But I don't see where the magic number is written for the beaglebone black uboot. 


any idea ?


William Hermans

unread,
Jun 17, 2016, 12:42:38 PM6/17/16
to beagl...@googlegroups.com

         //if (image_get_magic(header) != IH_MAGIC) {
          //       puts("bad magic\n");
          // }

fixed!
hehe !


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAF%2BMRtktwu9Yo9WchO%2BVpQ6Y1Vej2qLB397gBBhPnnFRDd-wmg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Robert Nelson

unread,
Jun 17, 2016, 12:47:54 PM6/17/16
to Micka, beagl...@googlegroups.com
On Fri, Jun 17, 2016 at 11:31 AM, Micka <micka...@gmail.com> wrote:
> Lol, ok
>
> But what went wrong ? It's checking a magic number to prevent something
> broken.
>
> Can I write back the correct magic number ?
>
> I found that in this file : arch/powerpc/cpu/mpc8xx/start.S
>
> it write somewhere the magic number : 0x27051956
>
> But I don't see where the magic number is written for the beaglebone black
> uboot.

it's for something generic, but we don't use it.. I'm tempted to just
patch it like my joke, as people do ask..

Micka

unread,
Jun 17, 2016, 12:50:49 PM6/17/16
to Robert Nelson, beagl...@googlegroups.com
ok

When I compile the uboot, are we using this one ? 

arch/arm/cpu/armv7/start.S

Can we add something like that :

        .long   0x27051956              /* U-Boot Magic Number                  */

Micka

unread,
Jun 17, 2016, 2:24:15 PM6/17/16
to Robert Nelson, beagl...@googlegroups.com
OK that not it I think.

I've tried to understand when the header is written in the MLO. And it looks like that it is the mkimage job . ( not sure ) .

the mkimage is call to create the MLO file. I discovered that the function omapimage_set_header is called to create the header file.

So it's not at all this structure

typedef struct image_header {
        __be32          ih_magic;       /* Image Header Magic Number    */
....................
} image_header_t;

but it's using this header : struct gp_header.


And that where I'm confused, because in the file : common/spl/spl_mmc.c it's looking at this header : 

struct image_header *header;

        header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
                                         sizeof(struct image_header));


What is wrong Robert Nelson, Where am I wrong ?
Reply all
Reply to author
Forward
0 new messages