mx23_olinuxino.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Olimex MX23 Olinuxino board
  4. *
  5. * Copyright (C) 2013 Marek Vasut <marex@denx.de>
  6. */
  7. #include <common.h>
  8. #include <asm/gpio.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/iomux-mx23.h>
  11. #include <asm/arch/imx-regs.h>
  12. #include <asm/arch/clock.h>
  13. #include <asm/arch/sys_proto.h>
  14. #ifdef CONFIG_LED_STATUS
  15. #include <status_led.h>
  16. #endif
  17. DECLARE_GLOBAL_DATA_PTR;
  18. /*
  19. * Functions
  20. */
  21. int board_early_init_f(void)
  22. {
  23. /* IO0 clock at 480MHz */
  24. mxs_set_ioclk(MXC_IOCLK0, 480000);
  25. /* SSP0 clock at 96MHz */
  26. mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
  27. return 0;
  28. }
  29. #ifdef CONFIG_CMD_USB
  30. int board_ehci_hcd_init(int port)
  31. {
  32. /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */
  33. gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1);
  34. udelay(100);
  35. return 0;
  36. }
  37. int board_ehci_hcd_exit(int port)
  38. {
  39. /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */
  40. gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 0);
  41. return 0;
  42. }
  43. #endif
  44. int dram_init(void)
  45. {
  46. return mxs_dram_init();
  47. }
  48. #ifdef CONFIG_CMD_MMC
  49. static int mx23_olx_mmc_cd(int id)
  50. {
  51. return 1; /* Card always present */
  52. }
  53. int board_mmc_init(bd_t *bis)
  54. {
  55. return mxsmmc_initialize(bis, 0, NULL, mx23_olx_mmc_cd);
  56. }
  57. #endif
  58. int board_init(void)
  59. {
  60. /* Adress of boot parameters */
  61. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  62. #if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
  63. status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_STATE);
  64. #endif
  65. return 0;
  66. }