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!
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.
to add to Vaibhav's post, here is a wiki article on GPMC setup.
Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
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?
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).
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(+)
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 firstname.lastname@example.org.
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.
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!
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
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.
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.
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?
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!
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 22.214.171.124 & 126.96.36.199.1 mentioned that non-multiplexed device is supported with an address range of only 2 Kbytes.And, there is a GPMC.GPMC_CONFIG.LIMITEDADDRESS bit to be set to 1 in such case.
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.
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.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.