SAMA5D36 NAND Flash timing settings

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

flomll
Posts: 10
Joined: Tue Jun 10, 2014 10:18 am

SAMA5D36 NAND Flash timing settings

Thu Apr 12, 2018 10:39 am

Hy,

I want to use a FMND2GxxS3J in combination with a SAMA5D36 but it seems to work only for bootstrap and u-boot. If it loads the Linux kernel it seems to be normal until the NAND.

The ONFI ECC parameters seems to be correct but it can not write to the BAD blocks....I can not upload a PDF file so I added a screenshot of the datasheet. We use device tree with Linux 4.1.x from linux4sam-5.3.

Does anyone know a solution to disable the ONFI for the timings because I think the settings from bootstrap should be OK.

I got this output:

Code: Select all

AT91Bootstrap 3.8.0-rb1.0.0 (Fre Apr  6 11:41:28 CEST 2018)

loading uboot


U-Boot 2016.03-rb1.0.0 (Apr 11 2018 - 13:57:45 +0200)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  256 MiB
NAND:  256 MiB
[LCD] Test Pattern: 320 x 240 [80 x 120]
In:    serial
Out:   serial
Err:   serial
Net:   macb0, gmac0 [PRIME]
Hit any key to stop autoboot:  0 
Loading autostart-script from USB-Device ...
starting USB...
USB0:   scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
resetting USB...
USB0:   scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
** Bad device usb 0 **
using environment from NAND!

NAND read: device 0 offset 0x1800000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
   Image Name:   Linux-4.1.0-linux4sam_5.3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2561879 Bytes = 2.4 MiB
   Load Address: 22000000
   Entry Point:  22000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.1.0-linux4sam_5.3 (fmueller@fmueller-tuxedo) (gcc version 5.4.0 (Buildroot 2017.02.10-ge3eafb9-svn-dirty) ) #1 PREEMPT Fri Apr 6 11:43:22 CEST 2018
