blob: 6b6fb0a7dd2178a20d9869a1b478d5a8b5124ad8 [file] [log] [blame]
Peng Fana181afe2019-09-16 03:09:55 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2019 NXP
4 */
5
Simon Glassed38aef2020-05-10 11:40:03 -06006#include <env.h>
Simon Glass97589732020-05-10 11:40:02 -06007#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06008#include <asm/global_data.h>
Marek Vasutf87338f2022-02-19 17:13:54 +01009#include <miiphy.h>
10#include <netdev.h>
11#include <asm/io.h>
Peng Fana181afe2019-09-16 03:09:55 +000012
13DECLARE_GLOBAL_DATA_PTR;
14
Marek Vasutf87338f2022-02-19 17:13:54 +010015int board_mmc_get_env_dev(int devno)
Peng Fana181afe2019-09-16 03:09:55 +000016{
Marek Vasutf87338f2022-02-19 17:13:54 +010017 return devno;
18}
19
20static void setup_fec(void)
21{
22 struct iomuxc_gpr_base_regs *gpr =
23 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
24
25 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
26 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
27}
28
Marek Vasutf87338f2022-02-19 17:13:54 +010029int board_init(void)
Peng Fan42219a72020-01-06 16:16:32 +080030{
Marek Vasutf87338f2022-02-19 17:13:54 +010031 setup_fec();
32
33 return 0;
Peng Fan42219a72020-01-06 16:16:32 +080034}
35
Peng Fana181afe2019-09-16 03:09:55 +000036int board_late_init(void)
37{
38#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
39 env_set("board_name", "DDR4 EVK");
40 env_set("board_rev", "iMX8MN");
41#endif
42 return 0;
43}