2014-05-05 10:52:28 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <netdev.h>
|
|
|
|
#include <miiphy.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/clock.h>
|
|
|
|
|
2016-03-17 12:53:03 +00:00
|
|
|
void eth_init_board(void)
|
2014-05-05 10:52:28 +00:00
|
|
|
{
|
|
|
|
struct sunxi_ccm_reg *const ccm =
|
|
|
|
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
|
|
|
|
|
|
|
/* Set MII clock */
|
2014-06-09 09:37:01 +00:00
|
|
|
#ifdef CONFIG_RGMII
|
2014-05-05 10:52:28 +00:00
|
|
|
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
|
|
|
|
CCM_GMAC_CTRL_GPIT_RGMII);
|
2015-01-25 11:10:48 +00:00
|
|
|
setbits_le32(&ccm->gmac_clk_cfg,
|
|
|
|
CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY));
|
2014-06-09 09:37:01 +00:00
|
|
|
#else
|
|
|
|
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII |
|
|
|
|
CCM_GMAC_CTRL_GPIT_MII);
|
|
|
|
#endif
|
2014-05-05 10:52:28 +00:00
|
|
|
}
|