Uboot does not boot when it is put at 400 offset

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Uboot does not boot when it is put at 400 offset

1,174 Views
mrigendra_chaub
Contributor III

Hi All,

my board is i.MX 6QuadPlus sabresd

1. I have this question that if I have a pluging image as uboot that is flash_header.S then how can I create a uboot.imx file out of it?

For sabreauto board in board/freescale/sabreauto directory I see these files

imximage.cfg

plugin.S

mx6qsabreauto.c

and some more .cfg files.

CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6sabresd/mx6qp.cfg,MX6QP"

But for my board I only see these

flash_header.S

board_header.h

CONFIG_SYS_EXTRA_OPTIONS=""

but nothing as .cfg file.

2. Some observations of mine when I uses plugin image and uboot.img 

When I compile the uboot as uboot.img I see this from the hexdump

00000000 27 05 19 56 0c 00 3d 7b 5b 2e 96 e1 00 08 00 00 |'..V..={[.......|
00000010 17 80 00 00 00 00 00 00 b3 6a 65 64 11 02 05 00 |.........jed....|
00000020 55 2d 42 6f 6f 74 20 32 30 31 36 2e 30 33 2d 67 |U-Boot 2016.03-g|
00000030 64 61 34 64 37 64 32 20 66 6f 72 20 6d 78 36 71 |da4d7d2 for mx6q|
00000040 2e 07 00 ea 55 55 55 55 55 55 55 55 55 55 55 55 |....UUUUUUUUUUUU|
00000050 55 55 55 55 00 00 00 00 00 00 00 00 00 00 00 00 |UUUU............|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*

00000440 d1 00 20 40 xx xx xx xx xx xx xx xx xx     |.. @Xt..........|

If I flash this image to the board

sudo dd if=u-boot.img of=/dev/sdX bs=1M count=1 

the board does not bootup

But if I strip first 64 byte header and make it like this,

00000000 2e 07 00 ea 55 55 55 55 55 55 55 55 55 55 55 55 |....UUUUUUUUUUUU| 
00000010 55 55 55 55 00 00 00 00 00 00 00 00 00 00 00 00 |UUUU............|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

*

00000400 d1 00 20 40 xx xx xx xx xx xx xx xx xx     |.. @Xt..........|

the board boots up.

from 0000000 to 00000020 is start of the assembly code in flash_header.S and at 440 some more assembly instructions inside flash_header.S

I read TRM and I read this 

Boot Device Type                        Image Vector Table Offset              Initial Load Region Size

SD/MMC/eSD/eMMC/SDXC          1 Kbyte = 0x400 bytes                  4 Kbyte

Exp1: NXP sabre board uses these images to boot up

U-Boot image: u-boot.imx 
boot image: boot.img 
Android system image: system.img 
Recovery image: recovery.img 
GPT table image: partition-table.img 
Vendor image: vendor.img 

I took my uboot image's where I have stripped uboot.img's first 64 bytes, and put in sabresd board, sabresd boots up.

Same sabresd boots with nxp android images where I checked with hexdump, the code does not start same as mine. So how ROM code undestand location of uboot in both kind of images?

Can anybody point me in right direction. My goal is to use this uboot and boot android images using nxp flashing tool.

0 Kudos
4 Replies

839 Views
igorpadykov
NXP Employee
NXP Employee

Hi mrigendra

plugin usage is described in sect.8.7 Plugin image i.MX6DQP Reference Manual

https://www.nxp.com/docs/en/reference-manual/iMX6DQPRM.pdf 

Does it working without plugin method.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

839 Views
mrigendra_chaub
Contributor III

Yes it works with plugin method.

My question is regarding offsets.

0 Kudos

839 Views
igorpadykov
NXP Employee
NXP Employee

offsets are the same, difference only in plugin flag as

described in Figure 8-21. Image Vector Table i.MX6DQ Reference Manual.

0 Kudos

839 Views
mrigendra_chaub
Contributor III

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 

0 Kudos