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