twister.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright (C) 2011
  3. * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
  4. *
  5. * Copyright (C) 2009 TechNexion Ltd.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <netdev.h>
  27. #include <asm/io.h>
  28. #include <asm/arch/mem.h>
  29. #include <asm/arch/mux.h>
  30. #include <asm/arch/sys_proto.h>
  31. #include <asm/omap_gpio.h>
  32. #include <asm/arch/mmc_host_def.h>
  33. #include <i2c.h>
  34. #include <asm/gpio.h>
  35. #include "twister.h"
  36. DECLARE_GLOBAL_DATA_PTR;
  37. /* Timing definitions for Ethernet Controller */
  38. static const u32 gpmc_smc911[] = {
  39. NET_GPMC_CONFIG1,
  40. NET_GPMC_CONFIG2,
  41. NET_GPMC_CONFIG3,
  42. NET_GPMC_CONFIG4,
  43. NET_GPMC_CONFIG5,
  44. NET_GPMC_CONFIG6,
  45. };
  46. static const u32 gpmc_XR16L2751[] = {
  47. XR16L2751_GPMC_CONFIG1,
  48. XR16L2751_GPMC_CONFIG2,
  49. XR16L2751_GPMC_CONFIG3,
  50. XR16L2751_GPMC_CONFIG4,
  51. XR16L2751_GPMC_CONFIG5,
  52. XR16L2751_GPMC_CONFIG6,
  53. };
  54. int board_init(void)
  55. {
  56. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  57. /* boot param addr */
  58. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  59. /* Chip select 1 and 3 are used for XR16L2751 UART controller */
  60. enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[1],
  61. XR16L2751_UART1_BASE, GPMC_SIZE_16M);
  62. enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[3],
  63. XR16L2751_UART2_BASE, GPMC_SIZE_16M);
  64. gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB_PHY1_RESET");
  65. gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
  66. return 0;
  67. }
  68. int misc_init_r(void)
  69. {
  70. dieid_num_r();
  71. return 0;
  72. }
  73. /*
  74. * Routine: set_muxconf_regs
  75. * Description: Setting up the configuration Mux registers specific to the
  76. * hardware. Many pins need to be moved from protect to primary
  77. * mode.
  78. */
  79. void set_muxconf_regs(void)
  80. {
  81. MUX_TWISTER();
  82. }
  83. int board_eth_init(bd_t *bis)
  84. {
  85. davinci_emac_initialize();
  86. /* init cs for extern lan */
  87. enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
  88. CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
  89. if (smc911x_initialize(0, CONFIG_SMC911X_BASE) <= 0)
  90. printf("\nError initializing SMC911x controlleri\n");
  91. return 0;
  92. }
  93. #if defined(CONFIG_OMAP_HSMMC) && \
  94. !defined(CONFIG_SPL_BUILD)
  95. int board_mmc_init(bd_t *bis)
  96. {
  97. return omap_mmc_init(0);
  98. }
  99. #endif