Discussion:
[linux-sunxi] NAND flashing support for Cubietruck using FEL and U-Boot
Piotr Król
2015-10-12 11:52:11 UTC
Permalink
Hi all,
I'm trying to utilize method of flashing NAND used by CHIP developers [1] on
my Cubietruck. In short they boot in FEL, write SPL, U-Boot and rootfs
to RAM and then after booting to U-Boot write those information to NAND.
This give ability to avoid {Live,Phoenix}Suit.

Because CHIP u-boot based on 2015.07 release and it lacks DT for
Cubietruck in private chat Boris suggested Hans sunxi-wip U-Boot tree
[2]. sunxi-wip based on 2015.10-rc4 and I see a lot of difference with
CHIP tree. I'm not sure what is exactly needed to enable NAND flashig on
Cubietruck.

One thing that is missing in sunxi-wip but used by CHIP is sunxi_nand
config command, second is suxi_nand_spl.c. But I would like to avoid
brainless porting of code that can lead nowhere. Especially that I don't
know what it exactly does.

What I tried so far:

* booting sunxi-wip using FEL - works fine
* successful nand write of padded and not padded SPL - at least it
returens OK
* nand write of U-Boot [3]

CT NAND chip is H27UCG8T2ATR-BC (Page Size : 8192 + 640(Spare), Block
Size : 2M + 160K bytes).

Unfortunately after reboot nothing happens no single message from SPL. When
trying after SPL write U-Boot I get [3].

Did anyone tried nand write on Cubietruck ? If yes then how it was tested ?
Any reason why despite no errors during nand write SPL was not flashed?
Or any reason why flashed SPL doesn't boot ?

Any suggestions or comments are welcome.

[1] https://github.com/NextThingCo/CHIP-tools/blob/chip/stable/chip-fel-flash.sh
[2] https://github.com/jwrdegoede/u-boot-sunxi/tree/sunxi-wip
[3] https://gist.github.com/pietrushnic/b2eeb1f8c4e40d687939

Best Regards,
--
Piotr Król
Embedded Systems Consultant
http://3mdeb.com | @3mdeb_com
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Priit Laes
2015-10-12 15:29:04 UTC
Permalink
Post by Piotr Król
Hi all,
I'm trying to utilize method of flashing NAND used by CHIP developers [1] on
my Cubietruck. In short they boot in FEL, write SPL, U-Boot and rootfs
to RAM and then after booting to U-Boot write those information to NAND.
This give ability to avoid {Live,Phoenix}Suit.
Because CHIP u-boot based on 2015.07 release and it lacks DT for
Cubietruck in private chat Boris suggested Hans sunxi-wip U-Boot tree
[2]. sunxi-wip based on 2015.10-rc4 and I see a lot of difference with
CHIP tree. I'm not sure what is exactly needed to enable NAND flashig on
Cubietruck.
One thing that is missing in sunxi-wip but used by CHIP is sunxi_nand
config command, second is suxi_nand_spl.c. But I would like to avoid
brainless porting of code that can lead nowhere. Especially that I don't
know what it exactly does.
* booting sunxi-wip using FEL - works fine
* successful nand write of padded and not padded SPL - at least it
  returens OK
* nand write of U-Boot [3]
CT NAND chip is H27UCG8T2ATR-BC (Page Size : 8192 + 640(Spare), Block
Size : 2M + 160K bytes).
Unfortunately after reboot nothing happens no single message from SPL. When
trying after SPL write U-Boot I get [3].
Did anyone tried nand write on Cubietruck ? If yes then how it was tested ?
Any reason why despite no errors during nand write SPL was not
flashed?
Or any reason why flashed SPL doesn't boot ?
Any suggestions or comments are welcome.
[1] https://github.com/NextThingCo/CHIP-tools/blob/chip/stable/chip-f
el-flash.sh
[2] https://github.com/jwrdegoede/u-boot-sunxi/tree/sunxi-wip
[3] https://gist.github.com/pietrushnic/b2eeb1f8c4e40d687939
I have successfully done it via mainline kernel from Hans's WIP branch
using mdt-utils like this: http://lists.denx.de/pipermail/u-boot/2015-M
ay/214959.html

Päikest,
Priit Laes :)
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Piotr Król
2015-10-12 16:19:06 UTC
Permalink
Post by Priit Laes
Post by Piotr Król
Hi all,
I'm trying to utilize method of flashing NAND used by CHIP developers [1] on
my Cubietruck. In short they boot in FEL, write SPL, U-Boot and rootfs
to RAM and then after booting to U-Boot write those information to NAND.
This give ability to avoid {Live,Phoenix}Suit.
Because CHIP u-boot based on 2015.07 release and it lacks DT for
Cubietruck in private chat Boris suggested Hans sunxi-wip U-Boot tree
[2]. sunxi-wip based on 2015.10-rc4 and I see a lot of difference with
CHIP tree. I'm not sure what is exactly needed to enable NAND flashig on
Cubietruck.
One thing that is missing in sunxi-wip but used by CHIP is sunxi_nand
config command, second is suxi_nand_spl.c. But I would like to avoid
brainless porting of code that can lead nowhere. Especially that I don't
know what it exactly does.
* booting sunxi-wip using FEL - works fine
* successful nand write of padded and not padded SPL - at least it
  returens OK
