Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peng Fan | 8159063 | 2016-08-11 14:02:57 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Freescale Semiconductor, Inc. |
Peng Fan | 8159063 | 2016-08-11 14:02:57 +0800 | [diff] [blame] | 4 | */ |
| 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 Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 13 | #include <asm/mach-imx/iomux-v3.h> |
| 14 | #include <asm/mach-imx/boot_mode.h> |
Peng Fan | 8159063 | 2016-08-11 14:02:57 +0800 | [diff] [blame] | 15 | #include <asm/io.h> |
| 16 | #include <common.h> |
| 17 | #include <fsl_esdhc.h> |
| 18 | #include <linux/sizes.h> |
| 19 | #include <mmc.h> |
| 20 | |
| 21 | DECLARE_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 | |
| 27 | int dram_init(void) |
| 28 | { |
| 29 | gd->ram_size = imx_ddr_size(); |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | static 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 | |
| 39 | static void setup_iomux_uart(void) |
| 40 | { |
| 41 | imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); |
| 42 | } |
| 43 | |
| 44 | int board_mmc_get_env_dev(int devno) |
| 45 | { |
| 46 | return devno; |
| 47 | } |
| 48 | |
| 49 | int mmc_map_to_kernel_blk(int devno) |
| 50 | { |
| 51 | return devno; |
| 52 | } |
| 53 | |
| 54 | int board_early_init_f(void) |
| 55 | { |
| 56 | setup_iomux_uart(); |
| 57 | |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | int 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 |
| 70 | static 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 | |
| 79 | int 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 Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 86 | env_set("board_name", "EVK"); |
| 87 | env_set("board_rev", "14X14"); |
Peng Fan | 8159063 | 2016-08-11 14:02:57 +0800 | [diff] [blame] | 88 | #endif |
| 89 | |
| 90 | return 0; |
| 91 | } |
| 92 | |
| 93 | int checkboard(void) |
| 94 | { |
| 95 | puts("Board: MX6ULL 14x14 EVK\n"); |
| 96 | |
| 97 | return 0; |
| 98 | } |