ath_gmac_miiphy_write(ath_gmac_unit2name(base), addr, reg, data)
-
+#ifdef S27_PHY_DEBUG
+ #undef S27_PHY_DEBUG
+#endif
int athrs27_reg_init(void)
{
-#if S27_PHY_DEBUG
+#ifdef S27_PHY_DEBUG
uint32_t rd_val;
#endif
/* reset switch */
- printf(MODULE_NAME ": resetting s27\n");
+ //printf(MODULE_NAME ": resetting s27\n");
athrs27_reg_write(0x0, athrs27_reg_read(0x0)|0x80000000);
while(i--) {
if(!(athrs27_reg_read(0x0)&0x80000000))
break;
}
- printf(MODULE_NAME ": s27 reset done\n");
+ //printf(MODULE_NAME ": s27 reset done\n");
athrs27_reg_write(PORT_STATUS_REGISTER0,0x4e);
athrs27_reg_rmw(OPERATIONAL_MODE_REG0,(1<<6)); /* Set GMII mode */
s27_wr_phy(phyAddr,ATHR_PHY_CONTROL,0x9000);
#endif
-#if S27_PHY_DEBUG
+#ifdef S27_PHY_DEBUG
rd_val = s27_rd_phy(phyAddr,ATHR_PHY_FUNC_CONTROL);
printf("S27 ATHR_PHY_FUNC_CONTROL (%d):%x\n",phyAddr,rd_val);
rd_val = s27_rd_phy(phyAddr,ATHR_PHY_ID1);
| ATHR_CTRL_SOFTWARE_RESET);
}
else {
- printf("############ is emulation ############\n");
+ //printf("############ is emulation ############\n");
if(ATHR_ETHUNIT(phyUnit) == ENET_UNIT_WAN) {
s27_wr_phy(phyAddr, ATHR_AUTONEG_ADVERT,ATHR_ADVERTISE_ALL);
}
}
rd_val = s27_rd_phy(phyAddr,ATHR_PHY_CONTROL);
- printf("%s ATHR_PHY_CONTROL %d :%x\n",__func__,phyAddr,rd_val);
+ //printf("%s ATHR_PHY_CONTROL %d :%x\n",__func__,phyAddr,rd_val);
rd_val = s27_rd_phy(phyAddr,ATHR_PHY_SPEC_STATUS);
- printf("%s ATHR_PHY_SPEC_STAUS %d :%x\n",__func__,phyAddr,rd_val);
+ //printf("%s ATHR_PHY_SPEC_STAUS %d :%x\n",__func__,phyAddr,rd_val);
}
if (!foundPhy) {
return FALSE; /* No PHY's configured for this ethUnit */
/* turn off power saving */
s27_wr_phy(phyUnit, 29, 41);
s27_wr_phy(phyUnit, 30, 0);
- printf("def_ S27_VER_1_0\n");
+ //printf("def_ S27_VER_1_0\n");
#endif
}
ath_reg_wr(SWITCH_CLOCK_SPARE_ADDRESS, 0x231);
//ath_reg_wr(SWITCH_CLOCK_SPARE_ADDRESS, 0x520);
if ((mac->mac_unit == 1)) {
- printf("Honey Bee ----> MAC 1 S27 PHY *\n");
+ //printf("Honey Bee ----> MAC 1 S27 PHY *\n");
ath_reg_wr(ATH_ETH_CFG, ETH_CFG_ETH_RXDV_DELAY_SET(3) |
ETH_CFG_ETH_RXD_DELAY_SET(3)|
ETH_CFG_RGMII_GE0_SET(1));
}
if (is_vir_phy()) {
- printf("Honey Bee ---->VIR PHY*\n");
+ //printf("Honey Bee ---->VIR PHY*\n");
ath_reg_wr(ATH_ETH_CFG, ETH_CFG_ETH_RXDV_DELAY_SET(3) |
ETH_CFG_ETH_RXD_DELAY_SET(3)|
}
if (is_s27()) {
mgmt_cfg_val = 2;
- printf("Scorpion ---->S27 PHY*\n");
+ //printf("Scorpion ---->S27 PHY*\n");
ath_reg_wr(ETH_CFG_ADDRESS, ETH_CFG_MII_GE0_SET(1)|
ETH_CFG_MII_GE0_SLAVE_SET(1));
udelay(1000);
ath_gmac_reg_wr(mac, ATH_MAC_FIFO_CFG_3, 0x1f00140);
- printf(": cfg1 %#x cfg2 %#x\n", ath_gmac_reg_rd(mac, ATH_MAC_CFG1),
- ath_gmac_reg_rd(mac, ATH_MAC_CFG2));
+ //printf(": cfg1 %#x cfg2 %#x\n", ath_gmac_reg_rd(mac, ATH_MAC_CFG1),
+ // ath_gmac_reg_rd(mac, ATH_MAC_CFG2));
}
size += CFG_CACHELINE_SIZE - 1;
if ((p = malloc(size)) == NULL) {
- printf("Cant allocate fifos\n");
+ //printf("Cant allocate fifos\n");
return -1;
}
eeprom += 6;
memcpy(mac, eeprom, 6);
} else {
- printf("%s: unknown ethernet device %s\n", __func__, dev->name);
+ //printf("%s: unknown ethernet device %s\n", __func__, dev->name);
return;
}
/* Use fixed address if the above address is invalid */
mac[4] = 0x08;
mac[5] = 0x41;
/*printf("No valid address in Flash. Using fixed address\n");*/
- } else {
- printf("Fetching MAC Address from 0x%p\n", __func__, eeprom);
}
}
ath_reg_wr(GPIO_OUT_FUNCTION4_ADDRESS, rddata);
#endif
- printf ("%s ::done\n",__func__);
+ //printf ("%s ::done\n",__func__);
}
int ath_gmac_enet_initialize(bd_t * bis)
u32 mask, mac_h, mac_l;
int i;
- printf("%s...\n", __func__);
+ //printf("%s...\n", __func__);
/* Switch Analog and digital reset seq */
mask = ATH_RESET_GE1_PHY | ATH_RESET_GE0_PHY;
mask = (ATH_RESET_GE0_MAC | ATH_RESET_GE1_MAC | ATH_RESET_GE0_MDIO | ATH_RESET_GE1_MDIO);
- printf("%s: reset mask:%x \n", __func__, mask);
+ //printf("%s: reset mask:%x \n", __func__, mask);
ath_reg_rmw_set(RST_RESET_ADDRESS, mask);
udelay(1000 * 100);
if (ath_gmac_macs[i]->mac_unit == 0) { /* WAN Phy */
#ifdef CFG_ATHRS27_PHY
- printf("S27 reg init\n");
+ //printf("S27 reg init\n");
athrs27_reg_init();
mask = ATH_RESET_GE0_MAC;
ath_reg_rmw_clear(RST_RESET_ADDRESS, mask);
#endif
#ifdef CONFIG_VIR_PHY
- printf("VIRPhy reg init \n");
+ //printf("VIRPhy reg init \n");
athr_vir_reg_init();
#endif
} else {
#ifdef CFG_ATHRS27_PHY
- printf("S27 reg init\n");
+ //printf("S27 reg init\n");
athrs27_reg_init_lan();
mask = ATH_RESET_GE1_MAC;
ath_reg_rmw_clear(RST_RESET_ADDRESS, mask);
{
unsigned char *mac = dev[i]->enetaddr;
- printf("%s: %02x:%02x:%02x:%02x:%02x:%02x\n", dev[i]->name,
- mac[0] & 0xff, mac[1] & 0xff, mac[2] & 0xff,
- mac[3] & 0xff, mac[4] & 0xff, mac[5] & 0xff);
+ //printf("%s: %02x:%02x:%02x:%02x:%02x:%02x\n", dev[i]->name,
+ // mac[0] & 0xff, mac[1] & 0xff, mac[2] & 0xff,
+ // mac[3] & 0xff, mac[4] & 0xff, mac[5] & 0xff);
}
mac_l = (dev[i]->enetaddr[4] << 8) | (dev[i]->enetaddr[5]);
mac_h = (dev[i]->enetaddr[0] << 24) | (dev[i]->enetaddr[1] << 16) |
ath_gmac_phy_setup(ath_gmac_macs[i]->mac_unit);
- printf("%s up\n",dev[i]->name);
+ //printf("%s up\n",dev[i]->name);
}