tricorder.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * (C) Copyright 2012
  3. * Corscience GmbH & Co. KG, <www.corscience.de>
  4. * Thomas Weber <weber@corscience.de>
  5. * Sunil Kumar <sunilsaini05@gmail.com>
  6. * Shashi Ranjan <shashiranjanmca05@gmail.com>
  7. *
  8. * Derived from Devkit8000 code by
  9. * Frederik Kriewitz <frederik@kriewitz.eu>
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #include <common.h>
  30. #include <twl4030.h>
  31. #include <asm/io.h>
  32. #include <asm/arch/mmc_host_def.h>
  33. #include <asm/arch/mux.h>
  34. #include <asm/arch/sys_proto.h>
  35. #include <asm/arch/mem.h>
  36. #include "tricorder.h"
  37. DECLARE_GLOBAL_DATA_PTR;
  38. /*
  39. * Routine: board_init
  40. * Description: Early hardware init.
  41. */
  42. int board_init(void)
  43. {
  44. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  45. /* boot param addr */
  46. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  47. return 0;
  48. }
  49. /*
  50. * Routine: misc_init_r
  51. * Description: Configure board specific parts
  52. */
  53. int misc_init_r(void)
  54. {
  55. twl4030_power_init();
  56. #ifdef CONFIG_TWL4030_LED
  57. twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
  58. #endif
  59. dieid_num_r();
  60. return 0;
  61. }
  62. /*
  63. * Routine: set_muxconf_regs
  64. * Description: Setting up the configuration Mux registers specific to the
  65. * hardware. Many pins need to be moved from protect to primary
  66. * mode.
  67. */
  68. void set_muxconf_regs(void)
  69. {
  70. MUX_TRICORDER();
  71. }
  72. #if defined(CONFIG_GENERIC_MMC) && !(defined(CONFIG_SPL_BUILD))
  73. int board_mmc_init(bd_t *bis)
  74. {
  75. return omap_mmc_init(0, 0, 0);
  76. }
  77. #endif
  78. /*
  79. * Routine: get_board_mem_timings
  80. * Description: If we use SPL then there is no x-loader nor config header
  81. * so we have to setup the DDR timings ourself on the first bank. This
  82. * provides the timing values back to the function that configures
  83. * the memory. We have either one or two banks of 128MB DDR.
  84. */
  85. void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
  86. u32 *mr)
  87. {
  88. /* General SDRC config */
  89. *mcfg = MICRON_V_MCFG_165(128 << 20);
  90. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  91. /* AC timings */
  92. *ctrla = MICRON_V_ACTIMA_165;
  93. *ctrlb = MICRON_V_ACTIMB_165;
  94. *mr = MICRON_V_MR_165;
  95. }