blob: f20ffbc52501a8a5c3ae9603b04847bab2cbd8dc [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 Glass3ba929a2020-10-30 21:38:53 -06006#include <asm/global_data.h>
Marek Vasutf87338f2022-02-19 17:13:54 +01007#include <asm/io.h>
Peng Fan6660af82025-01-09 11:29:07 +08008#include <env.h>
9#include <init.h>
Peng Fana181afe2019-09-16 03:09:55 +000010
11DECLARE_GLOBAL_DATA_PTR;
12
Marek Vasutf87338f2022-02-19 17:13:54 +010013int board_mmc_get_env_dev(int devno)
Peng Fana181afe2019-09-16 03:09:55 +000014{
Marek Vasutf87338f2022-02-19 17:13:54 +010015 return devno;
16}
17
18static void setup_fec(void)
19{
20 struct iomuxc_gpr_base_regs *gpr =
21 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
22
23 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
24 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
25}
26
Marek Vasutf87338f2022-02-19 17:13:54 +010027int board_init(void)
Peng Fan42219a72020-01-06 16:16:32 +080028{
Marek Vasutf87338f2022-02-19 17:13:54 +010029 setup_fec();
30
31 return 0;
Peng Fan42219a72020-01-06 16:16:32 +080032}
33
Peng Fana181afe2019-09-16 03:09:55 +000034int board_late_init(void)
35{
36#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
37 env_set("board_name", "DDR4 EVK");
38 env_set("board_rev", "iMX8MN");
39#endif
40 return 0;
41}