• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » OMAP™ Processors » OMAP35x Processors Forum » OMAP 3530 gpmc driver
Share
OMAP™ Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Resources
  • OMAP-L1x DSP+ARM9™-based Processors Product Folder
  • OMAP3525/30 DSP+ARM Cortex™-A8-based SOCs Product Folder

  • Top OMAPL Wiki Links
  • OMAPL3x Schematic Review Checklist
  • OMAPL13x Boot resources

  • OMAPL Document Resources
  • OMAPL137 Technical reference manual
  • OMAPL138 Technical reference manual
  • OMAPL Boot loader App Notes
  • Forums

    OMAP 3530 gpmc driver

    This question is not answered
    Michael Yu
    Posted by Michael Yu
    on Apr 07 2011 20:39 PM
    Prodigy80 points

    Hi: every one

     

    I am new to OMAP 3530. My project is transfer data from FPGA to OMAP trough gpmc interface using burst mode. with linux kernel

    please help me find gpmc driver and example code for read and write to gpmc interface.  

    how to set up gpmc_clk as 100Mhz and how to set to let gpmc_clk running continue even without read/write action.

    how to make U-boot file.

    how to set up OMAP 3530 as burst mode

     

    thank you very much for your help!

     

    Michael

    OMAP3530 Kernel 3530 OMAP clocking kernel Linux Drivers driver boot OMAP 3530 McBSP DMA
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Vaibhav Hiremath
      Posted by Vaibhav Hiremath
      on Apr 09 2011 17:05 PM
      Expert8160 points

      I can help you with some of the basic things,

       

      The GPMC configuration currently happening through u-boot(2010.06)/x-loader only, Kernel (2.6.32) only reads the configuration done by u-boot and uses it to find mapped/configured physical address and maps it to kernel virtual.

      Based on your requirement, whether you want to transfer it one time or you need user space interface for transfer you have to write simple driver (could be simple char driver) for data transfer over GPMC to FPGA.

      You have to come up with GPMC configuration based on FPGA interface, please refer to the existing NOR/NAND/ONENAND GPMC configuration setting in u-boot ("arch/arm/cpu/arm_cortexa8/omap3/mem.c" and function  "gpmc_init").

       

      Hope above information would give you some basic idea and direction.

       

      Thanks,

      Vaibhav

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jeff Culverhouse
      Posted by Jeff Culverhouse
      on Apr 11 2011 10:37 AM
      Expert7325 points

      Hello Michael,

      to add to Vaibhav's post, here is a wiki article on GPMC setup.

      http://processors.wiki.ti.com/index.php/Tips_for_configuring_OMAP35x_and_AM-DM37x_GPMC_registers

      ---------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.
      ---------------------------------------------------------------------------------------------------------

      Best regards,
      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Michael Yu
      Posted by Michael Yu
      on Apr 12 2011 12:45 PM
      Prodigy80 points

      Hi:jeff

      thank you very much for your help!

      what is means " NOR/NAND/ONENAND GPMC" . do you know how to set up wait signal as interrupt signal?

      do you know where I can find gpmc interface FPGA code which will work with OMAP interface?

       

      Sincerely,

      Michael

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jeff Culverhouse
      Posted by Jeff Culverhouse
      on Apr 12 2011 13:15 PM
      Expert7325 points

      Hello Michael,

      those are just some of the devices that interface to our General Purpose Memory Controller (GPMC).  The setup for the GPMC will have to be determined by the requirements for the particular FPGA you are using.  For determining the proper setup you will need to use the Technical Reference Manual (TRM) secrtion 11.1.  You can get the TRM from the product folder page (www.ti.com/omap3530). 

      ---------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.
      ---------------------------------------------------------------------------------------------------------

      Best regards,
      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yves McDonald
      Posted by Yves McDonald
      on Nov 09 2011 11:40 AM
      Intellectual320 points

      Hello,

      I'm trying to access FPGA registers as if the device was a small, non-multiplexed static RAM device (size<=2048 bytes). I did it by registering a platform device driver. For now, the driver is manually loaded (for testing/debugging convenience). Linux registers the device on CS3* with success and it shows up in /proc:

      root@am3517-evm:/run# cat /proc/iomem

      00000000-00000000 : omap2-nand.0

      01000000-01000400 : FPGA_REG.1

        01000000-010003ff : CBA_FPGA_Reg

      30000000-30000003 : omap2-nand

      However, when I try to acess it (from kernel space), I get a segmentation fault error and, if I try to unload the module, the kernel replies that it is in use. The only solution at that point is to reboot Linux: I probed with a scope during FPGA access and I didn't see any activity on CS* (always high) and clock (always low). 

      [  327.571441] read FPGA at base address:d0898000

      [  327.579864] Unhandled fault: external abort on non-linefetch (0x1008) at 0xd0898000

      [  327.587982] Internal error: : 1008 [#1]

      [  327.591979] last sysfs file: /sys/devices/virtual/net/lo/flags

      [  327.598114] Modules linked in: FpgaGpmcDriver(+)

      That kind of error is often linked with missing signals: GPMC clock is an example. I checked pin muxing (gpmc clock is active, + other signals), FPGA-AM3527 interconnections, and kernel configuration (option to disable unused clocks is not active). All looked good.
      Unless there is a hardware problem, or in VHDL code, is it correct to access iomem with the following kernel function calls ?:
      void *fpga_vp = ioremap_nocache(fpga_cs_base, 2048); // base set at 0x01000000
      unsigned short data = ioread16(fpga_vp);
      No luck so far... :-(
      Thanks,
      Yves
      ymcdonald@leapmedical.ca

       

      GPMC AM3517 FPGA interface omap2
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Xiaolin Zou
      Posted by Xiaolin Zou
      on Dec 30 2011 02:16 AM
      Prodigy160 points

      hi,Michael,have you solve this problem,I am also feel configure about this problem,I am looking forward to your reply.my email address is arlene0606@gmail.com.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yves McDonald
      Posted by Yves McDonald
      on Dec 30 2011 09:20 AM
      Intellectual320 points

      Yes, I finally made it: Linux kernel can 'talk' to an FPGA as if it was a memory device. The FPGA emulates a synchronous RAM memory. Address/data buses are not multiplexed for the sake of symplicity. The GPMC controller allocates a small, 4 kb address space for it but that's not an issue for my application: the FPGA is programmed to 'show' less than 256 registers on its GPMC interface.

      So, in retrospective, here is a list of things to keep in mind:

      - I implemented the FPGA device driver as a platform device driver. I chose ioctl() function calls to let user application access the FPGA;

      - Timing  specifications must be set in nanoseconds in the gpmc_timings structure, not gpmc_clocks ticks, as I originally assumed they were;

      - compiling the kernel gpmc driver in debug mode helps tracing down incorrect timings: it's easy to specify timing values which exceed the range of their respective bit maps in GPMC config registers;

      - At first, make sure the kernel does not turn off unused clocks (it's a kernel config option).

      - Make sure that the gpmc_clock pad is set as input/output: the GPMC hardware monitors it to tweak its timing.

      - keep it simple: use simple memory interface signals (ex: static RAM cs*, rd*, wr* signals) and relaxed timings: for example, my read/write cycles take about 200ns to complete and I use a 100MHz gpmc_clock.

      - don't be afraid to 'hack' the kernel: need to call hidden (static) kernel GPMC functions? Just export() them. I had to do so in order to do extra configuration works on the GPMC-FPGA intervace.

      It all works for me now. That required lots of head scratching, experimentation and probing but accessing the FPGA is a breeze now.

      Good Luck!

      am3517 gpmc fpga linux
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Xiaolin Zou
      Posted by Xiaolin Zou
      on Dec 31 2011 02:02 AM
      Prodigy160 points

      hi,Yves,I am really a new starter of linux kernel,I even can't find gpmc_timings structure,I am not sure about the kernel version of mine is the same as yours.I also can't find the configuration of the gpmc register and the definition of gpmc register,such as GPMC_CONFIG1_i(i=0..7).I really need your source code,even a demo,I can read and understand the code,but the concept or datasheet may not work for me,the time left is short for my work. By the way,happy new year!Thanks a lot!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yves McDonald
      Posted by Yves McDonald
      on Jan 06 2012 09:03 AM
      Intellectual320 points

      Thanks, best whishes for the Year of the Dragon too...

      Time is the essence indeed... It took me about six months to get confortable with kernel hacking and documentation about GPMC drivers was sparse. We called in external help to get it working. The code is a bit too large for direct posting here so I must find another way to 'show it off'. It is also very project-specific and I'd like to review it before publishing. 

      Here are two additional pointers:

      The kernel source file path for GPMC function is (in my package ): ~/arch/arm/mach-omap2/gpmc.c

      The kernel header file path (for th gpmc_timing_t structure): ~/arch/arm/plat-omap/include/plat/gpmc.h

      Happy coding!

      Linux Drivers GPMC FPGA AM3517
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • James.Ang
      Posted by James.Ang
      on Jan 30 2012 00:52 AM
      Prodigy165 points

      Hi Yves,

      I'm new to Linux and is also exploring the use of GPMC with a FPGA acting like a memory device. Read/Write to register/address.

      Can you zip up your driver's source code and related user-land test application to a sharing site such as yousendit for us as a good reference model?

      Many thanks in adv.

      James.

      OMAP beginner 3530 OMAP 35x Linux Drivers driver GPMC Beagleboard omap3530 omap3530
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yves McDonald
      Posted by Yves McDonald
      on Jan 30 2012 09:05 AM
      Intellectual320 points

      Hello James,

      I'm currently rushing to meet software release deadline  but I'll be glad to share the code as soon as I can. I think I can do that within a few weeks from today's date.

      This website probably has code sharing sections as well: as a matter of fact, I could easily attach a tar.gz file to the next post, when I'll be ready to publish.

      good luck,

      Yves

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • James.Ang
      Posted by James.Ang
      on Jan 30 2012 22:02 PM
      Prodigy165 points

      Hi Yves,

      Thank you so much for agreeing to share the code.

      I look forward to learning from your contribution.

      My setup is similar to yours.

      A OMAP3530 (Overo) connected to the Xilinx FPGA via the GPMC bus to read/write to registers in the FPGA in synchronous, non-multiplexing mode.

      Reading your post,

      "Timing  specifications must be set in nanoseconds in the gpmc_timings structure, not gpmc_clocks ticks, as I originally assumed they were;"

      I look at the TRM and they are to be calculated in terms of clks. The GPMC bus is shared with a SMSC911X Ethernet chip and the frequency is 83MHz.

      Can you explain a bit of the above?

      Many thanks in adv.

      James

      OMAP 3530 3530 Linux Drivers driver GPMC
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Xiaolin Zou
      Posted by Xiaolin Zou
      on Feb 01 2012 21:54 PM
      Prodigy160 points

      thanks a lot,how did you know I am a chinese?春节快乐!I  am looking forward to your code release.during the waiting timing,I have another FPGA to deal with.ASAP please!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • James.Ang
      Posted by James.Ang
      on Feb 22 2012 19:14 PM
      Prodigy165 points

      Hi Yves,

      While you are reviewing and scrubbing the code for sharing, can you advise on the CONFIGi configuration that you used?

      I want to configure OMAP3530 to FPGA using non-multiplexed, synchronous, single access RW mode.

      1) I found that the L3 clock is 166MHz and the GPMC clock is limited to 83MHz in this case. TRM stated that the maximum is 100MHz (when L3_clk divide by 1), thus it seems GPMC clock is limited to 166MHz divided by 2 giving 83MHz maximum.

      Can you advise if your L3 is 100MHz or 166MHz and the GPMC clock output?

      I got that by dropping this code in arch/arm/mach-omap2/gpmc.c - gpmc_init()

              rate = clk_get_rate(gpmc_l3_clk);
              printk(KERN_ALERT "gpmc_l3_clk frequency: %lu", rate);

      2) TRM Chap 11.1.3.3 & 11.1.3.3.1 mentioned that non-multiplexed device is supported with an address range of only 2 Kbytes.
      And, there is a GPMC.GPMC_CONFIG[1].LIMITEDADDRESS bit to be set to 1 in such case.

      Is this needed or already done globally across the kernel or by some other means later in the driver?
      3) What is the value of CONFIG7 that you used and its supporting reasons.
      Many thanks in adv and hope to learn from your experience.
      James Ang
      omap3 omap3530 OMAP 3530 beginner Linux 3530 OMAP 35x Gumstix Linux Drivers driver GPMC
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steven Wilson1
      Posted by Steven Wilson1
      on Apr 28 2012 12:33 PM
      Prodigy20 points

      I'm just getting started into Kernel hacking - and have a need to do something similar. The FPGA interface can be anything required at this point. I want to use the BeagleBone as the development platform for this.  Has the driver described in this sequence been made public yet?  This sound about exactly what I'm in need of.  This would be a GREAT thing to make part of the BeagleBone generic I/O offerings since the GPMC makes it up to the 80 I/Os available on the board.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use