* McBSP usage inside DSP processor
@ 2007-02-13 17:16 Luís Vitório Cargnini
2007-02-15 10:29 ` Guruswamy, Senthilvadivu
0 siblings, 1 reply; 6+ messages in thread
From: Luís Vitório Cargnini @ 2007-02-13 17:16 UTC (permalink / raw)
To: OMAP, dspgateway-devel
Dears:
I and my colleague are developing an application that will need to access an
AD/DA, from DSP processor, we are trying the McBSP functions MCBSP_init(),
read an write and so on. But we are having difficulties on execute this.
Someone knows how to access an McBSP inside DSP side ?
we are using DSPGateway.
Something that we note is that MCBSP_init() do not exist and are always
generating an error on compilation but CSL_init() works; someone could give
some info about it ?
here follow an code been developed by us:
#define CHIP_5510PG2_2 1
#include <std.h>
#include <stdint.h>
#include <math.h>
#include <csl.h>
#include <csl_dma.h>
#include <csl_emif.h>
#include <csl_irq.h>
#include <csl_timer.h>
#include <csl_mcbsp.h>
#include "tokliBIOS.h"
#define MCBSP_DEV0 (0)
#define MCBSP_DEV1 (1)
#define MCBSP_DEV2 (2)
#define BUFSIZ (0x10000/2)
int count;
void write_isr(void);
MCBSP_Handle fd;
MCBSP_Config configuracao = { /*tudo uint16*/
0x0200, //spcr1
0x1800, //spcr2
0x0000, //rcr1
0x0020, //rcr2
0x0000, //xcr1
0x0060, //xcr2
0x3249, //srgr1
0x03FF, //srgr2
0x0040, //mcr1
0x00A0, //mcr2
0x00E0, //pcr
0x0000, //rcera
0x0000, //rcerb
0x0000, //rcerc
0x0000, //rcerd
0x0000, //rcere
0x0000, //rcerf
0x0000, //rcerg
0x0000, //rcerh
0x0000, //xcera
0x0000, //xcerb
0x0000, //xcerc
0x0000, //xcerd
0x0000, //xcere
0x0000, //xcerf
0x0000, //xcerg
0x0000 //xcerh
};
void write_isr(void)
{
while(!MCBSP_xrdy(fd));
MCBSP_write16(fd, 1);
while(!MCBSP_rrdy(fd));
count = MCBSP_read16(fd);//o maximo eh 65536
}
static Uns mm_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt)
{
Int i;
Uns *ipbp = ipbuf_d[bid];
Uns off, len;
#define OFF 0 /* arbitrary */
Uns bid2;
uint16_t *addr = task->udata;
if (cnt != 2)
{
//dbg(task, "[DSP]: illegal data cnt: %d\n", cnt);
unuse_ipbuf(task, bid);
return 0;
}
off = ipbp[0]; /* offset within the mapped space */
len = ipbp[1]; /* len (in word count) */
unuse_ipbuf(task, bid);
CSL_init();//inicializa a tudo
fd = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);//ok
MCBSP_reset(fd);
MCBSP_config(fd,&configuracao);
IRQ_clear(IRQ_EVT_INT1);
IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, 0, 0);
IRQ_enable(IRQ_EVT_INT1); /* enable MCBSP1 transmit ready
interrupt */
MCBSP_start(fd, MCBSP_RCV_START | MCBSP_XMIT_START | MCBSP_SRGR_START |
MCBSP_SRGR_FRAMESYNC, 0x0010);
MCBSP_write16(fd,79);
busywait(2000000L);
while(!MCBSP_rrdy(fd));
count = MCBSP_read16(fd);//o maximo eh 65536
bid2 = get_free_ipbuf(task);
//if(bid2 == MBCMD_BID_NULL)
// return MBCMD_EID_STVBUF;
ipbp = ipbuf_d[bid2];
ipbp[0] = OFF;
ipbp[1] = count;
bksnd(task, bid2, 2);
return 0;
}
--
------------------------------------------------------------------------------
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Mastering Degree student @ PUC-RS
Electrical Engineer Faculty
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500 extension: 7696
---------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: McBSP usage inside DSP processor 2007-02-13 17:16 McBSP usage inside DSP processor Luís Vitório Cargnini @ 2007-02-15 10:29 ` Guruswamy, Senthilvadivu 2007-02-15 17:54 ` Diogo Scolari 0 siblings, 1 reply; 6+ messages in thread From: Guruswamy, Senthilvadivu @ 2007-02-15 10:29 UTC (permalink / raw) To: Luís Vitório Cargnini, OMAP, dspgateway-devel Hi, Couple of points to be noted for Mcbsp usage in DSP. 1. The Mcbsp instance say Mcbsp2 should be a module shared between ARM and DSP, or only for DSP. 2. If the Mcbsp instance is a shared one among DSP/ARM, then the base address of the Mcbsp to access from DSP would be different from that of the arm. Although the offsets of the registers like pcr, spcr, remain the same. 3. The IRQ line also would be obviously different for DSP. All these changes should be made in the arm Mcbsp driver to make it work from DSP. Regards, Senthil. -----Original Message----- From: linux-omap-open-source-bounces@linux.omap.com [mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of Luís Vitório Cargnini Sent: Tuesday, February 13, 2007 10:46 PM To: OMAP; dspgateway-devel@lists.sourceforge.net Subject: McBSP usage inside DSP processor Dears: I and my colleague are developing an application that will need to access an AD/DA, from DSP processor, we are trying the McBSP functions MCBSP_init(), read an write and so on. But we are having difficulties on execute this. Someone knows how to access an McBSP inside DSP side ? we are using DSPGateway. Something that we note is that MCBSP_init() do not exist and are always generating an error on compilation but CSL_init() works; someone could give some info about it ? here follow an code been developed by us: #define CHIP_5510PG2_2 1 #include <std.h> #include <stdint.h> #include <math.h> #include <csl.h> #include <csl_dma.h> #include <csl_emif.h> #include <csl_irq.h> #include <csl_timer.h> #include <csl_mcbsp.h> #include "tokliBIOS.h" #define MCBSP_DEV0 (0) #define MCBSP_DEV1 (1) #define MCBSP_DEV2 (2) #define BUFSIZ (0x10000/2) int count; void write_isr(void); MCBSP_Handle fd; MCBSP_Config configuracao = { /*tudo uint16*/ 0x0200, //spcr1 0x1800, //spcr2 0x0000, //rcr1 0x0020, //rcr2 0x0000, //xcr1 0x0060, //xcr2 0x3249, //srgr1 0x03FF, //srgr2 0x0040, //mcr1 0x00A0, //mcr2 0x00E0, //pcr 0x0000, //rcera 0x0000, //rcerb 0x0000, //rcerc 0x0000, //rcerd 0x0000, //rcere 0x0000, //rcerf 0x0000, //rcerg 0x0000, //rcerh 0x0000, //xcera 0x0000, //xcerb 0x0000, //xcerc 0x0000, //xcerd 0x0000, //xcere 0x0000, //xcerf 0x0000, //xcerg 0x0000 //xcerh }; void write_isr(void) { while(!MCBSP_xrdy(fd)); MCBSP_write16(fd, 1); while(!MCBSP_rrdy(fd)); count = MCBSP_read16(fd);//o maximo eh 65536 } static Uns mm_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt) { Int i; Uns *ipbp = ipbuf_d[bid]; Uns off, len; #define OFF 0 /* arbitrary */ Uns bid2; uint16_t *addr = task->udata; if (cnt != 2) { //dbg(task, "[DSP]: illegal data cnt: %d\n", cnt); unuse_ipbuf(task, bid); return 0; } off = ipbp[0]; /* offset within the mapped space */ len = ipbp[1]; /* len (in word count) */ unuse_ipbuf(task, bid); CSL_init();//inicializa a tudo fd = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);//ok MCBSP_reset(fd); MCBSP_config(fd,&configuracao); IRQ_clear(IRQ_EVT_INT1); IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, 0, 0); IRQ_enable(IRQ_EVT_INT1); /* enable MCBSP1 transmit ready interrupt */ MCBSP_start(fd, MCBSP_RCV_START | MCBSP_XMIT_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 0x0010); MCBSP_write16(fd,79); busywait(2000000L); while(!MCBSP_rrdy(fd)); count = MCBSP_read16(fd);//o maximo eh 65536 bid2 = get_free_ipbuf(task); //if(bid2 == MBCMD_BID_NULL) // return MBCMD_EID_STVBUF; ipbp = ipbuf_d[bid2]; ipbp[0] = OFF; ipbp[1] = count; bksnd(task, bid2, 2); return 0; } -- ------------------------------------------------------------------------------ Thanks && Regards Msc. Bsc. Luís Vitório Cargnini IEEE Member Mastering Degree student @ PUC-RS Electrical Engineer Faculty Ipiranga Avenue, 6681 - Building 30 P.O. Box: 90619-900 - Porto Alegre/RS Phone: +55 51 3320 3500 extension: 7696 --------------------------------------------------------------------------------- _______________________________________________ Linux-omap-open-source mailing list Linux-omap-open-source@linux.omap.com http://linux.omap.com/mailman/listinfo/linux-omap-open-source ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: McBSP usage inside DSP processor 2007-02-15 10:29 ` Guruswamy, Senthilvadivu @ 2007-02-15 17:54 ` Diogo Scolari 2007-02-15 18:15 ` Guruswamy, Senthilvadivu 0 siblings, 1 reply; 6+ messages in thread From: Diogo Scolari @ 2007-02-15 17:54 UTC (permalink / raw) To: Guruswamy, Senthilvadivu, OMAP, dspgateway-devel Hi Senthil Thank you for your reply. We would like to use the McBSP1, which is used by DSP only. We think we don`t need to modifie the ARM driver source code. Is this correct? Or we need really create an application that will run on ARM side to pool the McBSP and repass the colected data to DSP side? Thanks Diogo --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> escreveu: > Hi, > > > Couple of points to be noted for Mcbsp usage in DSP. > 1. The Mcbsp instance say Mcbsp2 should be a > module shared between ARM and DSP, or only for DSP. > 2. If the Mcbsp instance is a shared one among > DSP/ARM, then the base address of the Mcbsp to > access from DSP would be different from that of the > arm. Although the offsets of the registers like > pcr, spcr, remain the same. > 3. The IRQ line also would be obviously different > for DSP. > > All these changes should be made in the arm Mcbsp > driver to make it work from DSP. > > Regards, > Senthil. > > -----Original Message----- > From: linux-omap-open-source-bounces@linux.omap.com > [mailto:linux-omap-open-source-bounces@linux.omap.com] > On Behalf Of Luís Vitório Cargnini > Sent: Tuesday, February 13, 2007 10:46 PM > To: OMAP; dspgateway-devel@lists.sourceforge.net > Subject: McBSP usage inside DSP processor > > Dears: > I and my colleague are developing an application > that will need to access an > AD/DA, from DSP processor, we are trying the McBSP > functions MCBSP_init(), > read an write and so on. But we are having > difficulties on execute this. > Someone knows how to access an McBSP inside DSP side > ? > we are using DSPGateway. > Something that we note is that MCBSP_init() do not > exist and are always > generating an error on compilation but CSL_init() > works; someone could give > some info about it ? > > here follow an code been developed by us: > #define CHIP_5510PG2_2 1 > > #include <std.h> > #include <stdint.h> > #include <math.h> > #include <csl.h> > #include <csl_dma.h> > #include <csl_emif.h> > #include <csl_irq.h> > #include <csl_timer.h> > #include <csl_mcbsp.h> > > #include "tokliBIOS.h" > > #define MCBSP_DEV0 (0) > #define MCBSP_DEV1 (1) > #define MCBSP_DEV2 (2) > > #define BUFSIZ (0x10000/2) > > > int count; > void write_isr(void); > > MCBSP_Handle fd; > MCBSP_Config configuracao = { /*tudo uint16*/ > 0x0200, //spcr1 > 0x1800, //spcr2 > 0x0000, //rcr1 > 0x0020, //rcr2 > 0x0000, //xcr1 > 0x0060, //xcr2 > 0x3249, //srgr1 > 0x03FF, //srgr2 > 0x0040, //mcr1 > 0x00A0, //mcr2 > 0x00E0, //pcr > 0x0000, //rcera > 0x0000, //rcerb > 0x0000, //rcerc > 0x0000, //rcerd > 0x0000, //rcere > 0x0000, //rcerf > 0x0000, //rcerg > 0x0000, //rcerh > 0x0000, //xcera > 0x0000, //xcerb > 0x0000, //xcerc > 0x0000, //xcerd > 0x0000, //xcere > 0x0000, //xcerf > 0x0000, //xcerg > 0x0000 //xcerh > }; > > void write_isr(void) > { > while(!MCBSP_xrdy(fd)); > MCBSP_write16(fd, 1); > while(!MCBSP_rrdy(fd)); > count = MCBSP_read16(fd);//o maximo eh 65536 > } > > static Uns mm_rcv_bksnd(struct dsptask *task, Uns > bid, Uns cnt) > { > Int i; > Uns *ipbp = ipbuf_d[bid]; > Uns off, len; > #define OFF 0 /* arbitrary */ > Uns bid2; > uint16_t *addr = task->udata; > > if (cnt != 2) > { > //dbg(task, "[DSP]: illegal data cnt: %d\n", > cnt); > unuse_ipbuf(task, bid); > return 0; > } > > off = ipbp[0]; /* offset within the mapped > space */ > len = ipbp[1]; /* len (in word count) */ > unuse_ipbuf(task, bid); > > CSL_init();//inicializa a tudo > fd = MCBSP_open(MCBSP_DEV1, > MCBSP_OPEN_RESET);//ok > MCBSP_reset(fd); > MCBSP_config(fd,&configuracao); > IRQ_clear(IRQ_EVT_INT1); > IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, > 0, 0); > IRQ_enable(IRQ_EVT_INT1); /* enable MCBSP1 > transmit ready > interrupt */ > MCBSP_start(fd, MCBSP_RCV_START | > MCBSP_XMIT_START | MCBSP_SRGR_START | > MCBSP_SRGR_FRAMESYNC, 0x0010); > > MCBSP_write16(fd,79); > busywait(2000000L); > > while(!MCBSP_rrdy(fd)); > count = MCBSP_read16(fd);//o maximo eh 65536 > bid2 = get_free_ipbuf(task); > //if(bid2 == MBCMD_BID_NULL) > // return MBCMD_EID_STVBUF; > ipbp = ipbuf_d[bid2]; > ipbp[0] = OFF; > ipbp[1] = count; > bksnd(task, bid2, 2); > > return 0; > } > > -- > ------------------------------------------------------------------------------ > Thanks && Regards > Msc. Bsc. Luís Vitório Cargnini > IEEE Member > Mastering Degree student @ PUC-RS > Electrical Engineer Faculty > Ipiranga Avenue, 6681 - Building 30 > P.O. Box: 90619-900 - Porto Alegre/RS > Phone: +55 51 3320 3500 extension: 7696 > --------------------------------------------------------------------------------- > _______________________________________________ > Linux-omap-open-source mailing list > Linux-omap-open-source@linux.omap.com > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > _______________________________________________ > Linux-omap-open-source mailing list > Linux-omap-open-source@linux.omap.com > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: McBSP usage inside DSP processor 2007-02-15 17:54 ` Diogo Scolari @ 2007-02-15 18:15 ` Guruswamy, Senthilvadivu 2007-02-15 19:02 ` Diogo Scolari 0 siblings, 1 reply; 6+ messages in thread From: Guruswamy, Senthilvadivu @ 2007-02-15 18:15 UTC (permalink / raw) To: Diogo Scolari, Luís" "Vitório" Cargnini, OMAP, dspgateway-devel IF Mcbsp1 is accessible only by DSP, then it is necessary to go for DSP side Mcbsp driver, which would be copy of the arm driver except for the register addresses. If Mcbsp1 is a shared peripheral among ARM and DSP, then slight changes in the Arm Mcbsp driver should be enough. In this case, apart from the register offsets, the buffer used by the driver should also be in Arm/Dsp shared space. Regards, Senthil. -----Original Message----- From: Diogo Scolari [mailto:diogoscolari@yahoo.com.br] Sent: Thursday, February 15, 2007 11:25 PM To: Guruswamy, Senthilvadivu; Luís" "Vitório" Cargnini; OMAP; dspgateway-devel@lists.sourceforge.net Subject: RE: McBSP usage inside DSP processor Hi Senthil Thank you for your reply. We would like to use the McBSP1, which is used by DSP only. We think we don`t need to modifie the ARM driver source code. Is this correct? Or we need really create an application that will run on ARM side to pool the McBSP and repass the colected data to DSP side? Thanks Diogo --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> escreveu: > Hi, > > > Couple of points to be noted for Mcbsp usage in DSP. > 1. The Mcbsp instance say Mcbsp2 should be a > module shared between ARM and DSP, or only for DSP. > 2. If the Mcbsp instance is a shared one among > DSP/ARM, then the base address of the Mcbsp to > access from DSP would be different from that of the > arm. Although the offsets of the registers like > pcr, spcr, remain the same. > 3. The IRQ line also would be obviously different > for DSP. > > All these changes should be made in the arm Mcbsp > driver to make it work from DSP. > > Regards, > Senthil. > > -----Original Message----- > From: linux-omap-open-source-bounces@linux.omap.com > [mailto:linux-omap-open-source-bounces@linux.omap.com] > On Behalf Of Luís Vitório Cargnini > Sent: Tuesday, February 13, 2007 10:46 PM > To: OMAP; dspgateway-devel@lists.sourceforge.net > Subject: McBSP usage inside DSP processor > > Dears: > I and my colleague are developing an application > that will need to access an > AD/DA, from DSP processor, we are trying the McBSP > functions MCBSP_init(), > read an write and so on. But we are having > difficulties on execute this. > Someone knows how to access an McBSP inside DSP side > ? > we are using DSPGateway. > Something that we note is that MCBSP_init() do not > exist and are always > generating an error on compilation but CSL_init() > works; someone could give > some info about it ? > > here follow an code been developed by us: > #define CHIP_5510PG2_2 1 > > #include <std.h> > #include <stdint.h> > #include <math.h> > #include <csl.h> > #include <csl_dma.h> > #include <csl_emif.h> > #include <csl_irq.h> > #include <csl_timer.h> > #include <csl_mcbsp.h> > > #include "tokliBIOS.h" > > #define MCBSP_DEV0 (0) > #define MCBSP_DEV1 (1) > #define MCBSP_DEV2 (2) > > #define BUFSIZ (0x10000/2) > > > int count; > void write_isr(void); > > MCBSP_Handle fd; > MCBSP_Config configuracao = { /*tudo uint16*/ > 0x0200, //spcr1 > 0x1800, //spcr2 > 0x0000, //rcr1 > 0x0020, //rcr2 > 0x0000, //xcr1 > 0x0060, //xcr2 > 0x3249, //srgr1 > 0x03FF, //srgr2 > 0x0040, //mcr1 > 0x00A0, //mcr2 > 0x00E0, //pcr > 0x0000, //rcera > 0x0000, //rcerb > 0x0000, //rcerc > 0x0000, //rcerd > 0x0000, //rcere > 0x0000, //rcerf > 0x0000, //rcerg > 0x0000, //rcerh > 0x0000, //xcera > 0x0000, //xcerb > 0x0000, //xcerc > 0x0000, //xcerd > 0x0000, //xcere > 0x0000, //xcerf > 0x0000, //xcerg > 0x0000 //xcerh > }; > > void write_isr(void) > { > while(!MCBSP_xrdy(fd)); > MCBSP_write16(fd, 1); > while(!MCBSP_rrdy(fd)); > count = MCBSP_read16(fd);//o maximo eh 65536 > } > > static Uns mm_rcv_bksnd(struct dsptask *task, Uns > bid, Uns cnt) > { > Int i; > Uns *ipbp = ipbuf_d[bid]; > Uns off, len; > #define OFF 0 /* arbitrary */ > Uns bid2; > uint16_t *addr = task->udata; > > if (cnt != 2) > { > //dbg(task, "[DSP]: illegal data cnt: %d\n", > cnt); > unuse_ipbuf(task, bid); > return 0; > } > > off = ipbp[0]; /* offset within the mapped > space */ > len = ipbp[1]; /* len (in word count) */ > unuse_ipbuf(task, bid); > > CSL_init();//inicializa a tudo > fd = MCBSP_open(MCBSP_DEV1, > MCBSP_OPEN_RESET);//ok > MCBSP_reset(fd); > MCBSP_config(fd,&configuracao); > IRQ_clear(IRQ_EVT_INT1); > IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, > 0, 0); > IRQ_enable(IRQ_EVT_INT1); /* enable MCBSP1 > transmit ready > interrupt */ > MCBSP_start(fd, MCBSP_RCV_START | > MCBSP_XMIT_START | MCBSP_SRGR_START | > MCBSP_SRGR_FRAMESYNC, 0x0010); > > MCBSP_write16(fd,79); > busywait(2000000L); > > while(!MCBSP_rrdy(fd)); > count = MCBSP_read16(fd);//o maximo eh 65536 > bid2 = get_free_ipbuf(task); > //if(bid2 == MBCMD_BID_NULL) > // return MBCMD_EID_STVBUF; > ipbp = ipbuf_d[bid2]; > ipbp[0] = OFF; > ipbp[1] = count; > bksnd(task, bid2, 2); > > return 0; > } > > -- > ------------------------------------------------------------------------------ > Thanks && Regards > Msc. Bsc. Luís Vitório Cargnini > IEEE Member > Mastering Degree student @ PUC-RS > Electrical Engineer Faculty > Ipiranga Avenue, 6681 - Building 30 > P.O. Box: 90619-900 - Porto Alegre/RS > Phone: +55 51 3320 3500 extension: 7696 > --------------------------------------------------------------------------------- > _______________________________________________ > Linux-omap-open-source mailing list > Linux-omap-open-source@linux.omap.com > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > _______________________________________________ > Linux-omap-open-source mailing list > Linux-omap-open-source@linux.omap.com > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: McBSP usage inside DSP processor 2007-02-15 18:15 ` Guruswamy, Senthilvadivu @ 2007-02-15 19:02 ` Diogo Scolari 2007-02-15 19:07 ` Guruswamy, Senthilvadivu 0 siblings, 1 reply; 6+ messages in thread From: Diogo Scolari @ 2007-02-15 19:02 UTC (permalink / raw) To: Guruswamy, Senthilvadivu; +Cc: dspgateway-devel, Linux-omap-open-source Ok Senthil What do you mean about the McBSP DSP driver? We are using the C55 compiler and the CSL includes from Texas, remenbering we are using the DSPGateway, not the DSP/BIOS Link. We want to know if there is an how-to example to based on. Thank you. Diogo --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> escreveu: > IF Mcbsp1 is accessible only by DSP, then it is > necessary to go for DSP side Mcbsp driver, which > would be copy of the arm driver except for the > register addresses. > > If Mcbsp1 is a shared peripheral among ARM and DSP, > then slight changes in the Arm Mcbsp driver should > be enough. In this case, apart from the register > offsets, the buffer used by the driver should also > be in Arm/Dsp shared space. > > Regards, > Senthil. > > -----Original Message----- > From: Diogo Scolari > [mailto:diogoscolari@yahoo.com.br] > Sent: Thursday, February 15, 2007 11:25 PM > To: Guruswamy, Senthilvadivu; Luís" "Vitório" > Cargnini; OMAP; > dspgateway-devel@lists.sourceforge.net > Subject: RE: McBSP usage inside DSP processor > > Hi Senthil > > Thank you for your reply. > > We would like to use the McBSP1, which is used by > DSP > only. We think we don`t need to modifie the ARM > driver > source code. Is this correct? Or we need really > create > an application that will run on ARM side to pool the > McBSP and repass the colected data to DSP side? > > Thanks > > Diogo > > --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> > escreveu: > > > Hi, > > > > > > Couple of points to be noted for Mcbsp usage in > DSP. > > 1. The Mcbsp instance say Mcbsp2 should be a > > module shared between ARM and DSP, or only for > DSP. > > 2. If the Mcbsp instance is a shared one among > > DSP/ARM, then the base address of the Mcbsp to > > access from DSP would be different from that of > the > > arm. Although the offsets of the registers like > > pcr, spcr, remain the same. > > 3. The IRQ line also would be obviously > different > > for DSP. > > > > All these changes should be made in the arm Mcbsp > > driver to make it work from DSP. > > > > Regards, > > Senthil. > > > > -----Original Message----- > > From: > linux-omap-open-source-bounces@linux.omap.com > > > [mailto:linux-omap-open-source-bounces@linux.omap.com] > > On Behalf Of Luís Vitório Cargnini > > Sent: Tuesday, February 13, 2007 10:46 PM > > To: OMAP; dspgateway-devel@lists.sourceforge.net > > Subject: McBSP usage inside DSP processor > > > > Dears: > > I and my colleague are developing an application > > that will need to access an > > AD/DA, from DSP processor, we are trying the McBSP > > functions MCBSP_init(), > > read an write and so on. But we are having > > difficulties on execute this. > > Someone knows how to access an McBSP inside DSP > side > > ? > > we are using DSPGateway. > > Something that we note is that MCBSP_init() do not > > exist and are always > > generating an error on compilation but CSL_init() > > works; someone could give > > some info about it ? > > > > here follow an code been developed by us: > > #define CHIP_5510PG2_2 1 > > > > #include <std.h> > > #include <stdint.h> > > #include <math.h> > > #include <csl.h> > > #include <csl_dma.h> > > #include <csl_emif.h> > > #include <csl_irq.h> > > #include <csl_timer.h> > > #include <csl_mcbsp.h> > > > > #include "tokliBIOS.h" > > > > #define MCBSP_DEV0 (0) > > #define MCBSP_DEV1 (1) > > #define MCBSP_DEV2 (2) > > > > #define BUFSIZ (0x10000/2) > > > > > > int count; > > void write_isr(void); > > > > MCBSP_Handle fd; > > MCBSP_Config configuracao = { /*tudo uint16*/ > > 0x0200, //spcr1 > > 0x1800, //spcr2 > > 0x0000, //rcr1 > > 0x0020, //rcr2 > > 0x0000, //xcr1 > > 0x0060, //xcr2 > > 0x3249, //srgr1 > > 0x03FF, //srgr2 > > 0x0040, //mcr1 > > 0x00A0, //mcr2 > > 0x00E0, //pcr > > 0x0000, //rcera > > 0x0000, //rcerb > > 0x0000, //rcerc > > 0x0000, //rcerd > > 0x0000, //rcere > > 0x0000, //rcerf > > 0x0000, //rcerg > > 0x0000, //rcerh > > 0x0000, //xcera > > 0x0000, //xcerb > > 0x0000, //xcerc > > 0x0000, //xcerd > > 0x0000, //xcere > > 0x0000, //xcerf > > 0x0000, //xcerg > > 0x0000 //xcerh > > }; > > > > void write_isr(void) > > { > > while(!MCBSP_xrdy(fd)); > > MCBSP_write16(fd, 1); > > while(!MCBSP_rrdy(fd)); > > count = MCBSP_read16(fd);//o maximo eh 65536 > > } > > > > static Uns mm_rcv_bksnd(struct dsptask *task, Uns > > bid, Uns cnt) > > { > > Int i; > > Uns *ipbp = ipbuf_d[bid]; > > Uns off, len; > > #define OFF 0 /* arbitrary */ > > Uns bid2; > > uint16_t *addr = task->udata; > > > > if (cnt != 2) > > { > > //dbg(task, "[DSP]: illegal data cnt: > %d\n", > > cnt); > > unuse_ipbuf(task, bid); > > return 0; > > } > > > > off = ipbp[0]; /* offset within the mapped > > space */ > > len = ipbp[1]; /* len (in word count) */ > > unuse_ipbuf(task, bid); > > > > CSL_init();//inicializa a tudo > > fd = MCBSP_open(MCBSP_DEV1, > > MCBSP_OPEN_RESET);//ok > > MCBSP_reset(fd); > > MCBSP_config(fd,&configuracao); > > IRQ_clear(IRQ_EVT_INT1); > > IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, > > 0, 0); > > IRQ_enable(IRQ_EVT_INT1); /* enable > MCBSP1 > > transmit ready > > interrupt */ > > MCBSP_start(fd, MCBSP_RCV_START | > > MCBSP_XMIT_START | MCBSP_SRGR_START | > > MCBSP_SRGR_FRAMESYNC, 0x0010); > > > > MCBSP_write16(fd,79); > > busywait(2000000L); > > > === message truncated === __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: McBSP usage inside DSP processor 2007-02-15 19:02 ` Diogo Scolari @ 2007-02-15 19:07 ` Guruswamy, Senthilvadivu 0 siblings, 0 replies; 6+ messages in thread From: Guruswamy, Senthilvadivu @ 2007-02-15 19:07 UTC (permalink / raw) To: Diogo Scolari; +Cc: dspgateway-devel, Linux-omap-open-source I really don't know if there is any how to example in your package. I meant the Mcbsp accessible code written on DSP side. If you are using the CSL, then macros for Mcbsp access also should be available. If you are able to find the CSL APIs/macros for mcbsp2 on the DSP side, mcbsp1 also shall use the similar APIs. -----Original Message----- From: Diogo Scolari [mailto:diogoscolari@yahoo.com.br] Sent: Friday, February 16, 2007 12:33 AM To: Guruswamy, Senthilvadivu Cc: lvcargnini@ieee.org; Linux-omap-open-source@linux.omap.com; dspgateway-devel@lists.sourceforge.net Subject: RE: McBSP usage inside DSP processor Ok Senthil What do you mean about the McBSP DSP driver? We are using the C55 compiler and the CSL includes from Texas, remenbering we are using the DSPGateway, not the DSP/BIOS Link. We want to know if there is an how-to example to based on. Thank you. Diogo --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> escreveu: > IF Mcbsp1 is accessible only by DSP, then it is > necessary to go for DSP side Mcbsp driver, which > would be copy of the arm driver except for the > register addresses. > > If Mcbsp1 is a shared peripheral among ARM and DSP, > then slight changes in the Arm Mcbsp driver should > be enough. In this case, apart from the register > offsets, the buffer used by the driver should also > be in Arm/Dsp shared space. > > Regards, > Senthil. > > -----Original Message----- > From: Diogo Scolari > [mailto:diogoscolari@yahoo.com.br] > Sent: Thursday, February 15, 2007 11:25 PM > To: Guruswamy, Senthilvadivu; Luís" "Vitório" > Cargnini; OMAP; > dspgateway-devel@lists.sourceforge.net > Subject: RE: McBSP usage inside DSP processor > > Hi Senthil > > Thank you for your reply. > > We would like to use the McBSP1, which is used by > DSP > only. We think we don`t need to modifie the ARM > driver > source code. Is this correct? Or we need really > create > an application that will run on ARM side to pool the > McBSP and repass the colected data to DSP side? > > Thanks > > Diogo > > --- "Guruswamy, Senthilvadivu" <svadivu@ti.com> > escreveu: > > > Hi, > > > > > > Couple of points to be noted for Mcbsp usage in > DSP. > > 1. The Mcbsp instance say Mcbsp2 should be a > > module shared between ARM and DSP, or only for > DSP. > > 2. If the Mcbsp instance is a shared one among > > DSP/ARM, then the base address of the Mcbsp to > > access from DSP would be different from that of > the > > arm. Although the offsets of the registers like > > pcr, spcr, remain the same. > > 3. The IRQ line also would be obviously > different > > for DSP. > > > > All these changes should be made in the arm Mcbsp > > driver to make it work from DSP. > > > > Regards, > > Senthil. > > > > -----Original Message----- > > From: > linux-omap-open-source-bounces@linux.omap.com > > > [mailto:linux-omap-open-source-bounces@linux.omap.com] > > On Behalf Of Luís Vitório Cargnini > > Sent: Tuesday, February 13, 2007 10:46 PM > > To: OMAP; dspgateway-devel@lists.sourceforge.net > > Subject: McBSP usage inside DSP processor > > > > Dears: > > I and my colleague are developing an application > > that will need to access an > > AD/DA, from DSP processor, we are trying the McBSP > > functions MCBSP_init(), > > read an write and so on. But we are having > > difficulties on execute this. > > Someone knows how to access an McBSP inside DSP > side > > ? > > we are using DSPGateway. > > Something that we note is that MCBSP_init() do not > > exist and are always > > generating an error on compilation but CSL_init() > > works; someone could give > > some info about it ? > > > > here follow an code been developed by us: > > #define CHIP_5510PG2_2 1 > > > > #include <std.h> > > #include <stdint.h> > > #include <math.h> > > #include <csl.h> > > #include <csl_dma.h> > > #include <csl_emif.h> > > #include <csl_irq.h> > > #include <csl_timer.h> > > #include <csl_mcbsp.h> > > > > #include "tokliBIOS.h" > > > > #define MCBSP_DEV0 (0) > > #define MCBSP_DEV1 (1) > > #define MCBSP_DEV2 (2) > > > > #define BUFSIZ (0x10000/2) > > > > > > int count; > > void write_isr(void); > > > > MCBSP_Handle fd; > > MCBSP_Config configuracao = { /*tudo uint16*/ > > 0x0200, //spcr1 > > 0x1800, //spcr2 > > 0x0000, //rcr1 > > 0x0020, //rcr2 > > 0x0000, //xcr1 > > 0x0060, //xcr2 > > 0x3249, //srgr1 > > 0x03FF, //srgr2 > > 0x0040, //mcr1 > > 0x00A0, //mcr2 > > 0x00E0, //pcr > > 0x0000, //rcera > > 0x0000, //rcerb > > 0x0000, //rcerc > > 0x0000, //rcerd > > 0x0000, //rcere > > 0x0000, //rcerf > > 0x0000, //rcerg > > 0x0000, //rcerh > > 0x0000, //xcera > > 0x0000, //xcerb > > 0x0000, //xcerc > > 0x0000, //xcerd > > 0x0000, //xcere > > 0x0000, //xcerf > > 0x0000, //xcerg > > 0x0000 //xcerh > > }; > > > > void write_isr(void) > > { > > while(!MCBSP_xrdy(fd)); > > MCBSP_write16(fd, 1); > > while(!MCBSP_rrdy(fd)); > > count = MCBSP_read16(fd);//o maximo eh 65536 > > } > > > > static Uns mm_rcv_bksnd(struct dsptask *task, Uns > > bid, Uns cnt) > > { > > Int i; > > Uns *ipbp = ipbuf_d[bid]; > > Uns off, len; > > #define OFF 0 /* arbitrary */ > > Uns bid2; > > uint16_t *addr = task->udata; > > > > if (cnt != 2) > > { > > //dbg(task, "[DSP]: illegal data cnt: > %d\n", > > cnt); > > unuse_ipbuf(task, bid); > > return 0; > > } > > > > off = ipbp[0]; /* offset within the mapped > > space */ > > len = ipbp[1]; /* len (in word count) */ > > unuse_ipbuf(task, bid); > > > > CSL_init();//inicializa a tudo > > fd = MCBSP_open(MCBSP_DEV1, > > MCBSP_OPEN_RESET);//ok > > MCBSP_reset(fd); > > MCBSP_config(fd,&configuracao); > > IRQ_clear(IRQ_EVT_INT1); > > IRQ_configArgs(IRQ_EVT_INT1, write_isr, 0, > > 0, 0); > > IRQ_enable(IRQ_EVT_INT1); /* enable > MCBSP1 > > transmit ready > > interrupt */ > > MCBSP_start(fd, MCBSP_RCV_START | > > MCBSP_XMIT_START | MCBSP_SRGR_START | > > MCBSP_SRGR_FRAMESYNC, 0x0010); > > > > MCBSP_write16(fd,79); > > busywait(2000000L); > > > === message truncated === __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-02-15 19:07 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-02-13 17:16 McBSP usage inside DSP processor Luís Vitório Cargnini 2007-02-15 10:29 ` Guruswamy, Senthilvadivu 2007-02-15 17:54 ` Diogo Scolari 2007-02-15 18:15 ` Guruswamy, Senthilvadivu 2007-02-15 19:02 ` Diogo Scolari 2007-02-15 19:07 ` Guruswamy, Senthilvadivu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.