assabet.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * (C) Copyright 2002
  3. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  4. * Marius Groeger <mgroeger@sysgo.de>
  5. *
  6. * 2004 (c) MontaVista Software, Inc.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #include <common.h>
  27. #include <SA-1100.h>
  28. /* ------------------------------------------------------------------------- */
  29. /*
  30. * Board dependent initialisation
  31. */
  32. #define ECOR 0x8000
  33. #define ECOR_RESET 0x80
  34. #define ECOR_LEVEL_IRQ 0x40
  35. #define ECOR_WR_ATTRIB 0x04
  36. #define ECOR_ENABLE 0x01
  37. #define ECSR 0x8002
  38. #define ECSR_IOIS8 0x20
  39. #define ECSR_PWRDWN 0x04
  40. #define ECSR_INT 0x02
  41. #define SMC_IO_SHIFT 2
  42. #define NCR_0 (*((volatile u_char *)(0x100000a0)))
  43. #define NCR_ENET_OSC_EN (1<<3)
  44. static inline u8
  45. readb(volatile u8 * p)
  46. {
  47. return *p;
  48. }
  49. static inline void
  50. writeb(u8 v, volatile u8 * p)
  51. {
  52. *p = v;
  53. }
  54. static void
  55. smc_init(void)
  56. {
  57. u8 ecor;
  58. u8 ecsr;
  59. volatile u8 *addr = (volatile u8 *)(0x18000000 + (1 << 25));
  60. NCR_0 |= NCR_ENET_OSC_EN;
  61. udelay(100);
  62. ecor = readb(addr + (ECOR << SMC_IO_SHIFT)) & ~ECOR_RESET;
  63. writeb(ecor | ECOR_RESET, addr + (ECOR << SMC_IO_SHIFT));
  64. udelay(100);
  65. /*
  66. * The device will ignore all writes to the enable bit while
  67. * reset is asserted, even if the reset bit is cleared in the
  68. * same write. Must clear reset first, then enable the device.
  69. */
  70. writeb(ecor, addr + (ECOR << SMC_IO_SHIFT));
  71. writeb(ecor | ECOR_ENABLE, addr + (ECOR << SMC_IO_SHIFT));
  72. /*
  73. * Set the appropriate byte/word mode.
  74. */
  75. ecsr = readb(addr + (ECSR << SMC_IO_SHIFT)) & ~ECSR_IOIS8;
  76. ecsr |= ECSR_IOIS8;
  77. writeb(ecsr, addr + (ECSR << SMC_IO_SHIFT));
  78. udelay(100);
  79. }
  80. static void
  81. neponset_init(void)
  82. {
  83. smc_init();
  84. }
  85. int
  86. board_init(void)
  87. {
  88. DECLARE_GLOBAL_DATA_PTR;
  89. gd->bd->bi_arch_number = 25; /* Intel Assabet Board */
  90. gd->bd->bi_boot_params = 0xc0000100;
  91. neponset_init();
  92. return 0;
  93. }
  94. int
  95. dram_init(void)
  96. {
  97. DECLARE_GLOBAL_DATA_PTR;
  98. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  99. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  100. return (0);
  101. }