mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-01-25 11:25:17 +00:00
sk98lin: fix compile warnings
Fix warnings: skge.c: In function 'BoardInitMem': skge.c:1389: warning: dereferencing type-punned pointer will break strict-aliasing rules skge.c:1390: warning: dereferencing type-punned pointer will break strict-aliasing rules skge.c:1391: warning: dereferencing type-punned pointer will break strict-aliasing rules skgesirq.c: In function 'SkGePortCheckUpXmac': skgesirq.c:1301: warning: dereferencing type-punned pointer will break strict-aliasing rules skgesirq.c:1301: warning: dereferencing type-punned pointer will break strict-aliasing rules skgesirq.c:1398: warning: dereferencing type-punned pointer will break strict-aliasing rules skgesirq.c:1398: warning: dereferencing type-punned pointer will break strict-aliasing rules skrlmt.c: In function 'SkRlmtInit': skrlmt.c:661: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkMacPromiscMode': skxmac2.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkMacHashing': skxmac2.c:803: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:803: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkMacFlushTxFifo': skxmac2.c:1115: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:1115: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkMacFlushRxFifo': skxmac2.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkXmInitPauseMd': skxmac2.c:1987: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:1987: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c: In function 'SkXmOverflowStatus': skxmac2.c:4236: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:4236: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:4242: warning: dereferencing type-punned pointer will break strict-aliasing rules skxmac2.c:4242: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
3e7ec96948
commit
cfdd4a8918
4 changed files with 29 additions and 13 deletions
|
@ -1382,13 +1382,19 @@ int TxDescrSize; /* the size of a tx descriptor rounded up to alignment*/
|
||||||
pAC->TxDescrPerRing = TX_RING_SIZE / RxDescrSize;
|
pAC->TxDescrPerRing = TX_RING_SIZE / RxDescrSize;
|
||||||
|
|
||||||
for (i=0; i<pAC->GIni.GIMacsFound; i++) {
|
for (i=0; i<pAC->GIni.GIMacsFound; i++) {
|
||||||
|
TXD **txd_head, **txd_tail, **txd_prev;
|
||||||
|
|
||||||
|
txd_head = &pAC->TxPort[i][0].pTxdRingHead;
|
||||||
|
txd_tail = &pAC->TxPort[i][0].pTxdRingTail;
|
||||||
|
txd_prev = &pAC->TxPort[i][0].pTxdRingPrev;
|
||||||
|
|
||||||
SetupRing(
|
SetupRing(
|
||||||
pAC,
|
pAC,
|
||||||
pAC->TxPort[i][0].pTxDescrRing,
|
pAC->TxPort[i][0].pTxDescrRing,
|
||||||
pAC->TxPort[i][0].VTxDescrRing,
|
pAC->TxPort[i][0].VTxDescrRing,
|
||||||
(RXD**)&pAC->TxPort[i][0].pTxdRingHead,
|
(RXD**)txd_head,
|
||||||
(RXD**)&pAC->TxPort[i][0].pTxdRingTail,
|
(RXD**)txd_tail,
|
||||||
(RXD**)&pAC->TxPort[i][0].pTxdRingPrev,
|
(RXD**)txd_prev,
|
||||||
&pAC->TxPort[i][0].TxdRingFree,
|
&pAC->TxPort[i][0].TxdRingFree,
|
||||||
SK_TRUE);
|
SK_TRUE);
|
||||||
SetupRing(
|
SetupRing(
|
||||||
|
|
|
@ -1266,6 +1266,7 @@ int Port) /* Which port should be checked */
|
||||||
SK_GEPORT *pPrt; /* GIni Port struct pointer */
|
SK_GEPORT *pPrt; /* GIni Port struct pointer */
|
||||||
int Done;
|
int Done;
|
||||||
SK_U32 GpReg; /* General Purpose register value */
|
SK_U32 GpReg; /* General Purpose register value */
|
||||||
|
SK_U32 *pGpReg; /* Pointer to -- " -- */
|
||||||
SK_U16 Isrc; /* Interrupt source register */
|
SK_U16 Isrc; /* Interrupt source register */
|
||||||
SK_U16 IsrcSum; /* Interrupt source register sum */
|
SK_U16 IsrcSum; /* Interrupt source register sum */
|
||||||
SK_U16 LpAb; /* Link Partner Ability */
|
SK_U16 LpAb; /* Link Partner Ability */
|
||||||
|
@ -1274,6 +1275,8 @@ int Port) /* Which port should be checked */
|
||||||
SK_BOOL AutoNeg; /* Is Auto-negotiation used ? */
|
SK_BOOL AutoNeg; /* Is Auto-negotiation used ? */
|
||||||
SK_U8 NextMode; /* Next AutoSensing Mode */
|
SK_U8 NextMode; /* Next AutoSensing Mode */
|
||||||
|
|
||||||
|
pGpReg = &GpReg;
|
||||||
|
|
||||||
pPrt = &pAC->GIni.GP[Port];
|
pPrt = &pAC->GIni.GP[Port];
|
||||||
|
|
||||||
if (pPrt->PHWLinkUp) {
|
if (pPrt->PHWLinkUp) {
|
||||||
|
@ -1298,7 +1301,7 @@ int Port) /* Which port should be checked */
|
||||||
|
|
||||||
if (pPrt->PLinkBroken) {
|
if (pPrt->PLinkBroken) {
|
||||||
/* Link was broken */
|
/* Link was broken */
|
||||||
XM_IN32(IoC, Port, XM_GP_PORT, &GpReg);
|
XM_IN32(IoC, Port, XM_GP_PORT, pGpReg);
|
||||||
|
|
||||||
if ((GpReg & XM_GP_INP_ASS) == 0) {
|
if ((GpReg & XM_GP_INP_ASS) == 0) {
|
||||||
/* The Link is in sync */
|
/* The Link is in sync */
|
||||||
|
@ -1395,7 +1398,7 @@ int Port) /* Which port should be checked */
|
||||||
* here we usually can check whether the link is in sync and
|
* here we usually can check whether the link is in sync and
|
||||||
* auto-negotiation is done.
|
* auto-negotiation is done.
|
||||||
*/
|
*/
|
||||||
XM_IN32(IoC, Port, XM_GP_PORT, &GpReg);
|
XM_IN32(IoC, Port, XM_GP_PORT, pGpReg);
|
||||||
XM_IN16(IoC, Port, XM_ISRC, &Isrc);
|
XM_IN16(IoC, Port, XM_ISRC, &Isrc);
|
||||||
IsrcSum |= Isrc;
|
IsrcSum |= Isrc;
|
||||||
|
|
||||||
|
|
|
@ -657,8 +657,9 @@ int Level) /* Initialization Level */
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
|
for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
|
||||||
|
SK_U64 *pRandom = &Random;
|
||||||
Random = SkOsGetTime(pAC);
|
Random = SkOsGetTime(pAC);
|
||||||
*(SK_U32*)&pAC->Rlmt.Port[i].Random = *(SK_U32*)&Random;
|
*(SK_U32*)&pAC->Rlmt.Port[i].Random = *(SK_U32*)pRandom;
|
||||||
|
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < 4; j++) {
|
||||||
pAC->Rlmt.Port[i].Random[j] ^= pAC->Rlmt.Port[i].AddrPort->
|
pAC->Rlmt.Port[i].Random[j] ^= pAC->Rlmt.Port[i].AddrPort->
|
||||||
|
|
|
@ -747,10 +747,11 @@ SK_BOOL Enable) /* Enable / Disable */
|
||||||
{
|
{
|
||||||
SK_U16 RcReg;
|
SK_U16 RcReg;
|
||||||
SK_U32 MdReg;
|
SK_U32 MdReg;
|
||||||
|
SK_U32 *pMdReg = &MdReg;
|
||||||
|
|
||||||
if (pAC->GIni.GIGenesis) {
|
if (pAC->GIni.GIGenesis) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_MODE, &MdReg);
|
XM_IN32(IoC, Port, XM_MODE, pMdReg);
|
||||||
/* enable or disable promiscuous mode */
|
/* enable or disable promiscuous mode */
|
||||||
if (Enable) {
|
if (Enable) {
|
||||||
MdReg |= XM_MD_ENA_PROM;
|
MdReg |= XM_MD_ENA_PROM;
|
||||||
|
@ -797,10 +798,11 @@ SK_BOOL Enable) /* Enable / Disable */
|
||||||
{
|
{
|
||||||
SK_U16 RcReg;
|
SK_U16 RcReg;
|
||||||
SK_U32 MdReg;
|
SK_U32 MdReg;
|
||||||
|
SK_U32 *pMdReg = &MdReg;
|
||||||
|
|
||||||
if (pAC->GIni.GIGenesis) {
|
if (pAC->GIni.GIGenesis) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_MODE, &MdReg);
|
XM_IN32(IoC, Port, XM_MODE, pMdReg);
|
||||||
/* enable or disable hashing */
|
/* enable or disable hashing */
|
||||||
if (Enable) {
|
if (Enable) {
|
||||||
MdReg |= XM_MD_ENA_HASH;
|
MdReg |= XM_MD_ENA_HASH;
|
||||||
|
@ -1109,10 +1111,11 @@ SK_IOC IoC, /* IO context */
|
||||||
int Port) /* Port Index (MAC_1 + n) */
|
int Port) /* Port Index (MAC_1 + n) */
|
||||||
{
|
{
|
||||||
SK_U32 MdReg;
|
SK_U32 MdReg;
|
||||||
|
SK_U32 *pMdReg = &MdReg;
|
||||||
|
|
||||||
if (pAC->GIni.GIGenesis) {
|
if (pAC->GIni.GIGenesis) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_MODE, &MdReg);
|
XM_IN32(IoC, Port, XM_MODE, pMdReg);
|
||||||
|
|
||||||
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FTF);
|
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FTF);
|
||||||
}
|
}
|
||||||
|
@ -1139,10 +1142,11 @@ SK_IOC IoC, /* IO context */
|
||||||
int Port) /* Port Index (MAC_1 + n) */
|
int Port) /* Port Index (MAC_1 + n) */
|
||||||
{
|
{
|
||||||
SK_U32 MdReg;
|
SK_U32 MdReg;
|
||||||
|
SK_U32 *pMdReg = &MdReg;
|
||||||
|
|
||||||
if (pAC->GIni.GIGenesis) {
|
if (pAC->GIni.GIGenesis) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_MODE, &MdReg);
|
XM_IN32(IoC, Port, XM_MODE, pMdReg);
|
||||||
|
|
||||||
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FRF);
|
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FRF);
|
||||||
}
|
}
|
||||||
|
@ -1961,6 +1965,7 @@ int Port) /* Port Index (MAC_1 + n) */
|
||||||
{
|
{
|
||||||
SK_GEPORT *pPrt;
|
SK_GEPORT *pPrt;
|
||||||
SK_U32 DWord;
|
SK_U32 DWord;
|
||||||
|
SK_U32 *pDWord = &DWord;
|
||||||
SK_U16 Word;
|
SK_U16 Word;
|
||||||
|
|
||||||
pPrt = &pAC->GIni.GP[Port];
|
pPrt = &pAC->GIni.GP[Port];
|
||||||
|
@ -1984,7 +1989,7 @@ int Port) /* Port Index (MAC_1 + n) */
|
||||||
|
|
||||||
XM_OUT16(IoC, Port, XM_MMU_CMD, Word);
|
XM_OUT16(IoC, Port, XM_MMU_CMD, Word);
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_MODE, &DWord);
|
XM_IN32(IoC, Port, XM_MODE, pDWord);
|
||||||
|
|
||||||
if (pPrt->PFlowCtrlStatus == SK_FLOW_STAT_SYMMETRIC ||
|
if (pPrt->PFlowCtrlStatus == SK_FLOW_STAT_SYMMETRIC ||
|
||||||
pPrt->PFlowCtrlStatus == SK_FLOW_STAT_LOC_SEND) {
|
pPrt->PFlowCtrlStatus == SK_FLOW_STAT_LOC_SEND) {
|
||||||
|
@ -4228,18 +4233,19 @@ SK_U64 *pStatus) /* ptr for return overflow status value */
|
||||||
{
|
{
|
||||||
SK_U64 Status; /* Overflow status */
|
SK_U64 Status; /* Overflow status */
|
||||||
SK_U32 RegVal;
|
SK_U32 RegVal;
|
||||||
|
SK_U32 *pRegVal = &RegVal;
|
||||||
|
|
||||||
Status = 0;
|
Status = 0;
|
||||||
|
|
||||||
if ((IStatus & XM_IS_RXC_OV) != 0) {
|
if ((IStatus & XM_IS_RXC_OV) != 0) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_RX_CNT_EV, &RegVal);
|
XM_IN32(IoC, Port, XM_RX_CNT_EV, pRegVal);
|
||||||
Status |= (SK_U64)RegVal << 32;
|
Status |= (SK_U64)RegVal << 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((IStatus & XM_IS_TXC_OV) != 0) {
|
if ((IStatus & XM_IS_TXC_OV) != 0) {
|
||||||
|
|
||||||
XM_IN32(IoC, Port, XM_TX_CNT_EV, &RegVal);
|
XM_IN32(IoC, Port, XM_TX_CNT_EV, pRegVal);
|
||||||
Status |= (SK_U64)RegVal;
|
Status |= (SK_U64)RegVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue