Dear, I have bought a board as my new project develop board, which built in AM335x+DP83848, with RMII-1, ext-50MHz clock, PHYADDR=0, I had download u-boot 2014.07 version, and changed the gmii-sel to rmii:
writel((RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE), &cdev->miisel);
cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
puts("eth: PHY-RMII\n");
change the driver, add dp83848 support , and defined CONFIG_PHY_NATSEMI
static int dp83848_config(struct phy_device *phydev)
{
int mii_reg;
u32 phyId;
mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_PHYSID1);
phyId = (mii_reg & 0xffff) << 16;
mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_PHYSID2);
phyId |= (mii_reg & 0xffff);
Dbg_WaltPrintf("%s uid:%08X\n", phydev->drv->name, phydev->drv->uid);
phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
genphy_config_aneg(phydev);
return 0;
}
static struct phy_driver DP83848_driver = {
.name = "NatSemi DP83848",
.uid = 0x20005C90,
.mask = 0x3FFFFFF0,
.features = PHY_BASIC_FEATURES,
.config = &dp83848_config,
.startup = &genphy_startup,
.shutdown = &genphy_shutdown,
};
register in phy_natsemi_init function, phy_register(&DP83848_driver); and after reset, uboot log tell me it had identified the DP83848,
>[cpsw_phy_init,950]86f26f90,addr:0
>[get_phy_device_by_mask,643]00000001,interface:5
>[create_phy_by_mask,613]get_phy_id(0,-1)=20005C90
>[phy_connect_dev,767]cpsw connected to NatSemi DP83848
>[dp83848_config,124]NatSemi DP83848 uid:20005C90
but ping failed, arp can't get any ret, log:
boot# ping 192.168.16.254
--- NetLoop Entry
--- NetLoop UDP handler set (00000000)
--- NetLoop ARP handler set (00000000)
--- NetLoop timeout handler cancelled
Trying cpsw
link up on port 0, speed 100, full duplex
>[cpdma_submit,685]enter, len=1518
>[cpdma_submit,724]exit
>[cpdma_submit,685]enter, len=1518
>[cpdma_submit,724]exit
>[cpdma_submit,685]enter, len=1518
>[cpdma_submit,724]exit
>[cpdma_submit,685]enter, len=1518
>[cpdma_submit,724]exit
--- NetState set to 0
--- NetLoop Init
Using cpsw device
--- NetLoop timeout handler set (87f896c8)
sending ARP for 192.168.16.254
ARP broadcast 1
>[cpdma_submit,685]enter, len=42
>[cpdma_submit,724]exit
ARP broadcast 2
>[cpdma_submit,685]enter, len=42
>[cpdma_submit,724]exit
--- NetLoop timeout
--- NetState set to 3
--- NetLoop UDP handler set (00000000)
--- NetLoop ARP handler set (00000000)
--- NetLoop timeout handler cancelled
--- NetLoop Fail!
ping failed; host 192.168.16.254 is not alive
Command failed, result=1