sdp.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * (C) Copyright 2010
  3. * Texas Instruments Incorporated, <www.ti.com>
  4. * Aneesh V <aneesh@ti.com>
  5. * Steve Sakoman <steve@sakoman.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include <common.h>
  10. #include <twl6030.h>
  11. #include <asm/arch/sys_proto.h>
  12. #include <asm/arch/mmc_host_def.h>
  13. #include "sdp4430_mux_data.h"
  14. DECLARE_GLOBAL_DATA_PTR;
  15. const struct omap_sysinfo sysinfo = {
  16. "Board: OMAP4430 SDP\n"
  17. };
  18. /**
  19. * @brief board_init
  20. *
  21. * @return 0
  22. */
  23. int board_init(void)
  24. {
  25. gpmc_init();
  26. gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
  27. return 0;
  28. }
  29. int board_eth_init(bd_t *bis)
  30. {
  31. return 0;
  32. }
  33. /**
  34. * @brief misc_init_r - Configure SDP board specific configurations
  35. * such as power configurations, ethernet initialization as phase2 of
  36. * boot sequence
  37. *
  38. * @return 0
  39. */
  40. int misc_init_r(void)
  41. {
  42. #ifdef CONFIG_TWL6030_POWER
  43. twl6030_init_battery_charging();
  44. #endif
  45. return 0;
  46. }
  47. void set_muxconf_regs_essential(void)
  48. {
  49. do_set_mux((*ctrl)->control_padconf_core_base,
  50. core_padconf_array_essential,
  51. sizeof(core_padconf_array_essential) /
  52. sizeof(struct pad_conf_entry));
  53. do_set_mux((*ctrl)->control_padconf_wkup_base,
  54. wkup_padconf_array_essential,
  55. sizeof(wkup_padconf_array_essential) /
  56. sizeof(struct pad_conf_entry));
  57. if ((omap_revision() >= OMAP4460_ES1_0) &&
  58. (omap_revision() < OMAP4470_ES1_0))
  59. do_set_mux((*ctrl)->control_padconf_wkup_base,
  60. wkup_padconf_array_essential_4460,
  61. sizeof(wkup_padconf_array_essential_4460) /
  62. sizeof(struct pad_conf_entry));
  63. }
  64. void set_muxconf_regs_non_essential(void)
  65. {
  66. do_set_mux((*ctrl)->control_padconf_core_base,
  67. core_padconf_array_non_essential,
  68. sizeof(core_padconf_array_non_essential) /
  69. sizeof(struct pad_conf_entry));
  70. do_set_mux((*ctrl)->control_padconf_wkup_base,
  71. wkup_padconf_array_non_essential,
  72. sizeof(wkup_padconf_array_non_essential) /
  73. sizeof(struct pad_conf_entry));
  74. if (omap_revision() < OMAP4460_ES1_0) {
  75. do_set_mux((*ctrl)->control_padconf_wkup_base,
  76. wkup_padconf_array_non_essential_4430,
  77. sizeof(wkup_padconf_array_non_essential_4430) /
  78. sizeof(struct pad_conf_entry));
  79. }
  80. }
  81. #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
  82. int board_mmc_init(bd_t *bis)
  83. {
  84. omap_mmc_init(0, 0, 0, -1, -1);
  85. omap_mmc_init(1, 0, 0, -1, -1);
  86. return 0;
  87. }
  88. #endif
  89. /*
  90. * get_board_rev() - get board revision
  91. */
  92. u32 get_board_rev(void)
  93. {
  94. return 0x20;
  95. }