1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2020 Toradex
7 #include <asm/arch/clock.h>
8 #include <asm/arch/sys_proto.h>
13 DECLARE_GLOBAL_DATA_PTR;
17 /* rom_pointer[1] contains the size of TEE occupies */
19 gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
21 gd->ram_size = PHYS_SDRAM_SIZE;
26 #if IS_ENABLED(CONFIG_FEC_MXC)
27 static int setup_fec(void)
29 struct iomuxc_gpr_base_regs *gpr =
30 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
32 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
33 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
38 int board_phy_config(struct phy_device *phydev)
40 /* enable rgmii rxc skew and phy mode select to RGMII copper */
41 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f);
42 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8);
44 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00);
45 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee);
46 phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
47 phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
49 if (phydev->drv->config)
50 phydev->drv->config(phydev);
57 if (IS_ENABLED(CONFIG_FEC_MXC))
63 int board_mmc_get_env_dev(int devno)
68 int board_late_init(void)
73 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
74 int ft_board_setup(void *blob, bd_t *bd)