ts-7000
[Top] [All Lists]

[ts-7000] SPI in TS7500

To: <>
Subject: [ts-7000] SPI in TS7500
From: "Reinaldo A. Fagundes" <>
Date: Tue, 16 Mar 2010 14:33:28 -0300


Have one documentation to how to use the spi in ts7500, I need use a high precision rtc and like use SPI

 

thanks

 

De: [ Em nome de pakorn_0608
Enviada em: terça-feira, 16 de março de 2010 10:48
Para:
Assunto: [ts-7000] Re: DMA with SSP on TS7400

 

 


Thank a lot for your advice, i learn a lot from you.

I'm using kernel 2.4.26 flatform, and, i also use GFP_DMA flag on my "kmalloc" command.

Anyway,for my application, I'm using TS-7400 with ADS1278, adc 24bit/8CH.

By now,I only using this chip only 1CH at 2k sampling.Protocol of ADS1278 is SPI, and There is some application which I have to use upto 8 channel but maybe in lower sampling.

Not only this module that use transfer data via SPI, but it also have another module and application that transform data into some of standard file, moreover, it have web server for service some application for configuration and monitoring this data. There are moe a few but just a little job.

In section of SPI,I use external interrupt to catch signal from ADS1278 and then send and recrieve data via SPI bus which depend on sampling rate, 2k/1CH/24bit by now, more in the future.

It's sometime performance drop when i'm running full of them.
That why i try to use DMA for helping do some job of whole.

So, I'll try to use "dmac_flush_range" and tell the result soon.

--- In ts-7000%40yahoogroups.com, "Breton M. Saunders" <> wrote:
>
> The symptoms you describe are likely caused by data not being flushed to
> physical ram prior to invoking your dma transfer.
>
> Just checking back to the sdcard driver I did for the 7400. I did:
>
> dmac_flush_range(buf,buf+buflen); // where buf is a pointer to a virtual
> address (e.g. not a bus address)
>
> prior to performing a dma transfer.
>
> Although not strictly necessary on this platform, you should probably
> make sure you use the GFP_DMA flag when you allocate memory for your
> buffers.
>
> Incidentally, you are running this on a >2.6.27 platform?
> Also, you aren't using the sdcard driver in dma mode right? There will
> be some pretty serious problems if you are using TS's driver and just
> banging commands directly into the M2M registers.
>
> I think at 6k bytes per second you might as well not bother with DMA.
> From memory, 6k transfers at half fifo size (4 bytes) per interrupt is
> 1500 interrupts per second. Keeping the ISR time short, you'll hardly
> notice a performance drop. The main issue, though, is what are the
> peripherals you are addressing? If your peripheral is something like a
> tmp127, then the amount of signaling needed will kill any advantage of a
> dma driver. If you're transferring from a memory chip, then dma is
> probably quite sensible.
>
> -bms
>
> pakorn_0608 wrote:
> > Unfortunately for me,I test it more and check in deep.
> > Both of SSPTx and SSPRx are sometime update, not only one like i said before.
> >
> > For ts7400,I use virt_to_bus only for address that i got from "kmalloc", for SSPDR -address for SSPTX and SSPRx-, I doesn't use it.
> >
> > On the morning,I tried to use it with SSPDR. There is nothing comtout from SSP.
> > I thoght address of SSPDR is physical addresses by default for EP9302 on TS7400.
> >
> > I try to use bus_to_virt with the memory that use for keeping data from SSPRx. It's the same result.
> >
> > Anyway,Thanks so much, I learn a lot from you.
> >
> > Now i looking for mor information about flush cache cpu which another one tell me in another replying.
> >
> > I'm just read from a bit and it seem have a useful for me.
> > I'll try and update to you again if any progress.
> >
> >
> > --- In ts-7000%40yahoogroups.com, Abid Rashid <abidrashid24@> wrote:
> >
> >> Â
> >> It is important to map virtual addresses to physical addresses whenever you work with DMA. (Please note that virt_to_bus might restrict your cross platform portability).
> >> I am not sure which Addresses are you using for Rx.Â
> >>
> >> Make sure you have mapped your DMA virtual addresses to Rx bus addresses and vice versa.U might use bus_to_virt on DMA Rx addresses and use this address to look at the data.
> >> If any thing else I cant help....
> >> Â
> >> br,
> >> Abid
> >> --- On Mon, 3/15/10, pakorn_0608 <pakorn_0608@> wrote:
> >>
> >>
> >> From: pakorn_0608 <pakorn_0608@>
> >> Subject: [ts-7000] Re: DMA with SSP on TS7400
> >> To: ts-7000%40yahoogroups.com
> >> Date: Monday, March 15, 2010, 11:31 PM
> >>
> >>
> >> Â
> >>
> >>
> >>
> >> Thanks a lot, Abid :-)
> >>
> >> The virt_to_bus it's work for me.
> >> bit by bit between SSPtx and SSP_CLK is come out correctly, but, i have new problem now.
> >>
> >> Only SSPTx right , SSPRx is sometime right.
> >> I use printk" for show what i got from SSPRx by using DMA.
> >> On start up module,after enable DMA, the memory of SSPRx that i allocate for DMA, It's sometime show my default value which i set it up on initial, but, sometime it show correct value follow by what it get from SSPRx.
> >>
> >> I'm finding the way to solve it.
> >> Could you have any suggestion to me?
> >>
> >> Pakorn
> >>
> >> --- In .com, Abid Rashid <abidrashid24@ ...> wrote:
> >>
> >>> ÂÂ
> >>> Kmalloc returned addresses need to be mapped to the bus addresses.
> >>> Use
> >>> bus_addr = virt_to_bus( virt_addr/ *returned from kmalloc*/);
> >>> address as the dma destination.
> >>> Hope it would help
> >>> br,
> >>> Abid
> >>>
> >>> --- On Mon, 3/15/10, pakorn_0608 <pakorn_0608@ ...> wrote:
> >>>
> >>>
> >>> From: pakorn_0608 <pakorn_0608@ ...>
> >>> Subject: [ts-7000] DMA with SSP on TS7400
> >>> To: .com
> >>> Date: Monday, March 15, 2010, 3:21 AM
> >>>
> >>>
> >>> ÂÂ
> >>>
> >>>
> >>>
> >>> Dear members,
> >>>
> >>> I'm use DMA on M2M mode with SSP, both of SSPTx and SSPRx for each channel.
> >>>
> >>> I have a bit problem with data that transmit and receive from SSP.
> >>>
> >>> I use "kmalloc" to get allocate memory address and i write some data into that address.
> >>> I can write and read correctly by using "printk".
> >>>
> >>> I'm also use it with SSPDR for transmit data from SPI by "outl" command, data come out from SSPTx with clock sync correctly.
> >>>
> >>> Anyway,It's wrong when i'm using with DMA register.
> >>>
> >>> For example, DMA M2M0 using with SSPtx, I set DMA register, source register with address from kmalloc "0xd120_10eo" , destination address SSPDR "0x808A_0008" and BCR by 3.
> >>>
> >>> There are data come out from SSPtx but it is not right value that it should be in memory address shown by "printk".
> >>>
> >>> Could someone have some suggest to me for using DMA with SSP for 7400 board?
> >>>
> >>> ************ *******
> >>> example with some coding:
> >>> ************ *******
> >>>
> >>> /* I write it for kernel module*/
> >>> ...
> >>> char *buffer_dma[ MAX_EP93XX_ DMA_M2M_CHANNELS ];
> >>> .
> >>> .
> >>> .
> >>> buffer_dma[0] = kmalloc( size , GFP_KERNEL|GFP_ DMA); /* example size is 10*/
> >>>
> >>> for(i=0;i<10; i++)
> >>> {
> >>> buffer_dma[0] [i] = i*10;
> >>>
> >>> printk("Address of buffer_dma[0] [%d] = 0x%lx\n",i,( unsigned long)&buffer_ dma[0][i] );
> >>> printk("Value of buffer_dma[0] [%d] = %d\n",i,buffer_ dma[0][i] );
> >>> }
> >>>
> >>> /*
> >>> I print this value for show address and value
> >>> my address for buffer_dma[0] [0] is "0xd120_10eo" and value is 0
> >>> next, address for buffer_dma[0] [1] is "0xd120_10e1" and value is 10... and other value is shown correctly.
> >>>
> >>> I also use with SSP
> >>>
> >>> */
> >>>
> >>> for(i=0;i<10; i++)
> >>> {
> >>> outl(buffer_ dma[0][i] , SSPDR );
> >>> }
> >>>
> >>> /*
> >>> I'm set SSP 8 bit,
> >>> data come out from SSPTx is correctly , compare bit by bit with ssp_clock
> >>>
> >>> next i'm usongit with DMA M2M for SSPTx
> >>>
> >>> */
> >>>
> >>> outl(&buffer_ dma[0][0] , m2m_channel[ channel]. base + M2M_SAR_BASE0) ;
> >>> outl( SSPDR , m2m_channel[ channel]. base + M2M_DAR_BASE0) ;
> >>> outl(3 , m2m_channel[ channel]. base + M2M_BCR0);
> >>>
> >>> /*
> >>> After that i'm enable DMA
> >>> my data that come out from SSPTx is wrong all,
> >>> even i change data in my buffer_dma[0] [i] on above
> >>> data come out from SSPTx is still the same value.
> >>> It's not match with it should be in memory address
> >>> */
> >>>
> >>>
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU