mpc8260ads.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. /*
  2. * (C) Copyright 2001-2003
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * Modified during 2001 by
  6. * Advanced Communications Technologies (Australia) Pty. Ltd.
  7. * Howard Walker, Tuong Vu-Dinh
  8. *
  9. * (C) Copyright 2001, Stuart Hughes, Lineo Inc, stuarth@lineo.com
  10. * Added support for the 16M dram simm on the 8260ads boards
  11. *
  12. * See file CREDITS for list of people who contributed to this
  13. * project.
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License as
  17. * published by the Free Software Foundation; either version 2 of
  18. * the License, or (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28. * MA 02111-1307 USA
  29. */
  30. #include <common.h>
  31. #include <ioports.h>
  32. #include <mpc8260.h>
  33. #include <i2c.h>
  34. #include <spd.h>
  35. /*
  36. * I/O Port configuration table
  37. *
  38. * if conf is 1, then that port pin will be configured at boot time
  39. * according to the five values podr/pdir/ppar/psor/pdat for that entry
  40. */
  41. const iop_conf_t iop_conf_tab[4][32] = {
  42. /* Port A configuration */
  43. { /* conf ppar psor pdir podr pdat */
  44. /* PA31 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 TxENB */
  45. /* PA30 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 TxClav */
  46. /* PA29 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 TxSOC */
  47. /* PA28 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 RxENB */
  48. /* PA27 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 RxSOC */
  49. /* PA26 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 RxClav */
  50. /* PA25 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[0] */
  51. /* PA24 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[1] */
  52. /* PA23 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[2] */
  53. /* PA22 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[3] */
  54. /* PA21 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[4] */
  55. /* PA20 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[5] */
  56. /* PA19 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[6] */
  57. /* PA18 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[7] */
  58. /* PA17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[7] */
  59. /* PA16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[6] */
  60. /* PA15 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[5] */
  61. /* PA14 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[4] */
  62. /* PA13 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[3] */
  63. /* PA12 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[2] */
  64. /* PA11 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[1] */
  65. /* PA10 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[0] */
  66. /* PA9 */ { 0, 1, 1, 1, 0, 0 }, /* FCC1 L1TXD */
  67. /* PA8 */ { 0, 1, 1, 0, 0, 0 }, /* FCC1 L1RXD */
  68. /* PA7 */ { 0, 0, 0, 1, 0, 0 }, /* PA7 */
  69. /* PA6 */ { 1, 1, 1, 1, 0, 0 }, /* TDM A1 L1RSYNC */
  70. /* PA5 */ { 0, 0, 0, 1, 0, 0 }, /* PA5 */
  71. /* PA4 */ { 0, 0, 0, 1, 0, 0 }, /* PA4 */
  72. /* PA3 */ { 0, 0, 0, 1, 0, 0 }, /* PA3 */
  73. /* PA2 */ { 0, 0, 0, 1, 0, 0 }, /* PA2 */
  74. /* PA1 */ { 1, 0, 0, 0, 0, 0 }, /* FREERUN */
  75. /* PA0 */ { 0, 0, 0, 1, 0, 0 } /* PA0 */
  76. },
  77. /* Port B configuration */
  78. { /* conf ppar psor pdir podr pdat */
  79. /* PB31 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TX_ER */
  80. /* PB30 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_DV */
  81. /* PB29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC2 MII TX_EN */
  82. /* PB28 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_ER */
  83. /* PB27 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII COL */
  84. /* PB26 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII CRS */
  85. /* PB25 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[3] */
  86. /* PB24 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[2] */
  87. /* PB23 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[1] */
  88. /* PB22 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[0] */
  89. /* PB21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[0] */
  90. /* PB20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[1] */
  91. /* PB19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[2] */
  92. /* PB18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[3] */
  93. /* PB17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RX_DIV */
  94. /* PB16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RX_ERR */
  95. /* PB15 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TX_ERR */
  96. /* PB14 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TX_EN */
  97. /* PB13 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:COL */
  98. /* PB12 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:CRS */
  99. /* PB11 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  100. /* PB10 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  101. /* PB9 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  102. /* PB8 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  103. /* PB7 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  104. /* PB6 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  105. /* PB5 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  106. /* PB4 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  107. /* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  108. /* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  109. /* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  110. /* PB0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  111. },
  112. /* Port C */
  113. { /* conf ppar psor pdir podr pdat */
  114. /* PC31 */ { 0, 0, 0, 1, 0, 0 }, /* PC31 */
  115. /* PC30 */ { 0, 0, 0, 1, 0, 0 }, /* PC30 */
  116. /* PC29 */ { 0, 1, 1, 0, 0, 0 }, /* SCC1 EN *CLSN */
  117. /* PC28 */ { 0, 0, 0, 1, 0, 0 }, /* PC28 */
  118. /* PC27 */ { 0, 0, 0, 1, 0, 0 }, /* UART Clock in */
  119. /* PC26 */ { 0, 0, 0, 1, 0, 0 }, /* PC26 */
  120. /* PC25 */ { 0, 0, 0, 1, 0, 0 }, /* PC25 */
  121. /* PC24 */ { 0, 0, 0, 1, 0, 0 }, /* PC24 */
  122. /* PC23 */ { 0, 1, 0, 1, 0, 0 }, /* ATMTFCLK */
  123. /* PC22 */ { 0, 1, 0, 0, 0, 0 }, /* ATMRFCLK */
  124. /* PC21 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN RXCLK */
  125. /* PC20 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN TXCLK */
  126. /* PC19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_CLK CLK13 */
  127. /* PC18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC Tx Clock (CLK14) */
  128. /* PC17 */ { 0, 0, 0, 1, 0, 0 }, /* PC17 */
  129. /* PC16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC Tx Clock (CLK16) */
  130. /* PC15 */ { 0, 0, 0, 1, 0, 0 }, /* PC15 */
  131. /* PC14 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN *CD */
  132. /* PC13 */ { 0, 0, 0, 1, 0, 0 }, /* PC13 */
  133. /* PC12 */ { 0, 1, 0, 1, 0, 0 }, /* PC12 */
  134. /* PC11 */ { 0, 0, 0, 1, 0, 0 }, /* LXT971 transmit control */
  135. /* PC10 */ { 1, 1, 0, 0, 0, 0 }, /* LXT970 FETHMDC */
  136. /* PC9 */ { 1, 1, 0, 0, 0, 0 }, /* LXT970 FETHMDIO */
  137. /* PC8 */ { 0, 0, 0, 1, 0, 0 }, /* PC8 */
  138. /* PC7 */ { 0, 0, 0, 1, 0, 0 }, /* PC7 */
  139. /* PC6 */ { 0, 0, 0, 1, 0, 0 }, /* PC6 */
  140. /* PC5 */ { 0, 0, 0, 1, 0, 0 }, /* PC5 */
  141. /* PC4 */ { 0, 0, 0, 1, 0, 0 }, /* PC4 */
  142. /* PC3 */ { 0, 0, 0, 1, 0, 0 }, /* PC3 */
  143. /* PC2 */ { 0, 0, 0, 1, 0, 1 }, /* ENET FDE */
  144. /* PC1 */ { 0, 0, 0, 1, 0, 0 }, /* ENET DSQE */
  145. /* PC0 */ { 0, 0, 0, 1, 0, 0 }, /* ENET LBK */
  146. },
  147. /* Port D */
  148. { /* conf ppar psor pdir podr pdat */
  149. /* PD31 */ { 1, 1, 0, 0, 0, 0 }, /* SCC1 EN RxD */
  150. /* PD30 */ { 1, 1, 1, 1, 0, 0 }, /* SCC1 EN TxD */
  151. /* PD29 */ { 0, 1, 0, 1, 0, 0 }, /* SCC1 EN TENA */
  152. /* PD28 */ { 0, 1, 0, 0, 0, 0 }, /* PD28 */
  153. /* PD27 */ { 0, 1, 1, 1, 0, 0 }, /* PD27 */
  154. /* PD26 */ { 0, 0, 0, 1, 0, 0 }, /* PD26 */
  155. /* PD25 */ { 0, 0, 0, 1, 0, 0 }, /* PD25 */
  156. /* PD24 */ { 0, 0, 0, 1, 0, 0 }, /* PD24 */
  157. /* PD23 */ { 0, 0, 0, 1, 0, 0 }, /* PD23 */
  158. /* PD22 */ { 0, 0, 0, 1, 0, 0 }, /* PD22 */
  159. /* PD21 */ { 0, 0, 0, 1, 0, 0 }, /* PD21 */
  160. /* PD20 */ { 0, 0, 0, 1, 0, 0 }, /* PD20 */
  161. /* PD19 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */
  162. /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */
  163. /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */
  164. /* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXPRTY */
  165. /* PD15 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SDA */
  166. /* PD14 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SCL */
  167. /* PD13 */ { 0, 0, 0, 0, 0, 0 }, /* PD13 */
  168. /* PD12 */ { 0, 0, 0, 0, 0, 0 }, /* PD12 */
  169. /* PD11 */ { 0, 0, 0, 0, 0, 0 }, /* PD11 */
  170. /* PD10 */ { 0, 0, 0, 0, 0, 0 }, /* PD10 */
  171. /* PD9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC1 TXD */
  172. /* PD8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC1 RXD */
  173. /* PD7 */ { 0, 0, 0, 1, 0, 1 }, /* PD7 */
  174. /* PD6 */ { 0, 0, 0, 1, 0, 1 }, /* PD6 */
  175. /* PD5 */ { 0, 0, 0, 1, 0, 1 }, /* PD5 */
  176. /* PD4 */ { 0, 0, 0, 1, 0, 1 }, /* PD4 */
  177. /* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  178. /* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  179. /* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  180. /* PD0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  181. }
  182. };
  183. typedef struct bscr_ {
  184. unsigned long bcsr0;
  185. unsigned long bcsr1;
  186. unsigned long bcsr2;
  187. unsigned long bcsr3;
  188. unsigned long bcsr4;
  189. unsigned long bcsr5;
  190. unsigned long bcsr6;
  191. unsigned long bcsr7;
  192. } bcsr_t;
  193. void reset_phy (void)
  194. {
  195. volatile bcsr_t *bcsr = (bcsr_t *) CFG_BCSR;
  196. /* reset the FEC port */
  197. bcsr->bcsr1 &= ~FETH_RST;
  198. bcsr->bcsr1 |= FETH_RST;
  199. }
  200. int board_pre_init (void)
  201. {
  202. volatile bcsr_t *bcsr = (bcsr_t *) CFG_BCSR;
  203. bcsr->bcsr1 = ~FETHIEN & ~RS232EN_1;
  204. return 0;
  205. }
  206. #define ns2clk(ns) (ns / (1000000000 / CONFIG_8260_CLKIN) + 1)
  207. long int initdram (int board_type)
  208. {
  209. volatile immap_t *immap = (immap_t *) CFG_IMMR;
  210. volatile memctl8260_t *memctl = &immap->im_memctl;
  211. volatile uchar *ramaddr, c = 0xff;
  212. /* Initialisation is for 16MB DIMM the board is shipped with */
  213. long int msize = 16;
  214. uint or = 0xFF000CA0;
  215. uint psdmr = CFG_PSDMR;
  216. uint psrt = CFG_PSRT;
  217. int i;
  218. #ifndef CFG_RAMBOOT
  219. immap->im_siu_conf.sc_ppc_acr = 0x00000002;
  220. immap->im_siu_conf.sc_ppc_alrh = 0x01267893;
  221. immap->im_siu_conf.sc_tescr1 = 0x00004000;
  222. memctl->memc_mptpr = CFG_MPTPR;
  223. /* init local sdram, bank 4 */
  224. memctl->memc_lsrt = 0x00000010;
  225. memctl->memc_or4 = 0xFFC01480;
  226. memctl->memc_br4 = 0x04001861;
  227. memctl->memc_lsdmr = 0x2886A522;
  228. ramaddr = (uchar *) CFG_LSDRAM_BASE;
  229. *ramaddr = c;
  230. memctl->memc_lsdmr = 0x0886A522;
  231. for (i = 0; i < 8; i++) {
  232. *ramaddr = c;
  233. }
  234. memctl->memc_lsdmr = 0x1886A522;
  235. *ramaddr = c;
  236. memctl->memc_lsdmr = 0x4086A522;
  237. /* init sdram dimm */
  238. #ifdef CONFIG_SPD_EEPROM
  239. {
  240. spd_eeprom_t spd;
  241. uint pbi, bsel, rowst, lsb, tmp;
  242. i2c_read (CONFIG_SPD_ADDR, 0, 1, (uchar *) & spd, sizeof (spd));
  243. /* Bank-based interleaving is not supported for physical bank
  244. sizes greater than 128MB which is encoded as 0x20 in SPD
  245. */
  246. pbi = (spd.row_dens > 32) ? 1 : CONFIG_SDRAM_PBI;
  247. msize = spd.nrows * (4 * spd.row_dens); /* Mixed size not supported */
  248. or = ~(msize - 1) << 20; /* SDAM */
  249. switch (spd.nbanks) { /* BPD */
  250. case 2:
  251. bsel = 1;
  252. break;
  253. case 4:
  254. bsel = 2;
  255. or |= 0x00002000;
  256. break;
  257. case 8:
  258. bsel = 3;
  259. or |= 0x00004000;
  260. break;
  261. }
  262. lsb = 3; /* For 64-bit port, lsb is 3 bits */
  263. if (pbi) { /* Bus partition depends on interleaving */
  264. rowst = 32 - (spd.nrow_addr + spd.ncol_addr + bsel + lsb);
  265. or |= (rowst << 9); /* ROWST */
  266. } else {
  267. rowst = 32 - (spd.nrow_addr + spd.ncol_addr + lsb);
  268. or |= ((rowst * 2 - 12) << 9); /* ROWST */
  269. }
  270. or |= ((spd.nrow_addr - 9) << 6); /* NUMR */
  271. psdmr = (pbi << 31); /* PBI */
  272. /* Bus multiplexing parameters */
  273. tmp = 32 - (lsb + spd.nrow_addr); /* Tables 10-19 and 10-20 */
  274. psdmr |= ((tmp - (rowst - 5) - 13) << 24); /* SDAM */
  275. psdmr |= ((tmp - 3 - 12) << 21); /* BSMA */
  276. tmp = (31 - lsb - 10) - tmp;
  277. /* Pin connected to SDA10 is (31 - lsb - 10).
  278. rowst is multiplexed over (32 - (lsb + spd.nrow_addr)),
  279. so (rowst + tmp) alternates with AP.
  280. */
  281. if (pbi) /* Table 10-7 */
  282. psdmr |= ((10 - (rowst + tmp)) << 18); /* SDA10 */
  283. else
  284. psdmr |= ((12 - (rowst + tmp)) << 18); /* SDA10 */
  285. /* SDRAM device-specific parameters */
  286. tmp = ns2clk (70); /* Refresh recovery is not in SPD, so assume 70ns */
  287. switch (tmp) { /* RFRC */
  288. case 1:
  289. case 2:
  290. psdmr |= (1 << 15);
  291. break;
  292. case 3:
  293. case 4:
  294. case 5:
  295. case 6:
  296. case 7:
  297. case 8:
  298. psdmr |= ((tmp - 2) << 15);
  299. break;
  300. default:
  301. psdmr |= (7 << 15);
  302. }
  303. psdmr |= (ns2clk (spd.trp) % 8 << 12); /* PRETOACT */
  304. psdmr |= (ns2clk (spd.trcd) % 8 << 9); /* ACTTORW */
  305. /* BL=0 because for 64-bit SDRAM burst length must be 4 */
  306. /* LDOTOPRE ??? */
  307. for (i = 0, tmp = spd.write_lat; (i < 4) && ((tmp & 1) == 0); i++)
  308. tmp >>= 1;
  309. switch (i) { /* WRC */
  310. case 0:
  311. case 1:
  312. psdmr |= (1 << 4);
  313. break;
  314. case 2:
  315. case 3:
  316. psdmr |= (i << 4);
  317. break;
  318. }
  319. /* EAMUX=0 - no external address multiplexing */
  320. /* BUFCMD=0 - no external buffers */
  321. for (i = 1, tmp = spd.cas_lat; (i < 3) && ((tmp & 1) == 0); i++)
  322. tmp >>= 1;
  323. psdmr |= i; /* CL */
  324. switch (spd.refresh & 0x7F) {
  325. case 1:
  326. tmp = 3900;
  327. break;
  328. case 2:
  329. tmp = 7800;
  330. break;
  331. case 3:
  332. tmp = 31300;
  333. break;
  334. case 4:
  335. tmp = 62500;
  336. break;
  337. case 5:
  338. tmp = 125000;
  339. break;
  340. default:
  341. tmp = 15625;
  342. }
  343. psrt = tmp / (1000000000 / CONFIG_8260_CLKIN *
  344. ((memctl->memc_mptpr >> 8) + 1)) - 1;
  345. #ifdef SPD_DEBUG
  346. printf ("\nDIMM type: %-18.18s\n", spd.mpart);
  347. printf ("SPD size: %d\n", spd.info_size);
  348. printf ("EEPROM size: %d\n", 1 << spd.chip_size);
  349. printf ("Memory type: %d\n", spd.mem_type);
  350. printf ("Row addr: %d\n", spd.nrow_addr);
  351. printf ("Column addr: %d\n", spd.ncol_addr);
  352. printf ("# of rows: %d\n", spd.nrows);
  353. printf ("Row density: %d\n", spd.row_dens);
  354. printf ("# of banks: %d\n", spd.nbanks);
  355. printf ("Data width: %d\n",
  356. 256 * spd.dataw_msb + spd.dataw_lsb);
  357. printf ("Chip width: %d\n", spd.primw);
  358. printf ("Refresh rate: %02X\n", spd.refresh);
  359. printf ("CAS latencies: %02X\n", spd.cas_lat);
  360. printf ("Write latencies: %02X\n", spd.write_lat);
  361. printf ("tRP: %d\n", spd.trp);
  362. printf ("tRCD: %d\n", spd.trcd);
  363. printf ("OR=%X, PSDMR=%08X, PSRT=%0X\n", or, psdmr, psrt);
  364. #endif /* SPD_DEBUG */
  365. }
  366. #endif /* CONFIG_SPD_EEPROM */
  367. memctl->memc_psrt = psrt;
  368. memctl->memc_or2 = or;
  369. memctl->memc_br2 = CFG_SDRAM_BASE | 0x00000041;
  370. ramaddr = (uchar *) CFG_SDRAM_BASE;
  371. memctl->memc_psdmr = psdmr | 0x28000000; /* Precharge all banks */
  372. *ramaddr = c;
  373. memctl->memc_psdmr = psdmr | 0x08000000; /* CBR refresh */
  374. for (i = 0; i < 8; i++)
  375. *ramaddr = c;
  376. memctl->memc_psdmr = psdmr | 0x18000000; /* Mode Register write */
  377. *ramaddr = c;
  378. memctl->memc_psdmr = psdmr | 0x40000000; /* Refresh enable */
  379. *ramaddr = c;
  380. #endif
  381. /* return total ram size of DIMM */
  382. return (msize * 1024 * 1024);
  383. }
  384. int checkboard (void)
  385. {
  386. puts ("Board: Motorola MPC8260ADS\n");
  387. return 0;
  388. }