]> git.ipfire.org Git - thirdparty/u-boot.git/blob - board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c
imx: imx8mp: Add support for Polyhex Debix Model A SBC
[thirdparty/u-boot.git] / board / polyhex / imx8mp_debix_model_a / imx8mp_debix_model_a.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright 2019 NXP
4 * Copyright 2023 Gilles Talis <gilles.talis@gmail.com>
5 */
6
7 #include <asm-generic/gpio.h>
8 #include <asm/arch/clock.h>
9 #include <asm/arch/imx8mp_pins.h>
10 #include <asm/arch/sys_proto.h>
11 #include <asm/global_data.h>
12 #include <asm/mach-imx/gpio.h>
13 #include <asm/mach-imx/iomux-v3.h>
14 #include <common.h>
15 #include <env.h>
16 #include <errno.h>
17 #include <init.h>
18 #include <linux/delay.h>
19 #include <miiphy.h>
20 #include <netdev.h>
21
22 DECLARE_GLOBAL_DATA_PTR;
23
24 static void setup_fec(void)
25 {
26 struct iomuxc_gpr_base_regs *gpr =
27 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
28
29 /* Enable RGMII TX clk output */
30 setbits_le32(&gpr->gpr[1], BIT(22));
31 }
32
33 #if CONFIG_IS_ENABLED(NET)
34 int board_phy_config(struct phy_device *phydev)
35 {
36 if (phydev->drv->config)
37 phydev->drv->config(phydev);
38 return 0;
39 }
40 #endif
41
42 int board_init(void)
43 {
44 int ret = 0;
45
46 if (IS_ENABLED(CONFIG_FEC_MXC))
47 setup_fec();
48
49 return ret;
50 }
51
52 int board_late_init(void)
53 {
54 return 0;
55 }