Peng Fan | a181afe | 2019-09-16 03:09:55 +0000 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
2 | /* | ||||
3 | * Copyright 2019 NXP | ||||
4 | */ | ||||
5 | |||||
Peng Fan | 65f8586 | 2025-01-09 11:29:09 +0800 | [diff] [blame^] | 6 | #include <asm/arch/sys_proto.h> |
Marek Vasut | f87338f | 2022-02-19 17:13:54 +0100 | [diff] [blame] | 7 | #include <asm/io.h> |
Peng Fan | 6660af8 | 2025-01-09 11:29:07 +0800 | [diff] [blame] | 8 | #include <env.h> |
9 | #include <init.h> | ||||
Peng Fan | a181afe | 2019-09-16 03:09:55 +0000 | [diff] [blame] | 10 | |
Marek Vasut | f87338f | 2022-02-19 17:13:54 +0100 | [diff] [blame] | 11 | int board_mmc_get_env_dev(int devno) |
Peng Fan | a181afe | 2019-09-16 03:09:55 +0000 | [diff] [blame] | 12 | { |
Marek Vasut | f87338f | 2022-02-19 17:13:54 +0100 | [diff] [blame] | 13 | return devno; |
14 | } | ||||
15 | |||||
16 | static 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 Vasut | f87338f | 2022-02-19 17:13:54 +0100 | [diff] [blame] | 25 | int board_init(void) |
Peng Fan | 42219a7 | 2020-01-06 16:16:32 +0800 | [diff] [blame] | 26 | { |
Marek Vasut | f87338f | 2022-02-19 17:13:54 +0100 | [diff] [blame] | 27 | setup_fec(); |
28 | |||||
29 | return 0; | ||||
Peng Fan | 42219a7 | 2020-01-06 16:16:32 +0800 | [diff] [blame] | 30 | } |
31 | |||||
Peng Fan | a181afe | 2019-09-16 03:09:55 +0000 | [diff] [blame] | 32 | int board_late_init(void) |
33 | { | ||||
Peng Fan | 65f8586 | 2025-01-09 11:29:09 +0800 | [diff] [blame^] | 34 | #if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) |
35 | board_late_mmc_env_init(); | ||||
36 | #endif | ||||
37 | |||||
Peng Fan | a181afe | 2019-09-16 03:09:55 +0000 | [diff] [blame] | 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 | } |