Go to previous topic
Go to next topic
Last Post 01 Apr 2009 10:07 AM by  johnlongawa
Board bringup problem
 7 Replies
Author Messages
ronjobmann
New Member
New Member
Posts:


--
22 Mar 2009 12:43 PM
    Hi

    OK, I've successfully compiled the 2.6.22 kernel with the 'patch' and can boot that up just fine. However, when the kernel's init goes to do the handoff to the userland init, things break. I get no serial output after /bin/init gets called. (Or /bin/sh, or anything else). I have the /dev device ttymxc0 created and have doublechecked the driver code to make sure I had the correct major/minor for the device.

    I've tried using nfs as root filesystem. According to messages I see, things seem to mount correctly and my server doesn't have any error messages. I'm not sure how to use a ramdisk with logicloader (I couldn't find any examples of syntax or memory locations to use for loading, etc).

    My next attempt was going to be to try to put my filesystem in NAND as jffs2 filesystem but I suspect I'll get the same results with no serial output.

    I'm using Snapgear's distribution, hence their user apps like Busybox, etc. I'm building those with the same compiler as the kernel (little endian) so I don't think its an issue with the apps themselves.

    I'm at a loss as to what to try next. Any suggestions? Maybe someone has a working ramdisk I can try?

    Thanks for any help or direction you can give me.

    Ron
    johnlongawa
    New Member
    New Member
    Posts:


    --
    23 Mar 2009 09:28 AM
    It took me a while to get it working, too. The default baud rate for the driver might not match that of the early console. On the command line make sure you have explicitly specified the baud rate (i.e., "console=ttymxc0,115200") and verify the console device (major 5, minor 1) and ttymxc0 (major 207, minor 16 - on my system).
    ronjobmann
    New Member
    New Member
    Posts:


    --
    23 Mar 2009 09:40 AM
    Thanks for the reply. I looked again and I have the same major/minor that you do and in my kernel command line I'm specifying console=ttymxc0,115200. I also have the console device at 5,1.

    My terminal scrolls when I hit Enter, like the serial port is accepting entries.
    ronjobmann
    New Member
    New Member
    Posts:


    --
    23 Mar 2009 09:08 PM
    Here's more data.

    kernel command line: noinitrd console=ttymxc0,115200n8 root=/dev/nfs rw nfsroot=192.168.100.149:/opt/imx2/romfs ip=192.168.100.116:192.168.100.149:192.168.100.1

    % ls -l romfs/dev
    crw-rw-rw- 1 root root 5, 1 2009-03-15 16:37 console
    crw-rw-rw- 1 root root 5, 2 2009-03-16 22:32 ptmx
    drwxr-xr-x 2 root root 4096 2009-03-14 13:59 pts
    brw-rw-rw- 1 root root 1, 0 2009-03-15 21:03 ram0
    brw-rw-rw- 1 root root 1, 1 2009-03-15 21:03 ram1
    crw-rw-rw- 1 root root 4, 0 2009-03-22 15:34 tty0
    crw-rw-rw- 1 root root 4, 1 2009-03-22 15:34 tty1
    crw-rw-rw- 1 root root 207, 16 2009-03-17 21:10 ttymxc0
    crw-rw-rw- 1 root root 3, 0 2009-03-22 15:35 ttyp0
    crw-rw-rw- 1 root root 3, 1 2009-03-22 15:35 ttyp1

    My nfs server is setup correctly. I'm able to mount from a different device (just mounting, not using nfsroot).

    My libs are all in the right place.

    Here is the bootup:
    ATAG_CORE1, 4096, 255, 4, 1413545986, Uncompressing Linux......................
    Linux version 2.6.22.6 (cherice@Asentria) (gcc version 4.2.1) #24 PREEMPT Mon 9
    CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
    Machine: Freescale i.MX27ADS
    Memory policy: ECC disabled, Data cache writeback
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    Built 1 zonelists. Total pages: 32512
    Kernel command line: noinitrd console=ttymxc0,115200n8 root=/dev/nfs rw nfsroo1
    MXC IRQ initialized
    PID hash table entries: 512 (order: 9, 2048 bytes)
    MXC GPT timer initialized, rate = 13300000
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 128MB = 128MB total
    Memory: 126836KB available (2720K code, 244K data, 112K init)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    NET: Registered protocol family 16
    AIPI VA base: 0xd4000000
    CPU is i.MX27 Revision 2.0
    Clock input source is 26000000
    MXC GPIO hardware
    Generic PHY: Registered new driver
    SCSI subsystem initialized
    CSPI: mxc_spi-0 probed
    CSPI: mxc_spi-1 probed
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    MXC I2C driver
    NET: Registered protocol family 2
    Time: mxc_gpt clocksource has been installed.
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    usb: Host 1 host (serial) registered
    usb: OTG host (isp1301) registered
    usb: OTG gadget (isp1301) registered
    JFFS2 version 2.2. (NAND) ?© 2001-2006 Red Hat, Inc.
    yaffs Mar 21 2009 14:19:59 Installing.
    io scheduler noop registered
    io scheduler anticipatory registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    MXC WatchDog Driver 2.0
    MXC Watchdog # 0 Timer: initial timeout 60 sec
    Serial: MXC Internal UART driver
    mxcintuart.0: ttymxc0 at MMIO 0x1000a000 (irq = 20) is a Freescale MXC
    RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
    loop: module loaded
    SMSC LAN83C185: Registered new driver
    FEC ENET Version 0.2
    fec: PHY @ 0x0, ID 0x7fffffff -- unknown PHY!
    eth0: ethernet 00:08:ee:01:f7:d6
    MXC MTD nor Driver 2.0
    mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
    Intel/Sharp Extended Query Table at 0x0035
    cfi_cmdset_0001: Erase suspend on write enabled
    Searching for RedBoot partition table in mxc_nor_flash.0 at offset 0x1f0000
    No RedBoot partition table detected in mxc_nor_flash.0
    Creating 2 MTD partitions on "mxc_nor_flash.0":
    0x00000000-0x00040000 : "LoLo Bootloader"
    0x00040000-0x00050000 : "Bootloader config"
    MXC MTD nand Driver 2.0
    NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-)
    Scanning device for bad blocks
    Searching for RedBoot partition table in NAND 64MiB 3,3V 8-bit at offset 0x3ff0
    No RedBoot partition table detected in NAND 64MiB 3,3V 8-bit
    Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
    0x00000000-0x02000000 : "NAND RootFS"
    0x00000000-0x04000000 : "<NULL>"
    0x00000000-0x04000000 : "<NULL>"
    0x00000000-0x04000000 : "<NULL>"
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mxc_rtc mxc_rtc.0: rtc core: registered mxc_rtc as rtc0
    No external RTC clock
    Real TIme clock Driver v1.0
    mxc_rtc: probe of mxc_rtc.0 failed with error -2
    i2c /dev entries driver
    SSI module loaded successfully
    TCP cubic registered
    NET: Registered protocol family 1
    NET: Registered protocol family 17
    ieee80211: 802.11 data/management/control stack, git-1.1.13
    ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
    platform mxc_rtc.0: setting the system clock to 1970-01-01 00:02:27 (147)
    IP-Config: Guessing netmask 255.255.255.0
    IP-Config: Complete:
    device=eth0, addr=192.168.100.116, mask=255.255.255.0, gw=192.168.100.1,
    host=192.168.100.116, domain=, nis-domain=(none),
    bootserver=192.168.100.149, rootserver=192.168.100.149, rootpath=
    Looking up port of RPC 100003/2 on 192.168.100.149
    Looking up port of RPC 100005/1 on 192.168.100.149
    VFS: Mounted root (nfs filesystem).
    Start of Init_post
    Freeing init memory: 112K
    Ready to open initial console
    Ready to kick off userland init
    Running <NULL>
    Can't run command line prog
    Trying /sbin/init
    Trying /etc/init
    Trying /bin/init


    This is basically the same exact setup I use for another processor for a different project. All I've done is substitute in the 2.6.22 kernel and patch and build everything little-endian instead of big-endian.
    johnlongawa
    New Member
    New Member
    Posts:


    --
    24 Mar 2009 09:17 AM
    When I configure to enable the freescale UART driver, I see one message for each UART:


    Serial: MXC Internal UART driver
    mxcintuart.0: ttymxc0 at MMIO 0x1000a000 (irq = 20) is a Freescale MXC
    mxcintuart.1: ttymxc1 at MMIO 0x1000b000 (irq = 19) is a Freescale MXC
    mxcintuart.2: ttymxc2 at MMIO 0x1000c000 (irq = 18) is a Freescale MXC
    mxcintuart.4: ttymxc4 at MMIO 0x1001b000 (irq = 49) is a Freescale MXC
    mxcintuart.5: ttymxc5 at MMIO 0x1001c000 (irq = 48) is a Freescale MXC


    These are the serial configuration options I have turned on. I don't have any other console options on.


    CONFIG_SERIAL_MXC=y
    CONFIG_SERIAL_MXC_CONSOLE=y
    CONFIG_SERIAL_CORE=y
    CONFIG_SERIAL_CORE_CONSOLE=y


    Also, this is probably OK, but I don't specify the parity and word size for the console command line options. I'm assuming the init code really parses that string correctly.

    This is probably not significant, but in the board-specific -gpio.c source file I conditionally turned off the IRDA code in gpio_uart_active. And in the board-specific .h file I have all of the PBC and EXPIO definitions conditionally turned off.

    When I had your problem, it turned out to be because Busybox was not built right. First, I had missing libs, then it was configured wrong and finally, I discovered my tool chain was built improperly. Replacing Busybox by a "hello world" program helped me discover each of the problems I encountered.

    I hope you get it figured out.
    ronjobmann
    New Member
    New Member
    Posts:


    --
    24 Mar 2009 10:29 AM
    I took the other UARTs out of the equation on purpose, because somewhere I read that they can have IRQ conflicts. That's why there is only one in the boot up.

    I'll look into the other files you mentioned, though I would think since I ran 'the patch' that things would just have worked.

    This really sucks because I'm supposed to be using this platform as an evaluation tool for a client and I can't even get the serial ports working!

    Thanks again for your help. I'll post any change in status.
    ronjobmann
    New Member
    New Member
    Posts:


    --
    31 Mar 2009 08:53 PM
    Could someone please post or email me a working imx27lite zImage AND ramdisk or gzipped RFS (for nfs) so I can better troubleshoot what it is I'm doing wrong.

    My most recent development is instead of using the build system I use for other processor boards, I decided to go Ltib. Followed all the directions and still get the same result of no console after Freeing Init mem. Two completely different methods getting me to the same place.

    If you can help, you can email me at ronjobmann@yahoo.com.

    Thanks
    johnlongawa
    New Member
    New Member
    Posts:


    --
    01 Apr 2009 10:07 AM
    Ok, I sent you a root file system, a kernel image and some notes on how I load it.

    Good luck!


    ---