* nand write of U-Boot [3]
CT NAND chip is H27UCG8T2ATR-BC (Page Size : 8192 + 640(Spare), Block
Size : 2M + 160K bytes).
Unfortunately after reboot nothing happens no single message from SPL. When
trying after SPL write U-Boot I get [3].
Did anyone tried nand write on Cubietruck ? If yes then how it was tested ?
Any reason why despite no errors during nand write SPL was not flashed?
Or any reason why flashed SPL doesn't boot ?
Any suggestions or comments are welcome.
[1] https://github.com/NextThingCo/CHIP-tools/blob/chip/stable/chip-f
el-flash.sh
[2] https://github.com/jwrdegoede/u-boot-sunxi/tree/sunxi-wip
[3] https://gist.github.com/pietrushnic/b2eeb1f8c4e40d687939
I have successfully done it via mainline kernel from Hans's WIP branch
using mdt-utils like this: http://lists.denx.de/pipermail/u-boot/2015-M
ay/214959.html
Priit,
thanks for reply. IIUC method described by Roy cannot replace
{Live,Phoenix}Suit tool because it assume that there is system on board.
I'm more interesting in utilizing FEL mode, which can be useful in
production. Other thing is that Roy use MMC which I would like to avoid
so MMC-less devices could utilize solution.

Anyway its great to know that it is possible to write new U-Boot from
inside working system. I will try this approach and see how it works for
me. For sure it can be helpful for debugging purposes.

Thanks,
--
Piotr Król
Embedded Systems Consultant
http://3mdeb.com | @3mdeb_com
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Martin Collins
2015-10-12 17:11:52 UTC
Permalink
Post by Piotr Król
Did anyone tried nand write on Cubietruck ? If yes then how it was
tested ? Any reason why despite no errors during nand write SPL was
not flashed? Or any reason why flashed SPL doesn't boot ?
Have you seen this?
https://github.com/phelum/CT_NandBoot
There is a hidden part of NAND that must be tickled from FEL before that
other stuff works.

Martin
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steven Saunderson
2016-01-31 10:50:39 UTC
Permalink
Post by Piotr Król
Hi all,
I'm trying to utilize method of flashing NAND used by CHIP developers [1] on
my Cubietruck. In short they boot in FEL, write SPL, U-Boot and rootfs
to RAM and then after booting to U-Boot write those information to NAND.
This give ability to avoid {Live,Phoenix}Suit.
Because CHIP u-boot based on 2015.07 release and it lacks DT for
Cubietruck in private chat Boris suggested Hans sunxi-wip U-Boot tree
[2]. sunxi-wip based on 2015.10-rc4 and I see a lot of difference with
CHIP tree. I'm not sure what is exactly needed to enable NAND flashig on
Cubietruck.
One thing that is missing in sunxi-wip but used by CHIP is sunxi_nand
config command, second is suxi_nand_spl.c. But I would like to avoid
brainless porting of code that can lead nowhere. Especially that I don't
know what it exactly does.
* booting sunxi-wip using FEL - works fine
* successful nand write of padded and not padded SPL - at least it
returens OK
* nand write of U-Boot [3]
CT NAND chip is H27UCG8T2ATR-BC (Page Size : 8192 + 640(Spare), Block
Size : 2M + 160K bytes).
Unfortunately after reboot nothing happens no single message from SPL. When
trying after SPL write U-Boot I get [3].
Did anyone tried nand write on Cubietruck ? If yes then how it was tested ?
Any reason why despite no errors during nand write SPL was not flashed?
Or any reason why flashed SPL doesn't boot ?
I wrote CT_NandBoot (referred to above) which can write the boot blocks
(boot0 and boot1) which might help you. Recently I've been playing with a
modified sunxi-nand driver for the 3.4 kernel that can read and write the
boot blocks.

But writing boot0 is not enough. It has to be customised to contain the
DRAM specs, NAND GPIO specs, and the NAND chip ID. I presume Livesuit does
this when loading a board.

If you just want to avoid Livesuit then perhaps bootfix (the CT_NandBoot
program) will suffice. I added a feature where you can supply the
partitions and it will create the NAND MBR and download the partitions
after loading the boot blocks.

Cheers,
Steven
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...