All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] no DTB with nand SPL on sama5d3
@ 2019-01-16  1:13 Daniel Evans
  2019-01-16 13:02 ` Eugen.Hristev at microchip.com
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Evans @ 2019-01-16  1:13 UTC (permalink / raw)
  To: u-boot

After flashing my boot.bin to nand I get the following output:

RomBOOT
<debug_uart> Missing DTB
### ERROR ### Please RESET the board ###

I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?

Dan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-16  1:13 [U-Boot] no DTB with nand SPL on sama5d3 Daniel Evans
@ 2019-01-16 13:02 ` Eugen.Hristev at microchip.com
  2019-01-16 19:05   ` Daniel Evans
  0 siblings, 1 reply; 14+ messages in thread
From: Eugen.Hristev at microchip.com @ 2019-01-16 13:02 UTC (permalink / raw)
  To: u-boot




On 16.01.2019 03:13, Daniel Evans wrote:
> After flashing my boot.bin to nand I get the following output:
> 
> RomBOOT
> <debug_uart> Missing DTB
> ### ERROR ### Please RESET the board ###
> 
> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?

Hello Daniel,

Which defconfig are you using when building u-boot ?

You are trying to load the U-boot SPL right ?

It doesn't look like you even get to the point when you get to load the 
u-boot proper, so maybe there are missing parts from your SPL, or the 
size inside the 6th reset vector is not correctly calculated

Did you try with our at91bootstrap proprietary second level bootloader 
and get the same issue when booting the proper u-boot with it ?

Hope this helps,

Eugen

> 
> Dan
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-16 13:02 ` Eugen.Hristev at microchip.com
@ 2019-01-16 19:05   ` Daniel Evans
  2019-01-17  9:01     ` Eugen.Hristev at microchip.com
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Evans @ 2019-01-16 19:05 UTC (permalink / raw)
  To: u-boot

Hello,

Yes, I am trying to load the U-boot SPL

What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.  

AT91bootstrap works fine.

I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?

The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?

Dan



> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
> 
> 
> 
> 
> On 16.01.2019 03:13, Daniel Evans wrote:
>> After flashing my boot.bin to nand I get the following output:
>> 
>> RomBOOT
>> <debug_uart> Missing DTB
>> ### ERROR ### Please RESET the board ###
>> 
>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
> 
> Hello Daniel,
> 
> Which defconfig are you using when building u-boot ?
> 
> You are trying to load the U-boot SPL right ?
> 
> It doesn't look like you even get to the point when you get to load the 
> u-boot proper, so maybe there are missing parts from your SPL, or the 
> size inside the 6th reset vector is not correctly calculated
> 
> Did you try with our at91bootstrap proprietary second level bootloader 
> and get the same issue when booting the proper u-boot with it ?
> 
> Hope this helps,
> 
> Eugen
> 
>> 
>> Dan
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
>> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-16 19:05   ` Daniel Evans
@ 2019-01-17  9:01     ` Eugen.Hristev at microchip.com
  2019-01-17  9:05       ` Simon Goldschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Eugen.Hristev at microchip.com @ 2019-01-17  9:01 UTC (permalink / raw)
  To: u-boot



On 16.01.2019 21:05, Daniel Evans wrote:
> Hello,
> 
> Yes, I am trying to load the U-boot SPL
> 
> What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.

This is definitely weird. Are you using vanilla u-boot and no changes on 
top with the sama5d3_xplained? Looks like not even your console works in 
spl, or, you have a bad binary .

> 
> AT91bootstrap works fine.
> 
> I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?

How are you writing your nandflash ? are you using our sam-ba tool to 
write it ? do you use writeboot applet ?

> 
> The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?

Yes it should not include it. And if you write using sam-ba the nand 
header will be written by sam-ba, so your binary should not include it 
already.

I also suggest you open up a support ticket on support.microchip.com as 
our FAE have a lot of experience to assist with such situations.

Hope this helps,
Eugen

> 
> Dan
> 
> 
> 
>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>
>>
>>
>>
>> On 16.01.2019 03:13, Daniel Evans wrote:
>>> After flashing my boot.bin to nand I get the following output:
>>>
>>> RomBOOT
>>> <debug_uart> Missing DTB
>>> ### ERROR ### Please RESET the board ###
>>>
>>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
>>
>> Hello Daniel,
>>
>> Which defconfig are you using when building u-boot ?
>>
>> You are trying to load the U-boot SPL right ?
>>
>> It doesn't look like you even get to the point when you get to load the
>> u-boot proper, so maybe there are missing parts from your SPL, or the
>> size inside the 6th reset vector is not correctly calculated
>>
>> Did you try with our at91bootstrap proprietary second level bootloader
>> and get the same issue when booting the proper u-boot with it ?
>>
>> Hope this helps,
>>
>> Eugen
>>
>>>
>>> Dan
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>>>
> 
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-17  9:01     ` Eugen.Hristev at microchip.com
@ 2019-01-17  9:05       ` Simon Goldschmidt
  2019-01-17  9:09         ` Eugen.Hristev at microchip.com
  0 siblings, 1 reply; 14+ messages in thread
From: Simon Goldschmidt @ 2019-01-17  9:05 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>
>
>
> On 16.01.2019 21:05, Daniel Evans wrote:
> > Hello,
> >
> > Yes, I am trying to load the U-boot SPL
> >
> > What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>
> This is definitely weird. Are you using vanilla u-boot and no changes on
> top with the sama5d3_xplained? Looks like not even your console works in
> spl, or, you have a bad binary .

With debug uart enabled it shows the DTB is missing. So when using the
mainline defconfig (where debug uart is disabled) it fails to find a console as
the DTB is missing. That's unfortunate, but expected behaviour with DM_SERIAL,
I guess.

