mb.c 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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},
  64. /* SMC2 TXD */
  65. /* PA8 */ {1, 1, 0, 0, 0, 0},
  66. /* SMC2 RXD */
  67. /* PA7 */ {0, 0, 0, 0, 0, 0},
  68. /* PA6 */ {0, 0, 0, 0, 0, 0},
  69. /* PA5 */ {0, 0, 0, 0, 0, 0},
  70. /* PA4 */ {0, 0, 0, 0, 0, 0},
  71. /* PA3 */ {0, 0, 0, 0, 0, 0},
  72. /* PA2 */ {0, 0, 0, 0, 0, 0},
  73. /* PA1 */ {0, 0, 0, 0, 0, 0},
  74. /* PA0 */ {0, 0, 0, 0, 0, 0}
  75. },
  76. { /* conf ppar psor pdir podr pdat */
  77. /* PB31 */ {0, 0, 0, 0, 0, 0},
  78. /* PB30 */ {0, 0, 0, 0, 0, 0},
  79. /* PB29 */ {0, 0, 0, 0, 0, 0},
  80. /* PB28 */ {0, 0, 0, 0, 0, 0},
  81. /* PB27 */ {0, 0, 0, 0, 0, 0},
  82. /* PB26 */ {0, 0, 0, 0, 0, 0},
  83. /* PB25 */ {0, 0, 0, 0, 0, 0},
  84. /* PB24 */ {0, 0, 0, 0, 0, 0},
  85. /* PB23 */ {0, 0, 0, 0, 0, 0},
  86. /* PB22 */ {0, 0, 0, 0, 0, 0},
  87. /* PB21 */ {0, 0, 0, 0, 0, 0},
  88. /* PB20 */ {0, 0, 0, 0, 0, 0},
  89. /* PB19 */ {0, 0, 0, 0, 0, 0},
  90. /* PB18 */ {0, 0, 0, 0, 0, 0},
  91. /* PB17 */ {0, 0, 0, 0, 0, 0},
  92. /* PB16 */ {0, 0, 0, 0, 0, 0},
  93. /* PB15 */ {0, 0, 0, 0, 0, 0},
  94. /* PB14 */ {0, 0, 0, 0, 0, 0},
  95. /* PB13 */ {0, 0, 0, 0, 0, 0},
  96. /* PB12 */ {0, 0, 0, 0, 0, 0},
  97. /* PB11 */ {0, 0, 0, 0, 0, 0},
  98. /* PB10 */ {0, 0, 0, 0, 0, 0},
  99. /* PB9 */ {0, 0, 0, 0, 0, 0},
  100. /* PB8 */ {0, 0, 0, 0, 0, 0},
  101. /* PB7 */ {0, 0, 0, 0, 0, 0},
  102. /* PB6 */ {0, 0, 0, 0, 0, 0},
  103. /* PB5 */ {0, 0, 0, 0, 0, 0},
  104. /* PB4 */ {0, 0, 0, 0, 0, 0},
  105. /* PB3 */ {0, 0, 0, 0, 0, 0},
  106. /* pin doesn't exist */
  107. /* PB2 */ {0, 0, 0, 0, 0, 0},
  108. /* pin doesn't exist */
  109. /* PB1 */ {0, 0, 0, 0, 0, 0},
  110. /* pin doesn't exist */
  111. /* PB0 */ {0, 0, 0, 0, 0, 0}
  112. /* pin doesn't exist */
  113. },
  114. { /* conf ppar psor pdir podr pdat */
  115. /* PC31 */ {0, 0, 0, 0, 0, 0},
  116. /* PC30 */ {0, 0, 0, 0, 0, 0},
  117. /* PC29 */ {0, 0, 0, 0, 0, 0},
  118. /* PC28 */ {0, 0, 0, 0, 0, 0},
  119. /* PC27 */ {0, 0, 0, 0, 0, 0},
  120. /* PC26 */ {0, 0, 0, 0, 0, 0},
  121. /* PC25 */ {0, 0, 0, 0, 0, 0},
  122. /* PC24 */ {0, 0, 0, 0, 0, 0},
  123. /* PC23 */ {0, 0, 0, 0, 0, 0},
  124. /* PC22 */ {0, 0, 0, 0, 0, 0},
  125. /* PC21 */ {0, 0, 0, 0, 0, 0},
  126. /* PC20 */ {0, 0, 0, 0, 0, 0},
  127. /* PC19 */ {0, 0, 0, 0, 0, 0},
  128. /* PC18 */ {0, 0, 0, 0, 0, 0},
  129. /* PC17 */ {0, 0, 0, 0, 0, 0},
  130. /* PC16 */ {0, 0, 0, 0, 0, 0},
  131. /* PC15 */ {0, 0, 0, 0, 0, 0},
  132. /* PC14 */ {0, 0, 0, 0, 0, 0},
  133. /* PC13 */ {0, 0, 0, 0, 0, 0},
  134. /* PC12 */ {0, 0, 0, 0, 0, 0},
  135. /* PC11 */ {0, 0, 0, 0, 0, 0},
  136. /* PC10 */ {0, 0, 0, 0, 0, 0},
  137. /* PC9 */ {0, 0, 0, 0, 0, 0},
  138. /* PC8 */ {0, 0, 0, 0, 0, 0},
  139. /* PC7 */ {0, 0, 0, 0, 0, 0},
  140. /* PC6 */ {0, 0, 0, 0, 0, 0},
  141. /* PC5 */ {0, 0, 0, 0, 0, 0},
  142. /* PC4 */ {0, 0, 0, 0, 0, 0},
  143. /* PC3 */ {0, 0, 0, 0, 0, 0},
  144. /* PC2 */ {0, 0, 0, 0, 0, 0},
  145. /* PC1 */ {0, 0, 0, 0, 0, 0},
  146. /* PC0 */ {0, 0, 0, 0, 0, 0}
  147. },
  148. { /* conf ppar psor pdir podr pdat */
  149. /* PD31 */ {0, 0, 0, 0, 0, 0},
  150. /* PD30 */ {0, 0, 0, 0, 0, 0},
  151. /* PD29 */ {0, 0, 0, 0, 0, 0},
  152. /* PD28 */ {0, 0, 0, 0, 0, 0},
  153. /* PD27 */ {0, 0, 0, 0, 0, 0},
  154. /* PD26 */ {0, 0, 0, 0, 0, 0},
  155. /* PD25 */ {0, 0, 0, 0, 0, 0},
  156. /* PD24 */ {0, 0, 0, 0, 0, 0},
  157. /* PD23 */ {0, 0, 0, 0, 0, 0},
  158. /* PD22 */ {0, 0, 0, 0, 0, 0},
  159. /* PD21 */ {0, 0, 0, 0, 0, 0},
  160. /* PD20 */ {0, 0, 0, 0, 0, 0},
  161. /* PD19 */ {0, 0, 0, 0, 0, 0},
  162. /* PD18 */ {0, 0, 0, 0, 0, 0},
  163. /* PD17 */ {0, 0, 0, 0, 0, 0},
  164. /* PD16 */ {0, 0, 0, 0, 0, 0},
  165. /* PD15 */ {1, 1, 1, 0, 0, 0},
  166. /* I2C SDA */
  167. /* PD14 */ {1, 1, 1, 0, 0, 0},
  168. /* I2C SCL */
  169. /* PD13 */ {0, 0, 0, 0, 0, 0},
  170. /* PD12 */ {0, 0, 0, 0, 0, 0},
  171. /* PD11 */ {0, 0, 0, 0, 0, 0},
  172. /* PD10 */ {0, 0, 0, 0, 0, 0},
  173. /* PD9 */ {1, 1, 0, 1, 0, 0},
  174. /* SMC1 TXD */
  175. /* PD8 */ {1, 1, 0, 0, 0, 0},
  176. /* SMC1 RXD */
  177. /* PD7 */ {0, 0, 0, 0, 0, 0},
  178. /* PD6 */ {0, 0, 0, 0, 0, 0},
  179. /* PD5 */ {0, 0, 0, 0, 0, 0},
  180. /* PD4 */ {0, 0, 0, 0, 0, 0},
  181. /* PD3 */ {0, 0, 0, 0, 0, 0},
  182. /* pin doesn't exist */
  183. /* PD2 */ {0, 0, 0, 0, 0, 0},
  184. /* pin doesn't exist */
  185. /* PD1 */ {0, 0, 0, 0, 0, 0},
  186. /* pin doesn't exist */
  187. /* PD0 */ {0, 0, 0, 0, 0, 0}
  188. /* pin doesn't exist */
  189. }
  190. };
  191. #endif /* CONFIG_8260 */
  192. /* ------------------------------------------------------------------------- */
  193. /*
  194. * Check Board Identity:
  195. */
  196. int checkboard (void)
  197. {
  198. puts ("Board: Cogent " COGENT_MOTHERBOARD " motherboard with a "
  199. COGENT_CPU_MODULE " CPU Module\n");
  200. return (0);
  201. }
  202. /* ------------------------------------------------------------------------- */
  203. /*
  204. * Miscelaneous platform dependent initialisations while still
  205. * running in flash
  206. */
  207. int misc_init_f (void)
  208. {
  209. printf ("DIPSW: ");
  210. dipsw_init ();
  211. return (0);
  212. }
  213. /* ------------------------------------------------------------------------- */
  214. phys_size_t initdram (int board_type)
  215. {
  216. #ifdef CONFIG_CMA111
  217. return (32L * 1024L * 1024L);
  218. #else
  219. unsigned char dipsw_val;
  220. int dual, size0, size1;
  221. long int memsize;
  222. dipsw_val = dipsw_cooked ();
  223. dual = dipsw_val & 0x01;
  224. size0 = (dipsw_val & 0x08) >> 3;
  225. size1 = (dipsw_val & 0x04) >> 2;
  226. if (size0)
  227. if (size1)
  228. memsize = 16L * 1024L * 1024L;
  229. else
  230. memsize = 1L * 1024L * 1024L;
  231. else if (size1)
  232. memsize = 4L * 1024L * 1024L;
  233. else {
  234. printf ("[Illegal dip switch settings - assuming 16Mbyte SIMMs] ");
  235. memsize = 16L * 1024L * 1024L; /* shouldn't happen - guess 16M */
  236. }
  237. if (dual)
  238. memsize *= 2L;
  239. return (memsize);
  240. #endif
  241. }
  242. /* ------------------------------------------------------------------------- */
  243. /*
  244. * Miscelaneous platform dependent initialisations after monitor
  245. * has been relocated into ram
  246. */
  247. int misc_init_r (void)
  248. {
  249. printf ("LCD: ");
  250. lcd_init ();
  251. #if 0
  252. printf ("RTC: ");
  253. rtc_init ();
  254. printf ("PAR: ");
  255. par_init ();
  256. printf ("KBM: ");
  257. kbm_init ();
  258. printf ("PCI: ");
  259. pci_init ();
  260. #endif
  261. return (0);
  262. }