blob: c62d7a47e21b77918af85e966ac2bf8f58a75df4 [file] [log] [blame]
Peng Fana181afe2019-09-16 03:09:55 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2019 NXP
4 */
5
Peng Fan65f85862025-01-09 11:29:09 +08006#include <asm/arch/sys_proto.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
Marek Vasutf87338f2022-02-19 17:13:54 +010011int board_mmc_get_env_dev(int devno)
Peng Fana181afe2019-09-16 03:09:55 +000012{
Marek Vasutf87338f2022-02-19 17:13:54 +010013 return devno;
14}
15
16static void setup_fec(void)
17{
18 struct iomuxc_gpr_base_regs *gpr =
19 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
20
21 /* Use 125M anatop REF_CLK1 for ENET1, not from external */
22 clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
23}
24
Marek Vasutf87338f2022-02-19 17:13:54 +010025int board_init(void)
Peng Fan42219a72020-01-06 16:16:32 +080026{
Marek Vasutf87338f2022-02-19 17:13:54 +010027 setup_fec();
28
29 return 0;
Peng Fan42219a72020-01-06 16:16:32 +080030}
31
Peng Fana181afe2019-09-16 03:09:55 +000032int board_late_init(void)
33{
Peng Fan65f85862025-01-09 11:29:09 +080034#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
35 board_late_mmc_env_init();
36#endif
37
Peng Fana181afe2019-09-16 03:09:55 +000038#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}