I was able to wire a functional serial console using an FT232 breakout board. Here is what I learned:
My system properly detects and boots off SD when an appropriate one is inserted, but the kernel hangs before any screen output as with PATA. My effort to diagnose PATA boot follows.
Code:
U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)
CPU: Freescale i.MX51 family 3.0V at 800 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock : 66500000Hz
ipg per clock : 665000000Hz
uart clock : 66500000Hz
cspi clock : 54000000Hz
Board: Efika MX Smartbook [POR]
PMIC ID: 0x000045d0 [Rev: 2.0a]
DRAM: 512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x1000 bytes] -> ram 0xafd006e8
SUCCESS
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Boot Source: SPI NOR FLASH BOOT
Hit any key to stop autoboot: 0
EfikaSB# printenv
bootdelay=3
baudrate=115200
loadaddr=0x90007FC0
firmware_version=20101102095813
uboot_addr=0x00000000
uboot_size=0x00040000
env_addr=0x00040000
kerneladdr=0x90007FC0
scriptaddr=0x91000000
ramdiskaddr=0x92000000
console=ttymxc0,115200
model=sb
bootcmd=for device in "mmc ide"; do if strcmp ${device} == mmc; then; mmcinit; setenv units "0 1"; else; setenv units "0"; fi; for interface in ${units}; do if strcmp ${device} == mmc; then mmcprobe ${interface}; else; ide reset; fi; for fs in "ext2 fat"; do setenv loadcmd "${fs}load ${device} 0:1"; if ${loadcmd} ${scriptaddr} boot.scr; then; if imi ${scriptaddr}; then; autoscr ${scriptaddr}; fi; fi; done; done; done;
stdin=serial
stdout=serial
stderr=serial
Environment size: 706/4092 bytes
EfikaSB# showvar
HUSH_VERSION=0.01
EfikaSB# version
U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)
Code:
EfikaSB# ide reset
Reset IDE: Bus 0: OK
Device 0: Model: Flash Module Firm: Ver2.M11 Ser#: 12F20709070350000473
Type: Hard Disk
Capacity: 14719.8 MB = 14.3 GB (30146256 x 512)
EfikaSB# setenv loadcmd "ext2load ide 0:1"
EfikaSB# setenv ramdisk uInitrd-2.6.31.14.20-efikamx
EfikaSB# setenv kernel uImage-2.6.31.14.20-efikamx
EfikaSB# setenv bootargs console=${console} root=/dev/sda2 rootwait rw
EfikaSB# ${loadcmd} ${ramdiskaddr} ${ramdisk}
2740836 bytes read
EfikaSB# imi ${ramdiskaddr}
## Checking Image at 92000000 ...
Legacy image found
Image Name: Ubuntu ramdisk 2.6.31.14.20-efik
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2740772 Bytes = 2.6 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
EfikaSB# ${loadcmd} ${kerneladdr} ${kernel}
1964836 bytes read
EfikaSB# imi ${kerneladdr}
## Checking Image at 90007fc0 ...
Legacy image found
Image Name: Ubuntu kernel 2.6.31.14.20-efika
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1964772 Bytes = 1.9 MB
Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
EfikaSB# bootm ${kerneladdr} ${ramdiskaddr} ${bootargs}
## Booting kernel from Legacy Image at 90007fc0 ...
Image Name: Ubuntu kernel 2.6.31.14.20-efika
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1964772 Bytes = 1.9 MB
Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 92000000 ...
Image Name: Ubuntu ramdisk 2.6.31.14.20-efik
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2740772 Bytes = 2.6 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux............................................................................................................................................... done, booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 2.6.31.14.20-efikamx (root@buildbot) (gcc version 4.5.1 (Ubuntu/Linaro 4.5.1-7ubuntu2) ) #2 PREEMPT Mon Feb 28 21:18:36 CST 2011
[ 0.000000] CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: Genesi Efika MX (Smartbook)
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 105664
[ 0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/sda2 rootwait rw
[ 0.000000] PID hash table entries: 2048 (order: 11, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 416MB = 416MB total
[ 0.000000] Memory: 414804KB available (3564K code, 589K data, 136K init, 0K highmem)
[ 0.000000] SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] NR_IRQS:368
[ 0.000000] MXC IRQ initialized
[ 0.000000] MXC_Early serial console at MMIO 0x73fbc000 (options '115200')
[ 0.000000] console [ttymxc0] enabled
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)
[ 0.000000] Mount-cache hash table entries: 512
[ 0.000000] Initializing cgroup subsys ns
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Initializing cgroup subsys freezer
[ 0.000000] Initializing cgroup subsys net_cls
[ 0.000000] CPU: Testing write buffer coherency: ok
[ 0.000000] devtmpfs: initialized
[ 0.000000] regulator: core version 0.5
[ 0.000000] NET: Registered protocol family 16
[ 0.000000] i.MX IRAM pool: 128 KB@0x9a840000
[ 0.000000] IRAM READY
[ 0.000000] CPU is i.MX51 Revision 3.0
[ 0.000000] MXC GPIO hardware
[ 0.000000] Efika MX: mmc0 configured as MicroSD
[ 0.000000] Efika MX: mmc1 configured as external SDHC
[ 0.000000] Efika MX: Smartbook Revision 2.0
[ 0.000000] Efika MX: Memory type Hynix DDR2
[ 0.000000] Using SDMA I.API
[ 0.000000] MXC DMA API initialized
[ 0.000000] bio: create slab <bio-0> at 0
[ 0.000000] SCSI subsystem initialized
[ 0.000000] CSPI: mxc_spi-0 probed
[ 0.000000] IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
[ 0.000000] NET: Registered protocol family 8
[ 0.000000] NET: Registered protocol family 20
[ 0.000000] mc13892 Rev 2.0 FinVer 2 detected
[ 0.000000] Initializing regulators for Efika MX
[ 0.000000] regulator: SW1: 600 <--> 1375 mV
[ 0.000000] regulator: SW2: 900 <--> 1850 mV
[ 0.000000] regulator: SW3: 1100 <--> 1850 mV
[ 0.000000] regulator: SW4: 1100 <--> 1850 mV
[ 0.000000] regulator: SWBST: 0 mV
[ 0.000000] regulator: VIOHI: 0 mV
[ 0.000000] regulator: VPLL: 1050 <--> 1800 mV
[ 0.000000] regulator: VDIG: 1650 mV
[ 0.000000] regulator: VSD: 1800 <--> 3150 mV
[ 0.000000] regulator: VUSB2: 2400 <--> 2775 mV
[ 0.000000] regulator: VVIDEO: 2775 mV
[ 0.000000] regulator: VAUDIO: 2300 <--> 3000 mV
[ 0.000000] regulator: VCAM: 2500 <--> 3000 mV fast normal
[ 0.000000] regulator: VGEN1: 1200 <--> 3150 mV
[ 0.000000] regulator: VGEN2: 1200 <--> 3150 mV
[ 0.000000] regulator: VGEN3: 1800 <--> 2900 mV
[ 0.000000] regulator: VUSB: 0 mV
[ 0.000000] regulator: GPO1: 0 mV
[ 0.000000] regulator: GPO2: 0 mV
[ 0.000000] regulator: GPO3: 0 mV
[ 0.000000] regulator: GPO4: 0 mV
[ 0.000000] Device spi1.0 probed
[ 0.000000] NET: Registered protocol family 2
[ 5.003985] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 5.011976] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 5.019528] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[ 5.026236] TCP: Hash tables configured (established 16384 bind 16384)
[ 5.032778] TCP reno registered
[ 5.036163] NET: Registered protocol family 1
[ 5.040757] Unpacking initramfs...
[ 5.222814] Freeing initrd memory: 2676K
[ 5.227661] LPMode driver module loaded
[ 5.231509] Static Power Management for Freescale i.MX51
[ 5.237230] PM driver module loaded
[ 5.240999] sdram autogating driver module loaded
[ 5.246144] Bus freq driver module loaded
[ 5.250200] mxc_dvfs_core_probe
[ 5.253695] DVFS driver module loaded
[ 5.257376] i.MXC CPU frequency driver
[ 5.261716] DVFS PER driver module loaded
[ 5.267560] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 5.273432] msgmni has been set to 815
[ 5.278903] alg: No test for stdrng (krng)
[ 5.283347] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 5.290860] io scheduler noop registered (default)
[ 5.295703] io scheduler cfq registered
[ 5.316252] Console: switching to colour frame buffer device 30x20
[ 5.339251] EDID Dump:
[ 5.341621] 00ffffffffffff0006afd220000000000112010380160d780a2b699757559629
[ 5.349070] 214f5400000001010101010101010101010101010101b0130040415819201888
[ 5.356489] 3100df7d000000180000000f0000000000000000000000000020000000fe0041
[ 5.363905] 554f0a202020202020202020000000fe004231303141573032205630200a00c7
[ 5.371320] resolution: r(1024, 600), v(1024, 600) o(0, 0)
[ 5.376831] bpp=0, hw(0, 0), pclk=19841
[ 5.380676] margin(160, 24, 21, 3)
[ 5.384099] hv(136, 1), sync=0, vmode=0
[ 5.387943] mtl017: Probe LCD Panel: AUO B101AW02 V0
[ 5.392941] mxc_ipu mxc_ipu: Channel already disabled 9
[ 5.392952] mxc_ipu mxc_ipu: Channel already uninitialized 9
[ 5.403527] IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)
[ 5.450697] Serial: MXC Internal UART driver
[ 5.455356] mxcintuart.0: ttymxc0 at MMIO 0x73fbc000 (irq = 31) is a Freescale i.MX
[ 5.463055] console handover: boot [ttymxc0] -> real [ttymxc0]
[ 5.474960] loop: module loaded
[ 5.479947] mice: PS/2 mouse device common for all mice
[ 5.485454] mc13892 rtc probe start
[ 5.489555] pmic_rtc pmic_rtc.1: rtc core: registered pmic_rtc as rtc0
[ 5.496232] mc13892 rtc probe succeed
[ 5.500093] i2c /dev entries driver
[ 5.504521] Linux video capture interface: v2.00
[ 5.509747] mxc_v4l2_output mxc_v4l2_output.0: Registered device video0
[ 5.516712] MXC WatchDog Driver 2.0
[ 5.520332] clk: Unable to get requested clock: wdog_clk
[ 5.526095] MXC Watchdog # 0 Timer: initial timeout 60 sec
[ 5.531921] cpuidle: using governor ladder
[ 5.536079] cpuidle: using governor menu
[ 5.540555] PMIC Character device: successfully loaded
[ 5.546528] VPU initialized
[ 5.550246] Registered led device: led:capslock
[ 5.555403] Registered led device: led:alarm
[ 5.560911] Advanced Linux Sound Architecture Driver Version 1.0.20.
[ 5.572679] ALSA device list:
[ 5.575803] No soundcards found.
[ 5.580434] TCP cubic registered
[ 5.583705] NET: Registered protocol family 17
[ 5.588233] ThumbEE CPU extension supported.
[ 5.596151] input: Efika MX Input as /devices/virtual/input/input0
[ 5.603001] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
[ 5.612254] regulator_init_complete: incomplete constraints, leaving GPO4 on
[ 5.619470] regulator_init_complete: incomplete constraints, leaving GPO3 on
[ 5.626559] regulator_init_complete: incomplete constraints, leaving GPO2 on
[ 5.633632] regulator_init_complete: incomplete constraints, leaving GPO1 on
[ 5.640691] regulator_init_complete: incomplete constraints, leaving VGEN1 on
[ 5.647848] regulator_init_complete: incomplete constraints, leaving VCAM on
[ 5.654918] regulator_init_complete: incomplete constraints, leaving VAUDIO on
[ 5.662150] regulator_init_complete: incomplete constraints, leaving VSD on
[ 5.669132] regulator_init_complete: incomplete constraints, leaving VDIG on
[ 5.676205] regulator_init_complete: incomplete constraints, leaving SWBST on
[ 5.683973] pmic_rtc pmic_rtc.1: setting system clock to 2012-03-17 06:33:20 UTC (1331966000)
[ 6.003577] Freeing init memory: 136K
Loading, please wait...
[ 6.112886] udev[495]: starting version 163
Begin: Loading essential drivers ... [ 6.707540] pata_fsl pata_fsl: rchan=29 wchan=28
[ 6.712367] scsi0 : pata_fsl
[ 6.717332] ata1: PATA max UDMA/44 irq 70
[ 6.894623] ata1.00: CFA: Flash Module, Ver2.M11, max UDMA/100
[ 6.900471] ata1.00: 30146256 sectors, multi 1: LBA
[ 6.947754] ata1.00: configured for UDMA/44
[ 6.952355] scsi 0:0:0:0: Direct-Access ATA Flash Module Ver2 PQ: 0 ANSI: 5
[ 6.969394] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 6.975468] sd 0:0:0:0: [sda] 30146256 512-byte logical blocks: (15.4 GB/14.3 GiB)
[ 6.983277] sd 0:0:0:0: [sda] Write Protect is off
[ 6.988317] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 7.003412] sda: sda1 sda2 sda3
[ 7.019991] sd 0:0:0:0: [sda] Attached SCSI disk
[ 7.164006] mxsdhci: MXC Secure Digital Host Controller Interface driver
[ 7.171394] mxsdhci: MXC SDHCI Controller Driver.
[ 7.178954] mmc0: SDHCI detect irq 187 irq 1 INTERNAL DMA
[ 7.185057] mxsdhci: MXC SDHCI Controller Driver.
[ 7.192478] mmc1: SDHCI detect irq 136 irq 2 INTERNAL DMA
done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[ 7.523214] EXT4-fs (sda2): barriers enabled
[ 7.700928] mmc1: new high speed SDHC card at address b368
[ 7.714445] mmcblk0: mmc1:b368 NCard 14.9 GiB
[ 7.719167] mmcblk0: p1 p2
[ 8.487306] kjournald2 starting: pid 592, dev sda2:8, commit interval 5 seconds
[ 8.494808] EXT4-fs (sda2): warning: maximal mount count reached, running e2fsck is recommended
[ 8.507308] EXT4-fs (sda2): internal journal on sda2:8
[ 8.512477] EXT4-fs (sda2): delayed allocation enabled
[ 8.517703] EXT4-fs: file extents enabled
[ 8.524016] EXT4-fs: mballoc enabled
[ 8.527681] EXT4-fs (sda2): recovery complete
[ 8.533390] EXT4-fs (sda2): mounted filesystem with ordered data mode
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... done.
[ 13.032705] sgtl5000_hw_read: read reg error : Reg 0x1e
At this point the kernel is hung, but the following is displayed on the SB screen:
Code:
fsck from util-linux-ng 2.17.2
/dev/sda1: recovering journal
/dev/sda1: clean, 23/31360 files, 24397/124968 blocks (check after next mount)
My next step was to interrupt boot with init=/bin/bash in bootargs. The system booted and I got a live bash prompt on ttymxc0! Few modules are loaded at this stage of boot since udev is not running, and so I modprobed ehci-hcd to get USB for network and perhaps additional serial ports:
Code:
root@(none):/# modprobe ehci-hcd
[ 429.237151] usbcore: registered new interface driver usbfs
[ 429.242778] usbcore: registered new interface driver hub
[ 429.248262] usbcore: registered new device driver usb
[ 429.265825] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 429.382275] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
[ 429.388936] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
[ 429.422298] fsl-ehci fsl-ehci.0: irq 18, io base 0x73f80000
[ 429.442270] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
[ 429.448400] usb usb1: configuration #1 chosen from 1 choice
[ 429.454192] hub 1-0:1.0: USB hub found
[ 429.458012] hub 1-0:1.0: 1 port detected
At this point the system was frozen again. I tried repeating this experiment with external USB devices unplugged and it seems quite deterministic. I blacklisted the ehci-hcd module and now PATA boots successfully without any intervention on the serial console, but of course I can't use any USB devices.
If you have any suggestions for further debugging/troubleshooting this I'm all ears, but I suspect it to be either a hardware problem on my particular system or a particularly nasty manifestation of some underlying kernel driver problem (
SDMA?). To that end, if my system with its deterministic crash can be of any use to your debugging efforts, I would be more than happy to provide information and testing as I am able.
Thanks again for your time and attention =).