mx6ullevk.c 1.9 KB

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