mpc8260ads.c 16 KB

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