This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to configure nand partition support into kernel

Other Parts Discussed in Thread: AM3359

  I'm trying to get Nand flash support compiled into the kernel for a custom board with an AM3359 processor.  But,after booting this kernel, I don't see a /dev/mtdX or /dev/mtdblockX device. And when I ‘cat /proc/mtd’,it prints like follows(not any more):

           dev:    size   erasesize  name

        To follow what steps can I use the nand flash in linux

I want to boot ubifs on NAND(stand alone: mtd7)

 

 

check the information list :

 1. kernel boot log : Don't appear MTD partition setting

 2. in u-boot mtdparts info

device nand0 <omap2-nand.0>, # parts = 8
 #: name		size		offset		mask_flags
 0: SPL                 0x00020000	0x00000000	0
 1: SPL.backup1         0x00020000	0x00020000	0
 2: SPL.backup2         0x00020000	0x00040000	0
 3: SPL.backup3         0x00020000	0x00060000	0
 4: u-boot              0x001e0000	0x00080000	0
 5: u-boot-env          0x00020000	0x00260000	0
 6: kernel              0x00500000	0x00280000	0
 7: root                0x0f880000	0x00780000	0

active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

defaults:
mtdids  : nand0=omap2-nand.0
mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),12
8k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)
U-Boot# 

3. <kernel dir>/arch/arm/mach-omap2/board-am335xevm.c

/* NAND partition information */
static struct mtd_partition am335x_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
	{
		.name           = "SPL",
		.offset         = 0,			/* Offset = 0x0 */
		.size           = SZ_128K,
	},
	{
		.name           = "SPL.backup1",
		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x20000 */
		.size           = SZ_128K,
	},
	{
		.name           = "SPL.backup2",
		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x40000 */
		.size           = SZ_128K,
	},
	{
		.name           = "SPL.backup3",
		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x60000 */
		.size           = SZ_128K,
	},
	{
		.name           = "U-Boot",
		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
		.size           = 15 * SZ_128K,
	},
	{
		.name           = "U-Boot-Env",
		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
		.size           = 1 * SZ_128K,
	},
	{
		.name           = "Kernel",
		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
		.size           = 40 * SZ_128K,
	},
	{
		.name           = "File System",
		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
		.size           = MTDPART_SIZ_FULL,
	},
};


4. all this working in 'root' acoount

