Date: Sun, 1 Mar 2015 06:59:32 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279479 - head/sys/mips/atheros Message-ID: <201503010659.t216xWKA070805@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sun Mar 1 06:59:32 2015 New Revision: 279479 URL: https://svnweb.freebsd.org/changeset/base/279479 Log: Flesh out some more QCA955x ethernet PLL setup. Modified: head/sys/mips/atheros/qca955x_chip.c Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Sun Mar 1 06:54:59 2015 (r279478) +++ head/sys/mips/atheros/qca955x_chip.c Sun Mar 1 06:59:32 2015 (r279479) @@ -189,26 +189,21 @@ qca955x_chip_set_mii_speed(uint32_t unit 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 } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503010659.t216xWKA070805>