Recent Posts

Pages: 1 ... 8 9 [10]
91
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 12, 2018, 04:24:49 pm »
Still there is not a way to use NAND as boot device for the whole system, but this should be possible by just flashing kernel in raw mode in NAND and loading it with UBI drivers from there. Then the rest of the userspace could be put in UBI.
I've been through the config options in the 4.7 kernel you mentioned but I find any way to get it to support NAND.  With your CT does 'lsblk' show any NAND partitions ?  I'm thinking it's unlikely that any kernel can be booted from NAND if it can't access the NAND.  For instance, how could it load modules ?

I've installed an Armbian kernel with stretch on a CT and can generate U-Boot.  I'm still sarching for config settings so it can access NAND.  I'd like an SD-card version that can load my old kernels in NAND.

Please check 'lsblk' in your 4.7 kernel and tell me what it detects.

Cheers,
Steven
92
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 09, 2018, 10:24:09 am »
Any suggestions what to do next to get it booting the whole way up?

OK. Needed second eyes again to make it work. My son has so much younger eyes ;)

I did not have .next file in /boot folder. It did try to boot old kernel. This prevented it coming up.

Now I have U-Boot and U-Boot environment in NAND, but everything else in SATA-disk. It boots without MMC-card as I wanted it to be.

Still there is not a way to use NAND as boot device for the whole system, but this should be possible by just flashing kernel in raw mode in NAND and loading it with UBI drivers from there. Then the rest of the userspace could be put in UBI.


B.T.W I did put SPL and U-boot in first erase block and environment in second just to be able to erase them separately.

The above attachment having U-Boot config has at least one error. Nand setting block size has to be added one more zero. Even with this corrected I did not manage it to work. There has to be something weird in scrambling bits.
93
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 09, 2018, 06:08:59 am »
This project is now in a situation, where U-Boot 2018.03 sits on NAND and everything else is on SATA-disk.

U-Boot loads and executes kernel, ramdisk and dtb from SATA, but kernel boot does hung like this:
Found U-Boot script /boot/boot.scr
3708 bytes read in 49 ms (73.2 KiB/s)
## Executing script at 43100000
Boot script loaded from scsi
170 bytes read in 23 ms (6.8 KiB/s)
5824915 bytes read in 200 ms (27.8 MiB/s)
6909240 bytes read in 214 ms (30.8 MiB/s)
Found legacy kernel configuration
** File not found /boot/script.bin **
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5824851 Bytes = 5.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 49a71000, end 49fff153 ... OK

Starting kernel ...

*****************************************

Any suggestions what to do next to get it booting the whole way up?

In your /boot/boot.cmd file find your "setenv bootargs" statement and add "machid=0x10bb" to the end.  Then use mkimage to create a new /boot/boot.scr.

I've tried compiling U-Boot 2018.03 to add NAND code but I keep getting syntax errors or sram size exceeds available area.  So now I'm trying to get an old U-Boot with fdt capability to support NAND.

The 4.7 kernel you're using doesn't seem to support NAND.  I've tried changing the config but I just get it it to detect NAND.

So my progress so far has been minimal.  I'll post here when I get some useful results.

-- Steven
94
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by tilator on April 09, 2018, 05:43:19 am »
This project is now in a situation, where U-Boot 2018.03 sits on NAND and everything else is on SATA-disk.

U-Boot loads and executes kernel, ramdisk and dtb from SATA, but kernel boot does hung like this:

*********************************************

resetting ...

U-Boot SPL 2018.03 (Apr 08 2018 - 00:01:35 +0300)
DRAM: 2048 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from NAND


U-Boot 2018.03 (Apr 08 2018 - 00:01:35 +0300) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Cubietech Cubietruck
I2C:   ready
DRAM:  2 GiB
NAND:  8192 MiB
MMC:   SUNXI SD/MMC: 0
Loading Environment from NAND... OK
Setting up a 1024x768 vga console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
SCSI:  Target spinup took 0 ms.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c50000, eth1: usb_ether
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: ST9320325AS Rev: 0001
            Type: Hard Disk
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
Found 1 device(s).

Device 0: (0:0) Vendor: ATA Prod.: ST9320325AS Rev: 0001
            Type: Hard Disk
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
... is now current device
Scanning scsi 0:1...
Found U-Boot script /boot/boot.scr
3708 bytes read in 49 ms (73.2 KiB/s)
## Executing script at 43100000
Boot script loaded from scsi
170 bytes read in 23 ms (6.8 KiB/s)
5824915 bytes read in 200 ms (27.8 MiB/s)
6909240 bytes read in 214 ms (30.8 MiB/s)
Found legacy kernel configuration
** File not found /boot/script.bin **
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5824851 Bytes = 5.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 49a71000, end 49fff153 ... OK

Starting kernel ...

*****************************************

Any suggestions what to do next to get it booting the whole way up?
95
Cubieboard v3 Hardware (Cubietruck) / Re: A10/A20 NAND boot block access
« Last post by phelum on April 05, 2018, 04:11:48 am »
Having recent SW running on it is only important in keeping it up to date.
Hi,

I'm getting the 4.7 kernel running (from SD card) but I can't get it to see the AP6210 or NAND.  What I have noticed is that there is the CONFIG_MTD_NAND_ECC_SMC option in the compiler config that reverses the work byte order.  If you're seeing garbage maybe changing this option might help.

-- Steven
96
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.
97
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
98
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
99
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
100
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.
Pages: 1 ... 8 9 [10]