igep0030.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * (C) Copyright 2010
  3. * ISEE 2007 SL, <www.iseebcn.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <twl4030.h>
  25. #include <asm/io.h>
  26. #include <asm/arch/mem.h>
  27. #include <asm/arch/mmc_host_def.h>
  28. #include <asm/arch/mux.h>
  29. #include <asm/arch/sys_proto.h>
  30. #include <asm/mach-types.h>
  31. #include "igep0030.h"
  32. DECLARE_GLOBAL_DATA_PTR;
  33. /*
  34. * Routine: board_init
  35. * Description: Early hardware init.
  36. */
  37. int board_init(void)
  38. {
  39. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  40. /* boot param addr */
  41. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  42. return 0;
  43. }
  44. #ifdef CONFIG_SPL_BUILD
  45. /*
  46. * Routine: omap_rev_string
  47. * Description: For SPL builds output board rev
  48. */
  49. void omap_rev_string(void)
  50. {
  51. }
  52. /*
  53. * Routine: get_board_mem_timings
  54. * Description: If we use SPL then there is no x-loader nor config header
  55. * so we have to setup the DDR timings ourself on both banks.
  56. */
  57. void get_board_mem_timings(struct board_sdrc_timings *timings)
  58. {
  59. timings->mr = MICRON_V_MR_165;
  60. #ifdef CONFIG_BOOT_NAND
  61. timings->mcfg = MICRON_V_MCFG_200(256 << 20);
  62. timings->ctrla = MICRON_V_ACTIMA_200;
  63. timings->ctrlb = MICRON_V_ACTIMB_200;
  64. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  65. #else
  66. if (get_cpu_family() == CPU_OMAP34XX) {
  67. timings->mcfg = NUMONYX_V_MCFG_165(256 << 20);
  68. timings->ctrla = NUMONYX_V_ACTIMA_165;
  69. timings->ctrlb = NUMONYX_V_ACTIMB_165;
  70. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  71. } else {
  72. timings->mcfg = NUMONYX_V_MCFG_200(256 << 20);
  73. timings->ctrla = NUMONYX_V_ACTIMA_200;
  74. timings->ctrlb = NUMONYX_V_ACTIMB_200;
  75. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  76. }
  77. #endif
  78. }
  79. #endif
  80. #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
  81. int board_mmc_init(bd_t *bis)
  82. {
  83. omap_mmc_init(0, 0, 0);
  84. return 0;
  85. }
  86. #endif
  87. /*
  88. * Routine: misc_init_r
  89. * Description: Configure board specific parts
  90. */
  91. int misc_init_r(void)
  92. {
  93. twl4030_power_init();
  94. dieid_num_r();
  95. return 0;
  96. }
  97. /*
  98. * Routine: set_muxconf_regs
  99. * Description: Setting up the configuration Mux registers specific to the
  100. * hardware. Many pins need to be moved from protect to primary
  101. * mode.
  102. */
  103. void set_muxconf_regs(void)
  104. {
  105. MUX_DEFAULT();
  106. }