Skip to content

Commit

Permalink
Merge pull request #10 from robbep/master
Browse files Browse the repository at this point in the history
Fix problem with semaphore
  • Loading branch information
robbep committed Feb 17, 2015
2 parents d7edc00 + 3579e06 commit ce5f722
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 557 deletions.
2 changes: 1 addition & 1 deletion Driver/src/AltSpecsV2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ static int specs_dev_ioctl(struct inode *inode, struct file *file,

do {
iowrite32(0x0000, pReset);
printk(KERN_INFO DRV_NAME " Reset FIFO emssion %d \n",ioctl_param);
printk(KERN_INFO DRV_NAME " Reset FIFO emssion %lu \n",ioctl_param);

}while (ioread32 (pReset) != 0 );

Expand Down
2 changes: 1 addition & 1 deletion Driver/src/AltSpecsV2.mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ __attribute__((section(".modinfo"))) =

MODULE_ALIAS("pci:v00001172d00000005sv*sd*bc*sc*i*");

MODULE_INFO(srcversion, "0BA7EA2B3DF1E7BDEC7BEE4");
MODULE_INFO(srcversion, "94CD4F6A3540D097DF5B459");

static const struct rheldata _rheldata __used
__attribute__((section(".rheldata"))) = {
Expand Down
183 changes: 6 additions & 177 deletions Libraries/Specs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ void SpecsmasterEnableInt (SPECSMASTER * pSpecsmaster, U32 numIt)
return;
}
void SpecsmasterInit(SPECSMASTER * pSpecsmaster,
UINT MasterID,
HANDLE hdle)
UINT MasterID,
HANDLE hdle)
{

pSpecsmaster->hdle = hdle;
Expand Down Expand Up @@ -400,21 +400,7 @@ RETURN_CODE I2cBufferRead(
// SpecsmasterEnableInt ( pSpecsslave-> pSpecsmaster,1);//MTQ
/* rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecs,Taille);*/
if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}

Expand Down Expand Up @@ -477,21 +463,6 @@ RETURN_CODE I2cBufferReadwithSsAdd(
/* rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecs,Taille);*/

if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down Expand Up @@ -549,21 +520,6 @@ RETURN_CODE I2cBufferWrite(
}
/* rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecs,Taille);*/
if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down Expand Up @@ -635,21 +591,6 @@ RETURN_CODE I2cEEPROMWrite(
j=i;
}

if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down Expand Up @@ -689,21 +630,7 @@ RETURN_CODE JtagBufTDIWrite(
BufSpecslocal[1]=BufSpecslocal[1] | (OutSelect & 0xF);
rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecslocal,Taille);
if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}

Expand Down Expand Up @@ -744,21 +671,7 @@ RETURN_CODE JtagBufTMSWrite(
rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecslocal,Taille);
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}

Expand Down Expand Up @@ -786,20 +699,6 @@ RETURN_CODE ParallelWrite(
rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecslocal,3);
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < 3)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down Expand Up @@ -828,20 +727,6 @@ RETURN_CODE ParallelRead(
BufSpecslocal,3);
SpecsmasterEnableInt ( pSpecsslave-> pSpecsmaster,1);//MTQ
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < 3)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down Expand Up @@ -888,21 +773,6 @@ RETURN_CODE ParallelDMAWrite(
rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecslocal,Taille);
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
i=0;
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < Taille)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}
Expand Down Expand Up @@ -950,20 +820,6 @@ RETURN_CODE ParallelDMARead(
BufSpecslocal,3);
SpecsmasterEnableInt ( pSpecsslave-> pSpecsmaster,1);//MTQ
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < 3)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}
Expand Down Expand Up @@ -991,20 +847,7 @@ RETURN_CODE RegisterWrite(
rc = SpecsmasterEmitterFIFOWrite(pSpecsslave->pSpecsmaster,
BufSpecslocal,3);
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);
if (Spdemo)
{
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < 3)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}

return rc;
}

Expand Down Expand Up @@ -1034,20 +877,6 @@ RETURN_CODE RegisterRead(
SpecsmasterEnableInt ( pSpecsslave-> pSpecsmaster,1);//MTQ
SpecsmasterStartWrite ( pSpecsslave->pSpecsmaster);

if (Spdemo)
{
while (i < BufSpecsLengthMax)
{
BufSpecs[i] = 0;
i++;
}
i=0;
while (i < 3)
{
BufSpecs[i] = BufSpecslocal[i];
i++;
}
}
return rc;
}

Expand Down
26 changes: 1 addition & 25 deletions Libraries/Specs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,6 @@ extern "C" {
SPECS_API U32 BufSpecs[BufSpecsLengthMax];
SPECS_API PLX_NOTIFY_OBJECT InterTab[MAX_CARD];

#ifdef SPECS_EXPORTS
/*
SPECS_API BOOLEAN Spdemo=FALSE;
SPECS_API HANDLE EtatDev[MAX_CARD]={(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,
(HANDLE)-1,(HANDLE)-1};
SPECS_API U32 EtatDevCount[MAX_CARD]={0,0,0,0,0,0};
*/
SPECS_API BOOLEAN Spdemo=FALSE;
SPECS_API HANDLE EtatDev[NB_MASTER]={(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,
(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,
(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,(HANDLE)-1,
};
SPECS_API U32 EtatDevCount[NB_MASTER]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
#else
/*MTQ
SPECS_API BOOLEAN Spdemo;
SPECS_API HANDLE EtatDev[MAX_CARD];
SPECS_API U32 EtatDevCount[MAX_CARD];
*/
SPECS_API BOOLEAN Spdemo;
SPECS_API HANDLE EtatDev[NB_MASTER];
SPECS_API U32 EtatDevCount[NB_MASTER];
#endif

#define JTAG_byteIndex(n) ((n)+3-2*((n)%4))
#define JTAG_calcNBytes(nBits) ((nBits - 1)/8 + 1)
#define JTAG_bitsLeft(nBits) ((nBits - 1)%8 + 1)
Expand Down Expand Up @@ -132,7 +108,7 @@ SPECS_API void SpecsmasterInit(SPECSMASTER * pSpecsmaster,
UINT MasterID,
HANDLE hdle);

SPECS_API void SpecsmasterReset(SPECSMASTER * pSpecsmaster);
SPECS_API void SpecsmasterReset(SPECSMASTER * pSpecsmaster);

SPECS_API RETURN_CODE SpecsmasterEnd(SPECSMASTER * pSpecsmaster);

Expand Down
Loading

0 comments on commit ce5f722

Please sign in to comment.