Skip to content

Commit 8de3816

Browse files
Support ADIN1200
1 parent 913b90c commit 8de3816

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

source/portable/NetworkInterface/Common/phyHandling.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,31 @@ BaseType_t xPhyStartAutoNegotiation( EthernetPhy_t * pxPhyObject,
681681
ulRegValue |= phyPHYSTS_DUPLEX_STATUS;
682682
}
683683
}
684+
else if( ulPhyID == PHY_ID_ADIN1200 )
685+
{
686+
/* ADIN1200 get the resolved speed information from register 0x1A (PHY_STATUS_1)
687+
*/
688+
uint32_t ulControlStatus = 0u;
689+
uint32_t ulPortOperationMode = 0u;
690+
pxPhyObject->fnPhyRead( xPhyAddress, 0x1A, &ulControlStatus );
691+
/* Bits 7-9 indicate the speed and duplex. */
692+
ulPortOperationMode = ( ulControlStatus >> 7u ) & 0x07u;
693+
694+
ulRegValue = 0;
695+
696+
/* Detect 10Mb operation */
697+
if(( ulPortOperationMode & 0x2) == 0)
698+
{
699+
/* phyPHYSTS_SPEED_STATUS: 1=10Mb, 0=100Mb */
700+
ulRegValue |= phyPHYSTS_SPEED_STATUS;
701+
}
702+
703+
/* Detect full duplex operation */
704+
if( ulPortOperationMode & 0x1)
705+
{
706+
ulRegValue |= phyPHYSTS_DUPLEX_STATUS;
707+
}
708+
}
684709
else if( xHas_1F_PHYSPCS( ulPhyID ) )
685710
{
686711
/* 31 RW PHY Special Control Status */

source/portable/NetworkInterface/include/phyHandling.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118

119119
#define PHY_ID_MV88E6071 0xFF000710
120120

121+
#define PHY_ID_ADIN1200 0x0283BC20
122+
121123
/* Initialise the struct and assign a PHY-read and -write function. */
122124
void vPhyInitialise( EthernetPhy_t * pxPhyObject,
123125
xApplicationPhyReadHook_t fnPhyRead,

0 commit comments

Comments
 (0)