I don't know the hardware, but the real problem seems to me that the binary
being flashed is somehow missing the DTB?

Regards,
Simon

>
> >
> > AT91bootstrap works fine.
> >
> > I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?
>
> How are you writing your nandflash ? are you using our sam-ba tool to
> write it ? do you use writeboot applet ?
>
> >
> > The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?
>
> Yes it should not include it. And if you write using sam-ba the nand
> header will be written by sam-ba, so your binary should not include it
> already.
>
> I also suggest you open up a support ticket on support.microchip.com as
> our FAE have a lot of experience to assist with such situations.
>
> Hope this helps,
> Eugen
>
> >
> > Dan
> >
> >
> >
> >> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
> >>
> >>
> >>
> >>
> >> On 16.01.2019 03:13, Daniel Evans wrote:
> >>> After flashing my boot.bin to nand I get the following output:
> >>>
> >>> RomBOOT
> >>> <debug_uart> Missing DTB
> >>> ### ERROR ### Please RESET the board ###
> >>>
> >>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
> >>
> >> Hello Daniel,
> >>
> >> Which defconfig are you using when building u-boot ?
> >>
> >> You are trying to load the U-boot SPL right ?
> >>
> >> It doesn't look like you even get to the point when you get to load the
> >> u-boot proper, so maybe there are missing parts from your SPL, or the
> >> size inside the 6th reset vector is not correctly calculated
> >>
> >> Did you try with our at91bootstrap proprietary second level bootloader
> >> and get the same issue when booting the proper u-boot with it ?
> >>
> >> Hope this helps,
> >>
> >> Eugen
> >>
> >>>
> >>> Dan
> >>> _______________________________________________
> >>> U-Boot mailing list
> >>> U-Boot at lists.denx.de
> >>> https://lists.denx.de/listinfo/u-boot
> >>>
> >
> >
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-17  9:05       ` Simon Goldschmidt
@ 2019-01-17  9:09         ` Eugen.Hristev at microchip.com
  2019-01-17 18:38           ` Daniel Evans
  2019-01-17 21:34           ` Daniel Evans
  0 siblings, 2 replies; 14+ messages in thread
From: Eugen.Hristev at microchip.com @ 2019-01-17  9:09 UTC (permalink / raw)
  To: u-boot



On 17.01.2019 11:05, Simon Goldschmidt wrote:
> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>
>>
>>
>> On 16.01.2019 21:05, Daniel Evans wrote:
>>> Hello,
>>>
>>> Yes, I am trying to load the U-boot SPL
>>>
>>> What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>
>> This is definitely weird. Are you using vanilla u-boot and no changes on
>> top with the sama5d3_xplained? Looks like not even your console works in
>> spl, or, you have a bad binary .
> 
> With debug uart enabled it shows the DTB is missing. So when using the
> mainline defconfig (where debug uart is disabled) it fails to find a console as
> the DTB is missing. That's unfortunate, but expected behaviour with DM_SERIAL,
> I guess.
> 
> I don't know the hardware, but the real problem seems to me that the binary
> being flashed is somehow missing the DTB?

Yes that can happen, I suggested that some parts of the SPL are missing 
- either the binary flashed is smaller than the real size (and the DTB, 
being at the end is not copied...),

or the value inside the 6th vector is wrong, and the first stage 
bootloader is not copying enough data from NAND to RAM when executing 
the SPL binary. The first stage BL only copies the number of bytes given 
by 6th vector value

> 
> Regards,
> Simon
> 
>>
>>>
>>> AT91bootstrap works fine.
>>>
>>> I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?
>>
>> How are you writing your nandflash ? are you using our sam-ba tool to
>> write it ? do you use writeboot applet ?
>>
>>>
>>> The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?
>>
>> Yes it should not include it. And if you write using sam-ba the nand
>> header will be written by sam-ba, so your binary should not include it
>> already.
>>
>> I also suggest you open up a support ticket on support.microchip.com as
>> our FAE have a lot of experience to assist with such situations.
>>
>> Hope this helps,
>> Eugen
>>
>>>
>>> Dan
>>>
>>>
>>>
>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>
>>>>
>>>>
>>>>
>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>
>>>>> RomBOOT
>>>>> <debug_uart> Missing DTB
>>>>> ### ERROR ### Please RESET the board ###
>>>>>
>>>>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
>>>>
>>>> Hello Daniel,
>>>>
>>>> Which defconfig are you using when building u-boot ?
>>>>
>>>> You are trying to load the U-boot SPL right ?
>>>>
>>>> It doesn't look like you even get to the point when you get to load the
>>>> u-boot proper, so maybe there are missing parts from your SPL, or the
>>>> size inside the 6th reset vector is not correctly calculated
>>>>
>>>> Did you try with our at91bootstrap proprietary second level bootloader
>>>> and get the same issue when booting the proper u-boot with it ?
>>>>
>>>> Hope this helps,
>>>>
>>>> Eugen
>>>>
>>>>>
>>>>> Dan
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>
>>>
>>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-17  9:09         ` Eugen.Hristev at microchip.com
@ 2019-01-17 18:38           ` Daniel Evans
  2019-01-17 21:34           ` Daniel Evans
  1 sibling, 0 replies; 14+ messages in thread
From: Daniel Evans @ 2019-01-17 18:38 UTC (permalink / raw)
  To: u-boot

So I did a fresh clone of Uboot and got the same result:
RomBOOT
<debug_uart> Missing DTB
### ERROR ### Please RESET the board ###

To create the boot.bin I ran the following:
make mrproper
make sama5d3_xplained_nandflash_defconfig

I would then use an SD card to boot linux and then copy the boot.bin and other files with flash_erase and hand_write:

flash_erase /dev/mtd0 0 0
nandwrite -p /dev/mtd0 boot.bin

And here is the size of mtd0:
dev:    size   erasesize  name
mtd0: 00040000 00020000 “uboot_spl"

And you can see in the boot.bin file the following hex values:

0000000 2405 c090 2405 c090 2405 c090 2405 c090
*
00000d0 000f ea00 f014 e59f f014 e59f f014 e59f
00000e0 f014 e59f c51e 0000 f014 e59f f014 e59f


Which does correspond to the size once you remove the 208 header bytes.:
-rw-r--r-- 1 nelson nelson 50670 Jan 17 11:15 boot.bin

And it does appear to include the DTB since boot.bin without the nandheader (tail -C+209) is identical to spl/u-boot-spl.bin (except for the 6th vector), which is identical to spl/u-boot-spl-dtb.bin.  

Can you get it to work?

For completeness my cross compiler is gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf

Thanks,

Dan




> On Jan 17, 2019, at 2:09 AM, Eugen.Hristev at microchip.com wrote:
> 
> 
> 
> On 17.01.2019 11:05, Simon Goldschmidt wrote:
>> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>> 
>>> 
>>> 
>>> On 16.01.2019 21:05, Daniel Evans wrote:
>>>> Hello,
>>>> 
>>>> Yes, I am trying to load the U-boot SPL
>>>> 
>>>> What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>> 
>>> This is definitely weird. Are you using vanilla u-boot and no changes on
>>> top with the sama5d3_xplained? Looks like not even your console works in
>>> spl, or, you have a bad binary .
>> 
>> With debug uart enabled it shows the DTB is missing. So when using the
>> mainline defconfig (where debug uart is disabled) it fails to find a console as
>> the DTB is missing. That's unfortunate, but expected behaviour with DM_SERIAL,
>> I guess.
>> 
>> I don't know the hardware, but the real problem seems to me that the binary
>> being flashed is somehow missing the DTB?
> 
> Yes that can happen, I suggested that some parts of the SPL are missing 
> - either the binary flashed is smaller than the real size (and the DTB, 
> being at the end is not copied...),
> 
> or the value inside the 6th vector is wrong, and the first stage 
> bootloader is not copying enough data from NAND to RAM when executing 
> the SPL binary. The first stage BL only copies the number of bytes given 
> by 6th vector value
> 
>> 
>> Regards,
>> Simon
>> 
>>> 
>>>> 
>>>> AT91bootstrap works fine.
>>>> 
>>>> I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?
>>> 
>>> How are you writing your nandflash ? are you using our sam-ba tool to
>>> write it ? do you use writeboot applet ?
>>> 
>>>> 
>>>> The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?
>>> 
>>> Yes it should not include it. And if you write using sam-ba the nand
>>> header will be written by sam-ba, so your binary should not include it
>>> already.
>>> 
>>> I also suggest you open up a support ticket on support.microchip.com as
>>> our FAE have a lot of experience to assist with such situations.
>>> 
>>> Hope this helps,
>>> Eugen
>>> 
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>> 
>>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>> 
>>>>>> RomBOOT
>>>>>> <debug_uart> Missing DTB
>>>>>> ### ERROR ### Please RESET the board ###
>>>>>> 
>>>>>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
>>>>> 
>>>>> Hello Daniel,
>>>>> 
>>>>> Which defconfig are you using when building u-boot ?
>>>>> 
>>>>> You are trying to load the U-boot SPL right ?
>>>>> 
>>>>> It doesn't look like you even get to the point when you get to load the
>>>>> u-boot proper, so maybe there are missing parts from your SPL, or the
>>>>> size inside the 6th reset vector is not correctly calculated
>>>>> 
>>>>> Did you try with our at91bootstrap proprietary second level bootloader
>>>>> and get the same issue when booting the proper u-boot with it ?
>>>>> 
>>>>> Hope this helps,
>>>>> 
>>>>> Eugen
>>>>> 
>>>>>> 
>>>>>> Dan
>>>>>> _______________________________________________
>>>>>> U-Boot mailing list
>>>>>> U-Boot at lists.denx.de
>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>> 
>>>> 
>>>> 
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-17  9:09         ` Eugen.Hristev at microchip.com
  2019-01-17 18:38           ` Daniel Evans
@ 2019-01-17 21:34           ` Daniel Evans
  2019-01-20 15:23             ` Ben Whitten
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel Evans @ 2019-01-17 21:34 UTC (permalink / raw)
  To: u-boot

Follow up question:

I notice that u-boot-spl-pad.bin is empty even though CONFIG_SPL_PAD_TO = CONFIG_SPL_MAX_SIZE = 0x18000.  Is that why it isn’t find the dtb because it isn’t padded properly?

Dan

> On Jan 17, 2019, at 2:09 AM, Eugen.Hristev at microchip.com wrote:
> 
> 
> 
> On 17.01.2019 11:05, Simon Goldschmidt wrote:
>> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>> 
>>> 
>>> 
>>> On 16.01.2019 21:05, Daniel Evans wrote:
>>>> Hello,
>>>> 
>>>> Yes, I am trying to load the U-boot SPL
>>>> 
>>>> What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>> 
>>> This is definitely weird. Are you using vanilla u-boot and no changes on
>>> top with the sama5d3_xplained? Looks like not even your console works in
>>> spl, or, you have a bad binary .
>> 
>> With debug uart enabled it shows the DTB is missing. So when using the
>> mainline defconfig (where debug uart is disabled) it fails to find a console as
>> the DTB is missing. That's unfortunate, but expected behaviour with DM_SERIAL,
>> I guess.
>> 
>> I don't know the hardware, but the real problem seems to me that the binary
>> being flashed is somehow missing the DTB?
> 
> Yes that can happen, I suggested that some parts of the SPL are missing 
> - either the binary flashed is smaller than the real size (and the DTB, 
> being at the end is not copied...),
> 
> or the value inside the 6th vector is wrong, and the first stage 
> bootloader is not copying enough data from NAND to RAM when executing 
> the SPL binary. The first stage BL only copies the number of bytes given 
> by 6th vector value
> 
>> 
>> Regards,
>> Simon
>> 
>>> 
>>>> 
>>>> AT91bootstrap works fine.
>>>> 
>>>> I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?
>>> 
>>> How are you writing your nandflash ? are you using our sam-ba tool to
>>> write it ? do you use writeboot applet ?
>>> 
>>>> 
>>>> The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?
>>> 
>>> Yes it should not include it. And if you write using sam-ba the nand
>>> header will be written by sam-ba, so your binary should not include it
>>> already.
>>> 
>>> I also suggest you open up a support ticket on support.microchip.com as
>>> our FAE have a lot of experience to assist with such situations.
>>> 
>>> Hope this helps,
>>> Eugen
>>> 
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>> 
>>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>> 
>>>>>> RomBOOT
>>>>>> <debug_uart> Missing DTB
>>>>>> ### ERROR ### Please RESET the board ###
>>>>>> 
>>>>>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
>>>>> 
>>>>> Hello Daniel,
>>>>> 
>>>>> Which defconfig are you using when building u-boot ?
>>>>> 
>>>>> You are trying to load the U-boot SPL right ?
>>>>> 
>>>>> It doesn't look like you even get to the point when you get to load the
>>>>> u-boot proper, so maybe there are missing parts from your SPL, or the
>>>>> size inside the 6th reset vector is not correctly calculated
>>>>> 
>>>>> Did you try with our at91bootstrap proprietary second level bootloader
>>>>> and get the same issue when booting the proper u-boot with it ?
>>>>> 
>>>>> Hope this helps,
>>>>> 
>>>>> Eugen
>>>>> 
>>>>>> 
>>>>>> Dan
>>>>>> _______________________________________________
>>>>>> U-Boot mailing list
>>>>>> U-Boot at lists.denx.de
>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>> 
>>>> 
>>>> 
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-17 21:34           ` Daniel Evans
@ 2019-01-20 15:23             ` Ben Whitten
  2019-01-21  8:06               ` Eugen.Hristev at microchip.com
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Whitten @ 2019-01-20 15:23 UTC (permalink / raw)
  To: u-boot

