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 | |
Adam Ford | a855481 | 2023-03-23 22:06:16 -0500 | [diff] [blame] | 4 | #include <init.h> |
| 5 | #include <miiphy.h> |
| 6 | #include <asm/arch/sys_proto.h> |
| 7 | |
| 8 | static 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) |
| 18 | int 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 | |
| 26 | int board_init(void) |
| 27 | { |
| 28 | int ret = 0; |
| 29 | |
| 30 | if (CONFIG_IS_ENABLED(FEC_MXC)) |
| 31 | setup_fec(); |
| 32 | |
| 33 | return ret; |
| 34 | } |