Flesh out some more QCA955x ethernet PLL setup.

This commit is contained in:
Adrian Chadd 2015-03-01 06:59:32 +00:00
parent 5c8bc6bba2
commit ebac3fdb1c

View File

@ -189,26 +189,21 @@ qca955x_chip_set_mii_speed(uint32_t unit, uint32_t speed)
return;
}
/*
* XXX TODO !!
*/
static void
qca955x_chip_set_pll_ge(int unit, int speed, uint32_t pll)
{
#if 0
switch (unit) {
case 0:
ATH_WRITE_REG(AR934X_PLL_ETH_XMII_CONTROL_REG, pll);
ATH_WRITE_REG(QCA955X_PLL_ETH_XMII_CONTROL_REG, pll);
break;
case 1:
/* XXX nothing */
ATH_WRITE_REG(QCA955X_PLL_ETH_SGMII_CONTROL_REG, pll);
break;
default:
printf("%s: invalid PLL set for arge unit: %d\n",
__func__, unit);
return;
}
#endif
}
static void
@ -241,27 +236,23 @@ qca955x_chip_ddr_flush_ip2(void)
static uint32_t
qca955x_chip_get_eth_pll(unsigned int mac, int speed)
{
#if 0
uint32_t pll;
switch (speed) {
case 10:
pll = AR934X_PLL_VAL_10;
pll = QCA955X_PLL_VAL_10;
break;
case 100:
pll = AR934X_PLL_VAL_100;
pll = QCA955X_PLL_VAL_100;
break;
case 1000:
pll = AR934X_PLL_VAL_1000;
pll = QCA955X_PLL_VAL_1000;
break;
default:
printf("%s%d: invalid speed %d\n", __func__, mac, speed);
pll = 0;
}
return (pll);
#else
return (0);
#endif
}
static void
@ -275,24 +266,17 @@ qca955x_chip_reset_ethernet_switch(void)
#endif
}
#if 0
static void
qca955x_configure_gmac(uint32_t gmac_cfg)
{
uint32_t reg;
reg = ATH_READ_REG(AR934X_GMAC_REG_ETH_CFG);
reg = ATH_READ_REG(QCA955X_GMAC_REG_ETH_CFG);
printf("%s: ETH_CFG=0x%08x\n", __func__, reg);
reg &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 |
AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE |
AR934X_ETH_CFG_SW_PHY_SWAP);
reg &= ~(QCA955X_ETH_CFG_RGMII_EN | QCA955X_ETH_CFG_GE0_SGMII);
reg |= gmac_cfg;
ATH_WRITE_REG(AR934X_GMAC_REG_ETH_CFG, reg);
ATH_WRITE_REG(QCA955X_GMAC_REG_ETH_CFG, reg);
}
#endif
static void
qca955x_chip_init_usb_peripheral(void)
@ -326,17 +310,15 @@ qca955x_chip_reset_wmac(void)
static void
qca955x_chip_init_gmac(void)
{
#if 0
long gmac_cfg;
if (resource_long_value("ar934x_gmac", 0, "gmac_cfg",
if (resource_long_value("qca955x_gmac", 0, "gmac_cfg",
&gmac_cfg) == 0) {
printf("%s: gmac_cfg=0x%08lx\n",
__func__,
(long) gmac_cfg);
ar934x_configure_gmac((uint32_t) gmac_cfg);
qca955x_configure_gmac((uint32_t) gmac_cfg);
}
#endif
}
/*