Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 04, 2018, 09:18:22 am »
Thanks for the U-Boot link.  It sounds like new U-Boot does live in the low area of NAND.  Would it be acceptable to you if I get the new kernel running with an old U-Boot ?  I'll download Boris's kernel tomorrow and try to make one for testing.

You are welcome to do it.

Having recent SW running on it is only important in keeping it up to date.
22
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 04, 2018, 08:51:02 am »
To get the very same mainline U-Boot source it might be good idea to use this link:

ftp://ftp.denx.de/pub/u-boot/u-boot-2018.03.tar.bz2
Thanks for the U-Boot link.  It sounds like new U-Boot does live in the low area of NAND.  Would it be acceptable to you if I get the new kernel running with an old U-Boot ?  I'll download Boris's kernel tomorrow and try to make one for testing.

-- Steven
23
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 04, 2018, 08:31:52 am »
Things seem to have changed.  I downloaded U-Boot and it's now 2018.05.  The Cubietruck_defconfig doesn't have any mention of NAND.  If I run make menuconfig I can set the NAND support options but it needs the page, block, and OOB sizes which I'll have to get.

If you patch it, you will have NAND chip metrics in Cubietruck_defconfig.

With your U-Boot and kernel writes problem (garbage) I remember I had to use different read/writes in my modified NAND driver to access the boot0/boot1 area.  It looks like U-Boot now lives in this area rather than the normal NAND blocks so maybe the reads/writes it uses aren't right for normal NAND (the area you can partition using nand-part) and this is why you're getting garbage with normal I/O from the kernel.

I presume you've partitioned and formatted your NAND.  Does it have a small (say 64MiB) first partition formated VFAT ?  If so can you mount it and see if u-boot.bin is there ?

We did not get far enough to make partitions. U-Boot SPL and U-Boot itself are read from bare NAND without any partitioning. U-Boot settings have one partition leaving start of the NAND untouched for those and U-Boot environment.

The U-boot can use NAND right, because environment can be saved and again read without any trouble.

To get the very same mainline U-Boot source it might be good idea to use this link:

ftp://ftp.denx.de/pub/u-boot/u-boot-2018.03.tar.bz2
24
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 04, 2018, 08:19:51 am »
The u-boot patch seems to have one setting what was not really tried.

Its the last line having "CONFIG_NAND_ECC_NONE=y" in it in Cubietruck_defconfig.

I suppose it should be removed first if you are going to try this.
Things seem to have changed.  I downloaded U-Boot and it's now 2018.05.  The Cubietruck_defconfig doesn't have any mention of NAND.  If I run make menuconfig I can set the NAND support options but it needs the page, block, and OOB sizes which I'll have to get.  Also the make complains that my gcc isn't new enough so I might have to try compiling on a newer system.  This will take a while.

With your U-Boot and kernel writes problem (garbage) I remember I had to use different read/writes in my modified NAND driver to access the boot0/boot1 area.  It looks like U-Boot now lives in this area rather than the normal NAND blocks so maybe the reads/writes it uses aren't right for normal NAND (the area you can partition using nand-part) and this is why you're getting garbage with normal I/O from the kernel.

I presume you've partitioned and formatted your NAND.  Does it have a small (say 64MiB) first partition formated VFAT ?  If so can you mount it and see if u-boot.bin is there ?

Cheers,
Steven
25
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 04, 2018, 07:47:58 am »
The u-boot patch seems to have one setting what was not really tried.

Its the last line having "CONFIG_NAND_ECC_NONE=y" in it in Cubietruck_defconfig.

I suppose it should be removed first if you are going to try this.
26
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 04, 2018, 06:42:14 am »
Hi,
Wow, I'm impressed with how things have changed and what you've done.  What output do you get when you try to boot from NAND ?  I'm guessing that U-boot starts and tries to start the kernel.  One problem that I used to hit was that the MACHID wasn't passed to the kernel correctly and when the kernel started it noticed the mismatch and just stopped with no error message.

Also, where did you get your 4.9 kernel from ?  I might have to download a copy and try it here.

What we or mostly my son has done so far, is booting U-Boot from NAND without any USB-device or SD-card attached and then putting SD-card or USB-stick in loading kernel from there. Then booting kernel.

We did try flash NAND with user space having kernel and all then, but there are still some issues. So in fact we are still in situaton where U-Boot can definitely be booted from NAND and it works just fine with user space in USB or SD-card. We have not tried SATA yet, but I expect it work anyways and only the NAND is an issue.

NAND can be erased. It can be flashed, but after booting again it contains carbage. There has to be something odd. Writing NAND (through kernel MTD drivers) and then reading same NAND area using U-Boot driver to load user space is the issue. Kernel writing and U-Boot reading do not match.

