Mask off high order bits when setting DPRAM address lines.

This commit is contained in:
Ron Sluiter
2004-10-07 15:26:40 +00:00
parent d3fcda260d
commit 9edf5d0675
+18 -12
View File
@@ -2,9 +2,9 @@
FILENAME... drvPmac.cc
USAGE... Driver level support for Delta Tau PMAC model.
Version: $Revision: 1.4 $
Version: $Revision: 1.5 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2004-09-27 20:09:48 $
Last Modified: $Date: 2004-10-07 15:26:40 $
*/
/*
@@ -35,10 +35,11 @@ Last Modified: $Date: 2004-09-27 20:09:48 $
* Verified with firmware:
*
* Modification Log:
* -----------------
* ----------------------------------------------------------------------------
* .00 04/17/04 rls - Copied from drvOms.cc
* .01 09/21/04 rls - support for 32axes/controller.
* .02 09/27/04 rls - convert "Mbox_addrs" from logical to physical address.
* .03 10/07/04 rls - mask off high order bits when setting DPRAM address lines.
*/
#include <vxLib.h>
@@ -167,8 +168,8 @@ static long report(int level)
{
for (card = 0; card < Pmac_num_cards; card++)
if (motor_state[card])
printf(" Pmac VME8/44 motor card %d @ 0x%X, id: %s \n", card,
(uint_t) motor_state[card]->localaddr,
printf(" Pmac VME8/44 motor card %d @ 0x%X, id: %s \n",
card, (uint_t) motor_state[card]->localaddr,
motor_state[card]->ident);
}
return (0);
@@ -207,8 +208,8 @@ static int set_status(int card, int signal)
send_mess(card, "?", Pmac_axis[signal]);
recv_mess(card, buff, 1);
rtn_state = sscanf(buff, "%4hx%4hx%4hx", &motorstat.word1.All, &motorstat.word2.All,
&motorstat.word3.All);
rtn_state = sscanf(buff, "%4hx%4hx%4hx", &motorstat.word1.All,
&motorstat.word2.All, &motorstat.word3.All);
status.Bits.RA_DONE = (motorstat.word3.Bits.in_position == YES) ? 1 : 0;
status.Bits.EA_POSITION = (motorstat.word1.Bits.amp_enabled == YES) ? 1 : 0;
@@ -456,7 +457,8 @@ static int recv_mess(int card, char *com, int amount)
else
{
stptr->All = 0;
errlogPrintf("%s(%d): ERROR = 0x%X\n", __FILE__, __LINE__, (unsigned int) control);
errlogPrintf("%s(%d): ERROR = 0x%X\n", __FILE__, __LINE__,
(unsigned int) control);
epicsThreadSleep(flush_delay);
control = stptr->Bits.cntrl_char;
}
@@ -509,7 +511,8 @@ static int recv_mess(int card, char *com, int amount)
else
{
stptr->All = 0;
errlogPrintf("%s(%d): ERROR = 0x%X\n", __FILE__, __LINE__, (unsigned int) control);
errlogPrintf("%s(%d): ERROR = 0x%X\n", __FILE__, __LINE__,
(unsigned int) control);
return(-1);
}
}
@@ -666,8 +669,9 @@ int PmacSetup(int num_cards, /* maximum number of cards in rack */
if (PROBE_SUCCESS(status))
{
char A19A14; /* Select VME A19-A14 for DPRAM. */
status = devRegisterAddress(__FILE__, Pmac_ADDRS_TYPE, (size_t)
Mbox_addrs, 122, (volatile void **) &localaddr);
Mbox_addrs, 122, (volatile void **) &localaddr);
Debug(9, "motor_init: devRegisterAddress() status = %d\n", (int) status);
if (!RTN_SUCCESS(status))
@@ -677,9 +681,11 @@ int PmacSetup(int num_cards, /* maximum number of cards in rack */
return (ERROR);
}
Mbox_addrs = localaddr; /* Convert to physical address.*/
Mbox_addrs = (char *) localaddr; /* Convert to physical address.*/
Pmac_addrs = (char *) addrs;
*(Mbox_addrs + 0x121) = (char) ((unsigned long) Pmac_addrs >> 14); /* Select VME A19-A14 for DPRAM. */
A19A14 = (char) ((unsigned long) Pmac_addrs >> 14);
A19A14 &= 0x3F;
*(Mbox_addrs + 0x121) = A19A14;
}
else
{