Bug 772

Summary: [beagleboard] Can not recognize NAND flash on board
Product: [Build System, Metadata & Runtime] BSPs Reporter: Yi Zhao <yi.zhao>
Component: bsps-configurationAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Low CC: jiajun.xu, jingdong.lu, liang.li2, liangliang.wang, sgw, yi.zhao, yp.bsp.watcher, yp.watcher
Version: 1.0   
Target Milestone: 1.1   
Hardware: Beagleboard   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Yi Zhao 2011-02-25 00:00:16 UTC
Testing Env:    
Host: Ubuntu 10.10 x86_64
Kernel: 2.6.35-25-generic

beagleboard kernel and rootfs from weekly build 20110221
http://autobuilder.pokylinux.org/nightly/20110221-1/machines/beagleboard/arm/

u-boot environment setting:
###########
setenv optargs 'omapdss.def_disp=dvi vram=12M omapfb.mode="dvi:800x480MR-16@60"
video=omapfb.vram:0:4M,1:4M,2:4M omapfb.debug=y omapdss.debug=y'
setenv console ttyO2,115200n8;mmcinit;fatload mmc 0 0x80800000 uImage.bin;run
mmcargs; bootm 0x80800000
###########

There is a NAND flash on the board, but the system can not recognize it.

When the board boot up, U-boot message:
######################
U-Boot 2009.01-dirty (Feb 19 2009 - 12:23:21)

I2C:   ready
OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
DRAM:  256 MB
NAND:  256 MiB
Using default environment

#####################

#####################
root@beagleboard:~# cat /proc/mtd 
dev:    size   erasesize  name
root@beagleboard:~# dmesg |grep -i nand
Found NAND on CS0
Registering NAND on CS0
#####################

There is no /dev/mtd* devices.

Kernel configure:
##################
root@beagleboard:~# zcat /proc/config.gz |grep -i mtd
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_TESTS is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_MTD_OOPS is not set
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_PLATRAM is not set
# Self-contained MTD device drivers
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_M25P80 is not set
# CONFIG_MTD_SST25L is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
CONFIG_MTD_NAND_ECC=y
# CONFIG_MTD_NAND_ECC_SMC is not set
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_SM_COMMON is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
# CONFIG_MTD_NAND_GPIO is not set
# CONFIG_MTD_NAND_OMAP2 is not set
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_ALAUDA is not set
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_LPDDR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_DEBUG is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
root@beagleboard:~# 
#################

This issue also happens on 2.6.34 kernel.
Comment 1 Bruce Ashfield 2011-02-25 05:51:25 UTC
This is expected, since NAND/Flash aren't on the current minimal BSPs
feature list.

We'll expand the support for beagleboard peripherals post 1.0. Marking
this as an enhancement and leaving the milestone blank.
Comment 2 Bruce Ashfield 2011-03-03 17:59:40 UTC
bumping to 1.1
Comment 3 Jingdong Lu 2011-08-14 20:14:57 UTC
commit dcfb6e4d2ab5df32f0f2408a1aafd6923018555f
Author: Bruce Ashfield <bruce.ashfield@windriver.com>
Date:   Wed Jun 8 15:33:02 2011 -0400
Comment 4 Yi Zhao 2011-08-14 23:01:18 UTC
Verified with 20110806 build.

Now the system can recognize NAND fash as a mtd device:

########
root@beagleboard:~# cat /proc/devices |grep mtd
 90 mtd
 31 mtdblock
 
root@beagleboard:~# ls -l /dev/mtdblock*
brw-rw---- 1 root disk 31, 0 Jan  1  2000 /dev/mtdblock0
brw-rw---- 1 root disk 31, 1 Jan  1  2000 /dev/mtdblock1
brw-rw---- 1 root disk 31, 2 Jan  1  2000 /dev/mtdblock2
brw-rw---- 1 root disk 31, 3 Jan  1  2000 /dev/mtdblock3
brw-rw---- 1 root disk 31, 4 Jan  1  2000 /dev/mtdblock4
########