Kernel source was cloned from bbrezillion gihub linux-sunxi having branch bb/4.7/ubi-mlc. It is 4.9 version even though branch is 4.7.

https://github.com/bbrezillon/linux-sunxi/tree/bb/4.7/ubi-mlc

I suppose there must be something changed and old kernel NAND writing does not match new U-Boot reading. If we only got them to match each other, this would work just fine.

There are two attachments now. If you take 3/2018 mainline U-boot, patch it with what you can find in one of the attachments and then use u-boot.config as .config, you can have the very same U-Boot we have here.

Then you can take kernel source using link above, patch it with a file in attached kernel patch attachment and use config from the same zip, your kernel will be there too.

Just don't forget to use U-Boot ".img" file instead of ".bin" to flash. Mainline flashing instruction is otherwise just fine.
27
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 03, 2018, 04:17:12 pm »
Hi,

When you say your new U-boot works well I assume you're booting from SD-card.  Is this correct ?

No. It does boot 03/2018 U-Boot from NAND without SD-card.

See this:  http://git.denx.de/?p=u-boot.git;a=blob_plain;f=board/sunxi/README.nand;hb=HEAD

All you have to change is not flashing u-boot-dtb.bin but u-boot-dtb.img instead.

Do you know if kernel 4.9 should be compatible with this U-Boot version? It very much sounds like U-Boot and this kernel version use NAND different ways and they do not work together. Everything else seems to be OK.
Hi,
Wow, I'm impressed with how things have changed and what you've done.  What output do you get when you try to boot from NAND ?  I'm guessing that U-boot starts and tries to start the kernel.  One problem that I used to hit was that the MACHID wasn't passed to the kernel correctly and when the kernel started it noticed the mismatch and just stopped with no error message.

Also, where did you get your 4.9 kernel from ?  I might have to download a copy and try it here.

-- Steven
28
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 03, 2018, 03:08:52 pm »
I also would like it to boot (for emergency situations only) from NAND, but this seems to be tricky to do. U-boot and kernel both can access NAND, but they seem to do it somewhat differently. Both use mainline drivers.

Do you know if it has something to do with ECC or some NAND-related bit-manipulation?
Hi,

When you say your new U-boot works well I assume you're booting from SD-card.  Is this correct ?

No. It does boot 03/2018 U-Boot from NAND without SD-card.

See this:  http://git.denx.de/?p=u-boot.git;a=blob_plain;f=board/sunxi/README.nand;hb=HEAD

All you have to change is not flashing u-boot-dtb.bin but u-boot-dtb.img instead.

Do you know if kernel 4.9 should be compatible with this U-Boot version? It very much sounds like U-Boot and this kernel version use NAND different ways and they do not work together. Everything else seems to be OK.
29
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 03, 2018, 03:39:45 am »
I also would like it to boot (for emergency situations only) from NAND, but this seems to be tricky to do. U-boot and kernel both can access NAND, but they seem to do it somewhat differently. Both use mainline drivers.

Do you know if it has something to do with ECC or some NAND-related bit-manipulation?
Hi,

When you say your new U-boot works well I assume you're booting from SD-card.  Is this correct ?

My understanding of a NAND boot sequence is boot0, boot1, boot.axf. u-boot.bin, uImage.
boot0 initialises the RAM and loads an runs boot1.
boot1 reads the first NAND partition (vfat) and loads and runs boot.axf.
boot.axf reads boot.ini and loads and runs u-boot.bin.
u-boot.bin reads uEnv.txt and loads and starts the kernel (uImage).

I think u-boot.bin searches for a boot script in /boot or / and will use it if found.  Otherwise it defaults to its internal script which tells it to load script.bin and then load and run the kernel.

I presume you have a Cubietruck.  Can you connect a serial monitor to the debug port and see what happens if you try to boot with no SD-card present ?  My CB1, CB2, and CTs all boot from NAND but I'm running a legacy 3.4.103 kernel.  I did have the CB2 booting a 3.16 kernel but I gave up because it wouldn't support something (I forget what).

If your CT won't boot from NAND then watching the log from the debug port is the first step in solving the issues.

Cheers,
Steven
30
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 02, 2018, 04:04:13 pm »
Thank you for your knowledge.

What I and far more my son has done now, is compiling and installing 03.2018 version of U-Boot in it. It really replaces Allwinner boot0 and boot1. It seems to boot U-boot well and reliably.

It seems to be good choice in booting from NAND to SATA without SD-card. I'm sure it would as well boot from USB and of course SD-card too.

I also would like it to boot (for emergency situations only) from NAND, but this seems to be tricky to do. U-boot and kernel both can access NAND, but they seem to do it somewhat differently. Both use mainline drivers.

Do you know if it has something to do with ECC or some NAND-related bit-manipulation?
Pages: 1 2 [3] 4 5 ... 10