Go to previous topic
Go to next topic
Last Post 15 Feb 2008 08:37 AM by  olco
Linux 2.6.19.2
 73 Replies
Author Messages
zonque
New Member
New Member
Posts:


--
31 May 2007 06:00 PM
    Hi everyone,

    just wanted to let you know that I got a Linux installation ready which supports many (almost all) features of the LITEKIT. Here is the list of peripherals I've successfully tested simultaniously:

    * USB HS host
    * USB OTG host
    * IDE in UDMA mode
    * PCMCIA
    * Ethernet SMSC9117
    * MMC

    In the first place, I followed the instructions from http://www.logicpd.com/su...iewtopic.php?t=1074, but there was still some code missing here and there. I patched around for a couple of days and would like to share what I got. Since it would be too complicated to give out a patch against a heavily patched kernel tree, I created a new patch which should cleanly apply to a fresh linux-2.6.19.2 and put it online:

    http://caiaq.org/download...9.2-mx3lite.patch.gz (~1.1MB)

    Ugly enough, it's one big patch, I didn't take the time to split it up to multiple smaller, nicer ones.

    Does anyone at LogicPD feel responsible to merge such things upstream to the Linux git repository? I'm not sure wheter anyone who is not the copyright holder can actually put a "Signed-off-by:" line under the code.

    Greets,
    Daniel
    macneib@gmail.com
    New Member
    New Member
    Posts:


    --
    31 May 2007 06:35 PM
    Hi Daniel,
    Great Work! I'm just setting up now to test it out.
    zonque
    New Member
    New Member
    Posts:


    --
    31 May 2007 06:49 PM
    Posted By zonque on 12 Nov 2007 4:56 PM
    http://caiaq.org/download...9.2-mx3lite.patch.gz (~1.1MB)




    I forgot to post the link to the corresponding .config file. Here you go:

    http://caiaq.de/download/...9.2-imx31lite.config

    Daniel
    thehexa@gmail.com
    New Member
    New Member
    Posts:


    --
    31 May 2007 07:21 PM
    I will test this right away!

    Thanks for the effort, I will get back to this thread with my results.

    cheers!
    randyc
    New Member
    New Member
    Posts:


    --
    31 May 2007 08:56 PM
    Yee-haw, I can't wait to try it out!

    Randy
    randyc
    New Member
    New Member
    Posts:


    --
    01 Jun 2007 09:58 AM
    Well, I tried it with the LTIB image (which is pre-patched) from freescale and I tried it with the unpatched 2.6.19.2.bgz image w/o patches.

    The latter one patched just fine, although when I did the make I had to remove some # characters from vmlinux.lds

    Once I built the image, I was not sure what I should be doing next!
    I tried the old loader, I also tried booting the vmlinux image, etc.

    I guess I'll wait to see how hexa does and get the "linux for dummies" steps from him or any other kind soul who posts some help on here.

    Randy
    zonque
    New Member
    New Member
    Posts:


    --
    01 Jun 2007 11:49 AM
    Posted By randyc on 1 Jun 2007 9:58 AM
    Well, I tried it with the LTIB image (which is pre-patched) from freescale and I tried it with the unpatched 2.6.19.2.bgz image w/o patches.

    The latter one patched just fine, although when I did the make I had to remove some # characters from vmlinux.lds




    Ooops, then I forgot to fix that. Just remove the lines the compiler complains about.

    Posted By randyc on 1 Jun 2007 9:58 AM

    Once I built the image, I was not sure what I should be doing next!
    I tried the old loader, I also tried booting the vmlinux image, etc.




    Type "make zImage". Next, please follow the instructions from http://www.logicpd.com/su...iewtopic.php?t=1074. The basic steps are to setup TFTP and NFS environment and to build the second stage bootloader. The other posting described that very well and detailed.

    Daniel
    randyc
    New Member
    New Member
    Posts:


    --
    01 Jun 2007 01:00 PM
    Yeah, I'm familiar with the ftfp and nfs setup, seeing as I was the one that posted the instrucitons.

    What I was unclear about was where is rootfs? I see vmlinux in the top dir, and I see zImage way down buried in a boot dir, but I was looking for the part that I should nfs mount.

    When I boot the zImage that gets created with this build, it blitzes along and spits out status #'s I guess this is for debugging. When I get to 51.91 it complains about the clock speed and that's the end, it stops booting.

    this is right after 52.9, where it complains about something to do with usb. the last successful thing that happens is that the two nand partitions are created successfully.

    So I was left wondering if it was looking for rootfs, or what? It just hangs right there.

    Randy
    zonque
    New Member
    New Member
    Posts:


    --
    01 Jun 2007 01:17 PM
    Posted By randyc on 1 Jun 2007 1:0 PM

    What I was unclear about was where is rootfs? I see vmlinux in the top dir, and I see zImage way down buried in a boot dir, but I was looking for the part that I should nfs mount.




    Might be that you got a different hardware revision which has some differences regarding the electronic design around the USB PHY chips (see another thread in this forum for that). If that's the reason, you maybe have to disable the ARC USB support entirely in the kernel config.

    The NFS root issue works just as described in your posting, I didn't change anything there. Just put the right value to the second stage loader's CMDLINE variable or just leave it the was if you didn't change anything in your environment.

    The whole difference between the linux source tree you get when using my patch compared to the one you got with the ADS system is that I did some modifications in the GPIO settings, made some modules work for the LITE kit as well and fixed some bugs causing Ooopses.

    Greets,
    Daniel
    randyc
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 08:55 AM
    OK, now I get it.

    I used the rootfs from the other workspace, the one I sent in the long instructions for. I only build what you are suggesting so I can get a good, stable kernel (zImage) but everything else is pretty much as I described it. this is now working for me (finally!)

    Now if I only knew how to run a command that is NOT listed in the busybox set! I have a .c file that I compiled and want to run but don't know how to. I can more it, grep it, file it, etc but not execute it. I know this is a rookie thing, can anyone take pity on me and tell me how to do it?

    Randy
    KoryHerzinger
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 10:51 AM
    Posted By randyc on 4 Jun 2007 8:55 AM
    this is now working for me (finally!)




    Congratulations! I got a stable system this weekend as well. BTW, thanks to all who put in some effort to get this thing working, esp. Randy and Daniel.

    Posted By randyc on 4 Jun 2007 8:55 AM
    I know this is a rookie thing, can anyone take pity on me and tell me how to do it?




    Are execute permissions set on the file? If not, set them using chmod. Also, if the executable is not in a directory in your path, run it like this:

    mx31# ./foo


    - Kory
    thehexa@gmail.com
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 11:38 AM
    Posted By randyc on 4 Jun 2007 8:55 AM
    OK, now I get it.

    I used the rootfs from the other workspace, the one I sent in the long instructions for. I only build what you are suggesting so I can get a good, stable kernel (zImage) but everything else is pretty much as I described it. this is now working for me (finally!)

    Now if I only knew how to run a command that is NOT listed in the busybox set! I have a .c file that I compiled and want to run but don''t know how to. I can more it, grep it, file it, etc but not execute it. I know this is a rookie thing, can anyone take pity on me and tell me how to do it?

    Randy




    as Kory noted, you probably should make the file executable: chmod +x <compiled binary>

    For the new kernel, i downloaded the vanilla kernel from kernel.org, patched it with daniel's mega patch, then i removed completely the ltibdir/rpm/BUILD/linux-2.6.19.2 and moved the new patched source to the same location, that way i can still use ltib to compile it

    on another note, is anyone able to compile the MPEG4 encorder module?

    regards
    randyc
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 12:51 PM
    ha ha. Yeah, I think I know *how* to run it, but it doesn't work.
    I have several binary files that I can't run. here's an example:

    mx31# ls
    endian endian.c
    mx31# ls endian
    endian
    mx31# ls -al endian
    -rwxrwxrwx 1 root wheel 12938 Jun 4 14:16 endian
    mx31# endian
    -sh: endian: command not found
    mx31# ./endian
    -sh: ./endian: No such file or directory
    mx31#

    this is a compiled arm binary, which runs fine on other arm systems I have here. Just not this one. I can see it, I can more it, etc but it won't run. I just figured it was some trick that I didn't know about.

    Randy
    zonque
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 01:24 PM
    Posted By randyc on 4 Jun 2007 0:51 PM
    ha ha. Yeah, I think I know *how* to run it, but it doesn''t work.
    I have several binary files that I can''t run. here''s an example:

    mx31# ls
    endian endian.c
    mx31# ls endian
    endian
    mx31# ls -al endian
    -rwxrwxrwx 1 root wheel 12938 Jun 4 14:16 endian
    mx31# endian
    -sh: endian: command not found
    mx31# ./endian
    -sh: ./endian: No such file or directory
    mx31#

    this is a compiled arm binary, which runs fine on other arm systems I have here. Just not this one. I can see it, I can more it, etc but it won''t run. I just figured it was some trick that I didn''t know about.




    You have to compile it with the same compiler you used for you toolchain. To be more precise, your binary will only run if you used a compiler which outputs an EABI binary.

    Daniel
    KoryHerzinger
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 02:50 PM
    Quote:
    ha ha. Yeah, I think I know *how* to run it, but it doesn't work.
    I have several binary files that I can't run.


    Sorry, didn't know how "rookie" you meant

    Dan's right, build with the same toolchain if you're not already, but I'm not sure if that's the issue here. If you had built with the wrong toolchain and that was the issue, I would expect to see a different error (ld may crap out, or some nasty message from the loader about the ELF headers). 'No such file or directory' implies the shell can't even locate the resource to load. The fact that 'ls' can see it threw me off, but 'ls' interfaces to the file system on its own... its not a function of the shell but a standalone executable. Have you tried dropping your executable in /usr/bin?

    Anyway, it sounds like an issue with the shell, or maybe your NFS setup. I haven't tried building an executable to test yet, but I'll give it a shot tonight and see if I can replicate your problem.
    randyc
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 08:32 PM
    No, the advice was right on. Apparently there is an old EABI and a newer one. My other box, an arm9 box, has a more mature linux but uses the old EABI.

    When you run an executable compiled on this arm9 box on arm11, it says "file not found". Vise-versa is the same. yeah, I would have expected some kind of elf message, that's why I was so puzzled. I used the "file" command and it said it was an ARM executable either way. So it sees it as an executable but when you run it, it can't so lies and says file not found. Duh error message.

    anywho, when I recompiled it with the arm11 cross compiler on x86 it ran like a champ and said "Little endian" which is what I wanted to see. Now if I can just get that crazy logic 12" video touchscreen thing to work with Linux I'll be all set!

    Randy
    KoryHerzinger
    New Member
    New Member
    Posts:


    --
    04 Jun 2007 10:27 PM
    Randy: Yeah, found that out too when I built my first app and it ran fine. I had seen some issues earlier with not being able to touch files in certain directories, even though the rootfs was mounted as RW. It turned out to be a problem with my NFS config on my host.

    Anyway, gotta love it when error messages lie.
    zonque
    New Member
    New Member
    Posts:


    --
    05 Jun 2007 06:47 PM
    Regarding the patchset found at the ADS kit and slightly modified by me, I'd like to know whether LogicPD currently takes care about the merge upstream to the Linux kernel. The longer it takes to do that, the harder it will be since the kernel APIs are constantly changing. Is there a contact from LogicPD to the Freescale developers who did the patchset against 2.6.19.2?

    Thanks for shedding some light on that

    Daniel
    jesus.ruizdeinfante@hale.at
    New Member
    New Member
    Posts:


    --
    06 Jun 2007 01:27 AM
    Hi!

    Thanks to zonque, randyc, hhyilmaz and everyone involved on getting Linux up and running on the LITEKIT.

    It runs just fine here but I keep seeing a warning on the console
    every time I run top. It says
    "Unkown Hz value (88) Assume 100".
    If I run top again, the reported value keeps growing with the time till it eventually reaches 100 and then the warning disappears. Does anyone know what does that mean?
    JimmBurk
    New Member
    New Member
    Posts:


    --
    07 Jun 2007 04:27 PM
    Just wondering if anybody out there are has already patched the kernel to use KDB? Interested?

    The common patch cleanly installed after Daniel's new patch so the only work left is the ARM specific patches.

    If it is already done THANKS in advance if not I will post the patches as soon as I verify it really works as advertised.

    Jimm
    JimmBurk
    New Member
    New Member
    Posts:


    --
    13 Jun 2007 10:37 AM
    I believe that using kgdb would be more beneficial than just kdb. Has anyone ported Kgdb updates to this Kernel?

    The current release is for the 2.6.17 kernel in cvs for the kgdb project.

    http://kgdb.linsyssoft.com/ is where I go for CVS access.

    Also, since Daniels great work to port from 2.6.16 to 2.6.19 do you have any tricks to simplify the process? Or.....

    Jimm
    JimmBurk
    New Member
    New Member
    Posts:


    --
    13 Jun 2007 10:46 AM
    My CVS access in really here at sourceforge.net

    :pserver;username=anonymous:kgdb.cvs.sourceforge.net:/cvsroot/kgdb

    Jimm
    OradFarez
    New Member
    New Member
    Posts:


    --
    17 Jun 2007 06:06 PM
    Hello all. I am getting ready to try and install linux on my module next week. I have no problem building the kernel in SUSE Linux on my PC, but I have to reboot into this OS each time I want to work with this kit.

    Can the source be built under Windows using cygwin or similar? Is anyone doing it that way? Any tips or instructions you would like to share?

    Thank you.
    vali
    New Member
    New Member
    Posts:


    --
    25 Jun 2007 02:40 PM
    Hi,

    Does somebody still have this iso file:
    imx31_ads_20070128-rel3-ltib.iso

    on freescale there is now imx31_ads_20070511-rel4-ltib.iso and I get a lot of rejects if I try to apply the patch on it.

    thanks,
    Vali
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    09 Jul 2007 03:14 AM
    Hi all,

    We could install .iso image and build ltib successfully. Now we want to apply a patch so that we can use it for Litekit.The iso image we've used is imx31_ads_20070511-rel4-ltib.iso.
    We are applying the patch linux-2.6.19.2 given at http://caiaq.org/download...9.2-mx3lite.patch.gz .

    We followed the instructions from http://www.logicpd.com/su...iewtopic.php?t=1074.
    We used command: patch -p1 < /tmp/linux-2.6.19.2-mx3lite.patch. But we are getting message like :
    can't find file to patch at input line 144391
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff -Nur linux-2.6.19.2/drivers/usb/Kconfig linux-2.6.19.2-mx31/drivers/usb/Kconfig
    |--- linux-2.6.19.2/drivers/usb/Kconfig 2007-01-10 20:10:37.000000000 +0100
    |+++ linux-2.6.19.2-mx31/drivers/usb/Kconfig 2007-05-26 13:16:23.000000000 +0200
    --------------------------
    File to patch:
    Skip this patch? [y]
    Skipping patch.
    1 out of 1 hunk ignored

    we are getting messages like this continuously. But some patches are getting applied. We are new to this and we dont know how to get which all files were rejected from .rej file.

    Please tell us whether we are applying the patch properly and whether this particular patch can be applied to this release4 iso(imx31_ads_20070511-rel4-ltib.iso) image??

    Thanks
    Arjun
    zonque
    New Member
    New Member
    Posts:


    --
    10 Jul 2007 07:24 AM
    Posted By Arjun.KV on 9 Jul 2007 3:14 AM
    Hi all,

    We could install .iso image and build ltib successfully. Now we want to apply a patch so that we can use it for Litekit.The iso image we''ve used is imx31_ads_20070511-rel4-ltib.iso.
    We are applying the patch linux-2.6.19.2 given at http://caiaq.org/download...9.2-mx3lite.patch.gz .

    We followed the instructions from http://www.logicpd.com/su...iewtopic.php?t=1074.
    We used command: patch -p1 < /tmp/linux-2.6.19.2-mx3lite.patch. But we are getting message like :
    can''t find file to patch at input line 144391
    Perhaps you used the wrong -p or --strip option?




    As stated, you need to apply this patch against a clean linux-2.6.19.2 tree (unpatched, download from kernel.org).
    The patch will apply cleanly, however, there will be an error at the end of the complile run regarding vmlinux.lds - just remove the lines the build system complains about.

    Regards,
    Daniel
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    18 Jul 2007 05:41 AM
    Hi all,

    We followed the steps given in the link http://www.logicpd.com/su...iewtopic.php?t=1074,
    We came till loading the second stage bootloader on the board.
    After excuting, the board hangs:

    losh> load elf /tftp/192.168.0.121:/tftpboot/loader
    loading from /tftp/192.168.0.121:/tftpboot/loader:
    ......
    ELF section 0: download address: 0x80208000 load address: 0x800d0000
    loaded 1256 @ 0x800d0000 Ram
    ...done
    file loaded
    losh> ls
    R : load 1256
    D : tftp 0
    D : etc 0
    D : dev 0
    losh> load raw 0x81000000 1362216 /tftp/192.168.0.121:/tftpboot/zImage
    loading from /tftp/192.168.0.121:/tftpboot/zImage:
    loading raw binary to 0x81000000 (ram) len 0014c928:
    ...............................................................................efile loaded
    losh> ls
    R : load 1362216
    D : tftp 0
    D : etc 0
    D : dev 0
    losh> exec 0x800d03a8 -

    Is this be because we patched on the rel-4 linux BSP rather than on the fresh inux-2.6.19.2 tree. One more thing is that the zImage generated is 1.3 MB while the one in the steps i saround 1.6MB. Also can somebody tell us what is the exact configuration to be done while executing ltib.

    Regards
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    19 Jul 2007 06:18 AM
    Hi all,

    Pls ignore the above message. I started afresh.

    I applied the patch given at http://caiaq.org/download...9.2-mx3lite.patch.gz against a clean linux-2.6.19.2 tree (unpatched, download from kernel.org).
    We followed the steps given in the link http://www.logicpd.com/su...iewtopic.php?t=1074,

    We loaded the bootloader and the zImage
    We are getting the following kernel panic.(lengthy one..pls see the end)

    losh> load elf /tftp/192.168.0.121:/tftpboot/loader
    loading from /tftp/192.168.0.121:/tftpboot/loader:
    ......
    ELF section 0: download address: 0x80208000 load address: 0x800d0000
    loaded 1240 @ 0x800d0000 Ram
    ...done
    file loaded
    losh> load raw 0x81000000 1514816 /tftp/192.168.0.121:/tftpboot/zImage
    loading from /tftp/192.168.0.121:/tftpboot/zImage:
    loading raw binary to 0x81000000 (ram) len 00171d40:
    ............................................................................................................................efile loaded
    losh> exec 0x800d03a8 -
    Uncompressing Linux.................................................................................................. done, .[ 53.960000] Linux version 2.6.19.2 (imx31@192.168.0.7) (gcc version 4.1.1) #4 PREEMPT Thu Jul 19 12:58:37 IST 2007
    [ 52.960000] CPU: Some Random V6 Processor [4107b364] revision 4 (ARMv6TEJ), cr=00c5387f
    [ 52.960000] Machine: Freescale i.MX31 litekit
    [ 52.960000] Memory policy: ECC disabled, Data cache writeback
    [ 52.960000] CPU0: D VIPT write-back cache
    [ 52.960000] CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    [ 52.960000] CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    [ 52.960000] Built 1 zonelists. Total pages: 28448
    [ 53.960000] Kernel command line: console=ttymxc0 root=/dev/nfs nfsroot=192.168.0.121:/tftpboot/rootfs rw ip=192.168.0.12:n[ 54.960000] MXC IRQ initialized
    [ 52.960000] PID hash table entries: 512 (order: 9, 2048 bytes)
    [ 54.960000] Clock input source is 27000000
    [ 54.960000]
    [ 52.960000] WARNING: Can't generate CLOCK_TICK_RATE at 16625000 Hz
    [ 54.960000] Actual CLOCK_TICK_RATE is 17264423 Hz
    [ 52.960000] Console: colour dummy device 80x30
    [ 52.960000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 52.960000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 54.970000] Memory: 112MB = 112MB total
    [ 53.970000] Memory: 110464KB available (2512K code, 552K data, 104K init)
    [ 52.180000] Mount-cache hash table entries: 512
    [ 54.180000] CPU: Testing write buffer coherency: ok
    [ 54.180000] NET: Registered protocol family 16
    [ 54.180000] MXC GPIO hardware
    [ 54.180000] system_rev is: 0x11
    [ 52.180000] Irq init for eth0
    [ 52.180000] L2 cache: WB
    [ 52.180000] kobject_add failed for MX31ADS/MX31LITE PC (-13)
    [ 54.180000] Using SDMA I.API
    [ 54.180000] MXC DMA API initialized
    [ 54.180000] usb: isp1504 registered
    [ 54.180000] usb: Host 2 registered
    [ 54.180000] usb: OTG HS Host registered
    [ 54.180000] usb: OTG HS Gadget registered
    [ 53.190000] SCSI subsystem initialized
    [ 54.190000] MXC I2C driver
    [ 54.200000] NET: Registered protocol family 2
    [ 52.290000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 52.290000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [ 52.290000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 54.290000] TCP: Hash tables configured (established 4096 bind 2048)
    [ 54.290000] TCP reno registered
    [ 54.290000] Low-Level PM Driver module loaded
    [ 52.290000] Freescale i.MX31 Dynamic Power Management.
    [ 54.290000] JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
    [ 54.290000] io scheduler noop registered
    [ 54.290000] io scheduler anticipatory registered
    [ 54.290000] io scheduler deadline registered
    [ 54.290000] io scheduler cfq registered (default)
    [ 54.530000] No external RTC clock
    [ 52.530000] Real TIme clock Driver v1.0
    [ 52.530000] mxc_rtc: probe of mxc_rtc.0 failed with error -2
    [ 54.530000] MXC WatchDog Driver 2.0
    [ 54.540000] MXC Watchdog # 0 Timer: initial timeout 60 sec
    [ 54.540000] Serial: MXC Internal UART driver
    [ 54.540000] mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale MXC
    [ 54.830000] mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale MXC
    [ 54.840000] mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale MXC
    [ 54.850000] mxcintuart.4: ttymxc4 at MMIO 0x43fb4000 (irq = 47) is a Freescale MXC
    [ 52.860000] RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
    [ 54.870000] loop: loaded (max 8 devices)
    [ 54.880000] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    [ 54.880000] ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
    [ 54.890000] MXC: IDE driver, (c) 2004-2006 Freescale Semiconductor
    [ 54.900000] mxc_ide_resetproc: resetting ATA controller
    [ 54.510000] ide0: Bus empty, interface released.
    [ 54.510000] MXC MTD nor Driver 2.0
    [ 54.510000] mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
    [ 53.520000] Support for command set 0003 not present
    [ 52.530000] gen_probe: No supported Vendor Command Set found
    [ 52.540000] mxc_nor_flash: probe of mxc_nor_flash.0 failed with error -5
    [ 54.540000] MXC MTD nand Driver 2.0
    [ 54.550000] NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bit)
    [ 54.560000] Scanning device for bad blocks
    [ 52.560000] Bad eraseblock 0 at 0x00000000
    [ 53.910000] Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
    [ 53.920000] 0x00000000-0x00200000 : "nand.kernel"
    [ 53.920000] 0x00200000-0x04000000 : "nand.rootfs"
    [ 53.930000] 0x00000000-0x04000000 : "<NULL>"
    [ 53.940000] 0x00000000-0x04000000 : "<NULL>"
    [ 54.940000] mice: PS/2 mouse device common for all mice
    [ 54.950000] i2c /dev entries driver
    [ 54.950000] SSI module loaded successfully
    [ 52.960000] RNG Driver: Loading
    [ 54.960000] SEC: mxc_sec_mod_init() called
    [ 54.970000] MXC MMC/SD driver
    [ 54.970000] mxcmci-0 found
    [ 54.100000] oprofile: using arm/arm11
    [ 54.100000] TCP cubic registered
    [ 54.110000] NET: Registered protocol family 1
    [ 54.110000] NET: Registered protocol family 17
    [ 54.120000] ieee80211: 802.11 data/management/control stack, git-1.1.13
    [ 54.120000] ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
    [ 52.130000] Power Management for Freescale MX31
    [ 54.140000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 2
    [ 52.150000] VFS: Cannot open root device "nfs" or unknown-block(0,255)
    [ 52.150000] Please append a correct "root=" boot option
    [ 48.160000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
    [ 52.170000]

    The command line we used is "console=ttymxc0 root=/dev/nfs nfsroot=192.168.0.121:/tftpboot/rootfs rw ip=192.168.0.12::192.168.0.1:255.255.255.0 noalign".

    And the /etc/export file looks like this:

    #
    /tftpboot/rootfs 192.168.0.12(rw,sync)

    NFS server is running and when i checked with this command:
    # /usr/sbin/exportfs
    /home/imx31/ltib-imx31ads-20070511/rootfs
    192.168.0.12

    Could anyone tell us what needs to be done here?
    Also since no rootfs directory was generated, i used the one which i got when i built the ADS rel4 BSP code.

    Thanks
    alvinchaung
    New Member
    New Member
    Posts:


    --
    19 Jul 2007 08:02 PM
    Posted By Arjun.KV on 9 Jul 2007 3:14 AM
    Hi all,

    [ 52.130000] Power Management for Freescale MX31
    [ 54.140000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 2
    [ 52.150000] VFS: Cannot open root device "nfs" or unknown-block(0,255)
    [ 52.150000] Please append a correct "root=" boot option
    [ 48.160000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
    [ 52.170000]

    The command line we used is "console=ttymxc0 root=/dev/nfs nfsroot=192.168.0.121:/tftpboot/rootfs rw ip=192.168.0.12::192.168.0.1:255.255.255.0 noalign".

    And the /etc/export file looks like this:

    #
    /tftpboot/rootfs 192.168.0.12(rw,sync)

    NFS server is running and when i checked with this command:
    # /usr/sbin/exportfs
    /home/imx31/ltib-imx31ads-20070511/rootfs
    192.168.0.12

    Could anyone tell us what needs to be done here?
    Also since no rootfs directory was generated, i used the one which i got when i built the ADS rel4 BSP code.

    Thanks




    It seems that NFS has some problem when kernel execute
    maybe you can check these items :

    1. check again that you have selected the "NFS filesystem support" in kernel config
    2. make sure your NFS server is work normally.
    you can use another linux system to try to mount this directory that you share. In my /etc/exports , it look like some different with yours

    /tftpboot/ltib/rootfs 192.168.1.*(rw,no_root_squash,async)

    you can reference it if you need.


    Alvin
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    20 Jul 2007 08:34 AM
    I was able to mount the root. I commented out the set command line function in bootloader.c and just included the jffs file format(which was linked as a module earlier). But then i get the following kernel panic.


    [ 52.140000] Power Management for Freescale MX31
    [ 54.140000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 2
    [ 52.950000] VFS: Mounted root (jffs filesystem).
    [ 54.960000] Freeing init memory: 96K
    [ 52.960000] Warning: unable to open an initial console.
    [ 48.970000] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
    [ 52.980000]

    The Kernel command line is :
    console=ttymxc0,115200 root=/dev/mtdblock2 rw ip=off

    Also tried giving init = /linuxrc, but got the message as
    Failed to execute linuxrc Attempting defaults ...

    Anybody faced this problem? and why am i getting the warning as unable to open an initial console, while i have initialized all the serial and non standard drivers.

    Could anyone help me out in this?

    Thanks
    lwalkera
    New Member
    New Member
    Posts:


    --
    20 Jul 2007 09:16 AM
    If you don't have a /dev filesystem created, then the kernel/init may not be able to find /dev/console to bind to. Make sure you either create a /dev directory with the proper device files, or use devfs and have it in the fstab of your jffs image.
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    24 Jul 2007 01:54 AM
    Thanks everyone for all the help. Finally am able to run Linux on the litekit.

    Regards
    Arjun
    motraat
    New Member
    New Member
    Posts:


    --
    13 Aug 2007 09:37 AM
    Thanks to all generous souls!!!
    We are able to run Linux on litekit.
    I am currently not able to open /dev/fb0. I tried

    cat test.bmp > /dev/fb0

    its say
    errpor /dev/fb0: No such device

    Anyone able to configure LCD in linux platform ?
    Please reply
    zonque
    New Member
    New Member
    Posts:


    --
    14 Aug 2007 08:06 AM
    Posted By motraat on 13 Aug 2007 9:37 AM
    Thanks to all generous souls!!!
    We are able to run Linux on litekit.
    I am currently not able to open /dev/fb0. I tried

    cat test.bmp > /dev/fb0

    its say
    errpor /dev/fb0: No such device

    Anyone able to configure LCD in linux platform ?
    Please reply




    just do a "mknod fb0 c 29 0" in /dev, enable the mxc framebuffer in the kernel config and configure your display settings.
    I got DirectFB running instantly on my litekit.

    Daniel
    motraat
    New Member
    New Member
    Posts:


    --
    14 Aug 2007 08:37 AM
    Hello Daniel,

    If I am not wrong, this patch is provided by you only. Thanks again for that. I have used .tar from linux tree. Then patched it using your target. I am not using freescale BSP.

    Patch runs fine and also I am able to run my compiled programs on board.
    I can see /dev/fb0 without even using following command
    mknod fb0 c 29 0. But when try any thing with framebuffer, I get following message.

    -sh: /dev/fb0: No such device.

    Am I missing something.

    I have already integrated my dispaly for freescale board on linux. I used V4L to use IPU unit in that case.

    Can you provide any small utility to test in Litekit case.

    regards
    motraat@iss.fraunhofer.de
    zonque
    New Member
    New Member
    Posts:


    --
    15 Aug 2007 01:01 AM
    Posted By motraat on 13 Aug 2007 9:37 AM
    Hello Daniel,

    I can see /dev/fb0 without even using following command
    mknod fb0 c 29 0. But when try any thing with framebuffer, I get following message.

    -sh: /dev/fb0: No such device.




    Then either your /dev/fb0 has wrong major/minor numbers (other than 29,0) or you did not activate the framebuffer driver in your kernel configuration. You should see apropriate messages in the dmesg log in case this code has loaded.

    Writing random data to /dev/fb0 is a good test which should at least output some snow crash on the display. However, don't use /dev/random for that - it does not output anything, but I didn't have the time to track this down.

    Best regards,
    Daniel
    motraat
    New Member
    New Member
    Posts:


    --
    15 Aug 2007 09:47 AM
    Hi,

    Device looks alright. I can see correct major and minor as below:

    -sh-2.05b# ls -ll /dev/fb0
    crw-r--r-- 1 root root 29, 0 Aug 15 2007 /dev/fb0

    But nothing works on frame buffer.

    -sh-2.05b# cat /dev/fb0
    cat: /dev/fb0: No such device
    -sh-2.05b# /usr/sbin/fbset
    fbset: fbset(open): No such device

    I tried to explore but no luck so far.

    Another thing:
    Normally we can see Choice of LCD in menuconifg-->drivers-->Graphics-->

    But I could only see epson as choice Sharp does not look as one of the choice.

    Also under few configurations, I got following error :

    drivers/built-in.o: In function 'prpvf_stop' :
    mxc_mmc.c(.text+0x3ab20): undefined reference to 'mxcfb_set_refresh_mode'

    Is there any one who is using Sharp LCD and can see display?

    regards
    motra
    hm
    New Member
    New Member
    Posts:


    --
    22 Aug 2007 12:12 AM
    For those of you successfully running Linux on the i.MX31 Litekit, what sources are you using to build the user space tools? I've been trying to build busybox, but I am getting problems regarding missing include files and libraries all over the place. Building and installing the kernel worked great though, following the instructions in this thread.

    - HM
    motraat
    New Member
    New Member
    Posts:


    --
    22 Aug 2007 01:55 AM
    Hi HM,

    Busy box and other tools are working in my case. I generated stable kernel as per directions of Daniel http://www.logicpd.com/su...viewtopic.php?t=1135 . Also I generated rootfs directory with freescale BSP and patches provided by randy http://www.logicpd.com/su...viewtopic.php?t=1074

    Randy's patch is not so clean, one has to manual change many things. But he clearly mentioned what exactly needs to be changed.

    - motra
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    23 Aug 2007 03:21 AM
    Hi motra,

    I too am trying to interface our Sharp LCD. But I dont even see the /dev/fbo. This is after enabling the frame buffer driver kernel. Also I dont see any message related to frame buffer in the dmesg logs.

    mx31# cat /proc/devices
    Character devices:
    .....
    29 fb
    .....
    mx31# mknod fb0 c 29 0
    mx31# ls -l fb0
    crw-r--r-- 1 root root 29, 0 Jan 1 00:03 fb0
    mx31# /usr/sbin/fbset
    open /dev/fb0: No such device

    Were you able to solve this problem? If so please post help or atleast the dmesg log.

    Regards,
    Arjun
    motraat
    New Member
    New Member
    Posts:


    --
    23 Aug 2007 03:41 AM
    I am still trying. I am trying to compile the framebuffer driver as module so that I can install it later but I am getting error as :

    undefined registered_fb

    Also i could see that in board-mx31lite.h there are values which are different fron that of daniels patch. I am using rootfs generated from randy's patch and kernel image with Daniel's patch. I wish we had single workspace.
    I am too knew in this area...

    share your views and findings..
    zonque
    New Member
    New Member
    Posts:


    --
    23 Aug 2007 05:31 AM
    Posted By motraat on 23 Aug 2007 3:41 AM
    I am still trying. I am trying to compile the framebuffer driver as module so that I can install it later but I am getting error as :

    undefined registered_fb

    Also i could see that in board-mx31lite.h there are values which are different fron that of daniels patch. I am using rootfs generated from randy''s patch and kernel image with Daniel''s patch. I wish we had single workspace.
    I am too knew in this area...

    share your views and findings..




    Maybe we should discuss that in PM. Feel free to contact me at daniel@caiaq.de

    Greets,
    Daniel
    lilja.magnus@gmail.com
    New Member
    New Member
    Posts:


    --
    26 Aug 2007 05:59 AM
    With the info in this thread we're also running 2.6.19.2 on our i.MX31 Litekit board.

    We've also enabled the PMIC/MC13783 support (this worked after adding init of the SPI in arch/arm/mach-mx3/mx31lite.c).

    Using the commands from mx31_pm_howto on Freescale's LTIB image we're enabling DPM with dpm_init and then try changing the frequencies.

    Changing to any of the supported frequencies (133/266/532) seems to change the timing on both the console UART and the internal Linux timing as well. So trying this out is best done via ssh-login to the board.

    Anyway, executing 'sleep 20' from a shell directly after boot results in a sleep of 20 seconds, however changing the frequency to 266MHz (speed 266) and executing 'sleep 20' results in a sleep of 27 seconds (clock manually using a stopwatch).

    Has anyone else seens this and know how to fix this? We haven't looked into solving this yet. Also, it would be interesting to know if someone has tried this on a i.MX31 ADS board using the unmodified Freescale LTIB/kernel.

    Regards, Magnus
    fszczerba
    New Member
    New Member
    Posts:


    --
    28 Aug 2007 08:15 AM
    Posted By Arjun.KV on 23 Aug 2007 3:21 AM
    Hi motra,

    I too am trying to interface our Sharp LCD. But I dont even see the /dev/fbo. This is after enabling the frame buffer driver kernel. Also I dont see any message related to frame buffer in the dmesg logs.

    mx31# cat /proc/devices
    Character devices:
    .....
    29 fb
    .....
    mx31# mknod fb0 c 29 0
    mx31# ls -l fb0
    crw-r--r-- 1 root root 29, 0 Jan 1 00:03 fb0
    mx31# /usr/sbin/fbset
    open /dev/fb0: No such device

    Were you able to solve this problem? If so please post help or atleast the dmesg log.

    Regards,
    Arjun




    Silly question, but were you in /dev when you did the mknod command? It will create the device special file in the current directory with your invocation. Try:

    mx31# mknod /dev/fb0 c 29 0

    Frank
    motraat
    New Member
    New Member
    Posts:


    --
    28 Aug 2007 08:24 AM
    Hello Frank,

    Thanks for reply. Yes, I agree that one can make such silly mistakes
    But I have some progress with the help of few kind souls. But still I cann't see anything on LCD.

    By default there LCD is not enabled by daniel's patch. So one has do fb_init inside mx31lite.c file. Also one is supposed to set exact values for fb_lcd_mode (SHARP-QVGA in my case).

    Anything further which someone can help is appreciated

    regards
    motra
    fszczerba
    New Member
    New Member
    Posts:


    --
    28 Aug 2007 09:49 AM
    I am using the 10.1" VGA display. I made the following patches:

    Index: linux-2.6.19.2-imx31/arch/arm/mach-mx3/mx31lite.c
    ===================================================================
    --- linux-2.6.19.2-imx31/arch/arm/mach-mx3/mx31lite.c (revision 6788)
    +++ linux-2.6.19.2-imx31/arch/arm/mach-mx3/mx31lite.c (revision 6789)
    @@ -292,8 +292,30 @@
    },
    };

    -// TODO: #if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
    +#if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
    +static const char fb_default_mode[] = "Sharp-VGA";

    +/* mxc lcd driver */
    +static struct platform_device mxc_fb_device = {
    + .name = "mxc_sdc_fb",
    + .id = 0,
    + .dev = {
    + .release = mxc_nop_release,
    + .platform_data = &fb_default_mode,
    + .coherent_dma_mask = 0xFFFFFFFF,
    + },
    +};
    +
    +static void mxc_init_fb(void)
    +{
    + (void)platform_device_register(&mxc_fb_device);
    +}
    +#else
    +static inline void mxc_init_fb(void)
    +{
    +}
    +#endif
    +
    /*!
    * Board specific fixup function. It is called by \b setup_arch() in
    * setup.c file very early on during kernel starts. It allows the user to
    @@ -418,6 +440,7 @@
    spi_register_board_info(mxc_spi_board_info,
    ARRAY_SIZE(mxc_spi_board_info));

    + mxc_init_fb();
    }

    /*
    Index: linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb_modedb.c
    ===================================================================
    --- linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb_modedb.c (revision 6788)
    +++ linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb_modedb.c (revision 6789)
    @@ -55,6 +55,22 @@
    "TV-VGA", 60, 640, 480, 40574, 35, 45, 9, 1, 46, 5,
    0, FB_VMODE_NONINTERLACED, 0,
    },
    + [5] = {
    + /* 640x480 @ 60 Hz */
    + "Sharp-VGA",
    + 60, 640, 480, // 60 Hz, 640x480
    + 35285, // 35.285 ns clock period
    + 128, 128, // left & right margin
    + 34, 10, // upper & lower margin
    + 2, 2, // hsync & vsync len
    + 0
    + //| FB_SYNC_CLK_IDLE_EN
    + | FB_SYNC_OE_ACT_HIGH
    + //| FB_SYNC_HOR_HIGH_ACT
    + ,
    + FB_VMODE_NONINTERLACED,
    + 0,
    + },
    };

    int mxcfb_modedb_sz = ARRAY_SIZE(mxcfb_modedb);


    Along the way I added some additional error messages:

    Index: linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb.c
    ===================================================================
    --- linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb.c (revision 6788)
    +++ linux-2.6.19.2-imx31/drivers/video/mxc/mxcfb.c (revision 6789)
    @@ -993,6 +993,7 @@
    */
    fbi = mxcfb_init_fbinfo(&pdev->dev, &mxcfb_ops);
    if (!fbi) {
    + dev_err(&pdev->dev, "mxcfb_init_fbinfo() FAILED\n");
    ret = -ENOMEM;
    goto err0;
    }
    @@ -1020,6 +1021,7 @@

    if (!fb_find_mode(&fbi->var, fbi, fb_mode, mxcfb_modedb,
    mxcfb_modedb_sz, NULL, default_bpp)) {
    + dev_err(&pdev->dev, "fb_find_mode() FAILED\n");
    ret = -EBUSY;
    goto err2;
    }
    @@ -1033,6 +1035,7 @@

    ret = mxcfb_set_par(fbi);
    if (ret < 0) {
    + dev_err(&pdev->dev, "mxcfb_set_par() FAILED\n");
    goto err2;
    }

    @@ -1041,6 +1044,7 @@
    */
    ret = register_framebuffer(fbi);
    if (ret < 0) {
    + dev_err(&pdev->dev, "register_framebuffer() FAILED\n");
    goto err2;
    }
    #ifdef CONFIG_FB_MXC_OVERLAY
    @@ -1049,6 +1053,7 @@
    */
    fbi_ovl = mxcfb_init_fbinfo(&pdev->dev, &mxcfb_ovl_ops);
    if (!fbi_ovl) {
    + dev_err(&pdev->dev, "mxcfb_init_fbinfo() FAILED for overlay\n");
    ret = -ENOMEM;
    goto err3;
    }
    @@ -1076,6 +1081,7 @@

    ret = mxcfb_set_par(fbi_ovl);
    if (ret < 0) {
    + dev_err(&pdev->dev, "mxcfb_set_par() FAILED for overlay\n");
    goto err5;
    }

    @@ -1084,6 +1090,7 @@
    */
    ret = register_framebuffer(fbi_ovl);
    if (ret < 0) {
    + dev_err(&pdev->dev, "register_framebuffer() FAILED for overlay\n");
    goto err5;
    }
    #else


    I got pretty frustrated trying to figure out all of the right values from the LCD data sheet. I'd recommend you initialize the display with LoLo, then either dump the display registers from there, or apply the following patch to have the kernel dump them during boot, before it makes changes.

    Index: linux-2.6.19.2-imx31/drivers/mxc/ipu/ipu_sdc.c
    ===================================================================
    --- linux-2.6.19.2-imx31/drivers/mxc/ipu/ipu_sdc.c (revision 6788)
    +++ linux-2.6.19.2-imx31/drivers/mxc/ipu/ipu_sdc.c (revision 6789)
    @@ -88,6 +88,30 @@
    uint32_t div;

    dev_dbg(g_ipu_dev, "panel size = %d x %d\n", width, height);
    + dev_dbg(g_ipu_dev, "initial DI_DISP_IF_CONF = 0x%08X\n",
    + __raw_readl(DI_DISP_IF_CONF));
    + dev_dbg(g_ipu_dev, "initial DI_DISP_SIG_POL = 0x%08X\n",
    + __raw_readl(DI_DISP_SIG_POL));
    + dev_dbg(g_ipu_dev, "initial DI_DISP3_TIME_CONF = 0x%08X\n",
    + __raw_readl(DI_DISP3_TIME_CONF));
    + dev_dbg(g_ipu_dev, "initial SDC_HOR_CONF = 0x%08X\n",
    + __raw_readl(SDC_HOR_CONF));
    + dev_dbg(g_ipu_dev, "initial SDC_VER_CONF = 0x%08X\n",
    + __raw_readl(SDC_VER_CONF));
    + dev_dbg(g_ipu_dev, "initial SDC_SHARP_CONF_1 = 0x%08X\n",
    + __raw_readl(SDC_SHARP_CONF_1));
    + dev_dbg(g_ipu_dev, "initial SDC_SHARP_CONF_2 = 0x%08X\n",
    + __raw_readl(SDC_SHARP_CONF_2));
    + dev_dbg(g_ipu_dev, "initial SDC_COM_CONF = 0x%08X\n",
    + __raw_readl(SDC_COM_CONF));
    + dev_dbg(g_ipu_dev, "initial DI_DISP3_B0_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B0_MAP));
    + dev_dbg(g_ipu_dev, "initial DI_DISP3_B1_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B1_MAP));
    + dev_dbg(g_ipu_dev, "initial DI_DISP3_B2_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B2_MAP));
    + dev_dbg(g_ipu_dev, "initial DI_DISP_ACC_CC = 0x%08X\n",
    + __raw_readl(DI_DISP_ACC_CC));

    if ((vSyncWidth == 0) || (h_sync_width == 0))
    return EINVAL;
    @@ -190,6 +214,24 @@
    __raw_readl(DI_DISP_SIG_POL));
    dev_dbg(g_ipu_dev, "DI_DISP3_TIME_CONF = 0x%08X\n",
    __raw_readl(DI_DISP3_TIME_CONF));
    + dev_dbg(g_ipu_dev, "SDC_HOR_CONF = 0x%08X\n",
    + __raw_readl(SDC_HOR_CONF));
    + dev_dbg(g_ipu_dev, "SDC_VER_CONF = 0x%08X\n",
    + __raw_readl(SDC_VER_CONF));
    + dev_dbg(g_ipu_dev, "SDC_SHARP_CONF_1 = 0x%08X\n",
    + __raw_readl(SDC_SHARP_CONF_1));
    + dev_dbg(g_ipu_dev, "SDC_SHARP_CONF_2 = 0x%08X\n",
    + __raw_readl(SDC_SHARP_CONF_2));
    + dev_dbg(g_ipu_dev, "SDC_COM_CONF = 0x%08X\n",
    + __raw_readl(SDC_COM_CONF));
    + dev_dbg(g_ipu_dev, "DI_DISP3_B0_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B0_MAP));
    + dev_dbg(g_ipu_dev, "DI_DISP3_B1_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B1_MAP));
    + dev_dbg(g_ipu_dev, "DI_DISP3_B2_MAP = 0x%08X\n",
    + __raw_readl(DI_DISP3_B2_MAP));
    + dev_dbg(g_ipu_dev, "DI_DISP_ACC_CC = 0x%08X\n",
    + __raw_readl(DI_DISP_ACC_CC));

    return 0;
    }


    Just put a #define DEBUG at the top of ipu_sdc.c, before any #include statements, and rebuild your kernel. This will give before-and-after values for all of the display controller registers. From that and the i.MX31 datasheet (and/or the ipu_sdc driver code) you can work out what the proper values should be. Keep in mind that a lot of these settings need only be approximately correct to work (the display will accept a range of total line lengths, for example).

    Use fbset to experiment with different settings until you get something that works, then add it to the driver.

    Good luck!
    Frank
    DrOctavius
    New Member
    New Member
    Posts:


    --
    28 Aug 2007 11:06 AM
    Graphics:
    1) ./ltib -c
    2) DirectFB package.
    3) Device Drivers-> Graphic Support-> MXC Framebuffer support
    4) Build
    5) In your target run> df_dok (benchmark demo).

    Console:
    1) ./ltib -c
    2) Device Drivers-> Graphic Support-> MXC Framebuffer support
    3) Device Drivers-> Char Devices -> Virtual Terminal
    4) Device Drivers-> Char Devices -> Support for console in Virtual Terminal
    5) Device Drivers-> Graphic Support-> Console Display Drivers Support -> FrameBuffer Console support
    6) COMMAND_LINE of your bootloader: console=tty
    7) Build
    motraat
    New Member
    New Member
    Posts:


    --
    29 Aug 2007 10:45 AM
    Hi Frank,
    LCD BAcklights are working fine. I can see difference by switching them on-off. But hard luck so far. I cud not see values of registers, the was u suggested.
    here is the log:

    ........................................................ done, booting the kerne
    l.
    [ 53.960000] Linux version 2.6.19.2 (root@xpc15G) (gcc version 4.1.1) #10 PREE
    MPT Wed Aug 29 18:18:58 CEST 2007
    [ 52.960000] CPU: Some Random V6 Processor [4107b364] revision 4 (ARMv6TEJ), c
    r=00c5387f
    [ 52.960000] Machine: Freescale i.MX31 litekit
    [ 52.960000] Memory policy: ECC disabled, Data cache writeback
    [ 52.960000] CPU0: D VIPT write-back cache
    [ 52.960000] CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 s
    ets
    [ 52.960000] CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 s
    ets
    [ 52.960000] Built 1 zonelists. Total pages: 28448
    [ 53.960000] Kernel command line: console=ttymxc0 root=/dev/nfs nfsroot=172.27
    .161.98:/tftpboot/rootfs rw init=/linuxrc ip=172.27.161.2::172.27.161.98:255.255
    .255.0 noalign
    [ 54.960000] MXC IRQ initialized
    [ 52.960000] PID hash table entries: 512 (order: 9, 2048 bytes)
    [ 54.960000] Clock input source is 27000000
    [ 54.960000]
    [ 52.960000] WARNING: Can't generate CLOCK_TICK_RATE at 16625000 Hz
    [ 54.960000] Actual CLOCK_TICK_RATE is 17264423 Hz
    [ 52.960000] Console: colour dummy device 80x30
    [ 52.960000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 52.960000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 54.970000] Memory: 112MB = 112MB total
    [ 53.970000] Memory: 109824KB available (3108K code, 551K data, 112K init)
    [ 52.180000] Mount-cache hash table entries: 512
    [ 54.180000] CPU: Testing write buffer coherency: ok
    [ 54.180000] NET: Registered protocol family 16
    [ 54.180000] MXC GPIO hardware
    [ 54.180000] system_rev is: 0x11
    [ 52.180000] Irq init for eth0
    [ 52.180000] L2 cache: WB
    [ 52.180000] kobject_add failed for MX31ADS/MX31LITE PC (-13)
    [ 54.180000] Using SDMA I.API
    [ 54.180000] MXC DMA API initialized
    [ 54.180000] usb: Host 2 registered
    [ 54.180000] usb: OTG HS Host registered
    [ 54.180000] usb: OTG HS Gadget registered
    [ 53.190000] SCSI subsystem initialized
    [ 54.190000] usbcore: registered new interface driver usbfs
    [ 54.190000] usbcore: registered new interface driver hub
    [ 54.190000] usbcore: registered new device driver usb
    [ 54.190000] MXC I2C driver
    [ 54.200000] NET: Registered protocol family 2
    [ 52.290000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 52.290000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [ 52.290000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 54.290000] TCP: Hash tables configured (established 4096 bind 2048)
    [ 54.290000] TCP reno registered
    [ 54.290000] Low-Level PM Driver module loaded
    [ 52.290000] Freescale i.MX31 Dynamic Power Management.
    [ 54.290000] NTFS driver 2.1.27 [Flags: R/W].
    [ 54.290000] JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
    [ 54.290000] io scheduler noop registered
    [ 54.290000] io scheduler anticipatory registered
    [ 54.290000] io scheduler deadline registered
    [ 54.290000] io scheduler cfq registered (default)
    [ 54.290000] FS453/4 driver, (c) 2005 Freescale Semiconductor, Inc.
    [ 51.490000] mxc_ipu mxc_ipu: Warning: channel already initialized
    [ 52.490000] Console: switching to colour frame buffer device 30x40
    [ 54.490000] mxcfb: fb registered, using mode Sharp-QVGA
    [ 54.730000] No external RTC clock
    [ 52.730000] Real TIme clock Driver v1.0
    [ 52.730000] mxc_rtc: probe of mxc_rtc.0 failed with error -2
    [ 54.730000] MXC WatchDog Driver 2.0
    [ 54.730000] MXC Watchdog # 0 Timer: initial timeout 60 sec
    [ 54.730000] Serial: MXC Internal UART driver
    [ 54.730000] mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescal
    e MXC
    [ 54.060000] mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescal
    e MXC
    [ 54.070000] mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescal
    e MXC
    [ 54.080000] mxcintuart.4: ttymxc4 at MMIO 0x43fb4000 (irq = 47) is a Freescal
    e MXC
    [ 52.100000] RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 bloc
    ksize
    [ 54.110000] loop: loaded (max 8 devices)
    [ 54.110000] Linux video capture interface: v2.00
    [ 54.120000] MXC Video Output MXC Video Output.0: Registered device video16
    [ 54.130000] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    [ 54.130000] ide: Assuming 50MHz system bus speed for PIO modes; override with
    idebus=xx
    [ 54.140000] MXC: IDE driver, (c) 2004-2006 Freescale Semiconductor
    [ 54.150000] mxc_ide_resetproc: resetting ATA controller


    /************************************************
    [ 54.680000] ide0: Bus empty, interface released.
    [ 54.680000] MXC MTD nor Driver 2.0
    [ 54.680000] mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
    [ 53.690000] Support for command set 0003 not present



    [ 52.700000] gen_probe: No supported Vendor Command Set found
    [ 52.710000] mxc_nor_flash: probe of mxc_nor_flash.0 failed with error -5
    [ 54.710000] MXC MTD nand Driver 2.0
    [ 54.720000] NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND
    64MiB 3,3V 8-bit)
    [ 54.730000] Scanning device for bad blocks
    [ 52.740000] Bad eraseblock 146 at 0x00248000
    [ 52.750000] Bad eraseblock 148 at 0x00250000
    [ 52.760000] Bad eraseblock 292 at 0x00490000
    [ 52.770000] Bad eraseblock 296 at 0x004a0000
    [ 53.050000] Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
    [ 53.060000] 0x00000000-0x00200000 : "nand.kernel"
    [ 53.060000] 0x00200000-0x04000000 : "nand.rootfs"
    [ 53.070000] 0x00000000-0x04000000 : "<NULL>"
    [ 53.080000] 0x00000000-0x04000000 : "<NULL>"
    [ 55.090000] <6>PCMCIA: Initialize i.Mx31 pcmcia socket
    [ 53.090000] usbmon: debugfs is not available
    [ 55.090000] ehci_hcd: block sizes: qh 128 qtd 96 itd 192 sitd 96
    [ 55.090000] initializing FSL-SOC USB Controller
    [ 52.090000] XXXXXXXXXXXXXXXXXXXX pll = 197640000, usb_pdf = 1, usb_prepdf =
    1, retval = 49410000


    [ 51.100000] USB_CLK=49410000, should be 60MHz
    [ 54.100000] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
    [ 55.110000] drivers/usb/core/inode.c: creating file 'devices'
    [ 55.110000] drivers/usb/core/inode.c: creating file '001'
    [ 54.110000] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number
    1
    [ 55.120000] fsl-ehci fsl-ehci.0: reset hcs_params 0x10011 dbg=0 ind cc=0 pcc=
    0 ordered ports=1
    [ 55.120000] fsl-ehci fsl-ehci.0: reset hcc_params 0006 thresh 0 uframes 256/5
    12/1024 park
    [ 55.120000] fsl-ehci fsl-ehci.0: park 0
    [ 55.120000] fsl-ehci fsl-ehci.0: reset command 080b02 park=3 ithresh=8 period
    =1024 Reset HALT
    [ 55.120000] fsl-ehci fsl-ehci.0: ...powerdown ports...
    [ 54.150000] fsl-ehci fsl-ehci.0: irq 36, io base 0x43f88400
    [ 55.150000] fsl-ehci fsl-ehci.0: reset command 080b02 park=3 ithresh=8 period
    =1024 Reset HALT
    [ 55.150000] fsl-ehci fsl-ehci.0: init command 010009 (park)=0 ithresh=1 perio
    d=256 RUN
    [ 54.150000] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 20
    04
    [ 55.160000] usb usb1: default language 0x0409

    [ 55.160000] usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
    [ 54.160000] usb usb1: Product: Freescale On-Chip EHCI Host Controller
    [ 54.170000] usb usb1: Manufacturer: Linux 2.6.19.2 ehci_hcd
    [ 54.170000] usb usb1: SerialNumber: fsl-ehci.0
    [ 55.180000] usb usb1: uevent
    [ 55.180000] usb usb1: usb_probe_device
    [ 54.180000] usb usb1: configuration #1 chosen from 1 choice
    [ 55.180000] usb usb1: adding 1-0:1.0 (config #1, interface 0)
    [ 55.180000] usb 1-0:1.0: uevent
    [ 55.180000] hub 1-0:1.0: usb_probe_interface
    [ 55.180000] hub 1-0:1.0: usb_probe_interface - got id
    [ 54.180000] hub 1-0:1.0: USB hub found
    [ 54.190000] hub 1-0:1.0: 1 port detected
    [ 55.190000] hub 1-0:1.0: standalone hub
    [ 55.190000] hub 1-0:1.0: individual port power switching
    [ 55.190000] hub 1-0:1.0: individual port over-current protection
    [ 55.190000] hub 1-0:1.0: Single TT
    [ 55.190000] hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns)
    [ 55.190000] hub 1-0:1.0: power on to power good time: 20ms
    [ 55.190000] hub 1-0:1.0: 150mA bus power budget for each child
    [ 55.190000] hub 1-0:1.0: local power source is good
    [ 55.190000] hub 1-0:1.0: enabling power on all ports

    [ 55.300000] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000
    [ 55.300000] drivers/usb/core/inode.c: creating file '001'
    [ 55.300000] initializing FSL-SOC USB Controller
    [ 52.300000] XXXXXXXXXXXXXXXXXXXX pll = 197640000, usb_pdf = 1, usb_prepdf =
    1, retval = 49410000
    [ 51.310000] USB_CLK=49410000, should be 60MHz
    [ 54.320000] fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
    [ 55.330000] drivers/usb/core/inode.c: creating file '002'
    [ 54.330000] fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number
    2
    [ 55.330000] fsl-ehci fsl-ehci.1: reset hcs_params 0x10011 dbg=0 ind cc=0 pcc=
    0 ordered ports=1
    [ 55.330000] fsl-ehci fsl-ehci.1: reset hcc_params 0006 thresh 0 uframes 256/5
    12/1024 park
    [ 55.330000] fsl-ehci fsl-ehci.1: park 0
    [ 55.330000] fsl-ehci fsl-ehci.1: reset command 080b02 park=3 ithresh=8 period
    =1024 Reset HALT
    [ 55.340000] fsl-ehci fsl-ehci.1: ...powerdown ports...
    [ 54.370000] fsl-ehci fsl-ehci.1: irq 37, io base 0x43f88000
    [ 55.370000] fsl-ehci fsl-ehci.1: reset command 080b02 park=3 ithresh=8 period
    =1024 Reset HALT
    [ 55.370000] fsl-ehci fsl-ehci.1: init command 010009 (park)=0 ithresh=1 perio
    d=256 RUN
    [ 54.370000] fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00, driver 10 Dec 20
    04
    [ 55.380000] usb usb2: default language 0x0409
    [ 55.380000] usb usb2: new device strings: Mfr=3, Product=2, SerialNumber=1
    [ 54.380000] usb usb2: Product: Freescale On-Chip EHCI Host Controller
    [ 54.390000] usb usb2: Manufacturer: Linux 2.6.19.2 ehci_hcd
    [ 54.390000] usb usb2: SerialNumber: fsl-ehci.1
    [ 55.400000] usb usb2: uevent
    [ 55.400000] usb usb2: usb_probe_device
    [ 54.400000] usb usb2: configuration #1 chosen from 1 choice
    [ 55.400000] usb usb2: adding 2-0:1.0 (config #1, interface 0)
    [ 55.400000] usb 2-0:1.0: uevent
    [ 55.400000] hub 2-0:1.0: usb_probe_interface
    [ 55.400000] hub 2-0:1.0: usb_probe_interface - got id
    [ 54.400000] hub 2-0:1.0: USB hub found
    [ 54.410000] hub 2-0:1.0: 1 port detected
    [ 55.410000] hub 2-0:1.0: standalone hub
    [ 55.410000] hub 2-0:1.0: individual port power switching
    [ 55.410000] hub 2-0:1.0: individual port over-current protection
    [ 55.410000] hub 2-0:1.0: Single TT
    [ 55.410000] hub 2-0:1.0: TT requires at most 8 FS bit times (666 ns)
    [ 55.410000] hub 2-0:1.0: power on to power good time: 20ms
    [ 55.410000] hub 2-0:1.0: 150mA bus power budget for each child
    [ 55.410000] hub 2-0:1.0: local power source is good
    [ 55.410000] hub 2-0:1.0: enabling power on all ports
    [ 55.520000] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0000
    [ 55.520000] drivers/usb/core/inode.c: creating file '001'
    [ 54.520000] Initializing USB Mass Storage driver...
    [ 54.520000] usbcore: registered new interface driver usb-storage
    [ 54.530000] USB Mass Storage support registered.
    [ 54.530000] i2c /dev entries driver
    [ 54.540000] IPU Post-filter loading
    [ 54.540000] SSI module loaded successfully
    [ 52.550000] RNG Driver: Loading
    [ 54.550000] SEC: mxc_sec_mod_init() called
    [ 54.560000] MXC MMC/SD driver
    [ 54.560000] mxcmci-0 found
    [ 54.680000] oprofile: using arm/arm11
    [ 54.680000] TCP cubic registered
    [ 54.690000] NET: Registered protocol family 1
    [ 54.690000] NET: Registered protocol family 17
    [ 54.700000] ieee80211: 802.11 data/management/control stack, git-1.1.13
    [ 54.700000] ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@li
    nux.intel.com>

    [ 55.710000] ieee80211_crypt: registered algorithm 'NULL'
    [ 52.710000] Power Management for Freescale MX31
    [ 54.720000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b
    rev 2
    [ 54.260000] eth0: SMSC911x/921x identified at 0xc7a00000, IRQ: 90
    [ 54.260000] eth0: SMSC911x MAC Address: 00:08:ee:01:4a:99
    [ 54.290000] eth0: link down
    [ 52.300000] IP-Config: Complete:
    [ 52.300000] device=eth0, addr=172.27.161.2, mask=255.255.255.0, gw=172.
    27.161.98,
    [ 52.310000] host=172.27.161.2, domain=, nis-domain=(none),
    [ 52.310000] bootserver=255.255.255.255, rootserver=172.27.161.98, rootpa
    th=
    [ 53.320000] Looking up port of RPC 100003/2 on 172.27.161.98
    [ 54.890000] eth0: link up, 100Mbps, full-duplex, lpa 0x85E1
    [ 53.340000] Looking up port of RPC 100005/1 on 172.27.161.98
    [ 52.380000] VFS: Mounted root (nfs filesystem).
    [ 54.390000] Freeing init memory: 112K

    cheers
    motraat
    fszczerba
    New Member
    New Member
    Posts:


    --
    29 Aug 2007 11:23 AM
    Try changing the console spec in your bootline from

    "console=ttymxc0"

    to

    "console=fbcon console=ttymxc0"

    You should get a penguin on the display once the config is correct.
    Badguy
    New Member
    New Member
    Posts:


    --
    29 Aug 2007 02:20 PM
    Hey fszczerba,
    thanks for the screen work, worked like a charm.

    except the patch I copied from here failed and I had to manually merge it.

    no big deal, the screen is working good.

    got the OpenGL demo test's running looks like about 15fps.

    Good stuff!

    Thanks to all in the community here who have submitted code to get this all working.

    any fix's I come up with hardware wise you can count on.
    but none are needed yet, everything seems to be in order.

    Great Job and Thanks alot for the help in getting this all configured.
    motraat
    New Member
    New Member
    Posts:


    --
    30 Aug 2007 08:58 AM
    hi Badguy,

    if u have LQ035Q7DB02R can u post "struct mxc_fb_device" values
    Badguy
    New Member
    New Member
    Posts:


    --
    30 Aug 2007 09:45 AM
    No I am sorry, I have:
    LQ10D368, which is the 10.4 in. panel.
    motraat
    New Member
    New Member
    Posts:


    --
    03 Sep 2007 04:17 AM
    Hi,

    For LQ035Q7DB02:
    xres: 240,
    yres: 320,
    pixel_clock 35285,
    hsync_len: 13, /* hsw */
    vsync_len: 2, /* vsw */
    left_margin: 21, /* hbp */
    upper_margin: 5, /* vbp */
    right_margin: 11, /* hfp */
    lower_margin: 5, /* vfp */
    sync: FB_SYNC_VERT_HIGH_ACT,

    These values seem working but still there is distortion in display. Atleast I cud see something on screen. If someone has refined values plz post.

    -motra
    OradFarez
    New Member
    New Member
    Posts:


    --
    17 Sep 2007 04:05 AM
    Hello. I am having the same problem Randy had a while back: kernel stops right after the message about wrong speed for USB clock. I don't see what exactly needs to be done to fix this. Could someone describe what they did to get past this? Thank you.
    motraat
    New Member
    New Member
    Posts:


    --
    17 Sep 2007 04:59 AM
    Hi, I experienced this problem few times. My kernel stopped booting at USB wrong frequency message. I try loading again and it works well.
    OradFarez
    New Member
    New Member
    Posts:


    --
    17 Sep 2007 08:58 AM
    I have tried dozens of times while trying to tweak other settings and it always stops at the exact same point with no other error messages to help me understand what to fix I'm hoping one of the other members who had problems but are now booting successfully will stop by to offer their help.

    Thank you!
    OradFarez
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 02:47 AM
    Disabling USB capability allows the system to boot but how terrible is that!?

    Anyone have a patch that fixes whatever is broken in the USB code? I am wondering if it has something to do with the 19.2MHz clocks on the ADS board and 26MHz clocks on the Lite kit?

    By the way, my hardware is the Rev 6 pilot edition and I assume that it does not have those issues with grounding some pins on the ISP1504. I think I did find those unpopulated resistors on the board many months ago.
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    03 Oct 2007 08:22 AM
    I am not able to mount the SD/MMC card after the system boots.
    If the card is inserted at the time of boot up the card works just fine. But when I insert the card later(after bootup) I dont see a mmcblk created.
    And the interrupt routine itself is not called. Has anybody faced this problem.

    Any pointers would be really great.
    OradFarez
    New Member
    New Member
    Posts:


    --
    03 Oct 2007 11:49 AM
    See this topic for the same problem others are having (including myself):

    http://www.logicpd.com/su...viewtopic.php?t=1182
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    09 Oct 2007 04:10 AM
    I have Sharp LQ035Q7DB03 LCD and the display is up, but I get the images as "negative" on the screen, i.e. the colours are inversed(White is black and vice-versa). Any suggestions about what is wrong here?
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    09 Oct 2007 05:07 PM
    there are bits in the lcd controller registers to set parameters like sync and data polarity. Perhaps the data polarity is inverted?
    richard.laborde@logicpd.com
    Basic Member
    Basic Member
    Posts:247


    --
    10 Oct 2007 09:18 AM
    Arjun,

    What is the part number of your SOM? Do you know if it is a Beta, Pilot or Production kit?

    Thanks
    jonathankaufmann@gmail.com
    New Member
    New Member
    Posts:


    --
    10 Oct 2007 09:03 PM
    Here's the fb_videomode structure for the 12.1 " Sharp LQ121S1DG31 LCD from LogicPD. Works 100% after manually making the changes mentioned earlier in this thread.

    [6] = {
    /* 800x600 @ 60 Hz */
    "Sharp-SVGA",
    60, 800, 600, // 60 Hz, 640x480
    25000, // 25.000 ns clock period
    104, 104, // left & right margin
    28, 95, // upper & lower margin
    8, 4, // hsync & vsync len
    0
    //| FB_SYNC_CLK_IDLE_EN
    | FB_SYNC_OE_ACT_HIGH
    //| FB_SYNC_HOR_HIGH_ACT
    ,
    FB_VMODE_NONINTERLACED,
    0,
    },
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    10 Oct 2007 11:46 PM
    Thanks for the details. I just played around with the flags in the driver and now i am able to get proper display. Was an issue with the data polarity.

    Thanks
    Arjun
    phil.ecad@internode.on.net
    New Member
    New Member
    Posts:


    --
    15 Oct 2007 07:36 PM
    Hi all, I've been following this thread with interest.
    I have finally got the SD card fully working, at least with a new card.

    On the litekit the regulator for SDHC1 is REGU_VMMC2 so in drivers/mmc/mxc_mmc.c I changed the power control section to

    #if defined(CONFIG_MXC_MC13783_POWER)
    switch (ios->power_mode) {
    case MMC_POWER_UP:
    if (host->id == 0) {
    voltage.vmmc1 = vdd_mapping[ios->vdd];
    pmic_power_regulator_set_voltage(REGU_VMMC2, voltage);
    pmic_power_regulator_set_lp_mode(REGU_VMMC2,
    LOW_POWER_DISABLED);
    pmic_power_regulator_on(REGU_VMMC2);
    }
    if (host->id == 1) {
    voltage.vmmc2 = vdd_mapping[ios->vdd];
    pmic_power_regulator_set_voltage(REGU_VMMC2, voltage);
    pmic_power_regulator_set_lp_mode(REGU_VMMC2,
    LOW_POWER_DISABLED);
    pmic_power_regulator_on(REGU_VMMC2);
    }
    pr_debug("mmc power on\n");
    msleep(300);
    break;
    case MMC_POWER_OFF:
    if (host->id == 0) {
    pmic_power_regulator_set_lp_mode(REGU_VMMC2,
    LOW_POWER_EN);
    pmic_power_regulator_off(REGU_VMMC2);
    }

    if (host->id == 1) {
    pmic_power_regulator_set_lp_mode(REGU_VMMC2,
    LOW_POWER_EN);
    pmic_power_regulator_off(REGU_VMMC2);
    }
    pr_debug("mmc power off\n");
    break;
    default:
    break;
    }
    #endif


    The card detect input is DCD_DCE1 and the write protect input is GPIO1_6 so I added the get_ro function to drivers/mmc/mxc_mmc.c

    /*!
    * This function is called by MMC/SD Bus Protocol driver to read
    * the write protect switch of SD card
    *
    * @param mmc Pointer to MMC/SD host structure
    */
    static int mxcmci_get_ro(struct mmc_host *host)
    {
    return sdhc_get_write_protect(host);
    }

    /*!
    * MMC/SD host operations structure.
    * These functions are registered with MMC/SD Bus protocol driver.
    */
    static struct mmc_host_ops mxcmci_ops = {
    .request = mxcmci_request,
    .set_ios = mxcmci_set_ios,
    .get_ro = mxcmci_get_ro
    };


    and modified arch/arm/mach-mx3/mx31lite_gpio.c

    /*
    * Probe for the card. If present the GPIO data would be set.
    */
    int sdhc_get_card_det_status(struct device *dev)
    {
    if (to_platform_device(dev)->id == 0) {
    return mxc_get_gpio_datain(MX31_PIN_DCD_DCE1);
    } else {
    return mxc_get_gpio_datain(MX31_PIN_DCD_DCE1);
    }
    }
    EXPORT_SYMBOL(sdhc_get_card_det_status);

    /*
    * Return the card detect pin.
    */
    int sdhc_init_card_det(int id)
    {
    if (id == 0) {
    //write protect input
    mxc_request_iomux(MX31_PIN_GPIO1_6, OUTPUTCONFIG_GPIO, INPUTCONFIG_GPIO);
    iomux_config_mux(MX31_PIN_GPIO1_6, OUTPUTCONFIG_GPIO, INPUTCONFIG_GPIO);
    mxc_set_gpio_direction(MX31_PIN_GPIO1_6,1);
    //card detect INT input
    iomux_config_mux(MX31_PIN_DCD_DCE1, OUTPUTCONFIG_GPIO, INPUTCONFIG_GPIO);
    mxc_set_gpio_direction(MX31_PIN_DCD_DCE1,1);
    return IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1);
    } else {
    iomux_config_mux(MX31_PIN_GPIO1_2, OUTPUTCONFIG_GPIO,
    INPUTCONFIG_GPIO);
    mxc_set_gpio_direction(MX31_PIN_GPIO1_2,1);
    return IOMUX_TO_IRQ(MX31_PIN_GPIO1_2);
    }
    }
    EXPORT_SYMBOL(sdhc_init_card_det);

    int sdhc_get_write_protect(struct device *dev)
    {
    if (to_platform_device(dev)->id == 0) {
    return mxc_get_gpio_datain(MX31_PIN_GPIO1_6);
    } else {
    return mxc_get_gpio_datain(MX31_PIN_GPIO1_6);
    }
    }
    EXPORT_SYMBOL(sdhc_get_write_protect);


    The MC13783 will only output up to 3.0 volts and I think this is why an old Sandisk 512MB card won't work but a new Kingston 2GB card works fine.
    phil.ecad@internode.on.net
    New Member
    New Member
    Posts:


    --
    15 Oct 2007 09:43 PM
    Hi again.

    This time I'm having problems with USB OTG.
    According to the schematics from Logic, DTR_DCE2 should control the chip select for the OTG transceiver.
    When I boot Linux, the enable pin goes high and I can't get it to go low again.
    I have set the iomux registers as in http://www.logicpd.com/support/tdg/viewtopic.php?t=1302 and other ways of doing it but nothing helps.
    The enable for USB2 works as expected.
    Has anyone had this issue? Anyone know if the enable pin is actually DTR_DCE2 ?

    Thanks.
    OradFarez
    New Member
    New Member
    Posts:


    --
    15 Oct 2007 10:41 PM
    Hello, there is a little bit more to that USB chip select initialization code. I will post it here but I don't know if it helps because if you leave the pins in their power up state, I believe they are inputs and so the external pull downs just keep the transceivers selected.

    I am posting all the USB GPIO initialization code from mx31lite_gpio.c. You can compare it with the code made from Daniel's patch and see that several lines are different. Usually one or two lines is added to each function in regards to the nCS lines of the USB chips. This is code I added from a kernel used by Logic PD. I'm still fighting with the USB so I don't know if it helps, but it can't hurt!


    /*
    * USB Host 1
    * pins conflict with SPI1, ATA, UART3
    */
    int gpio_usbh1_active(void)
    {
    if (mxc_request_iomux(MX31_PIN_CSPI1_MOSI, /* USBH1_RXDM */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_MISO, /* USBH1_RXDP */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_SS0, /* USBH1_TXDM */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_SS1, /* USBH1_TXDP */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_SS2, /* USBH1_RCV */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_SCLK, /* USBH1_OEB (_TXOE) */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1) ||
    mxc_request_iomux(MX31_PIN_CSPI1_SPI_RDY, /* USBH1_FS */
    OUTPUTCONFIG_ALT1, INPUTCONFIG_ALT1)) {
    return -EINVAL;
    }

    mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, /* USBH1_RXDM */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, /* USBH1_RXDP */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, /* USBH1_TXDM */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, /* USBH1_TXDP */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, /* USBH1_RCV */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, /* USBH1_OEB (_TXOE) */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, /* USBH1_FS */
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));

    /* USB_H1_SUSPEND collides with WRLAN INT# line */
    // mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
    return 0;
    }

    EXPORT_SYMBOL(gpio_usbh1_active);

    void gpio_usbh1_inactive(void)
    {
    mxc_free_iomux(MX31_PIN_CSPI1_MOSI, /* USBH1_RXDM */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_MISO, /* USBH1_RXDP */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_SS0, /* USBH1_TXDM */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_SS1, /* USBH1_TXDP */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_SS2, /* USBH1_RCV */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_SCLK, /* USBH1_OEB (_TXOE) */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_CSPI1_SPI_RDY, /* USBH1_FS */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);

    mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, /* USBH1_RXDM */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, /* USBH1_RXDP */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, /* USBH1_TXDM */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, /* USBH1_TXDP */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, /* USBH1_RCV */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, /* USBH1_OEB (_TXOE) */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY /* USBH1_FS */,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    }

    EXPORT_SYMBOL(gpio_usbh1_inactive);

    /*
    * USB Host 2
    * pins conflict with UART5, PCMCIA
    */
    int gpio_usbh2_active(void)
    {
    if (mxc_request_iomux(MX31_PIN_USBH2_CLK,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBH2_DIR,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBH2_NXT,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBH2_STP,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBH2_DATA0,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBH2_DATA1,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_STXD3, /* USBH2_DATA2 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_SRXD3, /* USBH2_DATA3 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_SCK3, /* USBH2_DATA4 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_SFS3, /* USBH2_DATA5 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_STXD6, /* USBH2_DATA6 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_SRXD6, /* USBH2_DATA7 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE) ||
    mxc_request_iomux(MX31_PIN_DTR_DCE1, /* PORT2.8 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE)) {
    return -EINVAL;
    }

    #define H2_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
    mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_USBH2_STP, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, H2_PAD_CFG);
    mxc_iomux_set_pad(MX31_PIN_STXD3, H2_PAD_CFG); /* USBH2_DATA2 */
    mxc_iomux_set_pad(MX31_PIN_SRXD3, H2_PAD_CFG); /* USBH2_DATA3 */
    mxc_iomux_set_pad(MX31_PIN_SCK3, H2_PAD_CFG); /* USBH2_DATA4 */
    mxc_iomux_set_pad(MX31_PIN_SFS3, H2_PAD_CFG); /* USBH2_DATA5 */
    mxc_iomux_set_pad(MX31_PIN_STXD6, H2_PAD_CFG); /* USBH2_DATA6 */
    mxc_iomux_set_pad(MX31_PIN_SRXD6, H2_PAD_CFG); /* USBH2_DATA7 */
    mxc_iomux_set_pad(MX31_PIN_DTR_DCE1, H2_PAD_CFG);
    #undef H2_PAD_CFG

    mxc_iomux_set_gpr(MUX_PGP_UH2, true);
    mxc_set_gpio_direction(MX31_PIN_DTR_DCE1, 0);
    mxc_set_gpio_dataout(MX31_PIN_DTR_DCE1, 0);
    return 0;
    }

    EXPORT_SYMBOL(gpio_usbh2_active);

    void gpio_usbh2_inactive(void)
    {
    iomux_config_gpr(MUX_PGP_UH2, false);
    mxc_set_gpio_dataout(MX31_PIN_DTR_DCE1, 1);

    iomux_config_pad(MX31_PIN_USBH2_CLK,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_USBH2_DIR,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_USBH2_NXT,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_USBH2_STP,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_USBH2_DATA0,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_USBH2_DATA1,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_SRXD6, /* USBH2_DATA2 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_STXD6, /* USBH2_DATA3 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_SFS3, /* USBH2_DATA4 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_SCK3, /* USBH2_DATA5 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_SRXD3, /* USBH2_DATA6 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));
    iomux_config_pad(MX31_PIN_STXD3, /* USBH2_DATA7 */
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_FAST));

    mxc_free_iomux(MX31_PIN_USBH2_CLK,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBH2_DIR,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBH2_NXT,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBH2_STP,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBH2_DATA0,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBH2_DATA1,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);

    mxc_free_iomux(MX31_PIN_PC_VS2, /* USBH2_DATA2 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_PC_BVD1, /* USBH2_DATA3 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_PC_BVD2, /* USBH2_DATA4 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_PC_RST, /* USBH2_DATA5 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_IOIS16, /* USBH2_DATA6 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_PC_RW_B, /* USBH2_DATA7 */
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);

    mxc_free_iomux(MX31_PIN_NFWE_B,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_NFRE_B,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_NFALE,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_NFCLE,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_NFWP_B,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_NFCE_B,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_DTR_DCE1,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    }

    EXPORT_SYMBOL(gpio_usbh2_inactive);

    /*
    * USB OTG HS port
    */
    int gpio_usbotg_hs_active(void)
    {
    if (mxc_request_iomux(MX31_PIN_USBOTG_DATA0,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA1,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA2,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA3,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA4,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA5,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA6,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA7,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_CLK,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DIR,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_NXT,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_STP,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_DTR_DCE2,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE)) {
    return -EINVAL;
    }


    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_STP,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST));
    mxc_iomux_set_pad(MX31_PIN_DTR_DCE2,
    (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | PAD_CTL_ODE_CMOS ));

    mxc_set_gpio_direction(MX31_PIN_DTR_DCE2, 0);
    mxc_set_gpio_dataout(MX31_PIN_DTR_DCE2, 0);

    return 0;
    }

    EXPORT_SYMBOL(gpio_usbotg_hs_active);

    void gpio_usbotg_hs_inactive(void)
    {
    mxc_free_iomux(MX31_PIN_USBOTG_DATA0,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA1,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA2,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA3,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA4,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA5,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA6,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA7,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_CLK,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DIR,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_NXT,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_STP,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_DTR_DCE2,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_USBOTG_STP,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    mxc_iomux_set_pad(MX31_PIN_DTR_DCE2,
    (PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW));
    }

    EXPORT_SYMBOL(gpio_usbotg_hs_inactive);

    /*
    * USB OTG FS port
    */
    int gpio_usbotg_fs_active(void)
    {
    if (mxc_request_iomux(MX31_PIN_USBOTG_DATA0,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA1,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA2,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA3,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA4,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA5,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA6,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DATA7,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_CLK,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_DIR,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_NXT,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USBOTG_STP,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC) ||
    mxc_request_iomux(MX31_PIN_USB_PWR,
    OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC)) {
    return -EINVAL;
    }
    return 0;

    }

    EXPORT_SYMBOL(gpio_usbotg_fs_active);

    void gpio_usbotg_fs_inactive(void)
    {
    mxc_free_iomux(MX31_PIN_USBOTG_DATA0,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA1,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA2,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA3,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA4,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA5,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA6,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DATA7,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_CLK,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_DIR,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_NXT,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USBOTG_STP,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    mxc_free_iomux(MX31_PIN_USB_PWR,
    OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
    }

    EXPORT_SYMBOL(gpio_usbotg_fs_inactive);


    Sorry for being so long! I just didn't want to forget anything.
    phil.ecad@internode.on.net
    New Member
    New Member
    Posts:


    --
    16 Oct 2007 01:31 AM
    Thanks OradFarez,
    It turns out that the problem was caused by me enabling CSPI1 in the kernel config.
    I don't know why it made USB hang yet but WOOHOO I now have USB gadget support working.
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    24 Oct 2007 03:48 PM
    There's some alternate function sharing between CSPI1 and USB so that could be the conflict you had, Phil. Thanks for letting us know it's working for you and feel free to post more details of your usage of usb-gadget if possible.
    prashm_77@yahoo.com
    New Member
    New Member
    Posts:


    --
    29 Nov 2007 06:09 AM
    Hai,

    We have IMX31 LITEKIT board booting with linux 2.6.19.2. Its configured for USB OTG, while booting kernel tells
    "usb: isp1504 registered" & "ARC USBOTG h/w ID=0x5 revision=0x40". But while typing lsusb in host PC it hangs. what may be the problem?

    Thanks
    prashm_77@yahoo.com
    New Member
    New Member
    Posts:


    --
    05 Dec 2007 03:12 AM
    Hai zonque

    We have been using your patch and are trying to get all the resources done
    but we are facing problem with USB OTG and Audio support, can u help us on this errors ?

    Regards

    Posted By zonque on 31 May 2007 6:0 PM
    Hi everyone,

    just wanted to let you know that I got a Linux installation ready which supports many (almost all) features of the LITEKIT. Here is the list of peripherals I''ve successfully tested simultaniously:

    * USB HS host
    * USB OTG host
    * IDE in UDMA mode
    * PCMCIA
    * Ethernet SMSC9117
    * MMC

    In the first place, I followed the instructions from http://www.logicpd.com/su...iewtopic.php?t=1074, but there was still some code missing here and there. I patched around for a couple of days and would like to share what I got. Since it would be too complicated to give out a patch against a heavily patched kernel tree, I created a new patch which should cleanly apply to a fresh linux-2.6.19.2 and put it online:

    http://caiaq.org/download...9.2-mx3lite.patch.gz (~1.1MB)

    Ugly enough, it''s one big patch, I didn''t take the time to split it up to multiple smaller, nicer ones.

    Does anyone at LogicPD feel responsible to merge such things upstream to the Linux git repository? I''m not sure wheter anyone who is not the copyright holder can actually put a "Signed-off-by:" line under the code.

    Greets,
    Daniel


    prashm_77@yahoo.com
    New Member
    New Member
    Posts:


    --
    07 Dec 2007 03:21 AM
    Hai PhilCarrig

    We are testing the USB OTG and have made the changes as per your posts , but we are not able to test the same, please can u inform what config in kernel for check the same
    please help us


    Regards

    Posted By PhilCarrig on 16 Oct 2007 1:31 AM
    Thanks OradFarez,
    It turns out that the problem was caused by me enabling CSPI1 in the kernel config.
    I don''t know why it made USB hang yet but WOOHOO I now have USB gadget support working.


    prashm_77@yahoo.com
    New Member
    New Member
    Posts:


    --
    20 Dec 2007 03:38 AM
    Posted By Daniel on 16 Oct 2007 1:31 AM

    just wanted to let you know that I got a Linux installation ready which supports many (almost all) features of the LITEKIT. Here is the list of peripherals I''ve successfully tested simultaniously:

    * USB HS host
    * USB OTG host
    * IDE in UDMA mode
    * PCMCIA
    * Ethernet SMSC9117
    * MMC




    Hai Daniel,

    I am trying USB OTG in linux-2.6.19.2 kernel, after booting as per the manual i am testing gadget, after "modprobe g_file_storage file=/dev/ram0" command i am connecting usb otg cable to host machine but i am getting the error
    as shown "device descriptor read/64, error -110".

    what may be the problem?

    or pls. let me know how to test the usb otg

    thanks.


    *********************************************************

    Mounting filesystems
    Starting syslogd and klogd
    Running sysctl
    Setting up networking on loopback device:
    Setting up networking on eth0:
    Adding static route for default gateway to 192.168.50.1:
    route: SIOC[ADD|DEL]RT: File exists
    Setting nameserver to 192.168.50.1 in /etc/resolv.conf:
    Setting time from ntp server: north-america.pool.ntp.org
    Starting inetd:
    Starting the dropbear ssh server:
    mx31# lsusb
    Bus 002 Device 001: ID 0000:0000
    Bus 001 Device 001: ID 0000:0000
    mx31# lsmod
    Module Size Used by
    isp1504_arc 13216 0
    mx31# modprobe g_file_storage file=/dev/ram0
    [ 54.530000] ARC USBOTG Device Controller driver version 1 August 2005 init

    [ 54.540000] ARC USBOTG h/w ID=0x5 revision=0x40

    [ 54.570000] g_file_storage gadget: File-backed Storage Gadget, version: 28 November 2005

    [ 54.580000] g_file_storage gadget: Number of LUNs=1

    [ 54.580000] g_file_storage gadget-lun0: ro=0, file: /dev/ram/0

    [ 54.590000] arcotg_udc: gadget arc_udc bound to driver g_file_storage

    mx31# [ 54.990000] usb 1-1: new high speed USB device using fsl-ehci and address 2

    [ 51.110000] usb 1-1: device descriptor read/64, error -110
    olco
    New Member
    New Member
    Posts:


    --
    15 Feb 2008 08:37 AM
    Hi,

    I'm trying to make the litekit working with the freescale linux BSP ( for imx31ads)

    I downloaded the last BSP ( 20071008-rel5b ) and the kernel 2.6.19.2 + the patch/config files provided at the beginning of this post.

    I add to mods the patch to : 1) remove the vmlinux.lds error / 2) change the value of CROSS_COMPILE ?= /opt/freescale/usr..... in Makefile ( located in linux-2.6.19.2 )

    The board is booting, but stops during the boot process.
    Here is the sequence :

    losh> ifconfig sm0 192.168.0.43 255.255.255.0 198.168.255.254
    losh>
    losh>
    losh> load elf 0x800d03a8 35350 /tftp/192.168.0.42:/tftpboot/loader
    loading from /tftp/192.168.0.42:/tftpboot/loader:
    ......
    ELF section 0: download address: 0x80208000 load address: 0x800d0000
    loaded 1220 @ 0x800d0000 Ram
    ...done
    file loaded
    losh>
    losh> load raw 0x81000000 1789300 /tftp/192.168.0.42:/tftpboot/zImage
    loading from /tftp/192.168.0.42:/tftpboot/zImage:
    loading raw binary to 0x81000000 (ram) len 001b4d74:
    .......................................................................................................e
    file loaded
    losh>
    losh> exec 0x800d03a8 -
    Uncompressing Linux.....................................................................................
    [ 53.960000] Linux version 2.6.19.2 (olivier@olivier-desktop) (gcc version 4.1.2) #10 PREEMPT Fri Feb8
    [ 52.960000] CPU: Some Random V6 Processor [4107b364] revision 4 (ARMv6TEJ), cr=00c5387f
    [ 52.960000] Machine: Freescale i.MX31 litekit
    [ 52.960000] Memory policy: ECC disabled, Data cache writeback
    [ 52.960000] CPU0: D VIPT write-back cache
    [ 52.960000] CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    [ 52.960000] CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    [ 52.960000] Built 1 zonelists. Total pages: 28448
    [ 53.960000] Kernel command line: console=ttymxc0 root=/dev/nfs nfsroot=192.168.0.42:/home/nfs/rootfs3
    [ 54.960000] MXC IRQ initialized
    [ 52.960000] PID hash table entries: 512 (order: 9, 2048 bytes)
    [ 54.960000] Clock input source is 26000000
    [ 54.960000] Actual CLOCK_TICK_RATE is 16625000 Hz
    [ 52.960000] Console: colour dummy device 80x30
    [ 52.960000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 52.960000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 54.970000] Memory: 112MB = 112MB total
    [ 53.970000] Memory: 109824KB available (3112K code, 549K data, 112K init)
    [ 52.180000] Mount-cache hash table entries: 512
    [ 54.180000] CPU: Testing write buffer coherency: ok
    [ 54.180000] NET: Registered protocol family 16
    [ 54.180000] MXC GPIO hardware
    [ 54.180000] system_rev is: 0x11
    [ 52.180000] Irq init for eth0
    [ 52.180000] L2 cache: WB
    [ 52.180000] kobject_add failed for MX31ADS/MX31LITE PC (-13)
    [ 54.180000] Using SDMA I.API
    [ 54.180000] MXC DMA API initialized
    [ 54.180000] usb: Host 2 registered
    [ 54.180000] usb: OTG HS Host registered
    [ 54.180000] usb: OTG HS Gadget registered
    [ 53.190000] SCSI subsystem initialized
    [ 54.190000] usbcore: registered new interface driver usbfs
    [ 54.190000] usbcore: registered new interface driver hub
    [ 54.190000] usbcore: registered new device driver usb
    [ 54.190000] MXC I2C driver
    [ 54.200000] NET: Registered protocol family 2
    [ 52.280000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 52.280000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [ 52.280000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 54.280000] TCP: Hash tables configured (established 4096 bind 2048)
    [ 54.280000] TCP reno registered
    [ 54.280000] Low-Level PM Driver module loaded
    [ 52.280000] Freescale i.MX31 Dynamic Power Management.
    [ 54.280000] NTFS driver 2.1.27 [Flags: R/W].
    [ 54.280000] JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
    [ 54.280000] io scheduler noop registered
    [ 54.280000] io scheduler anticipatory registered
    [ 54.280000] io scheduler deadline registered
    [ 54.280000] io scheduler cfq registered (default)
    [ 54.280000] FS453/4 driver, (c) 2005 Freescale Semiconductor, Inc.
    [ 54.510000] No external RTC clock
    [ 52.510000] Real TIme clock Driver v1.0
    [ 52.510000] mxc_rtc: probe of mxc_rtc.0 failed with error -2
    [ 54.510000] MXC WatchDog Driver 2.0
    [ 54.510000] MXC Watchdog # 0 Timer: initial timeout 60 sec
    [ 54.510000] Serial: MXC Internal UART driver
    [ 54.510000] mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale MXC
    [ 54.800000] mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale MXC
    [ 54.810000] mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale MXC
    [ 54.820000] mxcintuart.4: ttymxc4 at MMIO 0x43fb4000 (irq = 47) is a Freescale MXC
    [ 52.830000] RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
    [ 54.840000] loop: loaded (max 8 devices)
    [ 54.850000] Linux video capture interface: v2.00
    [ 54.860000] MXC Video Output MXC Video Output.0: Registered device video16
    [ 54.860000] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    [ 54.870000] ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
    [ 54.880000] MXC: IDE driver, (c) 2004-2006 Freescale Semiconductor
    [ 54.880000] mxc_ide_resetproc: resetting ATA controller
    [ 54.500000] ide0: Bus empty, interface released.
    [ 54.500000] MXC MTD nor Driver 2.0
    [ 54.500000] mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
    [ 53.510000] Support for command set 0003 not present
    [ 52.520000] gen_probe: No supported Vendor Command Set found
    [ 52.520000] mxc_nor_flash: probe of mxc_nor_flash.0 failed with error -5
    [ 54.530000] MXC MTD nand Driver 2.0
    [ 54.540000] NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bit)
    [ 54.540000] Scanning device for bad blocks
    [ 52.550000] Bad eraseblock 0 at 0x00000000
    [ 53.850000] Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
    [ 53.860000] 0x00000000-0x00200000 : "nand.kernel"
    [ 53.860000] 0x00200000-0x04000000 : "nand.rootfs"
    [ 53.870000] 0x00000000-0x04000000 : "<NULL>"
    [ 53.880000] 0x00000000-0x04000000 : "<NULL>"
    [ 53.880000] usbmon: debugfs is not available
    [ 52.890000] XXXXXXXXXXXXXXXXXXXX pll = 190320000, usb_pdf = 1, usb_prepdf = 1, retval = 47580000
    [ 51.900000] USB_CLK=47580000, should be 60MHz
    [ 54.900000] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
    [ 54.910000] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1


    So, what am I doing wrong ?

    I ran only ./ltib -c --> does ltib configure and compile the kernel properly ?

    I read that I shall run "make zImage" , in that case --> You have not yet configured your kernel!
    So shall configure it with ./litb or directly with make menuconfig ?

    last question : I made a mix with the BSP ( 20071008-rel5b ) and the kernel 2.6.19.2
    is it an issue ?


    thanks
    Olivier


    ---