Hi,

On 17/01/2019 21:34, Daniel Evans wrote:
> Follow up question:
> 
> I notice that u-boot-spl-pad.bin is empty even though CONFIG_SPL_PAD_TO = CONFIG_SPL_MAX_SIZE = 0x18000.  Is that why it isn’t find the dtb because it isn’t padded properly?

As an aside although it buried as a footnote in the datasheet.
When the ROM code in the SAMA5D3 checks to see if SPL is valid code 
based on the size in the 6th vector or by checking the size of boot.bin 
from FAT, it must fit within SRAM0 (64KB, 0x10000) [1]

So whilst you have 128KB of SRAM, you can only load and execute SPL 
within 64KB (0x10000), perhaps CONFIG_SPL_MAX_SIZE should updated.

[1] Atmel SAMA5D3 datasheet, 11.4.3.1 under Figure 11-7, & 11.4.3.2.

Thanks,
Ben

> 
> Dan
> 
>> On Jan 17, 2019, at 2:09 AM, Eugen.Hristev at microchip.com wrote:
>>
>>
>>
>> On 17.01.2019 11:05, Simon Goldschmidt wrote:
>>> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>>>
>>>>
>>>>
>>>> On 16.01.2019 21:05, Daniel Evans wrote:
>>>>> Hello,
>>>>>
>>>>> Yes, I am trying to load the U-boot SPL
>>>>>
>>>>> What I posted previously was a custom board.  I switched over to the sama5d3_xplained and all I get with sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>>>
>>>> This is definitely weird. Are you using vanilla u-boot and no changes on
>>>> top with the sama5d3_xplained? Looks like not even your console works in
>>>> spl, or, you have a bad binary .
>>>
>>> With debug uart enabled it shows the DTB is missing. So when using the
>>> mainline defconfig (where debug uart is disabled) it fails to find a console as
>>> the DTB is missing. That's unfortunate, but expected behaviour with DM_SERIAL,
>>> I guess.
>>>
>>> I don't know the hardware, but the real problem seems to me that the binary
>>> being flashed is somehow missing the DTB?
>>
>> Yes that can happen, I suggested that some parts of the SPL are missing
>> - either the binary flashed is smaller than the real size (and the DTB,
>> being at the end is not copied...),
>>
>> or the value inside the 6th vector is wrong, and the first stage
>> bootloader is not copying enough data from NAND to RAM when executing
>> the SPL binary. The first stage BL only copies the number of bytes given
>> by 6th vector value
>>
>>>
>>> Regards,
>>> Simon
>>>
>>>>
>>>>>
>>>>> AT91bootstrap works fine.
>>>>>
>>>>> I know there was the issue with the nand_header showing up for the SD card but that shouldn’t effect the nand.  Some other patch I am missing to get a non-modified boot.bin nand working?
>>>>
>>>> How are you writing your nandflash ? are you using our sam-ba tool to
>>>> write it ? do you use writeboot applet ?
>>>>
>>>>>
>>>>> The size of the 6th reset vector looks correct, with the assumption that it does not include the 208 bytes of nand_header?
>>>>
>>>> Yes it should not include it. And if you write using sam-ba the nand
>>>> header will be written by sam-ba, so your binary should not include it
>>>> already.
>>>>
>>>> I also suggest you open up a support ticket on support.microchip.com as
>>>> our FAE have a lot of experience to assist with such situations.
>>>>
>>>> Hope this helps,
>>>> Eugen
>>>>
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>>
>>>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>>>
>>>>>>> RomBOOT
>>>>>>> <debug_uart> Missing DTB
>>>>>>> ### ERROR ### Please RESET the board ###
>>>>>>>
>>>>>>> I found the error message in fdtdec.c, but not sure what I am missing.  I have checked that my DTB is included in the boot.bin output.  Any insight on what I am missing?
>>>>>>
>>>>>> Hello Daniel,
>>>>>>
>>>>>> Which defconfig are you using when building u-boot ?
>>>>>>
>>>>>> You are trying to load the U-boot SPL right ?
>>>>>>
>>>>>> It doesn't look like you even get to the point when you get to load the
>>>>>> u-boot proper, so maybe there are missing parts from your SPL, or the
>>>>>> size inside the 6th reset vector is not correctly calculated
>>>>>>
>>>>>> Did you try with our at91bootstrap proprietary second level bootloader
>>>>>> and get the same issue when booting the proper u-boot with it ?
>>>>>>
>>>>>> Hope this helps,
>>>>>>
>>>>>> Eugen
>>>>>>
>>>>>>>
>>>>>>> Dan
>>>>>>> _______________________________________________
>>>>>>> U-Boot mailing list
>>>>>>> U-Boot at lists.denx.de
>>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> U-Boot mailing list
>>>> U-Boot at lists.denx.de
>>>> https://lists.denx.de/listinfo/u-boot
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-20 15:23             ` Ben Whitten
@ 2019-01-21  8:06               ` Eugen.Hristev at microchip.com
  2019-01-21 20:51                 ` Daniel Evans
  0 siblings, 1 reply; 14+ messages in thread
From: Eugen.Hristev at microchip.com @ 2019-01-21  8:06 UTC (permalink / raw)
  To: u-boot



On 20.01.2019 17:23, Ben Whitten wrote:
> Hi,
> 
> On 17/01/2019 21:34, Daniel Evans wrote:
>> Follow up question:
>>
>> I notice that u-boot-spl-pad.bin is empty even though 
>> CONFIG_SPL_PAD_TO = CONFIG_SPL_MAX_SIZE = 0x18000.  Is that why it 
>> isn’t find the dtb because it isn’t padded properly?
> 
> As an aside although it buried as a footnote in the datasheet.
> When the ROM code in the SAMA5D3 checks to see if SPL is valid code 
> based on the size in the 6th vector or by checking the size of boot.bin 
> from FAT, it must fit within SRAM0 (64KB, 0x10000) [1]
> 
> So whilst you have 128KB of SRAM, you can only load and execute SPL 
> within 64KB (0x10000), perhaps CONFIG_SPL_MAX_SIZE should updated.
> 
> [1] Atmel SAMA5D3 datasheet, 11.4.3.1 under Figure 11-7, & 11.4.3.2.
> 
> Thanks,
> Ben

It is true. 64 KB is reserved for Rom code itself (stack + code) and the 
rest of 64KB is free for copying the application binary and executing it.
If the MAX_SPL is wrong then we need to correct it. We also need to 
check if it's oversized in which case it's normal that the DTB won't be 
copied. Rom Code will copy at most 64 KB.

Daniel can you confirm this ?

Thanks

> 
>>
>> Dan
>>
>>> On Jan 17, 2019, at 2:09 AM, Eugen.Hristev at microchip.com wrote:
>>>
>>>
>>>
>>> On 17.01.2019 11:05, Simon Goldschmidt wrote:
>>>> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On 16.01.2019 21:05, Daniel Evans wrote:
>>>>>> Hello,
>>>>>>
>>>>>> Yes, I am trying to load the U-boot SPL
>>>>>>
>>>>>> What I posted previously was a custom board.  I switched over to 
>>>>>> the sama5d3_xplained and all I get with 
>>>>>> sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>>>>
>>>>> This is definitely weird. Are you using vanilla u-boot and no 
>>>>> changes on
>>>>> top with the sama5d3_xplained? Looks like not even your console 
>>>>> works in
>>>>> spl, or, you have a bad binary .
>>>>
>>>> With debug uart enabled it shows the DTB is missing. So when using the
>>>> mainline defconfig (where debug uart is disabled) it fails to find a 
>>>> console as
>>>> the DTB is missing. That's unfortunate, but expected behaviour with 
>>>> DM_SERIAL,
>>>> I guess.
>>>>
>>>> I don't know the hardware, but the real problem seems to me that the 
>>>> binary
>>>> being flashed is somehow missing the DTB?
>>>
>>> Yes that can happen, I suggested that some parts of the SPL are missing
>>> - either the binary flashed is smaller than the real size (and the DTB,
>>> being at the end is not copied...),
>>>
>>> or the value inside the 6th vector is wrong, and the first stage
>>> bootloader is not copying enough data from NAND to RAM when executing
>>> the SPL binary. The first stage BL only copies the number of bytes given
>>> by 6th vector value
>>>
>>>>
>>>> Regards,
>>>> Simon
>>>>
>>>>>
>>>>>>
>>>>>> AT91bootstrap works fine.
>>>>>>
>>>>>> I know there was the issue with the nand_header showing up for the 
>>>>>> SD card but that shouldn’t effect the nand.  Some other patch I am 
>>>>>> missing to get a non-modified boot.bin nand working?
>>>>>
>>>>> How are you writing your nandflash ? are you using our sam-ba tool to
>>>>> write it ? do you use writeboot applet ?
>>>>>
>>>>>>
>>>>>> The size of the 6th reset vector looks correct, with the 
>>>>>> assumption that it does not include the 208 bytes of nand_header?
>>>>>
>>>>> Yes it should not include it. And if you write using sam-ba the nand
>>>>> header will be written by sam-ba, so your binary should not include it
>>>>> already.
>>>>>
>>>>> I also suggest you open up a support ticket on 
>>>>> support.microchip.com as
>>>>> our FAE have a lot of experience to assist with such situations.
>>>>>
>>>>> Hope this helps,
>>>>> Eugen
>>>>>
>>>>>>
>>>>>> Dan
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>>>>
>>>>>>>> RomBOOT
>>>>>>>> <debug_uart> Missing DTB
>>>>>>>> ### ERROR ### Please RESET the board ###
>>>>>>>>
>>>>>>>> I found the error message in fdtdec.c, but not sure what I am 
>>>>>>>> missing.  I have checked that my DTB is included in the boot.bin 
>>>>>>>> output.  Any insight on what I am missing?
>>>>>>>
>>>>>>> Hello Daniel,
>>>>>>>
>>>>>>> Which defconfig are you using when building u-boot ?
>>>>>>>
>>>>>>> You are trying to load the U-boot SPL right ?
>>>>>>>
>>>>>>> It doesn't look like you even get to the point when you get to 
>>>>>>> load the
>>>>>>> u-boot proper, so maybe there are missing parts from your SPL, or 
>>>>>>> the
>>>>>>> size inside the 6th reset vector is not correctly calculated
>>>>>>>
>>>>>>> Did you try with our at91bootstrap proprietary second level 
>>>>>>> bootloader
>>>>>>> and get the same issue when booting the proper u-boot with it ?
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>>
>>>>>>> Eugen
>>>>>>>
>>>>>>>>
>>>>>>>> Dan
>>>>>>>> _______________________________________________
>>>>>>>> U-Boot mailing list
>>>>>>>> U-Boot at lists.denx.de
>>>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>>>>
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> https://lists.denx.de/listinfo/u-boot
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
>>
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] no DTB with nand SPL on sama5d3
  2019-01-21  8:06               ` Eugen.Hristev at microchip.com
