mx6ullevk.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 <env.h>
  17. #include <fsl_esdhc_imx.h>
  18. #include <linux/sizes.h>
  19. #include <mmc.h>
  20. DECLARE_GLOBAL_DATA_PTR;
  21. #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
  22. PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
  23. PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
  24. int dram_init(void)
  25. {
  26. gd->ram_size = imx_ddr_size();
  27. return 0;
  28. }
  29. static iomux_v3_cfg_t const uart1_pads[] = {
  30. MX6_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
  31. MX6_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
  32. };
  33. static void setup_iomux_uart(void)
  34. {
  35. imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
  36. }
  37. int board_mmc_get_env_dev(int devno)
  38. {
  39. return devno;
  40. }
  41. int mmc_map_to_kernel_blk(int devno)
  42. {
  43. return devno;
  44. }
  45. int board_early_init_f(void)
  46. {
  47. setup_iomux_uart();
  48. return 0;
  49. }
  50. int board_init(void)
  51. {
  52. /* Address of boot parameters */
  53. gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
  54. return 0;
  55. }
  56. #ifdef CONFIG_CMD_BMODE
  57. static const struct boot_mode board_boot_modes[] = {
  58. /* 4 bit bus width */
  59. {"sd1", MAKE_CFGVAL(0x42, 0x20, 0x00, 0x00)},
  60. {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
  61. {"qspi1", MAKE_CFGVAL(0x10, 0x00, 0x00, 0x00)},
  62. {NULL, 0},
  63. };
  64. #endif
  65. int board_late_init(void)
  66. {
  67. #ifdef CONFIG_CMD_BMODE
  68. add_board_boot_modes(board_boot_modes);
  69. #endif
  70. #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  71. env_set("board_name", "EVK");
  72. env_set("board_rev", "14X14");
  73. #endif
  74. return 0;
  75. }
  76. int checkboard(void)
  77. {
  78. puts("Board: MX6ULL 14x14 EVK\n");
  79. return 0;
  80. }