1 // SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/clock.h>
13 #include <asm/arch/sys_proto.h>
16 DECLARE_GLOBAL_DATA_PTR;
20 /* rom_pointer[1] contains the size of TEE occupies */
22 gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
24 gd->ram_size = PHYS_SDRAM_SIZE;
29 #if IS_ENABLED(CONFIG_FEC_MXC)
30 static int setup_fec(void)
32 struct iomuxc_gpr_base_regs *gpr =
33 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
35 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
36 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
41 int board_phy_config(struct phy_device *phydev)
43 /* enable rgmii rxc skew and phy mode select to RGMII copper */
44 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f);
45 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8);
47 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00);
48 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee);
49 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
50 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
52 if (phydev->drv->config)
53 phydev->drv->config(phydev);
60 if (IS_ENABLED(CONFIG_FEC_MXC))
66 int board_mmc_get_env_dev(int devno)
71 int board_late_init(void)
73 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
74 env_set("board_name", "EVK");
75 env_set("board_rev", "iMX8MM");