summaryrefslogtreecommitdiffstats
path: root/libs/MII
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-02-18 17:35:07 -0700
committerEvan Lojewski <github@meklort.com>2019-02-18 17:35:07 -0700
commit5a2b287cac9f534b0ba553719e079fe0edf6e38f (patch)
treee6de456fecc476cea4a776fdd634460bf5a78653 /libs/MII
parent56857263620d77651cd467d4e0070a3a4092def9 (diff)
downloadbcm5719-ortega-5a2b287cac9f534b0ba553719e079fe0edf6e38f.tar.gz
bcm5719-ortega-5a2b287cac9f534b0ba553719e079fe0edf6e38f.zip
Update MII init code to match latest description for port 0.
Diffstat (limited to 'libs/MII')
-rw-r--r--libs/MII/include/MII.h7
-rw-r--r--libs/MII/mii.c6
2 files changed, 12 insertions, 1 deletions
diff --git a/libs/MII/include/MII.h b/libs/MII/include/MII.h
index dcdaf37..1be6e04 100644
--- a/libs/MII/include/MII.h
+++ b/libs/MII/include/MII.h
@@ -68,8 +68,13 @@ uint16_t MII_readRegister(uint8_t phy, mii_reg_t reg);
void MII_writeRegister(uint8_t phy, mii_reg_t reg, uint16_t data);
/**
- * @fn void MII_writeRegister(uint8_t PHY, uint8_t reg, uint16_t data);
+ * @fn void MII_selectBlock(uint8_t phy, uint16_t block);
*/
void MII_selectBlock(uint8_t phy, uint16_t block);
+/**
+ * @fn uint16_t MII_getBlock(uint8_t phy);
+ */
+uint16_t MII_getBlock(uint8_t phy);
+
#endif /* MII_H */
diff --git a/libs/MII/mii.c b/libs/MII/mii.c
index c2d4ba2..c33f366 100644
--- a/libs/MII/mii.c
+++ b/libs/MII/mii.c
@@ -125,3 +125,9 @@ void MII_selectBlock(uint8_t phy, uint16_t block)
// Write register 0x1f with the block.
MII_writeRegister(phy, REG_MII_BLOCK_SELECT, block);
}
+
+uint16_t MII_getBlock(uint8_t phy)
+{
+ // Write register 0x1f with the block.
+ return MII_readRegister(phy, REG_MII_BLOCK_SELECT);
+}
OpenPOWER on IntegriCloud