mb.c 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  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 <board/cogent/dipsw.h>
  25. #include <board/cogent/lcd.h>
  26. #include <board/cogent/rtc.h>
  27. #include <board/cogent/par.h>
  28. #include <board/cogent/pci.h>
  29. /* ------------------------------------------------------------------------- */
  30. #if defined(CONFIG_8260)
  31. #include <ioports.h>
  32. /*
  33. * I/O Port configuration table
  34. *
  35. * if conf is 1, then that port pin will be configured at boot time
  36. * according to the five values podr/pdir/ppar/psor/pdat for that entry
  37. */
  38. const iop_conf_t iop_conf_tab[4][32] = {
  39. /* Port A configuration */
  40. { /* conf ppar psor pdir podr pdat */
  41. /* PA31 */ { 0, 0, 0, 0, 0, 0 },
  42. /* PA30 */ { 0, 0, 0, 0, 0, 0 },
  43. /* PA29 */ { 0, 0, 0, 0, 0, 0 },
  44. /* PA28 */ { 0, 0, 0, 0, 0, 0 },
  45. /* PA27 */ { 0, 0, 0, 0, 0, 0 },
  46. /* PA26 */ { 0, 0, 0, 0, 0, 0 },
  47. /* PA25 */ { 0, 0, 0, 0, 0, 0 },
  48. /* PA24 */ { 0, 0, 0, 0, 0, 0 },
  49. /* PA23 */ { 0, 0, 0, 0, 0, 0 },
  50. /* PA22 */ { 0, 0, 0, 0, 0, 0 },
  51. /* PA21 */ { 0, 0, 0, 0, 0, 0 },
  52. /* PA20 */ { 0, 0, 0, 0, 0, 0 },
  53. /* PA19 */ { 0, 0, 0, 0, 0, 0 },
  54. /* PA18 */ { 0, 0, 0, 0, 0, 0 },
  55. /* PA17 */ { 0, 0, 0, 0, 0, 0 },
  56. /* PA16 */ { 0, 0, 0, 0, 0, 0 },
  57. /* PA15 */ { 0, 0, 0, 0, 0, 0 },
  58. /* PA14 */ { 0, 0, 0, 0, 0, 0 },
  59. /* PA13 */ { 0, 0, 0, 0, 0, 0 },
  60. /* PA12 */ { 0, 0, 0, 0, 0, 0 },
  61. /* PA11 */ { 0, 0, 0, 0, 0, 0 },
  62. /* PA10 */ { 0, 0, 0, 0, 0, 0 },
  63. /* PA9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
  64. /* PA8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC2 RXD */
  65. /* PA7 */ { 0, 0, 0, 0, 0, 0 },
  66. /* PA6 */ { 0, 0, 0, 0, 0, 0 },
  67. /* PA5 */ { 0, 0, 0, 0, 0, 0 },
  68. /* PA4 */ { 0, 0, 0, 0, 0, 0 },
  69. /* PA3 */ { 0, 0, 0, 0, 0, 0 },
  70. /* PA2 */ { 0, 0, 0, 0, 0, 0 },
  71. /* PA1 */ { 0, 0, 0, 0, 0, 0 },
  72. /* PA0 */ { 0, 0, 0, 0, 0, 0 }
  73. },
  74. { /* conf ppar psor pdir podr pdat */
  75. /* PB31 */ { 0, 0, 0, 0, 0, 0 },
  76. /* PB30 */ { 0, 0, 0, 0, 0, 0 },
  77. /* PB29 */ { 0, 0, 0, 0, 0, 0 },
  78. /* PB28 */ { 0, 0, 0, 0, 0, 0 },
  79. /* PB27 */ { 0, 0, 0, 0, 0, 0 },
  80. /* PB26 */ { 0, 0, 0, 0, 0, 0 },
  81. /* PB25 */ { 0, 0, 0, 0, 0, 0 },
  82. /* PB24 */ { 0, 0, 0, 0, 0, 0 },
  83. /* PB23 */ { 0, 0, 0, 0, 0, 0 },
  84. /* PB22 */ { 0, 0, 0, 0, 0, 0 },
  85. /* PB21 */ { 0, 0, 0, 0, 0, 0 },
  86. /* PB20 */ { 0, 0, 0, 0, 0, 0 },
  87. /* PB19 */ { 0, 0, 0, 0, 0, 0 },
  88. /* PB18 */ { 0, 0, 0, 0, 0, 0 },
  89. /* PB17 */ { 0, 0, 0, 0, 0, 0 },
  90. /* PB16 */ { 0, 0, 0, 0, 0, 0 },
  91. /* PB15 */ { 0, 0, 0, 0, 0, 0 },
  92. /* PB14 */ { 0, 0, 0, 0, 0, 0 },
  93. /* PB13 */ { 0, 0, 0, 0, 0, 0 },
  94. /* PB12 */ { 0, 0, 0, 0, 0, 0 },
  95. /* PB11 */ { 0, 0, 0, 0, 0, 0 },
  96. /* PB10 */ { 0, 0, 0, 0, 0, 0 },
  97. /* PB9 */ { 0, 0, 0, 0, 0, 0 },
  98. /* PB8 */ { 0, 0, 0, 0, 0, 0 },
  99. /* PB7 */ { 0, 0, 0, 0, 0, 0 },
  100. /* PB6 */ { 0, 0, 0, 0, 0, 0 },
  101. /* PB5 */ { 0, 0, 0, 0, 0, 0 },
  102. /* PB4 */ { 0, 0, 0, 0, 0, 0 },
  103. /* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  104. /* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  105. /* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  106. /* PB0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  107. },
  108. { /* conf ppar psor pdir podr pdat */
  109. /* PC31 */ { 0, 0, 0, 0, 0, 0 },
  110. /* PC30 */ { 0, 0, 0, 0, 0, 0 },
  111. /* PC29 */ { 0, 0, 0, 0, 0, 0 },
  112. /* PC28 */ { 0, 0, 0, 0, 0, 0 },
  113. /* PC27 */ { 0, 0, 0, 0, 0, 0 },
  114. /* PC26 */ { 0, 0, 0, 0, 0, 0 },
  115. /* PC25 */ { 0, 0, 0, 0, 0, 0 },
  116. /* PC24 */ { 0, 0, 0, 0, 0, 0 },
  117. /* PC23 */ { 0, 0, 0, 0, 0, 0 },
  118. /* PC22 */ { 0, 0, 0, 0, 0, 0 },
  119. /* PC21 */ { 0, 0, 0, 0, 0, 0 },
  120. /* PC20 */ { 0, 0, 0, 0, 0, 0 },
  121. /* PC19 */ { 0, 0, 0, 0, 0, 0 },
  122. /* PC18 */ { 0, 0, 0, 0, 0, 0 },
  123. /* PC17 */ { 0, 0, 0, 0, 0, 0 },
  124. /* PC16 */ { 0, 0, 0, 0, 0, 0 },
  125. /* PC15 */ { 0, 0, 0, 0, 0, 0 },
  126. /* PC14 */ { 0, 0, 0, 0, 0, 0 },
  127. /* PC13 */ { 0, 0, 0, 0, 0, 0 },
  128. /* PC12 */ { 0, 0, 0, 0, 0, 0 },
  129. /* PC11 */ { 0, 0, 0, 0, 0, 0 },
  130. /* PC10 */ { 0, 0, 0, 0, 0, 0 },
  131. /* PC9 */ { 0, 0, 0, 0, 0, 0 },
  132. /* PC8 */ { 0, 0, 0, 0, 0, 0 },
  133. /* PC7 */ { 0, 0, 0, 0, 0, 0 },
  134. /* PC6 */ { 0, 0, 0, 0, 0, 0 },
  135. /* PC5 */ { 0, 0, 0, 0, 0, 0 },
  136. /* PC4 */ { 0, 0, 0, 0, 0, 0 },
  137. /* PC3 */ { 0, 0, 0, 0, 0, 0 },
  138. /* PC2 */ { 0, 0, 0, 0, 0, 0 },
  139. /* PC1 */ { 0, 0, 0, 0, 0, 0 },
  140. /* PC0 */ { 0, 0, 0, 0, 0, 0 }
  141. },
  142. { /* conf ppar psor pdir podr pdat */
  143. /* PD31 */ { 0, 0, 0, 0, 0, 0 },
  144. /* PD30 */ { 0, 0, 0, 0, 0, 0 },
  145. /* PD29 */ { 0, 0, 0, 0, 0, 0 },
  146. /* PD28 */ { 0, 0, 0, 0, 0, 0 },
  147. /* PD27 */ { 0, 0, 0, 0, 0, 0 },
  148. /* PD26 */ { 0, 0, 0, 0, 0, 0 },
  149. /* PD25 */ { 0, 0, 0, 0, 0, 0 },
  150. /* PD24 */ { 0, 0, 0, 0, 0, 0 },
  151. /* PD23 */ { 0, 0, 0, 0, 0, 0 },
  152. /* PD22 */ { 0, 0, 0, 0, 0, 0 },
  153. /* PD21 */ { 0, 0, 0, 0, 0, 0 },
  154. /* PD20 */ { 0, 0, 0, 0, 0, 0 },
  155. /* PD19 */ { 0, 0, 0, 0, 0, 0 },
  156. /* PD18 */ { 0, 0, 0, 0, 0, 0 },
  157. /* PD17 */ { 0, 0, 0, 0, 0, 0 },
  158. /* PD16 */ { 0, 0, 0, 0, 0, 0 },
  159. /* PD15 */ { 1, 1, 1, 0, 0, 0 }, /* I2C SDA */
  160. /* PD14 */ { 1, 1, 1, 0, 0, 0 }, /* I2C SCL */
  161. /* PD13 */ { 0, 0, 0, 0, 0, 0 },
  162. /* PD12 */ { 0, 0, 0, 0, 0, 0 },
  163. /* PD11 */ { 0, 0, 0, 0, 0, 0 },
  164. /* PD10 */ { 0, 0, 0, 0, 0, 0 },
  165. /* PD9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC1 TXD */
  166. /* PD8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC1 RXD */
  167. /* PD7 */ { 0, 0, 0, 0, 0, 0 },
  168. /* PD6 */ { 0, 0, 0, 0, 0, 0 },
  169. /* PD5 */ { 0, 0, 0, 0, 0, 0 },
  170. /* PD4 */ { 0, 0, 0, 0, 0, 0 },
  171. /* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  172. /* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  173. /* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  174. /* PD0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  175. }
  176. };
  177. #endif /* CONFIG_8260 */
  178. /* ------------------------------------------------------------------------- */
  179. /*
  180. * Check Board Identity:
  181. */
  182. int
  183. checkboard(void)
  184. {
  185. puts ("Board: Cogent " COGENT_MOTHERBOARD " motherboard with a "
  186. COGENT_CPU_MODULE " CPU Module\n");
  187. return (0);
  188. }
  189. /* ------------------------------------------------------------------------- */
  190. /*
  191. * Miscelaneous platform dependent initialisations while still
  192. * running in flash
  193. */
  194. int misc_init_f (void)
  195. {
  196. printf ("DIPSW: ");
  197. dipsw_init();
  198. return (0);
  199. }
  200. /* ------------------------------------------------------------------------- */
  201. long int
  202. initdram(int board_type)
  203. {
  204. #if CONFIG_CMA111
  205. return (32L * 1024L * 1024L);
  206. #else
  207. unsigned char dipsw_val;
  208. int dual, size0, size1;
  209. long int memsize;
  210. dipsw_val = dipsw_cooked();
  211. dual = dipsw_val & 0x01;
  212. size0 = (dipsw_val & 0x08) >> 3;
  213. size1 = (dipsw_val & 0x04) >> 2;
  214. if (size0)
  215. if (size1)
  216. memsize = 16L * 1024L * 1024L;
  217. else
  218. memsize = 1L * 1024L * 1024L;
  219. else
  220. if (size1)
  221. memsize = 4L * 1024L * 1024L;
  222. else {
  223. printf("[Illegal dip switch settings - assuming 16Mbyte SIMMs] ");
  224. memsize = 16L * 1024L * 1024L; /* shouldn't happen - guess 16M */
  225. }
  226. if (dual)
  227. memsize *= 2L;
  228. return (memsize);
  229. #endif
  230. }
  231. /* ------------------------------------------------------------------------- */
  232. /*
  233. * Miscelaneous platform dependent initialisations after monitor
  234. * has been relocated into ram
  235. */
  236. int misc_init_r (void)
  237. {
  238. printf ("LCD: ");
  239. lcd_init();
  240. #if 0
  241. printf ("RTC: ");
  242. rtc_init();
  243. printf ("PAR: ");
  244. par_init();
  245. printf ("KBM: ");
  246. kbm_init();
  247. printf ("PCI: ");
  248. pci_init();
  249. #endif
  250. return (0);
  251. }