cairo.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) 2014 DENX
  3. * Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr>
  4. *
  5. * Derived from code written by Robert Aigner (ra@spiid.net)
  6. *
  7. * Itself derived from Beagle Board and 3430 SDP code by
  8. * Richard Woodruff <r-woodruff2@ti.com>
  9. * Syed Mohammed Khasim <khasim@ti.com>
  10. *
  11. * SPDX-License-Identifier: GPL-2.0+
  12. */
  13. #include <common.h>
  14. #include <dm.h>
  15. #include <netdev.h>
  16. #include <ns16550.h>
  17. #include <asm/io.h>
  18. #include <asm/arch/mem.h>
  19. #include <asm/arch/mux.h>
  20. #include <asm/arch/sys_proto.h>
  21. #include <i2c.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/omap_mmc.h>
  24. #include "cairo.h"
  25. DECLARE_GLOBAL_DATA_PTR;
  26. /*
  27. * MUSB port on OMAP3EVM Rev >= E requires extvbus programming.
  28. */
  29. u8 omap3_evm_need_extvbus(void)
  30. {
  31. u8 retval = 0;
  32. /* TODO: verify if cairo handheld platform needs extvbus programming */
  33. return retval;
  34. }
  35. /*
  36. * Routine: board_init
  37. * Description: Early hardware init.
  38. */
  39. int board_init(void)
  40. {
  41. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  42. /* board id for Linux */
  43. gd->bd->bi_arch_number = MACH_TYPE_OMAP3_CAIRO;
  44. /* boot param addr */
  45. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  46. return 0;
  47. }
  48. /*
  49. * Routine: set_muxconf_regs
  50. * Description: Setting up the configuration Mux registers specific to the
  51. * hardware. Many pins need to be moved from protect to primary
  52. * mode.
  53. */
  54. void set_muxconf_regs(void)
  55. {
  56. MUX_CAIRO();
  57. }
  58. #if defined(CONFIG_GENERIC_MMC)
  59. int board_mmc_init(bd_t *bis)
  60. {
  61. return omap_mmc_init(0, 0, 0, -1, -1);
  62. }
  63. #endif
  64. #ifdef CONFIG_SPL_BUILD
  65. /*
  66. * Routine: get_board_mem_timings
  67. * Description: If we use SPL then there is no x-loader nor config header
  68. * so we have to setup the DDR timings ourself on the first bank. This
  69. * provides the timing values back to the function that configures
  70. * the memory.
  71. *
  72. * The Cairo board uses SAMSUNG DDR - K4X51163PG-FGC6
  73. */
  74. void get_board_mem_timings(struct board_sdrc_timings *timings)
  75. {
  76. timings->sharing = SAMSUNG_SHARING;
  77. timings->mcfg = SAMSUNG_V_MCFG_165(128 << 20);
  78. timings->ctrla = SAMSUNG_V_ACTIMA_165;
  79. timings->ctrlb = SAMSUNG_V_ACTIMB_165;
  80. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  81. timings->mr = SAMSUNG_V_MR_165;
  82. }
  83. #endif
  84. static const struct ns16550_platdata cairo_serial = {
  85. .base = OMAP34XX_UART2,
  86. .reg_shift = 2,
  87. .clock = V_NS16550_CLK,
  88. .fcr = UART_FCR_DEFVAL,
  89. };
  90. U_BOOT_DEVICE(cairo_uart) = {
  91. "ns16550_serial",
  92. &cairo_serial
  93. };
  94. /* force SPL booting into U-Boot, not Linux */
  95. #ifdef CONFIG_SPL_OS_BOOT
  96. int spl_start_uboot(void)
  97. {
  98. return 1;
  99. }
  100. #endif