@ 2019-01-21 20:51                 ` Daniel Evans
  2019-03-26 16:40                   ` [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01 Daniel Evans
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Evans @ 2019-01-21 20:51 UTC (permalink / raw)
  To: u-boot

Currently the boot.bin is only 50670 bytes (208 bytes nand_header + 44820 bytes u-boot-spl-nodtb.bin + 5642 u-boot-spl.dtb).  I tried playing with  CONFIG_SPL_MAX_SIZE and CONFIG_SPL_PAD_TO and got no changing in the output binaries, and I couldn’t get any padding no matter the setting.  So even though MAX size is an issue I don’t think it is what is keeping the SPL from finding the dtb.

Insight on where that is set in code so that I can experiment?

Dan

> On Jan 21, 2019, at 1:06 AM, <Eugen.Hristev@microchip.com> <Eugen.Hristev@microchip.com> wrote:
> 
> 
> 
> On 20.01.2019 17:23, Ben Whitten wrote:
>> Hi,
>> 
>> On 17/01/2019 21:34, Daniel Evans wrote:
>>> Follow up question:
>>> 
>>> I notice that u-boot-spl-pad.bin is empty even though 
>>> CONFIG_SPL_PAD_TO = CONFIG_SPL_MAX_SIZE = 0x18000.  Is that why it 
>>> isn’t find the dtb because it isn’t padded properly?
>> 
>> As an aside although it buried as a footnote in the datasheet.
>> When the ROM code in the SAMA5D3 checks to see if SPL is valid code 
>> based on the size in the 6th vector or by checking the size of boot.bin 
>> from FAT, it must fit within SRAM0 (64KB, 0x10000) [1]
>> 
>> So whilst you have 128KB of SRAM, you can only load and execute SPL 
>> within 64KB (0x10000), perhaps CONFIG_SPL_MAX_SIZE should updated.
>> 
>> [1] Atmel SAMA5D3 datasheet, 11.4.3.1 under Figure 11-7, & 11.4.3.2.
>> 
>> Thanks,
>> Ben
> 
> It is true. 64 KB is reserved for Rom code itself (stack + code) and the 
> rest of 64KB is free for copying the application binary and executing it.
> If the MAX_SPL is wrong then we need to correct it. We also need to 
> check if it's oversized in which case it's normal that the DTB won't be 
> copied. Rom Code will copy at most 64 KB.
> 
> Daniel can you confirm this ?
> 
> Thanks
> 
>> 
>>> 
>>> Dan
>>> 
>>>> On Jan 17, 2019, at 2:09 AM, Eugen.Hristev at microchip.com wrote:
>>>> 
>>>> 
>>>> 
>>>> On 17.01.2019 11:05, Simon Goldschmidt wrote:
>>>>> On Thu, Jan 17, 2019 at 10:02 AM <Eugen.Hristev@microchip.com> wrote:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 16.01.2019 21:05, Daniel Evans wrote:
>>>>>>> Hello,
>>>>>>> 
>>>>>>> Yes, I am trying to load the U-boot SPL
>>>>>>> 
>>>>>>> What I posted previously was a custom board.  I switched over to 
>>>>>>> the sama5d3_xplained and all I get with 
>>>>>>> sama5d3_xplained_nandflash_defconfig is ROMBOOT.
>>>>>> 
>>>>>> This is definitely weird. Are you using vanilla u-boot and no 
>>>>>> changes on
>>>>>> top with the sama5d3_xplained? Looks like not even your console 
>>>>>> works in
>>>>>> spl, or, you have a bad binary .
>>>>> 
>>>>> With debug uart enabled it shows the DTB is missing. So when using the
>>>>> mainline defconfig (where debug uart is disabled) it fails to find a 
>>>>> console as
>>>>> the DTB is missing. That's unfortunate, but expected behaviour with 
>>>>> DM_SERIAL,
>>>>> I guess.
>>>>> 
>>>>> I don't know the hardware, but the real problem seems to me that the 
>>>>> binary
>>>>> being flashed is somehow missing the DTB?
>>>> 
>>>> Yes that can happen, I suggested that some parts of the SPL are missing
>>>> - either the binary flashed is smaller than the real size (and the DTB,
>>>> being at the end is not copied...),
>>>> 
>>>> or the value inside the 6th vector is wrong, and the first stage
>>>> bootloader is not copying enough data from NAND to RAM when executing
>>>> the SPL binary. The first stage BL only copies the number of bytes given
>>>> by 6th vector value
>>>> 
>>>>> 
>>>>> Regards,
>>>>> Simon
>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> AT91bootstrap works fine.
>>>>>>> 
>>>>>>> I know there was the issue with the nand_header showing up for the 
>>>>>>> SD card but that shouldn’t effect the nand.  Some other patch I am 
>>>>>>> missing to get a non-modified boot.bin nand working?
>>>>>> 
>>>>>> How are you writing your nandflash ? are you using our sam-ba tool to
>>>>>> write it ? do you use writeboot applet ?
>>>>>> 
>>>>>>> 
>>>>>>> The size of the 6th reset vector looks correct, with the 
>>>>>>> assumption that it does not include the 208 bytes of nand_header?
>>>>>> 
>>>>>> Yes it should not include it. And if you write using sam-ba the nand
>>>>>> header will be written by sam-ba, so your binary should not include it
>>>>>> already.
>>>>>> 
>>>>>> I also suggest you open up a support ticket on 
>>>>>> support.microchip.com as
>>>>>> our FAE have a lot of experience to assist with such situations.
>>>>>> 
>>>>>> Hope this helps,
>>>>>> Eugen
>>>>>> 
>>>>>>> 
>>>>>>> Dan
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> On Jan 16, 2019, at 6:02 AM, Eugen.Hristev at microchip.com wrote:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 16.01.2019 03:13, Daniel Evans wrote:
>>>>>>>>> After flashing my boot.bin to nand I get the following output:
>>>>>>>>> 
>>>>>>>>> RomBOOT
>>>>>>>>> <debug_uart> Missing DTB
>>>>>>>>> ### ERROR ### Please RESET the board ###
>>>>>>>>> 
>>>>>>>>> I found the error message in fdtdec.c, but not sure what I am 
>>>>>>>>> missing.  I have checked that my DTB is included in the boot.bin 
>>>>>>>>> output.  Any insight on what I am missing?
>>>>>>>> 
>>>>>>>> Hello Daniel,
>>>>>>>> 
>>>>>>>> Which defconfig are you using when building u-boot ?
>>>>>>>> 
>>>>>>>> You are trying to load the U-boot SPL right ?
>>>>>>>> 
>>>>>>>> It doesn't look like you even get to the point when you get to 
>>>>>>>> load the
>>>>>>>> u-boot proper, so maybe there are missing parts from your SPL, or 
>>>>>>>> the
>>>>>>>> size inside the 6th reset vector is not correctly calculated
>>>>>>>> 
>>>>>>>> Did you try with our at91bootstrap proprietary second level 
>>>>>>>> bootloader
>>>>>>>> and get the same issue when booting the proper u-boot with it ?
>>>>>>>> 
>>>>>>>> Hope this helps,
>>>>>>>> 
>>>>>>>> Eugen
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Dan
>>>>>>>>> _______________________________________________
>>>>>>>>> U-Boot mailing list
>>>>>>>>> U-Boot at lists.denx.de
>>>>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> _______________________________________________
>>>>>> U-Boot mailing list
>>>>>> U-Boot at lists.denx.de
>>>>>> https://lists.denx.de/listinfo/u-boot
>>> 
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01
  2019-01-21 20:51                 ` Daniel Evans
@ 2019-03-26 16:40                   ` Daniel Evans
  2019-03-27  5:58                     ` Stefan Roese
  2019-03-27  7:01                     ` Eugen.Hristev at microchip.com
  0 siblings, 2 replies; 14+ messages in thread
From: Daniel Evans @ 2019-03-26 16:40 UTC (permalink / raw)
  To: u-boot

After an install of Nand flash using an SD card and linux script on a custom sama5d36 board, setup with the following partitions:

$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "at91bootstrap"
mtd1: 000c0000 00020000 "bootloader"
mtd2: 00080000 00020000 "bootloader env"
mtd3: 1fe80000 00020000 “rootfs”

And Uboot settings for version v2019.01

setenv loadImages "mtdparts default && ubi part rootfs && ubifsmount ubi0:rootfs && ubifsload 0x22000000 /boot/vmlinuz && ubifsload 0x21000000 /boot/sama5d3.dtb && bootz 0x22000000 - 0x21000000;”
setenv kernelAddr 0x22000000
setenv dtbAddr 0x21000000
setenv bootcmd "run loadImages"

I get the following Uboot error after the ubi part rootfs command:

ubi0: attaching mtd4
ubi0 error: scan_peb: bad image sequence number 115116184 in PEB 4080, expected 273711372
Erase counter header dump:
        magic          0x55424923
        version        1
        ec             1
        vid_hdr_offset 2048
        data_offset    4096
        image_seq      115116184
        hdr_crc        0x8905e9e9
erase counter header hexdump:
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -22
UBI error: cannot attach mtd4
UBI error: cannot initialize UBI, error -22
UBI init error 22
Please check, if the correct MTD partition is used (size big enough?)

If I do a nand erase.chip then do my SD card install everything works.  The error shows up if I try to do a second SD card install.  

Of note is the fact that I do not see this issue if I use an old version of uboot (2014).  

Any insight?

Dan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01
  2019-03-26 16:40                   ` [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01 Daniel Evans
@ 2019-03-27  5:58                     ` Stefan Roese
  2019-03-27  7:01                     ` Eugen.Hristev at microchip.com
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2019-03-27  5:58 UTC (permalink / raw)
  To: u-boot

Hi Dan,

On 26.03.19 17:40, Daniel Evans wrote:
> After an install of Nand flash using an SD card and linux script on a custom sama5d36 board, setup with the following partitions:
> 
> $ cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00040000 00020000 "at91bootstrap"
> mtd1: 000c0000 00020000 "bootloader"
> mtd2: 00080000 00020000 "bootloader env"
> mtd3: 1fe80000 00020000 “rootfs”
> 
> And Uboot settings for version v2019.01
> 
> setenv loadImages "mtdparts default && ubi part rootfs && ubifsmount ubi0:rootfs && ubifsload 0x22000000 /boot/vmlinuz && ubifsload 0x21000000 /boot/sama5d3.dtb && bootz 0x22000000 - 0x21000000;”
> setenv kernelAddr 0x22000000
> setenv dtbAddr 0x21000000
> setenv bootcmd "run loadImages"
> 
> I get the following Uboot error after the ubi part rootfs command:
> 
> ubi0: attaching mtd4
> ubi0 error: scan_peb: bad image sequence number 115116184 in PEB 4080, expected 273711372
> Erase counter header dump:
>          magic          0x55424923
>          version        1
>          ec             1
>          vid_hdr_offset 2048
>          data_offset    4096
>          image_seq      115116184
>          hdr_crc        0x8905e9e9
> erase counter header hexdump:
> ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -22
> UBI error: cannot attach mtd4
> UBI error: cannot initialize UBI, error -22
> UBI init error 22
> Please check, if the correct MTD partition is used (size big enough?)

 From this error message, I suspect that your MTD partition might
not be the correct one in U-Boot (correct size). What does
"mtdparts" show in U-Boot?

> If I do a nand erase.chip then do my SD card install everything
> works.  The error shows up if I try to do a second SD card
> install.

Please compare both mtdparts outputs here.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01
  2019-03-26 16:40                   ` [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01 Daniel Evans
  2019-03-27  5:58                     ` Stefan Roese
@ 2019-03-27  7:01                     ` Eugen.Hristev at microchip.com
  1 sibling, 0 replies; 14+ messages in thread
From: Eugen.Hristev at microchip.com @ 2019-03-27  7:01 UTC (permalink / raw)
  To: u-boot



On 26.03.2019 18:40, Daniel Evans wrote:

> 
> After an install of Nand flash using an SD card and linux script on a 
> custom sama5d36 board, setup with the following partitions:
> 
> $ cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00040000 00020000 "at91bootstrap"
> mtd1: 000c0000 00020000 "bootloader"
> mtd2: 00080000 00020000 "bootloader env"
> mtd3: 1fe80000 00020000 “rootfs”
> 
> And Uboot settings for version v2019.01
> 
> setenv loadImages "mtdparts default && ubi part rootfs && ubifsmount 
> ubi0:rootfs && ubifsload 0x22000000 /boot/vmlinuz && ubifsload 
> 0x21000000 /boot/sama5d3.dtb && bootz 0x22000000 - 0x21000000;”
> setenv kernelAddr 0x22000000
> setenv dtbAddr 0x21000000
> setenv bootcmd "run loadImages"
> 
> I get the following Uboot error after the ubi part rootfs command:
> 
> ubi0: attaching mtd4
> ubi0 error: scan_peb: bad image sequence number 115116184 in PEB 4080, 
> expected 273711372
> Erase counter header dump:
>          magic          0x55424923
>          version        1
>          ec             1
>          vid_hdr_offset 2048
>          data_offset    4096
>          image_seq      115116184
>          hdr_crc        0x8905e9e9
> erase counter header hexdump:
> ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -22
> UBI error: cannot attach mtd4
> UBI error: cannot initialize UBI, error -22
> UBI init error 22
> Please check, if the correct MTD partition is used (size big enough?)
> 
> If I do a nand erase.chip then do my SD card install everything works. 
>   The error shows up if I try to do a second SD card install.
> 
> Of note is the fact that I do not see this issue if I use an old version 
> of uboot (2014).
> 
> Any insight?

It looks like the MTD partitioning has changed as expected in u-boot 
2019 vs 2014, and maybe you need to use mtd5 instead of mtd4 ?
Check the layout and see if it's as expected...

About our current flash layout:

http://www.at91.com/linux4sam/bin/view/Linux4SAM/Sama5d3XplainedMainPage#NAND_Flash_demo_Memory_map

maybe mtdparts default is not doing the proper thing ?

> 
> Dan
> 
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-27  7:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16  1:13 [U-Boot] no DTB with nand SPL on sama5d3 Daniel Evans
2019-01-16 13:02 ` Eugen.Hristev at microchip.com
2019-01-16 19:05   ` Daniel Evans
2019-01-17  9:01     ` Eugen.Hristev at microchip.com
2019-01-17  9:05       ` Simon Goldschmidt
2019-01-17  9:09         ` Eugen.Hristev at microchip.com
2019-01-17 18:38           ` Daniel Evans
2019-01-17 21:34           ` Daniel Evans
2019-01-20 15:23             ` Ben Whitten
2019-01-21  8:06               ` Eugen.Hristev at microchip.com
2019-01-21 20:51                 ` Daniel Evans
2019-03-26 16:40                   ` [U-Boot] scan_peb ubi error sama5d36 nand flash v2019.01 Daniel Evans
2019-03-27  5:58                     ` Stefan Roese
2019-03-27  7:01                     ` Eugen.Hristev at microchip.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.