[    0.000000] CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: aba5core
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk vt.global_cursor_default=0 mtdparts=atmel_nand:128k(bootstrap)ro,640k(uboot)ro,128k(env)rw,128k(env_redundant)rw,9M(lcd_logo)rw, 8M(ke 
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 514768K/524288K available (3213K kernel code, 126K rwdata, 1060K rodata, 172K init, 221K bss, 9520K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04346b0   (4274 kB)
[    0.000000]       .init : 0xc0435000 - 0xc0460000   ( 172 kB)
[    0.000000]       .data : 0xc0460000 - 0xc047fba0   ( 127 kB)
[    0.000000]        .bss : 0xc047fba0 - 0xc04b730c   ( 222 kB)
[    0.000000] Preemptible * RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14479245754 ns
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[    0.000000] Console: colour dummy device 80x30
[    0.060000] Calibrating delay loop... 348.97 BogoMIPS (lpj=1744896)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.060000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.060000] CPU: Testing write buffer coherency: ok
[    0.060000] Setting up static identity map for 0x20008200 - 0x20008234
[    0.060000] devtmpfs: initialized
[    0.080000] VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
[    0.080000] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.080000] pinctrl core: initialized pinctrl subsystem
[    0.080000] NET: Registered protocol family 16
[    0.080000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.080000] AT91: Detected SoC family: sama5d3
[    0.080000] AT91: Detected SoC: sama5d36, revision 2
[    0.110000] No ATAGs?
[    0.110000] gpio-at91 fffff200.gpio: at address e0854200
[    0.110000] gpio-at91 fffff400.gpio: at address e0856400
[    0.120000] gpio-at91 fffff600.gpio: at address e0858600
[    0.120000] gpio-at91 fffff800.gpio: at address e085a800
[    0.120000] gpio-at91 fffffa00.gpio: at address e085ca00
[    0.130000] pinctrl-at91 ahb:apb:pinctrl@fffff200: initialized AT91 pinctrl driver
[    0.130000] clocksource tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 115833966437 ns
[    0.170000] at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave sg-cpy ), 8 channels
[    0.170000] at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave sg-cpy ), 8 channels
[    0.180000] at91_i2c f0014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[    0.180000] at91_i2c f0014000.i2c: AT91 i2c bus driver (hw version: 0x402).
[    0.180000] at91_i2c f0018000.i2c: using dma0chan2 (tx) and dma0chan3 (rx) for DMA transfers
[    0.190000] at91_i2c f0018000.i2c: AT91 i2c bus driver (hw version: 0x402).
[    0.190000] Switched to clocksource tcb_clksrc
[    0.230000] NET: Registered protocol family 2
[    0.230000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.230000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.230000] TCP: Hash tables configured (established 4096 bind 4096)
[    0.230000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.230000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.240000] NET: Registered protocol family 1
[    0.240000] RPC: Registered named UNIX socket transport module.
[    0.240000] RPC: Registered udp transport module.
[    0.240000] RPC: Registered tcp transport module.
[    0.240000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.240000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.250000] io scheduler noop registered (default)
[    0.260000] f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 29, base_baud = 4125000) is a ATMEL_SERIAL
[    0.260000] f0024000.serial: ttyS5 at MMIO 0xf0024000 (irq = 30, base_baud = 4125000) is a ATMEL_SERIAL
[    0.260000] ffffee00.serial: ttyS0 at MMIO 0xffffee00 (irq = 38, base_baud = 8250000) is a ATMEL_SERIAL
[    0.760000] console [ttyS0] enabled
[    0.760000] [drm] Initialized drm 1.1.0 20060810
[    0.780000] brd: module loaded
[    0.800000] loop: module loaded
[    0.810000] atmel_nand_nfc 70000000.nfc: NFC is probed.
[    0.810000] atmel_nand 60000000.nand: Using dma0chan4 for DMA transfers.
[    0.820000] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xaa
[    0.830000] nand: Hynix H27S2G8F2DKA-BM
[    0.830000] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    0.840000] atmel_nand 60000000.nand: minimum ECC: 4 bits in 512 bytes
[    0.850000] atmel_nand 60000000.nand: Initialize PMECC params, cap: 8, sector: 512
[    0.850000] atmel_nand 60000000.nand: Using NFC Sram read 
[    0.860000] Scanning device for bad blocks
[    0.860000] Bad eraseblock 0 at 0x000000000000
[    0.870000] Bad eraseblock 1 at 0x000000020000
[    0.870000] Bad eraseblock 2 at 0x000000040000
[    0.880000] Bad eraseblock 3 at 0x000000060000
[    0.880000] Bad eraseblock 4 at 0x000000080000
[    0.890000] Bad eraseblock 5 at 0x0000000a0000
[    0.890000] Bad eraseblock 6 at 0x0000000c0000
[    0.900000] Bad eraseblock 7 at 0x0000000e0000
[    0.900000] Bad eraseblock 8 at 0x000000100000
[    0.900000] Bad eraseblock 9 at 0x000000120000
[    0.910000] Bad eraseblock 10 at 0x000000140000
[    0.910000] Bad eraseblock 11 at 0x000000160000
[    0.920000] Bad eraseblock 12 at 0x000000180000
[    0.920000] Bad eraseblock 13 at 0x0000001a0000
[    0.930000] Bad eraseblock 14 at 0x0000001c0000
...
[   10.720000] Bad eraseblock 2045 at 0x00000ffa0000
[   10.720000] Bad eraseblock 2046 at 0x00000ffc0000
[   10.730000] Bad eraseblock 2047 at 0x00000ffe0000
[   10.730000] mtd: bad character after partition (r)
[   10.740000] 9 ofpart partitions found on MTD device atmel_nand
[   10.740000] Creating 9 MTD partitions on "atmel_nand":
[   10.750000] 0x000000040000-0x0000000c0000 : "uboot"
[   10.750000] 0x0000000c0000-0x000000100000 : "uboot_env"
[   10.760000] 0x000000100000-0x0000001e0000 : "uboot_lcd-img"
[   10.770000] 0x000000f00000-0x000001000000 : "device_tree"
[   10.780000] 0x000001000000-0x000001800000 : "kernel_fast"
[   10.790000] 0x000001800000-0x000002000000 : "kernel_debug"
[   10.800000] 0x000002000000-0x000008000000 : "rootfs_fast"
[   10.800000] 0x000008000000-0x00000e000000 : "rootfs_debug"
[   10.820000] 0x00000e000000-0x000010000000 : "config"
[   10.830000] AT91: Starting after wakeup
[   10.830000] atmel_aes f8038000.aes: version: 0x135
[   10.840000] atmel_aes f8038000.aes: Atmel AES - Using dma1chan0, dma1chan1 for DMA transfers
[   10.850000] atmel_sha f8034000.sha: version: 0x410
[   10.860000] atmel_sha f8034000.sha: using dma1chan2 for DMA transfers
[   10.860000] atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
[   10.870000] atmel_tdes f803c000.tdes: version: 0x701
[   10.880000] atmel_tdes f803c000.tdes: using dma1chan3, dma1chan4 for DMA transfers
[   10.890000] atmel_tdes f803c000.tdes: Atmel DES/TDES
[   10.890000] iio iio:device0: Resolution used: 12 bits
[   10.900000] iio iio:device0: ADC Touch screen is disabled.
[   10.910000] NET: Registered protocol family 17
[   10.920000] ubi0: attaching mtd7
[   10.930000] ubi0: scanning is finished
[   10.930000] ubi0: empty MTD device detected
[   10.930000] ubi0 error: ubi_early_get_peb: no free eraseblocks
[   10.940000] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd7, error -28
[   10.950000] UBI error: cannot attach mtd7
[   10.950000] input: gpio_keys as /devices/soc0/gpio_keys/input/input0
[   10.970000] UBIFS error (pid: 1): cannot open "ubi0:rootfs", error -19VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
[   10.980000] Please append a correct "root=" boot option; here are the available partitions:
[   10.990000] 0100            8192 ram0  (driver?)
[   11.000000] 0101            8192 ram1  (driver?)
[   11.000000] 0102            8192 ram2  (driver?)
[   11.010000] 0103            8192 ram3  (driver?)
[   11.010000] 1f00             512 mtdblock0  (driver?)
[   11.020000] 1f01             256 mtdblock1  (driver?)
[   11.020000] 1f02             896 mtdblock2  (driver?)
[   11.030000] 1f03            1024 mtdblock3  (driver?)
[   11.030000] 1f04            8192 mtdblock4  (driver?)
[   11.040000] 1f05            8192 mtdblock5  (driver?)
[   11.040000] 1f06           98304 mtdblock6  (driver?)
[   11.050000] 1f07           98304 mtdblock7  (driver?)
[   11.050000] 1f08           32768 mtdblock8  (driver?)
[   11.060000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   11.060000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.0-linux4sam_5.3 #1
[   11.060000] Hardware name: Atmel SAMA5
[   11.060000] [<c00133bc>] (unwind_backtrace) from [<c0011434>] (show_stack+0x10/0x14)
[   11.060000] [<c0011434>] (show_stack) from [<c030c0b8>] (panic+0x78/0x1e4)
[   11.060000] [<c030c0b8>] (panic) from [<c04361e4>] (mount_block_root+0x204/0x24c)
[   11.060000] [<c04361e4>] (mount_block_root) from [<c043649c>] (prepare_namespace+0x88/0x1b8)
[   11.060000] [<c043649c>] (prepare_namespace) from [<c0435d8c>] (kernel_init_freeable+0x168/0x1ac)
[   11.060000] [<c0435d8c>] (kernel_init_freeable) from [<c030b16c>] (kernel_init+0x8/0xe4)
[   11.060000] [<c030b16c>] (kernel_init) from [<c000eb48>] (ret_from_fork+0x14/0x2c)
[   11.060000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   41.660000] random: nonblocking pool is initialized
blue_z
Location: USA
Posts: 1642
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D36 NAND Flash timing settings

Sat Apr 14, 2018 1:45 am

flomll wrote:I want to use a FMND2GxxS3J ...
What is this?
Google finds zip.

flomll wrote:The ONFI ECC parameters seems to be correct but it can not write to the BAD blocks
Why would you want to write to a bad block?

flomll wrote:Does anyone know a solution to disable the ONFI for the timings because I think ...
You're asking an XY question. The answer isn't likely to resolve anything.

Regards
flomll
Posts: 10
Joined: Tue Jun 10, 2014 10:18 am

Re: SAMA5D36 NAND Flash timing settings

Mon Apr 16, 2018 11:12 am

The FMND2GxxS3J is a Fidelix NAND Flash with 2Gbit (256MB). I would like to add the datasheet but PDF is not allowed by this forum (take a look at the attachments).

Does anyone know where to set the NAND timings for sam4linux-5.1 kernel (Linux 4.1.x)? I think it used one of the ONFI modes 0 - 5 but I do not know where.
blue_z
Location: USA
Posts: 1642
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D36 NAND Flash timing settings

Wed Apr 18, 2018 1:09 am

flomll wrote:The FMND2GxxS3J is a Fidelix NAND Flash with 2Gbit (256MB). I would like to add the datasheet but PDF is not allowed by this forum (take a look at the attachments).
That's not a complete part number.
If the document is already hosted online, then simply post the link. Otherwise upload it to a free cloud storage site (e.g. Dropbox), and post the link.
flomll
Posts: 10
Joined: Tue Jun 10, 2014 10:18 am

Re: SAMA5D36 NAND Flash timing settings

Wed Apr 18, 2018 11:08 am

I successfully use the FMND4G... but the FMND2G.. does not work.

Here are the links:

https://www.dropbox.com/s/8340lwlgzh8zf ... K.PDF?dl=0

https://www.dropbox.com/s/tcjniuthx5dp6 ... 1.pdf?dl=0

I checked the timings at the datasheet of both chips and they are equal. Page 30.
flomll
Posts: 10
Joined: Tue Jun 10, 2014 10:18 am

Re: SAMA5D36 NAND Flash timing settings

Thu Apr 19, 2018 7:14 am

Is it possible that the problem comes from the RAM?

We use a RAM without ECC on the FMND4G08S3K-ID and with ECC on the FMND2G08S3J-ID.
blue_z
Location: USA
Posts: 1642
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D36 NAND Flash timing settings

Thu Apr 19, 2018 8:14 pm

flomll wrote:I successfully use the FMND4G... but the FMND2G.. does not work.
Some salient information is slowly revealed.

flomll wrote:I checked the timings at the datasheet of both chips and they are equal. Page 30.
If the chip timings are identical, but one version is "successful" and the other "does not work", then that is solid evidence (if not proof) that NAND chip timing is not an issue.
Yet you persist in asking about a way to "set the NAND timings"!

flomll wrote:Is it possible that the problem comes from the RAM?
If you're manufacturing boards, then don't you have a memory exerciser/diagnostic program?


A quick review of the two NAND flash datasheets reveals one significant difference (other than chip capacity): page size, or more specifically the OOB size.
What adjustments (and there are several that are required) have you made in your build & installation to accommodate these two different OOB sizes ?

Regards
flomll
Posts: 10
Joined: Tue Jun 10, 2014 10:18 am

Re: SAMA5D36 NAND Flash timing settings

Mon Apr 23, 2018 1:24 pm

blue_z wrote:
Thu Apr 19, 2018 8:14 pm
flomll wrote:Is it possible that the problem comes from the RAM?
If you're manufacturing boards, then don't you have a memory exerciser/diagnostic program?
No! :(
blue_z wrote:
Thu Apr 19, 2018 8:14 pm
A quick review of the two NAND flash datasheets reveals one significant difference (other than chip capacity): page size, or more specifically the OOB size.
What adjustments (and there are several that are required) have you made in your build & installation to accommodate these two different OOB sizes ?
Take a look at the output from the first post. The ONFI outputs the right spare area sizes. Now I checked the match of the ECC layout from U-Boot and Linux. They are equal. Take a look at the attachments.

https://www.dropbox.com/s/ble4gntkxq6df ... g.png?dl=0

https://www.dropbox.com/s/3wj4yx3gbpsdj ... d.png?dl=0

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest