blob: ad83f36ef75112a6b06d2dc76905a1825415671e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peng Fan81590632016-08-11 14:02:57 +08002/*
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
Peng Fan81590632016-08-11 14:02:57 +08004 */
5
6#include <asm/arch/clock.h>
7#include <asm/arch/iomux.h>
8#include <asm/arch/imx-regs.h>
9#include <asm/arch/crm_regs.h>
10#include <asm/arch/mx6-pins.h>
11#include <asm/arch/sys_proto.h>
12#include <asm/gpio.h>
Stefano Babic33731bc2017-06-29 10:16:06 +020013#include <asm/mach-imx/iomux-v3.h>
14#include <asm/mach-imx/boot_mode.h>
Peng Fan81590632016-08-11 14:02:57 +080015#include <asm/io.h>
16#include <common.h>
17#include <fsl_esdhc.h>
18#include <linux/sizes.h>
19#include <mmc.h>
20
21DECLARE_GLOBAL_DATA_PTR;
22
23#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
24 PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
25 PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
26
27int dram_init(void)
28{
29 gd->ram_size = imx_ddr_size();
30
31 return 0;
32}
33
34static iomux_v3_cfg_t const uart1_pads[] = {
35 MX6_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
36 MX6_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
37};
38
39static void setup_iomux_uart(void)
40{
41 imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
42}
43
44int board_mmc_get_env_dev(int devno)
45{
46 return devno;
47}
48
49int mmc_map_to_kernel_blk(int devno)
50{
51 return devno;
52}
53
54int board_early_init_f(void)
55{
56 setup_iomux_uart();
57
58 return 0;
59}
60
61int board_init(void)
62{
63 /* Address of boot parameters */
64 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
65
66 return 0;
67}
68
69#ifdef CONFIG_CMD_BMODE
70static const struct boot_mode board_boot_modes[] = {
71 /* 4 bit bus width */
72 {"sd1", MAKE_CFGVAL(0x42, 0x20, 0x00, 0x00)},
73 {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
74 {"qspi1", MAKE_CFGVAL(0x10, 0x00, 0x00, 0x00)},
75 {NULL, 0},
76};
77#endif
78
79int board_late_init(void)
80{
81#ifdef CONFIG_CMD_BMODE
82 add_board_boot_modes(board_boot_modes);
83#endif
84
85#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Simon Glass6a38e412017-08-03 12:22:09 -060086 env_set("board_name", "EVK");
87 env_set("board_rev", "14X14");
Peng Fan81590632016-08-11 14:02:57 +080088#endif
89
90 return 0;
91}
92
93int checkboard(void)
94{
95 puts("Board: MX6ULL 14x14 EVK\n");
96
97 return 0;
98}