UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Voyager
Voyager
683 Views
Registered: ‎09-14-2016

NAND Support after updating from 2016.3 to 2017.4

Hi all,

 

After updating linux-xlnx from 4.6(tag v2016.3) to 4.9 (tag v2017.4) i'm able to access to UBIFS part even if I formate all the part...

 

flash_erase /dev/mtd5 0 0
ubiformat /dev/mtd5 -O 2048
ubiattach /dev/ubi_ctrl -m 5 -O 2048

 

Erasing 128 Kibyte @ 31e0000 -- 98 % complete flash_erase: Skipping bad block at 03200000
flash_erase: Skipping bad block at 03220000
flash_erase: Skipping bad block at 03240000
flash_erase: Skipping bad block at 03260000
Erasing 128 Kibyte @ 3260000 -- 100 % complete
ubiformat: mtd5 (nand), size 52953088 bytes (50.5 MiB), 404 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 403 -- 100 % complete
ubiformat: 400 eraseblocks are supposedly empty
ubiformat: 4 bad eraseblocks found, numbers: 400, 401, 402, 403
ubiformat: formatting eraseblock 362 -- 89 % comubi0: attaching mtd0
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubiformaubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubiformat: formaubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubiformat: formatting erubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
ubiformat: formatting eraseblockCPU: 0 PID: 1912 Comm: ubiattach Not tainted 4.9.0-xilinx #2
Hardware name: Xilinx Zynq Platform
[<c010e394>] (unwind_backtrace) from [<c010a5b0>] (show_stack+0x10/0x14)
[<c010a5b0>] (show_stack) from [<c02de9ec>] (dump_stack+0x80/0x9c)
[<c02de9ec>] (dump_stack) from [<c03f61ec>] (ubi_io_read+0x1d8/0x2ac)
[<c03f61ec>] (ubi_io_read) from [<c03f64e0>] (ubi_io_read_ec_hdr+0x68/0x1d4)
[<c03f64e0>] (ubi_io_read_ec_hdr) from [<c03fab14>] (ubi_attach+0x17c/0x1130)
[<c03fab14>] (ubi_attach) from [<c03f0fc4>] (ubi_attach_mtd_dev+0x600/0xac8)
[<c03f0fc4>] (ubi_attach_mtd_dev) from [<c03f2544>] (ctrl_cdev_ioctl+0x178/0x1f4)
[<c03f2544>] (ctrl_cdev_ioctl) from [<c01ddc4c>] (vfs_ioctl+0x18/0x3c)
[<c01ddc4c>] (vfs_ioctl) from [<c01de50c>] (do_vfs_ioctl+0x778/0x8cc)
[<c01de50c>] (do_vfs_ioctl) from [<c01de694>] (SyS_ioctl+0x34/0x5c)
[<c01de694>] (SyS_ioctl) from [<c0106d40>] (ret_fast_syscall+0x0/0x3c)

Some info to help:

 

root@pti1549 ~ # uname -a
Linux pti1547-dev 4.9.0-xilinx #2 SMP PREEMPT Thu May 3 17:07:44 CEST 2018 armv7l GNU/Linux

 

 

nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
nand: AMD/Spansion S34ML02G1
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_bbt: ECC error in BBT at 0x00000ffe0000
nand_bbt: ECC error in BBT at 0x00000ffc0000
Scanning device for bad blocks
Bad block table written to 0x00000ffe0000, version 0x01
Bad block table written to 0x00000ffc0000, version 0x01
6 ofpart partitions found on MTD device pl35x-nand
Creating 6 MTD partitions on "pl35x-nand":

 

root@pti1549 ~ # mtdinfo /dev/mtd5
mtd5
Name:                           nand-factory
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          404 (52953088 bytes, 50.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true

 

root@pti1549 ~ # mtd_debug info /dev/mtd5
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 52953088 (50M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 64
regions = 0

 

Any advice ?

 

Cheers,

Trigger

 

0 Kudos
1 Reply
Voyager
Voyager
644 Views
Registered: ‎09-14-2016

Re: NAND Support after updating from 2016.3 to 2017.4

Hi all,

 

Without Xilinx answer let's go for dirty pach:

 

# Clone repo
git clone https://github.com/Xilinx/linux-xlnx.git
cd linux-xlnx

# Set cross compil and arch
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-

# Config
make xilinx_zynq_defconfig

# NAND / MTD / UBI 
make menuconfig

# Fix troubles
git checkout xilinx-v2016.3 drivers/mtd/mtdchar.c
git checkout xilinx-v2016.3 drivers/mtd/mtdconcat.c
git checkout xilinx-v2016.3 drivers/mtd/mtdcore.c
git checkout xilinx-v2016.3 drivers/mtd/mtdpart.c
git checkout xilinx-v2016.3 drivers/mtd/nand/nand_base.c
git checkout xilinx-v2016.3 drivers/mtd/nand/nand_ids.c
git checkout xilinx-v2016.3 drivers/mtd/nand/nand_timings.c
git checkout xilinx-v2016.3 drivers/mtd/nand/pl35x_nand.c
git checkout xilinx-v2016.3 include/linux/mtd/mtd.h
git checkout xilinx-v2016.3 include/linux/mtd/nand.h
git checkout xilinx-v2016.3 include/linux/of_mtd.h

# build
make -j5 ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

 

I's dirty but it works,

Regards,

Trigger

 

 

0 Kudos