none
Do we need to modify Board Support Package to access External Memory interface in I.MX RRS feed

  • Question

  • Hi,

    We need to access an external memory interface module in i.mx25 processor. For this there is no module implemented in our BSP. So we started implementation of accessing this module in our own driver which will run in kernel mode. The problem is we are able to read/write in to the external memory interface but we are not getting any hardware signals like CHIPSELECT and R/W. Because of this we are not sure whether we are doing rite or wrong.

    Settings That We did:

    1) We defined ChipSelect region in config.bib as RAM.

    2) We did vitual mapping to this physical memory region using virtual alloc and virtual copy functions.

    3) Using virtual pointer we are doing read/write operations.

    Processor : I.MX25

    Platform : WinCE6.0R2

    Do we need to do anything in BSP to get hardware signals? Can't we do this type accessing from driver(in kernel mode)?

    Thank you very much for your replies.

     

    Regards,

    Shiva

     

    Thursday, January 13, 2011 1:21 PM

All replies

  • Hi Shiva,

    To got access to a new memory region, you have to declare this region into the g_oalAddressTable array.

    In Freescale BSPs, this is generaly declared in <PLATFORM_ROOT>\SRC\INC\oemaddrtab_cfg.inc.

    Be sure that your memory region is present in this declaration.

    Regards

    Fabrice

    Thursday, January 13, 2011 1:28 PM
  • Fabrice:

    It is not necessary to add the memory region to OEMAddressTable unless the kernel or bootloader need to access the addresses.  Since Shiva is writing a driver, it shouldn't be necessary.  (if this was CE 5.0 or before, then there could be some exceptions that would allow drivers to access very large address ranges)

    Shiva:

    It seems odd to me that you are able to read/write this "external memory interface", but yet the hardware lines aren't changing.  How did you establish that you are actually reading and writing to it?  Now I have to admit that I don't know much about the i.MX31 so you could be using technical terms associated with it.  Is this actually your system RAM?

    You say: 1) We defined ChipSelect region in config.bib as RAM. - Can you show us what you actually did?  If you defined it as RAM then this would be your system RAM and used by the kernel.  If that is the case then you need to initialize the interface early.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Thursday, January 13, 2011 2:31 PM
    Moderator
  • I didn't work with i.MX processors. Normally in Processors Memory controller, There should be a register to configure the chip select as SRAM interface. Did you configure that register?

    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Thursday, January 13, 2011 2:56 PM
  • The MX51 processor has an External Memory Interface section which contains the registers necessary to enable a particular chip select.  Presumably the MX25 has something similar (all processors do).  You'll need to configure bus type, bus width, timings etc. 

    The pins themselves may have their own configuration - you may need to configure them as input/output, drive strength etc.  If the MX25 supports multiple functions on those particular pins you will need to configure that as well.


    Dean Ramsier eMVP BSQUARE Corporation
    Thursday, January 13, 2011 6:33 PM
  • Hi Mignon,

    Thank you very much for your early response.

    I saw oemaddresstab_cfg.inc file. In this file CS1 memory region(Which we want to access as external interface) is not defined.

    So, I will add my memory region in to this file. After this do I need to build the BSP? or can i directly clone the BSP in to platform builder and build my OSDesign?

     

    Regards,

    Shiva

    Friday, January 14, 2011 1:52 PM
  • Hi Bruce Eitman,

    Thank you very much for your response.

    1) Please find the settings that I did in config.bib file.

    ;**************************** MEMORY SECTION ***************************
    MEMORY

    ; --------------------------- RAM image --------------------------------
    ;   Start Addr      End Addr        Mem Type    Region Name     Size
    ;   0x80000000      0x80100000      SDRAM       reserved         1 MB
    ;   0x80100000      0x82000000      SDRAM       NK                31 MB
    ;   0x82000000      0x84000000      SDRAM       RAM             32 MB
    ;   0xA8000000      0xAFFFFFFF        RAM          MEM_CS1     128 MB
    ;   0xB8002000      0xB8002FFF        RAM        WEIMCR           4 KB  (WEIM control Register);   
    ; ----------------------------------------------------------------------
    ;

       Name                       Address     Size             Type

     BOOT_AND_OTHER  80000000    00100000    RESERVED
     NK                          80100000    01f00000     RAMIMAGE
     RAM                        82000000    02000000    RAM
     MEM_CS1                A8000000    07A12000    RAM            //This region I amusing as External Memory Interface
     WEIMCR                 B8002000    00000FA0     RAM            //This region is to set External Memory Interface control registers

    2) Initially I did virtual maping to 0xB8002000 and read default control register values. These values are matching with the values specified in I.MX25Referance manual.Woth this comaprison we concluded that we are able to read hardware control registers. During this operation we are enabling ChipSelect1 pin(this will be toggelled by processor automatically when we attempt to read/write operation) , Read/Write signal, Output Enable signal and data port size.

    3) Then we did virtual mapping to 0xA8000000 and tried to do read/write of 8-bit data.We are able to get the values when we read back after write operation. With this we concluded, we are able to access external memory. But the problem is when we are doing these operations we are not getting ChipSelect signal toggling.

    If this space is system RAM, could you tell me where can I define this interface details?(Whether do I need to initialize in kernel init code?)

     

    Thanks & Regards,

    Shiva

    Friday, January 14, 2011 2:30 PM
  • Hi Shiva,

    If you still do not get the problem resolved, try the step below.

    1. Remove declaration from config.bib.

    2. Add an entry in OEMAddressTable for MEM_CS1 memory region as under

        (this is just an example, you need to use appropriate values):

                            Virtual Addr     Physical Addr         Size (128MB)

        MEM_CS1      0x88000000     0x30000000        0x08000000

    3.  As you are accessing memory in kernel mode, use uncached addr (0x88000000 + 0x20000000 = 0xA8000000) as the base address for the external memory.

    4. you should be able to observe the Chip Select signals, if you access this memory region. If not, you may need to configure the external memory interface as suggested by Dean Ramsier.

    Regards,

    Mansukh 

     

    Sunday, January 16, 2011 5:24 AM
  • Hello Shiva, I haven't see your question before !

    When you have modified oemaddresstab_cfg.inc, you will have to recompile the BSP, there is no need to redo Sysgen.

    I don't understand your question about cloning BSP?

    If you work on a custom board, of course you will have to clone the Platform to add the drivers for your hardware and remove drivers which are not used/supported on you board. But this has nothing to do with the memory mapping problem you have.

     

     

    Sunday, January 16, 2011 3:28 PM
  • Shiva, you are probably doing a Write/Read from some other area in RAM, this is why you are not seeing signal on CS or Address lines of your external memory chip.

    Use the Watch Window to look at the memory address 0xA8000000 to confirm if you are writing to it correctly. If my guess is write, then you have to track the issue in the PDD layer of your driver.

    Emeel Noohi -MCTS

    Tuesday, January 18, 2011 3:29 AM