Hi, all
I already posted here before... but still got the doubts...
The OMAP 3530 and a DSP C5510, I want to write/read data in the DSP via HPI (auto-incrementing).
The OMAP is running LINUX 2.6.28.I'm using the GPMC bus in the OMAP side.
I know that I have to control the HPI transfer using two pins HCNTL0 and HCNTL1, Changing their status I select, the DSP knows if the data I was passing was DATA, ADRESS or CONTROL.
_____________ _______________
| GPIOx|--------------->|HCNTL0 |
| GPIOy|--------------->|HCNTL1 |
| GPMC|--------------->| HPI |
| OMAP | | DSP |
| 3530 | | C5510A |
| | | |
|____________| |_______________|
FIG1
So in the OMAP software I can use the linux funcition "__raw_writel(val, reg_addr)" in a loop with the "val" changing with the data I want and the interesting part, the reg-addr value set to:
REG Physical Address
GPMC_NAND_DATA_i 0x6E00 0084 + (0x0000 0030 * I)
I=3 for example...
"SPRUF98B–September 2008 Memory Subsystem page 1263"
to write address or data, for GPMC writing in the same register doesnt matter, software will control the pins HCNTL0 and HCNTL1, and DSP will know the address, the data and the auto-incrementing I want.
__________________ __________________
( ) ( )
( SET HCNTL0 = 0 )---->( WRITE )
( SET HCNTL1 = 0 ) ( HPIC )
(__________________) (__________________)
|
|
|
__________________ _________V________
( ) ( )
( WRITE )<----( SET HCNTL0 = 0 )
( HPIA MSB ) ( SET HCNTL1 = 1 )
(__________________) (__________________)
|
|
|
_______V__________ __________________
( ) ( )
( SET HCNTL0 = 0 )---->( WRITE )
( SET HCNTL1 = 0 ) ( HPIC )
(__________________) (__________________)
|
|
|
__________________ _________V________
( ) ( )
( WRITE )<----( SET HCNTL0 = 0 )
( HPIA LSB ) ( SET HCNTL1 = 1 )
(__________________) (__________________)
|
| .....................................
| : :
_______V__________ : __________________ :
( ) : ( ) :
( SET HCNTL0 = 1 )--------->( WRITE )----- :
( SET HCNTL1 = 0 ) : ( HPID AUTO-INC ) | :
(__________________) : (__________________) | :
: ^ | :
: | LOOP | :
: | | :
: -------------- :
:...................................:
FIG. 2
So Ok this point?
Now, the hardcore part!
To save CPU, We will use the DMA (replacing the "dots square" in fig 2).
We configure the DMA mode, two channels one for WR and other for RD.
The doubt is the following, when I use the functions bellow:
dsp_in_dmabuf = dma_map_single(lp->dev, buffer_wr, len, DMA_TO_DEVICE);
omap_set_dma_src_adrr(*dma_ch_dsp_in, dsp_in_dmabuf);
omap_set_dma_dest_adrr(*dma_ch_dsp_in, (physaddr + reg));
omap_start_dma(*dma_ch_dsp_in);
1) The (physaddr + reg) should be a constant address correct? (In this case I will use the same constant GPMC_NAND_DATA_i register)?
2) When DMA writes to external device, it write the address and then the data I want to write? How can I tell DMA to just send data in the GPMC lines without send address to the bus?
I hope you can help me,
Thanks...