Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 04 Oct 2007 05:33 AM by  arjun.kv@7lf-tech.com
PCMCIA/CF Not Enabled
 20 Replies
Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages
davek
New Member
New Member
Posts:


--
10 Jul 2007 12:27 PM
    Is anyone using the PCMCIA/CF in the LiteKit successfully under linux? It seems that the processor is not driving the PCC_POWER_nEN_3.3V pin, so the power to the CF slot is disabled.

    I've searched through the drivers, and I don't see anywhere that they poke that bit to enable power. I've downloaded the full patch from this site. Are there newer drivers?

    Thanks
    davek
    New Member
    New Member
    Posts:


    --
    12 Jul 2007 09:57 AM
    So I've done quite a bit more research and have some more info if this helps anyone with ideas.

    It seems that the mx31ads_pcmcia driver's .probe function is never called by the platform. The driver is created, but there are no devices to pair it with. Since there are no devices, it doesn't run probe. How are these devices supposed to be created? Where does that responsibility lie?

    Thanks for any help you can provide....
    zonque
    New Member
    New Member
    Posts:


    --
    23 Jul 2007 07:22 AM
    Posted By davek on 12 Jul 2007 9:57 AM
    It seems that the mx31ads_pcmcia driver''s .probe function is never called by the platform. The driver is created, but there are no devices to pair it with. Since there are no devices, it doesn''t run probe. How are these devices supposed to be created? Where does that responsibility lie?




    In case you're using my patchset, I guess I'm the one to blame in this case.
    The answer is simple: There are two strings:

    drivers/pcmcia/mx31ads-pcmcia.h: 22
    arch/arm/mach-mx3/devices.c: 587

    those two have to be identical, otherwise the platform device is not probed.
    I accidentally changed one of them, I guess.

    Daniel
    davek
    New Member
    New Member
    Posts:


    --
    24 Jul 2007 11:04 AM
    Hi zonque, thanks very much for your help. That solved that problem. I had temporarily added a platform_device_register( ) of my own, but this solution is more correct.

    So it now detects the insertion of a CompactFlash memory card, but dump_cis says "no CIS present" for socket 0. Any suggestions?

    Thanks so much!
    davek
    New Member
    New Member
    Posts:


    --
    24 Jul 2007 11:45 AM
    If I startup the board with Lolo, and mount the flash card in the bootloader using:
    mount fatfs /cf
    and then proceed with the boot process, the card is properly detected and the proper windows are printed out with dump_cis.

    The ide_cs driver properly loads, but the hotplug/udev scripts seem to be broken. More importantly I continually get the following message on the console:
    [ 52.730000] hda: lost interrupt

    And ide access to the device just seems to hang the kernel. Any suggestions?
    davek
    New Member
    New Member
    Posts:


    --
    24 Jul 2007 02:15 PM
    A little bit more searching in the PCMCIA driver found the following line in mx31ads_pcmcia.c:

    /*
    * This really needs a better solution. The IRQ
    * may or may not be claimed by the driver.
    */

    Might this be a hint as to the solution?
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 08:12 AM
    I did the change in as above and am able to see the message:
    [ 53.330000] pccard: PCMCIA card inserted into slot 0

    But after this I dont see a hda message or hda device being created in /dev. I dont get a message that PCMCIA driver is initialised.
    Also if i do a dump_cis i get a command not found. Do I need to run any script or the driver itself is not initialized correctly?
    davek
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 08:23 AM
    Hi Arjun.KV,

    Make sure you have the PCMCIA user tool installed, they are in the packages pcmcia-cs and pcmciautils. Those are selectable in the ltib package manager.

    In order for a flash card to work, you'll need to make sure you're building support for ide_cs into the kernel. Make sure you have PCMCIA IDE selected as built-in or module support. This will compile the legacy stuff.

    That being said, I haven't been able to get it working. There seems to be a problem with interrupt support in this old driver. It detects the card, etc, but the I just get a bunch of hda: interrupt lost messages.

    Dave
    jdr
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 02:17 PM
    Hi,

    I got the PCMCIA driver loaded and doing something, but somehow the I/O operations seem to fail. I always get zero Manufacturer and Device IDs when doing pccardctl info.

    imx31:/mnt# pccardctl info
    PRODID_1=""
    PRODID_2=""
    PRODID_3=""
    PRODID_4=""
    MANFID=0000,0000
    FUNCID=255

    I tried different Compact Flash cards inserted into the CF/PCMCIA slot, without success.

    dmesg shows that the CF card is detected:
    pccard: PCMCIA card inserted into slot 0

    But somehow the ide-cs driver does not register any device. I think it is because of the MANFID and FUNCID having odd values.

    Does anyone have an idea whats wrong ?

    Thanks,
    jdr
    davek
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 02:47 PM
    Hi jdr....

    It could be a timing problem. I'm pretty sure that that's what I'm seeing.
    On line 794 of mx31ads_pcmcia.c I changed:

    code = PCMCIA_POR_PSHT(mx31ads_pcmcia_por_psht(speed_ns, clk_ns))
    | PCMCIA_POR_PSST(mx31ads_pcmcia_por_psst(speed_ns, clk_ns))
    | PCMCIA_POR_PSL(mx31ads_pcmcia_por_pslt(speed_ns, clk_ns));

    to be:
    code = PCMCIA_POR_PSHT(0)
    | PCMCIA_POR_PSST(63)
    | PCMCIA_POR_PSL(127);

    Not sure if it's perfect, but it's better.

    Hope that helps, let me know if it works for you.
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    20 Sep 2007 06:15 PM
    Keep in mind that old versions of baseboard hardware have the CF interface signals messed up. Check PCN341 for more info:

    http://www.logicpd.com/do..._iMX_LITEKIT_PCN.pdf
    davek
    New Member
    New Member
    Posts:


    --
    21 Sep 2007 11:22 AM
    I have a 1007052 Rev 1 baseboard, so it appears that this problem has been fixed on the PCB that I have, correct?
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    24 Sep 2007 04:40 PM
    If you can load a file from a cf card using lolo 2.3.5 you can be sure that's it's fixed. A workaround to the CF interface issue on old hardware was built into 2.3.4, so 2.3.4 works on the bad hardware and 2.3.5 works on the fixed hw.
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    25 Sep 2007 04:13 AM
    Hi,

    I am getting the following message when i try to use cf.

    mx31# /etc/rc.d/init.d/pcmcia start
    [ 51.960000] pcmcia_core: exports duplicate symbol dead_socket (owned by kernel)
    [ 52.970000] mx31ads_pcmcia: Unknown symbol clk_get
    [ 52.980000] mx31ads_pcmcia: Unknown symbol clk_get_rate
    [ 51.030000] firmware_class: exports duplicate symbol release_firmware (owned by kernel)
    [ 51.060000] pcmcia_core: exports duplicate symbol dead_socket (owned by kernel)
    [ 51.090000] pcmcia: exports duplicate symbol cs_error (owned by kernel)
    mx31# dump_cis
    Socket 0:
    no CIS present
    mx31# cardctl info
    PRODID_1=""
    PRODID_2=""
    PRODID_3=""
    PRODID_4=""
    MANFID=0000,0000
    FUNCID=255

    I did the timing changes in mx31ads_pcmcia.c as suggested.
    Any reason why this is happening?
    davek
    New Member
    New Member
    Posts:


    --
    25 Sep 2007 05:57 AM
    Paul, is there a way in LoLo to list CIS info from a card, or does it only know how to handle memory cards?
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    26 Sep 2007 03:57 PM
    There isn't a built in command, although on previous products (a404/pxa270) there was a procedure to do this. It used the w, x, and remap commands to set up the interface and dump out the memory-mapped attribute area, I believe. I haven't worked the procedure out for the i.mx31 and I don't think that lolo itself looks at the card's cis (timing values are hard-coded).
    davek
    New Member
    New Member
    Posts:


    --
    27 Sep 2007 09:38 AM
    Paul, if you figure out the method for the MX31 that would really help me prove where the problem is. Right now it looks like it's a baseboard or MX31 timing problem. I've sent the query off to Freescale and they have an FAE looking at it, but any insight you could provide would be appreciated.

    Thanks
    Dave
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    27 Sep 2007 09:05 PM
    I will let you know.

    In the meantime, the timing from the WinCE driver registry file might be helpful to you:

    "NumSlots"=dword:1
    "OffboardCtrlReg"=dword:16300000 ; only used if "NumSlots"=dword:2
    ; Set the strobe timing value according to CF spec
    "PccStrobeLength"=dword:0000000F ; Strobe length maximum value is 0x7F
    "PccStrobeSetupTime"=dword:0000000F ; Strobe setup time maximum value is 0x3F
    "PccStrobeHoldTime"=dword:0000003F ; Strobe hold time maximum value is 0x3F

    "SlotBIsrDll"="pcmcia_isrb.dll"
    "SlotBIsrHandler"="ISRHandler"
    "SlotBAttr"=dword:00000303 ; meet the minimum required in the CF spec
    "SlotBCommon"=dword:00000203 ; if max timing is desired, ws will have to
    "SlotBIO"=dword:00000284 ; be increased
    "SlotBIrq"=dword:36


    "SlotAIsrDll"="pcmcia_isra.dll"
    "SlotAIsrHandler"="ISRHandler"
    "SlotAAttr"=dword:00000303 ; meet the minimum required in the CF spec
    "SlotACommon"=dword:00000203 ; if max timing is desired, ws will have to
    "SlotAIO"=dword:00000284 ; be increased
    "SlotAIrq"=dword:36
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    03 Oct 2007 08:11 AM
    Hi,

    This might sound silly, but what config settings did you use to generate the hdx devices.
    [ 52.730000] hda: lost interrupt

    Also when i try to mount the cf card in LoLo I get the following error:
    losh> mount fatfs /cf
    timeout resetting cf card
    error: mount: failed to open (ATA)

    Any suggestions would be great.
    richard.laborde@logicpd.com
    Basic Member
    Basic Member
    Posts:247


    --
    03 Oct 2007 09:20 AM
    Arjun.KV,

    The Pilot and Production i.MX31 kits need a little time to initialize the CF card. If you are using a script you can use the sleep <mseconds> command to give the kit time to do that.

    sleep 3000;
    mount fatfs /cf;

    In some cases, having a sleep command between 2 mount commands helps. I've always had good success with just the one delay.

    Thanks
    You are not authorized to post a reply.
    Page 1 of 212 > >>