blob: dd74e7c0f7559f78fe0e589d689aefdb804042be [file] [log] [blame]
Adam Forda8554812023-03-23 22:06:16 -05001// SPDX-License-Identifier: GPL-2.0+
2/* Copyright 2023 Logic PD, Inc dba Beacon EmbeddedWorks */
3
Adam Forda8554812023-03-23 22:06:16 -05004#include <init.h>
5#include <miiphy.h>
6#include <asm/arch/sys_proto.h>
7
8static void setup_fec(void)
9{
10 struct iomuxc_gpr_base_regs *gpr =
11 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
12
13 /* Enable RGMII TX clk output */
14 setbits_le32(&gpr->gpr[1], BIT(22));
15}
16
17#if IS_ENABLED(CONFIG_NET)
18int board_phy_config(struct phy_device *phydev)
19{
20 if (phydev->drv->config)
21 phydev->drv->config(phydev);
22 return 0;
23}
24#endif
25
26int board_init(void)
27{
28 int ret = 0;
29
30 if (CONFIG_IS_ENABLED(FEC_MXC))
31 setup_fec();
32
33 return ret;
34}