what can I do solve this problem?

 

  • Hi Hwang,

    Do you have NAND support enabled in the kernel?

    Please follow this guide to enable it: http://processors.wiki.ti.com/index.php/AM335x_NAND_Driver%27s_Guide#Driver_Configuration

    Best regards,
    Miroslav

  • already check kernel menuconfig.

    It's ti-sdk's kernel configuration, right?

    root@ubuntu:/ti/ti-sdk-am335x-evm/board-support/linux-3.2.0-psp04.06.00.11# make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm menuconfig

     

    then, make uImage same option.

  • Hwang, did you do:

    make am335x_evm_defconfig

    before making the uImage?


    P.S. Sorry, I forgot you are working on a custom board.

    Can you share your boot log?

    Best regards,
    Miroslav

  • Mriroslav,

    I check it :

    make <option> am335x_evm_defconfig

    then

    make <option> uImage

    but mtd partitions did not set

    this is boot log, check it.

     

    U-Boot 2013.01.01 (Feb 17 2014 - 14:15:26)
    
    I2C:   ready
    DRAM:  256 MiB
    WARNING: Caches not enabled
    i2c error waiting for data ACK (status=0x16)
    Could not write the EEPROM; something fundamentally wrong on the I2C bus.
    Could not get board ID.
    NAND:  256 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO 
    Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0 
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Peripheral mode controller at 47401000 using PIO, IRQ 0
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO 
    Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0 
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Host mode controller at 47401800 using PIO, IRQ 0
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  1  0 
    Booting from mmc ...
    reading uImage
    3366664 bytes read in 362 ms (8.9 MiB/s)
    ## Booting kernel from Legacy Image at 80200000 ...
       Image Name:   Linux-3.2.0
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3366600 Bytes = 3.2 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 3.2.0 (root@ubuntu) (gcc version 4.7.3 20130226 (pr
    erelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03)
     ) #19 Tue Apr 8 16:09:06 KST 2014
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructio
    n cache
    [    0.000000] Machine: am335xevm
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM335X ES2.1 (sgx neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pag
    es: 65024
    [    0.000000] Kernel command line: console=ttyO0,115200n8 noinitrd root=/dev/mm
    cblk0p2 rootdelay=2
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 256MB = 256MB total
    [    0.000000] Memory: 252944k/252944k available, 9200k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc05e6000   (6008 kB)
    [    0.000000]       .init : 0xc05e6000 - 0xc0622000   ( 240 kB)
    [    0.000000]       .data : 0xc0622000 - 0xc068f3a0   ( 437 kB)
    [    0.000000]        .bss : 0xc068f3c4 - 0xc06bf4f0   ( 193 kB)
    [    0.000000] NR_IRQS:396
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrup
    ts
    [    0.000000] Total of 128 interrupts on 1 active controller
    [    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
    [    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
    [    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 13
    1071999ms
    [    0.000000] Console: colour dummy device 80x30
    [    0.000091] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
    [    0.089080] pid_max: default: 32768 minimum: 301
    [    0.089172] Security Framework initialized
    [    0.089263] Mount-cache hash table entries: 512
    [    0.089630] CPU: Testing write buffer coherency: ok
    [    0.109558] omap_hwmod: pruss: failed to hardreset
    [    0.110656] print_constraints: dummy: 
    [    0.110992] NET: Registered protocol family 16
    [    0.113037] OMAP GPIO hardware version 0.1
    [    0.115417] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.117218]  omap_i2c.1: alias fck already exists
    [    0.118072]  omap2_mcspi.1: alias fck already exists
    [    0.118286]  omap2_mcspi.2: alias fck already exists
    [    0.119201]  edma.0: alias fck already exists
    [    0.119232]  edma.0: alias fck already exists
    [    0.119232]  edma.0: alias fck already exists
    [    0.144897] bio: create slab <bio-0> at 0
    [    0.146972] SCSI subsystem initialized
    [    0.148498] usbcore: registered new interface driver usbfs
    [    0.148834] usbcore: registered new interface driver hub
    [    0.149017] usbcore: registered new device driver usb
    [    0.149353] registerd cppi-dma Intr @ IRQ 17
    [    0.149353] Cppi41 Init Done Qmgr-base(d087a000) dma-base(d0878000)
    [    0.149383] Cppi41 Init Done
    [    0.149383] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
    [    0.149688] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
    [    0.150756] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
    [    0.152496] tps65910 1-002d: JTAGREVNUM 0x0
    [    0.154876] print_constraints: VRTC: 
    [    0.156280] print_constraints: VIO: at 1800 mV 
    [    0.158569] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal 
    [    0.160858] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal 
    [    0.161865] print_constraints: VDD3: 5000 mV 
    [    0.163238] print_constraints: VDIG1: at 1800 mV 
    [    0.164642] print_constraints: VDIG2: at 1800 mV 
    [    0.166046] print_constraints: VPLL: at 1800 mV 
    [    0.167449] print_constraints: VDAC: at 1800 mV 
    [    0.168823] print_constraints: VAUX1: at 1800 mV 
    [    0.170257] print_constraints: VAUX2: at 3300 mV 
    [    0.171661] print_constraints: VAUX33: at 3300 mV 
    [    0.173065] print_constraints: VMMC: at 3300 mV 
    [    0.173553] tps65910 1-002d: No interrupt support, no core IRQ
    [    0.175018] Advanced Linux Sound Architecture Driver Version 1.0.24.
    [    0.176116] Switching to clocksource gp timer
    [    0.190307] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    [    0.190490] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    [    0.190795] MUSB0 controller's USBSS revision = 4ea20800
    [    0.190826] musb0: Enabled SW babble control
    [    0.191711] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using 
    DMA, IRQ 18
    [    0.191864] musb-hdrc musb-hdrc.1: dma type: dma-cppi41
    [    0.192169] MUSB1 controller's USBSS revision = 4ea20800
    [    0.192169] musb1: Enabled SW babble control
    [    0.192596] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [    0.192687] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus numbe
    r 1
    [    0.192810] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    0.192840] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=
    1
    [    0.192840] usb usb1: Product: MUSB HDRC host driver
    [    0.192840] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
    [    0.192871] usb usb1: SerialNumber: musb-hdrc.1
    [    0.193603] hub 1-0:1.0: USB hub found
    [    0.193634] hub 1-0:1.0: 1 port detected
    [    0.194152] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using
     DMA, IRQ 19
    [    0.194549] NET: Registered protocol family 2
    [    0.194732] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.195068] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.195220] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.195312] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.195312] TCP reno registered
    [    0.195312] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.195343] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.195526] NET: Registered protocol family 1
    [    0.195770] RPC: Registered named UNIX socket transport module.
    [    0.195770] RPC: Registered udp transport module.
    [    0.195800] RPC: Registered tcp transport module.
    [    0.195800] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.196014] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.207672] VFS: Disk quotas dquot_6.5.2
    [    0.207733] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.208251] msgmni has been set to 494
    [    0.211273] alg: No test for stdrng (krng)
    [    0.211944] io scheduler noop registered
    [    0.211944] io scheduler deadline registered
    [    0.212036] io scheduler cfq registered (default)
    [    0.213134] Could not set LED4 to fully on
    [    0.247222] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
    [    0.897003] console [ttyO0] enabled
    [    0.901245] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    [    0.909088] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    [    0.916870] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    [    0.924621] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    [    0.932403] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    [    0.940673] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
    [    0.956237] brd: module loaded
    [    0.963989] loop: module loaded
    [    0.967529] i2c-core: driver [tsl2550] using legacy suspend method
    [    0.973968] i2c-core: driver [tsl2550] using legacy resume method
    [    0.980438] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    1.066711] No daughter card found
    [    1.070312] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    1.085510] Board name: A335_SDC
    [    1.088897] Board version: □□
    [    1.092193] The board is a AM335x Smart Data Concentrator.
    [    1.099395]  omap_hsmmc.1: alias fck already exists
    [    1.108459] registered am33xx_sr device
    [    1.114257] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.121459] omap2-nand driver initializing
    [    1.125885] OneNAND driver initializing
    [    1.131622] tun: Universal TUN/TAP device driver, 1.6
    [    1.136932] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
    [    1.143615] CAN device driver interface
    [    1.147644] CAN bus driver for Bosch D_CAN controller 1.0
    [    1.196777] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    [    1.203247] davinci_mdio davinci_mdio.0: detected phy mask fffffffc
    [    1.211395] davinci_mdio.0: probed
    [    1.214935] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
    [    1.222351] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown
    [    1.230041] usbcore: registered new interface driver zd1201
    [    1.236053] usbcore: registered new interface driver cdc_ether
    [    1.242340] usbcore: registered new interface driver cdc_eem
    [    1.248413] usbcore: registered new interface driver dm9601
    [    1.254272] cdc_ncm: 04-Aug-2011
    [    1.257843] usbcore: registered new interface driver cdc_ncm
    [    1.263763] Initializing USB Mass Storage driver...
    [    1.269104] usbcore: registered new interface driver usb-storage
    [    1.275360] USB Mass Storage support registered.
    [    1.280578] usbcore: registered new interface driver usbserial
    [    1.286682] usbserial: USB Serial Driver core
    [    1.291412] USB Serial support registered for pl2303
    [    1.296783] usbcore: registered new interface driver pl2303
    [    1.302612] pl2303: Prolific PL2303 USB to serial adaptor driver
    [    1.309326] mousedev: PS/2 mouse device common for all mice
    [    1.316223] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0
    [    1.323303] am33xx-rtc: already running
    [    1.327545] i2c /dev entries driver
    [    1.331542] Linux video capture interface: v2.00
    [    1.336700] usbcore: registered new interface driver uvcvideo
    [    1.342742] USB Video Class driver (1.1.1)
    [    1.347869] lm75 1-004f: hwmon0: sensor 'tmp275'
    [    1.447601] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    1.456054] cpuidle: using governor ladder
    [    1.460845] cpuidle: using governor menu
    [    1.468017] omap4_aes_mod_init: loading AM33X AES driver
    [    1.473663] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
    [    1.480438] omap4_aes_probe: probe() done
    [    1.484863] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
    [    1.491027] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
    [    1.508636] omap4_sham_probe: probe() done
    [    1.515289] usbcore: registered new interface driver usbhid
    [    1.521148] usbhid: USB HID core driver
    [    1.525939] usbcore: registered new interface driver snd-usb-audio
    [    1.534088] ALSA device list:
    [    1.537231]   No soundcards found.
    [    1.540802] oprofile: hardware counters not available
    [    1.546081] oprofile: using timer interrupt.
    [    1.550720] nf_conntrack version 0.5.0 (3952 buckets, 15808 max)
    [    1.557403] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    1.563079] TCP cubic registered
    [    1.566558] NET: Registered protocol family 10
    [    1.571868] NET: Registered protocol family 17
    [    1.576538] can: controller area network core (rev 20090105 abi 8)
    [    1.583129] NET: Registered protocol family 29
    [    1.587799] can: raw protocol (rev 20090105)
    [    1.592254] can: broadcast manager protocol (rev 20090105 t)
    [    1.598205] Registering the dns_resolver key type
    [    1.603179] VFP support v0.3: implementor 41 architecture 3 part 30 variant c
     rev 3
    [    1.611206] ThumbEE CPU extension supported.
    [    1.615753] mux: Failed to setup hwmod io irq -22
    [    1.621337] Power Management for AM33XX family
    [    1.626190] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [    1.632904] Copied the M3 firmware to UMEM
    [    1.637268] Cortex M3 Firmware Version = 0x181
    [    1.643676] create_regulator: VDD1: Failed to create debugfs directory
    [    1.652038] smartreflex smartreflex: am33xx_sr_probe: Driver initialized
    [    1.667114] clock: disabling unused clocks to save power
    [    1.680541] mmc0: host does not support reading read-only switch. assuming wr
    ite-enable.
    [    1.689422] mmc0: new SDHC card at address aaaa
    [    1.694915] mmcblk0: mmc0:aaaa SU04G 3.69 GiB 
    [    1.702026]  mmcblk0: p1 p2
    [    1.708923] Detected MACID=88:33:14:f6:e2:a6
    [    1.714630] cpsw: Detected MACID = 88:33:14:f6:e2:a8
    [    1.721069] omap_rtc am33xx-rtc: setting system clock to 2013-06-25 23:08:38 
    UTC (1372201718)
    [    1.730346] Waiting 2sec before mounting root device...
    [    3.743591] kjournald starting.  Commit interval 5 seconds
    [    3.753448] EXT3-fs (mmcblk0p2): using internal journal
    [    3.758941] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    [    3.766204] VFS: Mounted root (ext3 filesystem) on device 179:2.
    [    3.772888] Freeing init memory: 240K
    INIT: version 2.88 booting
    Starting udev
    Error opening /dev/fb0: No such device
    Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or d
    irectory
    bootlogd.
    ALSA: Restoring mixer settings...
    Configuring network interfaces... /usr/sbin/alsactl: load_state:1686: No soundca
    rds found...
    [    7.418609] net eth0: CPSW phy found : id is : 0x4dd074
    [    7.431427] ADDRCONF(NETDEV_UP): eth0: link is not ready
    udhcpc (v1.20.2) started
    Sending discover...
    [    9.418365] PHY: 0:00 - Link is Up - 100/Full
    [    9.423065] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    Sending discover...
    Sending discover...
    No lease, failing
    done.
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    Starting thttpd.
    Stopping Bootlog daemon: bootlogd.
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am335x-evm ttyO0
    
    Arago 2013.05 am335x-evm ttyO0
    
    am335x-evm login: root
    root@am335x-evm:~# cat /proc/mtd
    dev:    size   erasesize  name
    root@am335x-evm:~# 

  • Hwang, for some reason your NAND flash isn't detected. The NAND detection and the MTD partitions initialization should happen between these two lines:

    Hwang Jinwook said:
    [ 1.121459] omap2-nand driver initializing [ 1.125885] OneNAND driver initializing

    My suggestion is to put prints inside the code and see what exactly is happening.

    From the first line I quoted it looks like the omap2-nand driver has been initialized, but it should later call the nand_scan_ident() function to identify the NAND flash. If the NAND flash is not detected, the nand_scan_ident() function should print a "No NAND device found" error message. Check whether this function is called and if it is - why is nothing printed on the serial console.

    The functions you might be interested in are:

    static int __devinit omap_nand_probe() inside <kernel_dir>/drivers/mtd/nand/omap2.c
    int nand_scan_ident()
    inside <kernel_dir>/drivers/mtd/nand/nand_base.c
    static struct nand_flash_dev *nand_get_flash_type() inside the same file (this prints NAND chip information if it detects one)

    Best regards,
    Miroslav

  • Hwang,

    Before you put prints inside the code, please also let me know about the contents of your static struct evm_dev_cfg gen_purp_evm_dev_cfg[] (or whatever name you are using) inside the <kernel_dir>/arch/arm/mach-omap2/board-am335xevm.c file. Do you have the evm_nand_init() function included?

    Best regards,
    Miroslav

  • yes, included evm_nand_init

    board-am335xevm.c

    static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {
    	{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{enable_ecap0,	DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
    						PROFILE_2 | PROFILE_7) },
    	{lcdc_init,	DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
    						PROFILE_2 | PROFILE_7) },
    	{mfd_tscadc_init,	DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
    						PROFILE_2 | PROFILE_7) },
    	{rgmii1_init,	DEV_ON_BASEBOARD, PROFILE_ALL},
    	{rgmii2_init,	DEV_ON_DGHTR_BRD, (PROFILE_1 | PROFILE_2 |
    						PROFILE_4 | PROFILE_6) },
    	{usb0_init,	DEV_ON_BASEBOARD, PROFILE_ALL},
    	{usb1_init,	DEV_ON_BASEBOARD, PROFILE_ALL},
    	{evm_nand_init, DEV_ON_DGHTR_BRD,
    		(PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},
    	{i2c1_init,     DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2)},
    	{lis331dlh_init, DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2)},
    	{mcasp1_init,	DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
    	{mmc1_init,	DEV_ON_DGHTR_BRD, PROFILE_2},
    	{mmc2_wl12xx_init,	DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 |
    								PROFILE_5)},
    	{mmc0_init,	DEV_ON_BASEBOARD, (PROFILE_ALL & ~PROFILE_5)},
    	{mmc0_no_cd_init,	DEV_ON_BASEBOARD, PROFILE_5},
    	{spi0_init,	DEV_ON_DGHTR_BRD, PROFILE_2},
    	{uart1_wl12xx_init,	DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 |
    								PROFILE_5)},
    	{wl12xx_init,	DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)},
    	{d_can_init,	DEV_ON_DGHTR_BRD, PROFILE_1},
    	{matrix_keypad_init, DEV_ON_DGHTR_BRD, PROFILE_0},
    	{volume_keys_init,  DEV_ON_DGHTR_BRD, PROFILE_0},
    	{uart2_init,	DEV_ON_DGHTR_BRD, PROFILE_3},
    	{haptics_init,	DEV_ON_DGHTR_BRD, (PROFILE_4)},
    	{sgx_init,	DEV_ON_BASEBOARD, PROFILE_ALL},
    	{NULL, 0, 0},
    };
    

    evm_nand_init  (in same file)

    static void evm_nand_init(int evm_id, int profile)
    {
    	struct omap_nand_platform_data *pdata;
    	struct gpmc_devices_info gpmc_device[2] = {
    		{ NULL, 0 },
    		{ NULL, 0 },
    	};
    
    	setup_pin_mux(nand_pin_mux);
    	pdata = omap_nand_init(am335x_nand_partitions,
    		ARRAY_SIZE(am335x_nand_partitions), 0, 0,
    		&am335x_nand_timings);
    	if (!pdata)
    		return;
    
    	pdata->ecc_opt =OMAP_ECC_BCH8_CODE_HW;
    	pdata->elm_used = true;
    	gpmc_device[0].pdata = pdata;
    	gpmc_device[0].flag = GPMC_DEVICE_NAND;
    
    	omap_init_gpmc(gpmc_device, sizeof(gpmc_device));
    	omap_init_elm();
    }
    

  • Hwang Jinwook said:
    {evm_nand_init, DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},

    Hwang, this will only execute if the board is in a PROFILE different than PROFILE_2 or PROFILE_3. Can you verify that? Do you have a CPLD switch on the board, like the AM335x GP EVM?

    Assuming your board is configured to act like the GP EVM, the function that calls the above structure is:

    static void setup_general_purpose_evm(void)
    {
        u32 prof_sel = am335x_get_profile_selection();
        u32 boardid = GEN_PURP_EVM;

        if (!strncmp("1.5A", config.version, 4))
            boardid = GEN_PURP_DDR3_EVM;

        pr_info("The board is general purpose EVM %sin profile %d\n",
                ((boardid == GEN_PURP_DDR3_EVM) ? "with DDR3 " : ""),
                prof_sel);

        _configure_device(boardid, gen_purp_evm_dev_cfg, (1L << prof_sel));

        am33xx_cpsw_init(AM33XX_CPSW_MODE_RGMII, NULL, NULL);
        /* Atheros Tx Clk delay Phy fixup */
        phy_register_fixup_for_uid(AM335X_EVM_PHY_ID, AM335X_EVM_PHY_MASK,
                       am33xx_evm_tx_clk_dly_phy_fixup);
    }

    The prof_sel parameter is what you need to check. If it is 2 or 3, then the evm_nand_init() will never run. If it is -1 (PROFILE_NONE), then you need to tell me if your NAND flash is on the main board or on a daughter board.

    Best regards,
    Miroslav

  • board-am335xevm.c

    around line:2790

    input print "6666666666666666666" , then kernel bootlog output "6666666666666666666"

    so, we are board name is "A335_SDC"

    therefore, cannot access 'setup_general_purpose_evm()' function

     

    let me see code:

     

     static void am335x_evm_setup(struct memory_accessor *mem_acc, void *context)

    .....

    	if (!strncmp("A335BONE", config.name, 8)) {
    		daughter_brd_detected = false;
    		if(!strncmp("00A1", config.version, 4) ||
    		   !strncmp("00A2", config.version, 4))
    			setup_beaglebone_old();
    		else
    			setup_beaglebone();
    
    	} else if (!strncmp("A335BNLT", config.name, 8)) {
    		setup_beagleboneblack();
    	} else if (!strncmp("A335X_SK", config.name, 8)) {
    		daughter_brd_detected = false;
    		setup_starterkit();
    	} else if (!strncmp("A335_SDC", config.name, 8)) {
    		setup_dataconcentrator();
    	printk("66666666666666666666666666666\n");
    
    	} else {
    		/* only 6 characters of options string used for now */
    		snprintf(tmp, 7, "%s", config.opt);
    		pr_info("SKU: %s\n", tmp);
    
    		if (!strncmp("SKU#01", config.opt, 6))
    			setup_general_purpose_evm();
    		else if (!strncmp("SKU#02", config.opt, 6))
    			setup_ind_auto_motor_ctrl_evm();
    		else
    			goto out;
    	}
    

    And , you said check the prof_sel 's parameter is '1L'

    my code same with your code

  • Hwang Jinwook said:
    } else if (!strncmp("A335_SDC", config.name, 8)) { setup_dataconcentrator();

    This means that the equivalent of the setup_general_purpose_evm() function for your board is setup_dataconcentrator(). Inside it you most probably have a _configure_device() function to which you pass a structure of evm_dev_cfg type. Check what this structure name is and find it inside the board config file. Then check if evm_nand_init entry exists there.

    Best regards,
    Miroslav

  • I see,checked evm_sdc_dev .

    without evm_nand_init

     

    include code :

    /* EVM - Data Concentrator */
    static struct evm_dev_cfg evm_sdc_dev_cfg[] = {
    	{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{enable_sdc_ecap1, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart0_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart2_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart3_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart4_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart5_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{plc_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{led_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{mmc1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{rgmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{rgmii2_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{gpio_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{spi1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{usb0_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{NULL, 0, 0},
    };

  • This is why the NAND isn't initialized. Add the evm_nand_init entry to this list and the NAND should be initialized after you rebuild the kernel, if there aren't any conflicts with the other entries in the list.

    Best regards,
    Miroslav

  • Miroslav,

    I solve problem

    thank you very much

     

    process :

    /* EVM - Data Concentrator */
    static struct evm_dev_cfg evm_sdc_dev_cfg[] = {
    	{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{enable_sdc_ecap1, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart0_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart2_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart3_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart4_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{uart5_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{plc_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{led_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	//added 1line 	
    	{evm_nand_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{mmc1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{rgmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{rgmii2_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{gpio_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{spi1_sdc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{usb0_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
    	{NULL, 0, 0},
    };