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.

Linux/AM3351: NAND conflict with UART4

Part Number: AM3351
Other Parts Discussed in Thread: AM3352

Tool/software: Linux

Hi, i am using processor-sdk-04.01.00.06.

as per my custom board i configured uart4 as a debug port,  after this changes nand is not detecting.

please let me know what could be done in u-boot.

 static struct module_pin_mux uart4_pin_mux[] = {

       {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)},    /* UART4_RXD */
       {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)},        /* UART4_TXD */
       {-1},
 };
 

  • Hi,

    The GPMC_WAIT0 signal is required for NAND boot. There is nothing you can do in software as a workaround.
  • hi biser. thanks for your quick response.
    if i dissable uart4. nand is detecting.

    i enabled pin mux for uart4, nand in below functions
    void set_uart_mux_conf(void) //board.c
    {
    enable_uart4_pin_mux();
    }
    enable_board_pin_mux(void) //mux.c
    {
    configure_module_pin_mux(mmc0_pin_mux);
    configure_module_pin_mux(nand_pin_mux);
    configure_module_pin_mux(gpio0_7_pin_mux);
    }
    static struct module_pin_mux nand_pin_mux[] = {
    {OFFSET(gpmc_ad0), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD0 */
    {OFFSET(gpmc_ad1), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD1 */
    {OFFSET(gpmc_ad2), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD2 */
    {OFFSET(gpmc_ad3), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD3 */
    {OFFSET(gpmc_ad4), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD4 */
    {OFFSET(gpmc_ad5), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD5 */
    {OFFSET(gpmc_ad6), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD6 */
    {OFFSET(gpmc_ad7), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD7 */
    #ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
    {OFFSET(gpmc_ad8), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD8 */
    {OFFSET(gpmc_ad9), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD9 */
    {OFFSET(gpmc_ad10), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD10 */
    {OFFSET(gpmc_ad11), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD11 */
    {OFFSET(gpmc_ad12), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD12 */
    {OFFSET(gpmc_ad13), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD13 */
    {OFFSET(gpmc_ad14), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD14 */
    {OFFSET(gpmc_ad15), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD15 */
    #endif
    {OFFSET(gpmc_wait0), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* nWAIT */
    {OFFSET(gpmc_wpn), (MODE(7) | PULLUP_EN)}, /* nWP */
    {OFFSET(gpmc_csn0), (MODE(0) | PULLUP_EN)}, /* nCS */
    {OFFSET(gpmc_wen), (MODE(0) | PULLDOWN_EN)}, /* WEN */
    {OFFSET(gpmc_oen_ren), (MODE(0) | PULLDOWN_EN)}, /* OE */
    {OFFSET(gpmc_advn_ale), (MODE(0) | PULLDOWN_EN)}, /* ADV_ALE */
    {OFFSET(gpmc_be0n_cle), (MODE(0) | PULLDOWN_EN)}, /* BE_CLE */
    {-1},
    };
  • Like I said, NAND will not be detected if the GPMC_WAIT0 pin is pinmuxed to another function.
  • Sorry for the confusion with my first post.
    i configured uart4 like below, but still nand is not detecting.

    static struct module_pin_mux uart4_pin_mux[] = {
    {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)}, /* UART4_TXD */
    {-1},
    };
  • Make sure that:

    {OFFSET(gpmc_wait0), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* nWAIT */

    is really pinmuxed to this mode.
  • if i configure uart0 as a debug port, nand is working fine.
    but nand is not detecting by changing debug port to uart4
  • What Linux version are you using? Do you see any debug messages when UART4 is configured? Please attach the boot log file.
  • i am using u-boot-2017.01+gitAUTOINC+590c7d7fe1-g590c7d7fe1,  linux-4.9.41+gitAUTOINC+e3a80a1c5c-ge3a80a1c5c.

     i got below logs through uart4 

    U-Boot 2017.01-00360-gc6c77f9-dirty (Mar 20 2018 - 15:13:35 +0530)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  256 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env

    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   No ethernet found.
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    reading /am335x-boneblack.dtb
    40718 bytes read in 15 ms (2.6 MiB/s)
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3619776 bytes read in 766 ms (4.5 MiB/s)
    40758 bytes read in 39 ms (1020.5 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8df1d000, end 8df29f35 ... OK

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.9.41-ge3a80a1c5c (root@sridhar-ThinkCentre-M73) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 PREEM8
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt:Machine model: TI AM335x BeagleBone Black
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] cma: Reserved 48 MiB at 0x8a800000
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (neon)
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960
    [    0.000000] Kernel command line: console=ttyO4,115200n8 root=PARTUUID=0001819e-02 rw rootfstype=ext4 rootwait
    [    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: 198316K/262144K available (7168K kernel code, 284K rwdata, 2396K rodata, 1024K init, 280K bss, 14676K reserved, 49152K )
    [    0.000000] Virtual kernel memory layout:

  • now i enabled pin mux for uart4 & nand in kernel.

    both are detecting in kernel. but  u-boot is having  issue.

    please check below logs.

    U-Boot 2017.01-00360-gc6c77f9-dirty (Mar 20 2018 - 15:13:35 +0530)          

    CPU  : AM335X-GP rev 2.1                                                    

    Model: TI AM335x BeagleBone Black      

    DRAM:  256 MiB                          

    NAND:  0 MiB                            

    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1  

    reading uboot.env                      

    ** Unable to read "uboot.env" from mmc0:1 **

    Using default environment

    <ethaddr> not set. Validating first E-fuse MAC

    Net:   No ethernet found.

    Hit any key to stop autoboot:  0

    switch to partitions #0, OK

    mmc0 is current device

    SD/MMC found on device 0

    reading boot.scr

    ** Unable to read file boot.scr **

    reading uEnv.txt

    ** Unable to read file uEnv.txt **

    switch to partitions #0, OK

    mmc0 is current device

    Scanning mmc 0:1...

    reading /am335x-boneblack.dtb

    40718 bytes read in 15 ms (2.6 MiB/s)

    switch to partitions #0, OK

    mmc0 is current device

    SD/MMC found on device 0

    3619776 bytes read in 766 ms (4.5 MiB/s)

    40758 bytes read in 39 ms (1020.5 KiB/s)

    ## Flattened Device Tree blob at 88000000

      Booting using the fdt blob at 0x88000000

      Loading Device Tree to 8df1d000, end 8df29f35 ... OK

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0

    [    0.000000] Linux version 4.9.41-ge3a80a1c5c (root@sridhar-ThinkCentre-M73) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 PREEM8

    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d

    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

    [    0.000000] OF: fdt:Machine model: TI AM335x BeagleBone Black

    [    0.000000] efi: Getting EFI parameters from FDT:

    [    0.000000] efi: UEFI not found.

    [    0.000000] cma: Reserved 48 MiB at 0x8a800000

    [    0.000000] Memory policy: Data cache writeback

    [    0.000000] CPU: All CPU(s) started in SVC mode.

    [    0.000000] AM335X ES2.1 (neon)

    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960

    [    0.000000] Kernel command line: console=ttyO4,115200n8 root=PARTUUID=0001819e-02 rw rootfstype=ext4 rootwait

    [    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: 198316K/262144K available (7168K kernel code, 284K rwdata, 2396K rodata, 1024K init, 280K bss, 14676K reserved, 49152K )

    [    0.000000] Virtual kernel memory layout:

    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)

    [    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)

    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)

    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)

    [    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)

    [    0.000000]       .init : 0xc0b00000 - 0xc0c00000   (1024 kB)

    [    0.000000]       .data : 0xc0c00000 - 0xc0c47390   ( 285 kB)

    [    0.000000]        .bss : 0xc0c47390 - 0xc0c8d534   ( 281 kB)

    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

    [    0.000000] Preemptible hierarchical RCU implementation.

    [    0.000000]  Build-time adjustment of leaf fanout to 32.

    [    0.000000] NR_IRQS:16 nr_irqs:16 16

    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts

    [    0.000000] OMAP clockevent source: timer2 at 19200000 Hz

    [    0.000033] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 111848106981ns

    [    0.000079] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 99544814920 ns

    [    0.000103] OMAP clocksource: timer1 at 19200000 Hz

    [    0.000999] clocksource_probe: no matching clocksources found

    [    0.001345] Console: colour dummy device 80x30

    [    0.001399] WARNING: Your 'console=ttyO4' has been replaced by 'ttyS4'

    [    0.001415] This ensures that you still see kernel messages. Please

    [    0.001430] update your kernel commandline.

    [    0.001476] Calibrating delay loop... 298.59 BogoMIPS (lpj=1492992)

    [    0.067611] pid_max: default: 32768 minimum: 301

    [    0.067918] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.067946] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.069661] CPU: Testing write buffer coherency: ok

    [    0.070347] Setting up static identity map for 0x80100000 - 0x80100060

    [    0.072336] EFI services will not be available.

    [    0.075719] devtmpfs: initialized

    [    0.108001] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3

    [    0.108770] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

    [    0.108825] futex hash table entries: 256 (order: -1, 3072 bytes)

    [    0.116078] pinctrl core: initialized pinctrl subsystem

    [    0.119905] NET: Registered protocol family 16

    [    0.124483] DMA: preallocated 256 KiB pool for atomic coherent allocations

    [    0.158370] omap_hwmod: debugss: _wait_target_disable failed

    [    0.162675] omap_hwmod: d_can0: _wait_target_ready failed: -16

    [    0.162699] omap_hwmod: d_can0: cannot be enabled for reset (3)

    [    0.166063] omap_hwmod: d_can1: _wait_target_ready failed: -16

    [    0.166082] omap_hwmod: d_can1: cannot be enabled for reset (3)

    [    0.257697] cpuidle: using governor ladder

    [    0.287678] cpuidle: using governor menu

    [    0.303934] OMAP GPIO hardware version 0.1

    [    0.310991] omap_gpio 481ac000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_gpio2_pins, deferrie

    [    0.311920] omap_gpio 481ae000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_gpio3_pins, deferrie

    [    0.327358] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferrie

    [    0.335272] No ATAGs?

    [    0.335310] hw-breakpoint: debug architecture 0x4 unsupported.

    [    0.399462] edma 49000000.edma: TI EDMA DMA engine driver

    [    0.406889] vgaarb: loaded

    [    0.408503] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring e

    [    0.408629] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring e

    [    0.408954] media: Linux media interface: v0.10

    [    0.409091] Linux video capture interface: v2.00

    [    0.409211] pps_core: LinuxPPS API ver. 1 registered

    [    0.409231] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

    [    0.409292] PTP clock support registered

    [    0.409739] EDAC MC: Ver: 3.0.0

    [    0.412183] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400

    [    0.412967] Advanced Linux Sound Architecture Driver Initialized.

    [    0.415678] clocksource: Switched to clocksource timer1

    [    0.442811] NET: Registered protocol family 2

    [    0.444528] TCP established hash table entries: 2048 (order: 1, 8192 bytes)

    [    0.444617] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

    [    0.444689] TCP: Hash tables configured (established 2048 bind 2048)

    [    0.444843] UDP hash table entries: 256 (order: 0, 4096 bytes)

    [    0.444892] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

    [    0.445212] NET: Registered protocol family 1

    [    0.446245] RPC: Registered named UNIX socket transport module.

    [    0.446279] RPC: Registered udp transport module.

    [    0.446295] RPC: Registered tcp transport module.

    [    0.446311] RPC: Registered tcp NFSv4.1 backchannel transport module.

    [    0.448200] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available

    [    0.453921] workingset: timestamp_bits=14 max_order=16 bucket_order=2

    [    0.475304] squashfs: version 4.0 (2009/01/31) Phillip Lougher

    [    0.477736] NFS: Registering the id_resolver key type

    [    0.477836] Key type id_resolver registered

    [    0.477856] Key type id_legacy registered

    [    0.477964] ntfs: driver 2.1.32 [Flags: R/O].

    [    0.482275] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)

    [    0.482315] io scheduler noop registered

    [    0.482334] io scheduler deadline registered

    [    0.482750] io scheduler cfq registered (default)

    [    0.486709] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568

    [    0.494128] backlight supply power not found, using dummy regulator

    [    0.494934] pwm-backlight backlight: invalid default brightness level: 53, using 8

    [    0.658414] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled

    [    0.667655] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 94, base_baud = 3000000) is a 8250

    [    0.670022] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 95, base_baud = 3000000) is a 8250

    [    0.672133] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 96, base_baud = 3000000) is a 8250

    [    1.366940] console [ttyS4] enabled

    [    1.374311] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20

    [    1.381401] [drm] Initialized

    [    1.388747] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).

    [    1.395424] [drm] No driver support for vblank timestamp query.

    [    1.483747] Console: switching to colour frame buffer device 160x50

    [    1.529108] tilcdc 4830e000.lcdc: fb0:  frame buffer device

    [    1.593457] brd: module loaded

    [    1.613246] loop: module loaded

    [    1.622768] libphy: Fixed MDIO Bus: probed

    [    1.632938] mousedev: PS/2 mouse device common for all mice

    [    1.639466] GTP driver installing...[    1.643477] i2c /dev entries driver

    [    1.652055] cpuidle: enable-method property 'ti,am3352' found operations

    [    1.661411] omap_hsmmc 48060000.mmc: Got CD GPIO

    [    1.730377] ledtrig-cpu: registered to indicate activity on CPUs

    [    1.749351] NET: Registered protocol family 10

    [    1.756849] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver

    [    1.764942] NET: Registered protocol family 17

    [    1.770216] Key type dns_resolver registered

    [    1.775021] omap_voltage_late_init: Voltage driver support not added

    [    1.806066] omap-gpmc 50000000.gpmc: GPMC revision 6.0

    [    1.811454] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000

    [    1.821918] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xdc

    [    1.828738] nand: Micron MT29F4G08ABADAH4

    [    1.832892] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

    [    1.840753] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme

    [    1.846286] mmc0: host does not support reading read-only switch, assuming write-enable

    [    1.854587] mmc0: new high speed SDHC card at address aaaa

    [    1.861845] mmcblk0: mmc0:aaaa SS08G 7.40 GiB

    [    1.868574]  mmcblk0: p1 p2

    [    1.872197] 10 ofpart partitions found on MTD device omap2-nand.0

    [    1.880336] Creating 10 MTD partitions on "omap2-nand.0":

    [    1.885976] 0x000000000000-0x000000020000 : "NAND.SPL"

    [    1.894680] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"

    [    1.903582] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"

    [    1.912535] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"

    [    1.921402] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"

    [    1.930605] 0x0000000c0000-0x0000004c0000 : "NAND.u-boot"

    [    1.940535] 0x0000004c0000-0x0000004e0000 : "NAND.u-boot-env"

    [    1.949460] 0x0000004e0000-0x000000500000 : "NAND.u-boot-env.backup1"

    [    1.956033] random: fast init done

    [    1.962625] 0x000000500000-0x000000d00000 : "NAND.kernel"

    [    1.974006] 0x000000d00000-0x000020300000 : "NAND.file-system"

    [    1.980103] mtd: partition "NAND.file-system" extends beyond the end of device "omap2-nand.0" -- size truncated to 0x1f300000

  • Hello khageswararao,

    Please, use this code.

    static struct module_pin_mux uart4_pin_mux[] = {
    {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */
    {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)}, /* UART4_TXD */
    {-1},
    };


    Best regards,
    Kemal

  • i configured like below. still nand is showing 0 Mib

    static struct module_pin_mux uart4_pin_mux[] = {
    {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */
    {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)}, /* UART4_TXD */
    {-1},
    };

    log messages:

    U-Boot 2017.01-00360-gc6c77f9-dirty (Mar 23 2018 - 18:28:33 +0530)

    CPU : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM: 256 MiB
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env

    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
  • Which pins are you actually using for UART4? Hopefully, the mii pins. It sounds like you have Linux working so you modified the .dts fie for UART4? Finally,

    u-boot also uses .dts files in the arch/arm/dts directory; did you modify that file, too?

    Steve K.

  • I tried this pinmuxing on AM335x-EVM and the NAND is properly detected by U-Boot. Please, make sure you are distcleaning the U-Boot while building. Check your board for current leakages, and for short-circuits over these lines. Type => nand info command and see if the NAND is not really detected, use => mm 0x44e10870 command in U-Boot, root@am335x-evm:~# devmem2 0x44e10870 in Linux and check the Control Module register's status with and without these multiplexings. Attach an oscilloscope on NAND lines and see which signal is stopped when you change the pinmux.

  • it was fixed.

    i used am335x-evm (arch/arm/dts/am335x-evm.dts)  nand settings in am335x-boneblack (arch/arm/dts/am335x-bone-common.dtsi)

    nand.diff
    diff --git a/arch/arm/dts/am335x-bone-common.dtsi b/arch/arm/dts/am335x-bone-common.dtsi
    index 40a3c35..5f9da95 100644
    --- a/arch/arm/dts/am335x-bone-common.dtsi
    +++ b/arch/arm/dts/am335x-bone-common.dtsi
    @@ -14,7 +14,7 @@
     	};
     
     	chosen {
    -		stdout-path = &uart0;
    +		stdout-path = &uart4;
     		tick-timer = &timer2;
     	};
     
    @@ -92,20 +92,27 @@
     			0x17c (PIN_INPUT_PULLUP | MUX_MODE3)	/* uart1_rtsn.i2c2_scl */
     		>;
     	};
    -
    +#if 0
     	uart0_pins: pinmux_uart0_pins {
     		pinctrl-single,pins = <
     			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
     			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
     		>;
     	};
    +#endif
    +        uart4_pins: pinmux_uart4_pins {
    +               pinctrl-single,pins = <
    +                       0x11C (PIN_INPUT_PULLUP | MUX_MODE3)    /* uart4rxd.uart0_rxd */
    +                       0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* uart4txd.uart0_txd */
    +               >;
    +        };
     
     	clkout2_pin: pinmux_clkout2_pin {
     		pinctrl-single,pins = <
     			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
     		>;
     	};
    -
    +#if 0
     	cpsw_default: cpsw_default {
     		pinctrl-single,pins = <
     			/* Slave 1 */
    @@ -143,7 +150,7 @@
     			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
     		>;
     	};
    -
    +#endif
     	davinci_mdio_default: davinci_mdio_default {
     		pinctrl-single,pins = <
     			/* MDIO */
    @@ -166,6 +173,7 @@
     		>;
     	};
     
    +#if 1
     	emmc_pins: pinmux_emmc_pins {
     		pinctrl-single,pins = <
     			0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
    @@ -180,14 +188,44 @@
     			0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
     		>;
     	};
    +#endif
    +
    +	nandflash_pins_s0: nandflash_pins_s0 {
    +		pinctrl-single,pins = <
    +			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
    +			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
    +			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
    +			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
    +			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
    +			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
    +			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
    +			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
    +			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
    +			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
    +			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
    +			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
    +			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
    +			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
    +			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
    +		>;
    +	};
    +
     };
     
    +#if 0
     &uart0 {
     	pinctrl-names = "default";
     	pinctrl-0 = <&uart0_pins>;
     
     	status = "okay";
     };
    +#endif
    +&uart4 {
    +       pinctrl-names = "default";
    +       pinctrl-0 = <&uart4_pins>;
    +
    +       status = "okay";
    +};
     
     &usb {
     	status = "okay";
    @@ -369,13 +407,14 @@
     	phy-mode = "mii";
     };
     
    +#if 0
     &mac {
     	pinctrl-names = "default", "sleep";
     	pinctrl-0 = <&cpsw_default>;
     	pinctrl-1 = <&cpsw_sleep>;
     	status = "okay";
     };
    -
    +#endif
     &davinci_mdio {
     	pinctrl-names = "default", "sleep";
     	pinctrl-0 = <&davinci_mdio_default>;
    @@ -391,6 +430,88 @@
     	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
     };
     
    +&gpmc {
    +	status = "okay";
    +	pinctrl-names = "default";
    +	pinctrl-0 = <&nandflash_pins_s0>;
    +	ranges = <0 0 0x08000000 0x1000000>;	/* CS0: 16MB for NAND */
    +	nand@0,0 {
    +		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
    +		ti,nand-ecc-opt = "bch8";
    +		ti,elm-id = <&elm>;
    +		nand-bus-width = <8>;
    +		gpmc,device-width = <1>;
    +		gpmc,sync-clk-ps = <0>;
    +		gpmc,cs-on-ns = <0>;
    +		gpmc,cs-rd-off-ns = <44>;
    +		gpmc,cs-wr-off-ns = <44>;
    +		gpmc,adv-on-ns = <6>;
    +		gpmc,adv-rd-off-ns = <34>;
    +		gpmc,adv-wr-off-ns = <44>;
    +		gpmc,we-on-ns = <0>;
    +		gpmc,we-off-ns = <40>;
    +		gpmc,oe-on-ns = <0>;
    +		gpmc,oe-off-ns = <54>;
    +		gpmc,access-ns = <64>;
    +		gpmc,rd-cycle-ns = <82>;
    +		gpmc,wr-cycle-ns = <82>;
    +		gpmc,wait-on-read = "true";
    +		gpmc,wait-on-write = "true";
    +		gpmc,bus-turnaround-ns = <0>;
    +		gpmc,cycle2cycle-delay-ns = <0>;
    +		gpmc,clk-activation-ns = <0>;
    +		gpmc,wait-monitoring-ns = <0>;
    +		gpmc,wr-access-ns = <40>;
    +		gpmc,wr-data-mux-bus-ns = <0>;
    +		/* MTD partition table */
    +		/* All SPL-* partitions are sized to minimal length
    +		 * which can be independently programmable. For
    +		 * NAND flash this is equal to size of erase-block */
    +		#address-cells = <1>;
    +		#size-cells = <1>;
    +		partition@0 {
    +			label = "NAND.SPL";
    +			reg = <0x00000000 0x000020000>;
    +		};
    +		partition@1 {
    +			label = "NAND.SPL.backup1";
    +			reg = <0x00020000 0x00020000>;
    +		};
    +		partition@2 {
    +			label = "NAND.SPL.backup2";
    +			reg = <0x00040000 0x00020000>;
    +		};
    +		partition@3 {
    +			label = "NAND.SPL.backup3";
    +			reg = <0x00060000 0x00020000>;
    +		};
    +		partition@4 {
    +			label = "NAND.u-boot-spl-os";
    +			reg = <0x00080000 0x00040000>;
    +		};
    +		partition@5 {
    +			label = "NAND.u-boot";
    +			reg = <0x000C0000 0x00100000>;
    +		};
    +		partition@6 {
    +			label = "NAND.u-boot-env";
    +			reg = <0x001C0000 0x00020000>;
    +		};
    +		partition@7 {
    +			label = "NAND.u-boot-env.backup1";
    +			reg = <0x001E0000 0x00020000>;
    +		};
    +		partition@8 {
    +			label = "NAND.kernel";
    +			reg = <0x00200000 0x00800000>;
    +		};
    +		partition@9 {
    +			label = "NAND.file-system";
    +			reg = <0x00A00000 0x0F600000>;
    +		};
    +	};
    +};
    +
     &aes {
     	status = "okay";
     };
    diff --git a/arch/arm/dts/am335x-boneblack.dts b/arch/arm/dts/am335x-boneblack.dts
    index 27ebe4a..7c02a26 100644
    --- a/arch/arm/dts/am335x-boneblack.dts
    +++ b/arch/arm/dts/am335x-boneblack.dts
    @@ -14,7 +14,7 @@
     	model = "TI AM335x BeagleBone Black";
     	compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
     	chosen {
    -		stdout-path = &uart0;
    +		stdout-path = &uart4;
     		tick-timer = &timer2;
     	};
     };
    @@ -29,6 +29,7 @@
     	vmmc-supply = <&vmmcsd_fixed>;
     };
     
    +#if 0
     &mmc2 {
     	vmmc-supply = <&vmmcsd_fixed>;
     	pinctrl-names = "default";
    @@ -36,7 +37,7 @@
     	bus-width = <8>;
     	status = "okay";
     };
    -
    +#endif
     &am33xx_pinmux {
     	nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
     
    
    diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
    index e13fcff..0eb1e9a 100644
    --- a/board/ti/am335x/board.h
    +++ b/board/ti/am335x/board.h
    @@ -26,48 +26,48 @@
     
     static inline int board_is_bone(void)
     {
    -	return board_ti_is("A335BONE");
    +	return 0;/*board_ti_is("A335BONE");*/
     }
     
     static inline int board_is_bone_lt(void)
     {
    -	return board_ti_is("A335BNLT");
    +	return 1;/*board_ti_is("A335BNLT");*/
     }
     
     static inline int board_is_bbg1(void)
     {
    -	return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
    +	return 0;/*board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);*/
     }
     
     static inline int board_is_beaglebonex(void)
     {
    -	return board_is_bone() || board_is_bone_lt() || board_is_bbg1();
    +	return 0;/*board_is_bone() || board_is_bone_lt() || board_is_bbg1();*/
     }
     
     static inline int board_is_evm_sk(void)
     {
    -	return board_ti_is("A335X_SK");
    +	return 0;/*board_ti_is("A335X_SK");
     }
     
     static inline int board_is_idk(void)
     {
    -	return !strncmp(board_ti_get_config(), "SKU#02", 6);
    +	return 0;/*!strncmp(board_ti_get_config(), "SKU#02", 6);*/
     }
     
     static inline int board_is_gp_evm(void)
     {
    -	return board_ti_is("A33515BB");
    +	return 0;/*board_ti_is("A33515BB");*/
     }
     
     static inline int board_is_evm_15_or_later(void)
     {
    -	return (board_is_gp_evm() &&
    -		strncmp("1.5", board_ti_get_rev(), 3) <= 0);
    +	return 0;/*(board_is_gp_evm() &&
    +		strncmp("1.5", board_ti_get_rev(), 3) <= 0);*/
     }
     
     static inline int board_is_icev2(void)
     {
    -	return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);
    +	return 0;/*board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);*/
     }
     
     /*
    @@ -84,4 +84,5 @@ void enable_uart4_pin_mux(void);
     void enable_uart5_pin_mux(void);
     void enable_i2c0_pin_mux(void);
     void enable_board_pin_mux(void);
    +void Enable_LCD_Power(void);
     #endif
    diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
    index ad85b3a..470a1dc 100644
    --- a/board/ti/am335x/mux.c
    +++ b/board/ti/am335x/mux.c
    @@ -47,15 +47,20 @@ static struct module_pin_mux uart3_pin_mux[] = {
     };
     
     static struct module_pin_mux uart4_pin_mux[] = {
    -	{OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)},	/* UART4_RXD */
    -	{OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)},		/* UART4_TXD */
    -	{-1},
    +       {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)},    /* UART4_RXD */
    +       {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)},        /* UART4_TXD */
    +       {-1},
     };
     
     static struct module_pin_mux uart5_pin_mux[] = {
    +#if 0
     	{OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)},	/* UART5_RXD */
     	{OFFSET(lcd_data8), (MODE(4) | PULLUDEN)},		/* UART5_TXD */
     	{-1},
    +#endif
    +        {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)},    /* UART4_RXD */
    +        {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)},        /* UART4_TXD */
    +        {-1},
     };
     
     static struct module_pin_mux mmc0_pin_mux[] = {
    @@ -65,7 +70,7 @@ static struct module_pin_mux mmc0_pin_mux[] = {
     	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
     	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
     	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
    -	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
    +//	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
     	{OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)},	/* GPIO0_6 */
     	{-1},
     };
    @@ -77,7 +82,8 @@ static struct module_pin_mux mmc0_no_cd_pin_mux[] = {
     	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
     	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
     	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
    -	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
    +//	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
    +	{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)},   /* MMC0_CD */
     	{-1},
     };
     
    @@ -262,6 +268,13 @@ static struct module_pin_mux uart3_icev2_pin_mux[] = {
     	{-1},
     };
     
    +static struct module_pin_mux LCD_pin_mux[] = {
    +	{OFFSET(mii1_col),(MODE(7))},/*GPIO3_0*/
    +	{OFFSET(mii1_crs),(MODE(7))},/*GPIO3_3*/
    +	{OFFSET(mii1_txen),(MODE(7))},/*GPIO3_3*/
    +	{-1},
    +};
    +
     #if defined(CONFIG_NOR_BOOT)
     void enable_norboot_pin_mux(void)
     {
    @@ -304,6 +317,21 @@ void enable_i2c0_pin_mux(void)
     	configure_module_pin_mux(i2c0_pin_mux);
     }
     
    diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
    index 854141e..1209db9 100644
    --- a/board/ti/common/board_detect.c
    +++ b/board/ti/common/board_detect.c
    @@ -235,6 +235,9 @@ int __maybe_unused ti_i2c_eeprom_dra7_get(int bus_addr, int dev_addr)
     bool __maybe_unused board_ti_is(char *name_tag)
     {
     	struct ti_common_eeprom *ep = TI_EEPROM_DATA;
    +	
    +	if(!strncmp(name_tag,"A335X_SK",8));
    +		return true;
     
     	if (ep->header == TI_DEAD_EEPROM_MAGIC)
     		return false;
    diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
    index db64406..fd802b3 100644
    --- a/configs/am335x_evm_defconfig
    +++ b/configs/am335x_evm_defconfig
    @@ -13,9 +13,9 @@ CONFIG_SPL=y
     CONFIG_SPL_STACK_R=y
     CONFIG_SPL_MTD_SUPPORT=y
     CONFIG_SPL_MUSB_NEW_SUPPORT=y
    -CONFIG_SPL_NET_SUPPORT=y
    +CONFIG_SPL_NET_SUPPORT=n
     CONFIG_SPL_USB_GADGET_SUPPORT=y
    -CONFIG_SPL_USBETH_SUPPORT=y
    +CONFIG_SPL_USBETH_SUPPORT=n
     CONFIG_SPL_OS_BOOT=y
     # CONFIG_CMD_IMLS is not set
     CONFIG_CMD_ASKENV=y
    @@ -62,4 +62,5 @@ CONFIG_OF_LIBFDT=y
     CONFIG_OF_BOARD_SETUP=y
     CONFIG_DM_NAND=y
     CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL"
    -CONFIG_SPL_ETH_SUPPORT=y
    +CONFIG_SPL_ETH_SUPPORT=n
    +CONFIG_CONS_INDEX=5
    diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
    index 4aa0004..03e6940 100644
    --- a/include/asm-generic/gpio.h
    +++ b/include/asm-generic/gpio.h
    @@ -6,6 +6,7 @@
     
     #ifndef _ASM_GENERIC_GPIO_H_
     #define _ASM_GENERIC_GPIO_H_
    +#include "../linux/types.h"
     
     /*
      * Generic GPIO API for U-Boot
    diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
    index bc1f2b2..9086f55 100644
    --- a/include/configs/am335x_evm.h
    +++ b/include/configs/am335x_evm.h
    @@ -30,7 +30,7 @@
     #define CONFIG_BOARD_LATE_INIT
     
     /* Clock Defines */
    -#define V_OSCK				24000000  /* Clock output from T2 */
    +#define V_OSCK				19200000  /* Clock output from T2 */
     #define V_SCLK				(V_OSCK)
     
     /* Custom script for NOR */
    @@ -88,7 +88,7 @@
     	func(NAND, nand, 0) \
     	func(PXE, pxe, na) \
     	func(DHCP, dhcp, na)
    -
    +#if 1
     #define CONFIG_BOOTCOMMAND \
     	"if test ${boot_fit} -eq 1; then "	\
     		"run update_to_fit;"	\
    @@ -98,6 +98,12 @@
     	"run envboot; " \
     	"run distro_bootcmd"
     
    +#endif
    +
    +#if 0
    +#define CONFIG_BOOTCOMMAND \
    +        "run nandboot"
    +#endif
     #include <config_distro_bootcmd.h>
     
     #ifndef CONFIG_SPL_BUILD
    @@ -111,8 +117,8 @@
     	"bootpart=0:2\0" \
     	"bootdir=/boot\0" \
     	"bootfile=zImage\0" \
    -	"fdtfile=undefined\0" \
    -	"console=ttyO0,115200n8\0" \
    +	"fdtfile=am335x-boneblack.dtb\0" \
    +	"console=ttyO4,115200n8\0" \
     	"partitions=" \
     		"uuid_disk=${uuid_gpt_disk};" \
     		"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
    @@ -160,7 +166,7 @@
     		"if test $board_name = A335_ICE; then "\
     			"setenv console ttyO3,115200n8;" \
     		"else " \
    -			"setenv console ttyO0,115200n8;" \
    +			"setenv console ttyO4,115200n8;" \
     		"fi;\0" \
     	NANDARGS \
     	NETARGS \
    @@ -230,7 +236,7 @@
     					"128k(NAND.SPL.backup2)," \
     					"128k(NAND.SPL.backup3)," \
     					"256k(NAND.u-boot-spl-os)," \
    -					"1m(NAND.u-boot)," \
    +					"4m(NAND.u-boot)," \
     					"128k(NAND.u-boot-env)," \
     					"128k(NAND.u-boot-env.backup1)," \
     					"8m(NAND.kernel)," \
    diff --git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h
    index 809d015..545a500 100644
    --- a/include/configs/ti_am335x_common.h
    +++ b/include/configs/ti_am335x_common.h
    @@ -37,7 +37,7 @@
     #define CONFIG_MII			/* Required in net/eth.c */
     #endif
     
    -#define CONFIG_DRIVER_TI_CPSW		/* Driver for IP block */
    +#undef CONFIG_DRIVER_TI_CPSW		/* Driver for IP block */
     /*
      * RTC related defines. To use bootcount you must set bootlimit in the
      * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT