u-boot/board/sunxi/gmac.c
Tom Rini debd98265d arm: sunxi: Remove <common.h> and add needed includes
Remove <common.h> from all mach-sunxi and board/sunxi files and when
needed add missing include files directly.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06 15:06:33 -06:00

21 lines
535 B
C

#include <netdev.h>
#include <miiphy.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
void eth_init_board(void)
{
struct sunxi_ccm_reg *const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
/* Set MII clock */
#ifdef CONFIG_RGMII
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
CCM_GMAC_CTRL_GPIT_RGMII);
setbits_le32(&ccm->gmac_clk_cfg,
CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY));
#else
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII |
CCM_GMAC_CTRL_GPIT_MII);
#endif
}