rockchip: board: roc-pc-rk3399: Remove support for push button
[oweals/u-boot.git] / board / toradex / verdin-imx8mm / verdin-imx8mm.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2020 Toradex
4  */
5
6 #include <common.h>
7 #include <asm/arch/clock.h>
8 #include <asm/arch/sys_proto.h>
9 #include <asm/io.h>
10 #include <miiphy.h>
11 #include <netdev.h>
12
13 DECLARE_GLOBAL_DATA_PTR;
14
15 int dram_init(void)
16 {
17         /* rom_pointer[1] contains the size of TEE occupies */
18         if (rom_pointer[1])
19                 gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
20         else
21                 gd->ram_size = PHYS_SDRAM_SIZE;
22
23         return 0;
24 }
25
26 #if IS_ENABLED(CONFIG_FEC_MXC)
27 static int setup_fec(void)
28 {
29         struct iomuxc_gpr_base_regs *gpr =
30                 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
31
32         /* Use 125M anatop REF_CLK1 for ENET1, not from external */
33         clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
34
35         return 0;
36 }
37
38 int board_phy_config(struct phy_device *phydev)
39 {
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);
43
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);
48
49         if (phydev->drv->config)
50                 phydev->drv->config(phydev);
51         return 0;
52 }
53 #endif
54
55 int board_init(void)
56 {
57         if (IS_ENABLED(CONFIG_FEC_MXC))
58                 setup_fec();
59
60         return 0;
61 }
62
63 int board_mmc_get_env_dev(int devno)
64 {
65         return devno;
66 }
67
68 int board_late_init(void)
69 {
70         return 0;
71 }
72
73 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
74 int ft_board_setup(void *blob, bd_t *bd)
75 {
76         return 0;
77 }
78 #endif