Xilinx Zynq pl353

阅读: 评论:0

Xilinx Zynq pl353

Xilinx Zynq pl353

作者

QQ群:852283276
微信:arm80x86
微信公众号:青儿创客基地
B站:主页

参考

U-Boot NAND Driver
NAND
Zynq Pl353 SMC and NAND drivers
ZYNQ 从NAND flash启动应用笔记
NAND flash sub-pages

FPGA

vivado下设置nand参数,

u-boot

u-boot下开启参数,

#define CONFIG_NAND
#define CONFIG_NAND_ZYNQ

u-boot下mtd配置说明,

/** Three environment variables are used by the parsing routines:** 'partition' - keeps current partition identifier** partition  := <part-id>* <part-id>  := <dev-id>,part_num*** 'mtdids' - linux kernel mtd device id <-> u-boot device id mapping** mtdids=<idmap>[,<idmap>,...]** <idmap>    := <dev-id>=<mtd-id>* <dev-id>   := 'nand'|'nor'|'onenand'<dev-num>* <dev-num>  := mtd device number, 0...* <mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)*** 'mtdparts' - partition list** mtdparts=mtdparts=<mtd-def>[;<mtd-def>...]** <mtd-def>  := <mtd-id>:<part-def>[,<part-def>...]* <mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)* <part-def> := <size>[@<offset>][<name>][<ro-flag>]* <size>     := standard linux memsize OR '-' to denote all remaining space* <offset>   := partition start offset within the device* <name>     := '(' NAME ')'* <ro-flag>  := when set to 'ro' makes partition read-only (not used, passed to kernel)** Notes:* - each <mtd-id> used in mtdparts must albo exist in 'mtddis' mapping* - if the above variables are not set defaults for a given target are used** Examples:** 1 NOR Flash, with 1 single writable partition:* mtdids=nor0=edb7312-nor* mtdparts=mtdparts=edb7312-nor:-** 1 NOR Flash with 2 partitions, 1 NAND with one* mtdids=nor0=edb7312-nor,nand0=edb7312-nand* mtdparts=mtdparts=edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)**/

对于zynq,

#define MTDIDS_DEFAULT "nand0=pl353-nand"
#define MTDPARTS_DEFAULT "mtdparts=pl353-nand:128k(rcw),219008k(rootfs),32m(rd),128k(dtb)," "9088k(kernel),128k(fman),128k(bootenv),768k(boot)"/*modify by zhuce*/

u-boot下通过nand命令操作nand,

zynq-uboot> nand
nand - NAND sub-systemUsage:
nand info - show available NAND devices
nand device [dev] - show or set current device
nand read - addr off|partition size
nand write - addr off|partition sizeread/write 'size' bytes starting at offset 'off'to/from memory address 'addr', skipping bad blocks.
nand read.raw - addr off|partition [count]
nand write.raw - addr off|partition [count]Use read.raw/write.raw to avoid ECC and access the flash as-is.
nand erase[.spread] [clean] off size - erase 'size' bytes from offset 'off'With '.spread', erase enough for given file size, otherwise,'size' includes skipped bad blocks.
nand erase.part [clean] partition - erase entire mtd partition'
nand erase.chip [clean] - erase entire chip'
nand bad - show bad blocks
nand dump[.oob] off - dump page
nand scrub [-y] off size | scrub.part partition | scrub.chipreally clean NAND erasing bad blocks (UNSAFE)
nand markbad off [...] - mark bad block(s) at offset (UNSAFE)
nand biterr off - make a bit error at offset (UNSAFE)
nand lock [tight] [status]bring nand to lock state or display locked pages
nand unlock[.allexcept] [offset] [size] - unlock section
zynq-uboot> nand infoDevice 0: nand0, sector size 128 KiBPage size      2048 bOOB size         64 bErase size   131072 b

linux

pl353-nand的驱动不支持slc nand的sub pages特性,开启配置,

CONFIG_PL35X_SMC = y
CONFIG_MTD_NAND = y
CONFIG_MTD_NAND_PL35X = y

对应的驱动文件,

driversmemorypl353-smc.c
driversmtdnandpl353_nand.c

内核启动报错,

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Unknown W29N01HV
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
mmc0: Problem switching card into high-speed mode!
mmc0: new SDHC card at address 0001
mmcblk0: mmc0:0001 SD 14.5 GiB mmcblk0: p1
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
Bad block table not found for chip 0
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
Bad block table not found for chip 0
Scanning device for bad blocks
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out
pl353_nand_cmd_function timed out

但是在u-boot下可以访问,内核下不支持Winbond的nand,报nand: Unknown W29N01HV,不包含这个厂商,但是检测ondie_ecc_state的的device id0xf1,这是Winbond的,然后通过ONFI来获取nand的基本信息,和u-boot下比对是对的。

ondie_ecc_state 0
ONFI version: 10
mtd name: pl353-nand
mtd writesize: 2048
mtd erasesize: 131072
mtd oobsize: 64
mtd chipsize: 134217728
mtd bits_per_cell: 1
mtd busw: 0 # x8
mtd ecc_bits: 1
mtd ecc_strength_ds: 1
mtd ecc_step_ds: 512

Device Manufacturer是一个用空格补齐的字符串,所有nand参数都按照onfi标准,可读取,

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond W29N01HV
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: bad block at 0x000007f60000
nand_read_bbt: bad block at 0x000007f80000
nand_read_bbt: bad block at 0x000007fa0000
nand_read_bbt: bad block at 0x000007fc0000
6 ofpart partitions found on MTD device pl353-nand
Creating 6 MTD partitions on "pl353-nand":
0x000000000000-0x0000000c0000 : "boot"
0x0000000c0000-0x0000000e0000 : "bootenv"
0x0000000e0000-0x000000100000 : "bootenvredund"
0x000000100000-0x000001000000 : "pl"
0x000001000000-0x000001500000 : "kernel"
0x000001500000-0x000008000000 : "rootfs"

本文发布于:2024-02-04 17:08:12,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170712363957654.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:Xilinx   Zynq
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23