blob: e35d505aea97236554eb9437c6a5dc0fd18c49ab [file] [log] [blame]
Peng Fana181afe2019-09-16 03:09:55 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2019 NXP
4 */
5
6#include <common.h>
Simon Glassed38aef2020-05-10 11:40:03 -06007#include <env.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Marek Vasutf87338f2022-02-19 17:13:54 +010010#include <miiphy.h>
11#include <netdev.h>
12#include <asm/io.h>
Peng Fana181afe2019-09-16 03:09:55 +000013
14DECLARE_GLOBAL_DATA_PTR;
15
Marek Vasutf87338f2022-02-19 17:13:54 +010016int board_mmc_get_env_dev(int devno)
Peng Fana181afe2019-09-16 03:09:55 +000017{
Marek Vasutf87338f2022-02-19 17:13:54 +010018 return devno;
19}
20
21static void setup_fec(void)
22{
23 struct iomuxc_gpr_base_regs *gpr =
24 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
25
26 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
27 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
28}
29
Marek Vasutf87338f2022-02-19 17:13:54 +010030int board_init(void)
Peng Fan42219a72020-01-06 16:16:32 +080031{
Marek Vasutf87338f2022-02-19 17:13:54 +010032 setup_fec();
33
34 return 0;
Peng Fan42219a72020-01-06 16:16:32 +080035}
36
Peng Fana181afe2019-09-16 03:09:55 +000037int board_late_init(void)
38{
39#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
40 env_set("board_name", "DDR4 EVK");
41 env_set("board_rev", "iMX8MN");
42#endif
43 return 0;
44}