omap1510innovator.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * (C) Copyright 2002
  3. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  4. * Marius Groeger <mgroeger@sysgo.de>
  5. *
  6. * (C) Copyright 2002
  7. * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
  8. *
  9. * (C) Copyright 2003
  10. * Texas Instruments, <www.ti.com>
  11. * Kshitij Gupta <Kshitij@ti.com>
  12. *
  13. * See file CREDITS for list of people who contributed to this
  14. * project.
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License as
  18. * published by the Free Software Foundation; either version 2 of
  19. * the License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  29. * MA 02111-1307 USA
  30. */
  31. #include <common.h>
  32. static void flash__init (void);
  33. static void ether__init (void);
  34. static inline void delay (unsigned long loops)
  35. {
  36. __asm__ volatile ("1:\n"
  37. "subs %0, %1, #1\n"
  38. "bne 1b":"=r" (loops):"0" (loops));
  39. }
  40. /*
  41. * Miscellaneous platform dependent initialisations
  42. */
  43. int board_init (void)
  44. {
  45. DECLARE_GLOBAL_DATA_PTR;
  46. /* arch number of OMAP 1510-Board */
  47. gd->bd->bi_arch_number = 234;
  48. /* adress of boot parameters */
  49. gd->bd->bi_boot_params = 0x10000100;
  50. /* kk - this speeds up your boot a quite a bit. However to make it
  51. * work, you need make sure your kernel startup flush bug is fixed.
  52. * ... rkw ...
  53. */
  54. icache_enable ();
  55. flash__init ();
  56. ether__init ();
  57. return 0;
  58. }
  59. int misc_init_r (void)
  60. {
  61. /* volatile ushort *gdir = (ushort *) (GPIO_DIR_CONTROL_REG); */
  62. /* volatile ushort *mdir = (ushort *) (MPUIO_DIR_CONTROL_REG); */
  63. /* setup gpio direction to match board (no floats!) */
  64. /**gdir = 0xCFF9; */
  65. /**mdir = 0x103F; */
  66. return (0);
  67. }
  68. /******************************
  69. Routine:
  70. Description:
  71. ******************************/
  72. static void flash__init (void)
  73. {
  74. #define CS0_CHIP_SELECT_REG 0xfffecc10
  75. #define CS3_CHIP_SELECT_REG 0xfffecc1c
  76. #define EMIFS_GlB_Config_REG 0xfffecc0c
  77. {
  78. unsigned int regval;
  79. regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
  80. regval = regval | 0x0001; /* Turn off write protection for flash devices. */
  81. if (regval & 0x0002) {
  82. regval = regval & 0xfffd; /* Swap CS0 and CS3 so that flash is visible at 0x0 and eeprom at 0x0c000000. */
  83. /* If, instead, you want to reference flash at 0x0c000000, then it seemed the following were necessary. */
  84. /* *((volatile unsigned int *)CS0_CHIP_SELECT_REG) = 0x202090; / * Overrides head.S setting of 0x212090 */
  85. /* *((volatile unsigned int *)CS3_CHIP_SELECT_REG) = 0x202090; / * Let's flash chips be fully functional. */
  86. }
  87. *((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval;
  88. }
  89. }
  90. /******************************
  91. Routine:
  92. Description:
  93. ******************************/
  94. static void ether__init (void)
  95. {
  96. #define ETH_CONTROL_REG 0x0800000b
  97. /* take the Ethernet controller out of reset and wait
  98. * for the EEPROM load to complete.
  99. */
  100. *((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
  101. udelay (3);
  102. }
  103. int dram_init (void)
  104. {
  105. DECLARE_GLOBAL_DATA_PTR;
  106. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  107. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  108. return 0;
  109. }