AnsweredAssumed Answered

Is flash_header.S file relevant with newer android O uboot

Question asked by mrigendra chaubey on Jul 1, 2018
Latest reply on Jul 3, 2018 by mrigendra chaubey

I am using uboot 2017.03 for sabreauto android, and I am trying to use flash_header.S

 

I still do not understand how plugin image works.

 

When I flash my uboot.bin with fsl-sdcard-partition.sh. I will show 

 

mrigendra.chaubey@CPU-384U:~/uboot-imx_android_sabreauto$ sudo hexdump -C /dev/sdf
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001c0 01 00 ee fe ff ff 01 00 00 00 ff af e2 0e 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00 |EFI PART....\...|
00000210 ff 8a 6c dd 00 00 00 00 01 00 00 00 00 00 00 00 |..l.............|
00000220 ff af e2 0e 00 00 00 00 22 00 00 00 00 00 00 00 |........".......|
00000230 de af e2 0e 00 00 00 00 8b 43 02 05 72 4d ed 4a |.........C..rM.J|
00000240 be 85 17 f1 e3 69 c2 32 02 00 00 00 00 00 00 00 |.....i.2........|
00000250 80 00 00 00 80 00 00 00 86 d2 54 ab 00 00 00 00 |..........T.....|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000400 36 07 00 ea 00 00 00 00 00 00 00 00 00 00 00 00 |6...............| ---------> b _start at 1KiB
00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000800 d1 00 20 40 58 74 90 00 00 00 00 00 00 00 00 00 |.. @Xt..........| ---------------> ivt header at 2KiB

 

above dump is taken when I created a GPT partition table on the sd card using gparted.

Then I put my uboot.bin as 

 

sudo dd if=u-boot.bin of=/dev/sdf bs=512 seek=2

 

This do not work? Why?

 

Now if I overwrite over partition table as 

 

sudo dd if=u-boot.bin of=/dev/sdf bs=512K count=1

 

and hexdump 

 

00000000 36 07 00 ea 00 00 00 00 00 00 00 00 00 00 00 00 |6...............|  ---------> b _start at 0
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000400 d1 00 20 40 58 74 90 00 00 00 00 00 00 00 00 00 |.. @Xt..........|  ---------> ivt header at 1kiB
00000410 20 74 90 00 00 74 90 00 00 00 00 00 00 00 00 00 | t...t..........|
00000420 00 70 90 00 00 20 00 00 01 00 00 00 d1 00 20 40 |.p... ........ @|

 

This works after flashing.

 

So my problem is, with gpt partition table my image is not working. Somehow offsets are getting wrong as I can see that gpt header is at 0x800 or at 2KiB offset.

I want to flash this image using  fsl-sdcard-partition.sh,that also creates gpt partition table. In that case also it will not work. Then how can I use this uboot for android?

  

How big chunk ROM code copies from SD card  for plugin image?

From the TRM it says that load region is 4 Kbyte. That means ROM takes first 4k from SD card with gpt partition table too? 

If thats the case why ROM code can't find ivt header because still my ivt header is inside that 4k?

Can you tell where I am wrong? 

flash_header.S reference i am taking from here,

 

https://git.congatec.com/arm/qmx6_uboot/commit/476a853fac44b27c6a84f52b002e15e957f06d4f 

P.S.

I cannot track changes that what is done in order to change flash_header.S and it become plugin.S. on git log plugin.S nothing useful comes up.

 

on further search I saw this thread 

 

关于imx6q uboot中的flash_header.S一些疑问 

 

but with no answer, but my question is same.

Outcomes