mpc8555cds.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. /*
  2. * Copyright 2004, 2011 Freescale Semiconductor.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <pci.h>
  8. #include <asm/processor.h>
  9. #include <asm/mmu.h>
  10. #include <asm/immap_85xx.h>
  11. #include <asm/fsl_ddr_sdram.h>
  12. #include <ioports.h>
  13. #include <spd_sdram.h>
  14. #include <libfdt.h>
  15. #include <fdt_support.h>
  16. #include "../common/cadmus.h"
  17. #include "../common/eeprom.h"
  18. #include "../common/via.h"
  19. #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  20. extern void ddr_enable_ecc(unsigned int dram_size);
  21. #endif
  22. void local_bus_init(void);
  23. /*
  24. * I/O Port configuration table
  25. *
  26. * if conf is 1, then that port pin will be configured at boot time
  27. * according to the five values podr/pdir/ppar/psor/pdat for that entry
  28. */
  29. const iop_conf_t iop_conf_tab[4][32] = {
  30. /* Port A configuration */
  31. { /* conf ppar psor pdir podr pdat */
  32. /* PA31 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 TxENB */
  33. /* PA30 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 TxClav */
  34. /* PA29 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 TxSOC */
  35. /* PA28 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 RxENB */
  36. /* PA27 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 RxSOC */
  37. /* PA26 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 RxClav */
  38. /* PA25 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[0] */
  39. /* PA24 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[1] */
  40. /* PA23 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[2] */
  41. /* PA22 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[3] */
  42. /* PA21 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[4] */
  43. /* PA20 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[5] */
  44. /* PA19 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[6] */
  45. /* PA18 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXD[7] */
  46. /* PA17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[7] */
  47. /* PA16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[6] */
  48. /* PA15 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[5] */
  49. /* PA14 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[4] */
  50. /* PA13 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[3] */
  51. /* PA12 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[2] */
  52. /* PA11 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[1] */
  53. /* PA10 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXD[0] */
  54. /* PA9 */ { 0, 1, 1, 1, 0, 0 }, /* FCC1 L1TXD */
  55. /* PA8 */ { 0, 1, 1, 0, 0, 0 }, /* FCC1 L1RXD */
  56. /* PA7 */ { 0, 0, 0, 1, 0, 0 }, /* PA7 */
  57. /* PA6 */ { 0, 1, 1, 1, 0, 0 }, /* TDM A1 L1RSYNC */
  58. /* PA5 */ { 0, 0, 0, 1, 0, 0 }, /* PA5 */
  59. /* PA4 */ { 0, 0, 0, 1, 0, 0 }, /* PA4 */
  60. /* PA3 */ { 0, 0, 0, 1, 0, 0 }, /* PA3 */
  61. /* PA2 */ { 0, 0, 0, 1, 0, 0 }, /* PA2 */
  62. /* PA1 */ { 1, 0, 0, 0, 0, 0 }, /* FREERUN */
  63. /* PA0 */ { 0, 0, 0, 1, 0, 0 } /* PA0 */
  64. },
  65. /* Port B configuration */
  66. { /* conf ppar psor pdir podr pdat */
  67. /* PB31 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TX_ER */
  68. /* PB30 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_DV */
  69. /* PB29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC2 MII TX_EN */
  70. /* PB28 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_ER */
  71. /* PB27 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII COL */
  72. /* PB26 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII CRS */
  73. /* PB25 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[3] */
  74. /* PB24 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[2] */
  75. /* PB23 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[1] */
  76. /* PB22 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[0] */
  77. /* PB21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[0] */
  78. /* PB20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[1] */
  79. /* PB19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[2] */
  80. /* PB18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[3] */
  81. /* PB17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RX_DIV */
  82. /* PB16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RX_ERR */
  83. /* PB15 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TX_ERR */
  84. /* PB14 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TX_EN */
  85. /* PB13 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:COL */
  86. /* PB12 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:CRS */
  87. /* PB11 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  88. /* PB10 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  89. /* PB9 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  90. /* PB8 */ { 0, 1, 0, 0, 0, 0 }, /* FCC3:RXD */
  91. /* PB7 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  92. /* PB6 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  93. /* PB5 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  94. /* PB4 */ { 0, 1, 0, 1, 0, 0 }, /* FCC3:TXD */
  95. /* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  96. /* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  97. /* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  98. /* PB0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  99. },
  100. /* Port C */
  101. { /* conf ppar psor pdir podr pdat */
  102. /* PC31 */ { 0, 0, 0, 1, 0, 0 }, /* PC31 */
  103. /* PC30 */ { 0, 0, 0, 1, 0, 0 }, /* PC30 */
  104. /* PC29 */ { 0, 1, 1, 0, 0, 0 }, /* SCC1 EN *CLSN */
  105. /* PC28 */ { 0, 0, 0, 1, 0, 0 }, /* PC28 */
  106. /* PC27 */ { 0, 0, 0, 1, 0, 0 }, /* UART Clock in */
  107. /* PC26 */ { 0, 0, 0, 1, 0, 0 }, /* PC26 */
  108. /* PC25 */ { 0, 0, 0, 1, 0, 0 }, /* PC25 */
  109. /* PC24 */ { 0, 0, 0, 1, 0, 0 }, /* PC24 */
  110. /* PC23 */ { 0, 1, 0, 1, 0, 0 }, /* ATMTFCLK */
  111. /* PC22 */ { 0, 1, 0, 0, 0, 0 }, /* ATMRFCLK */
  112. /* PC21 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN RXCLK */
  113. /* PC20 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN TXCLK */
  114. /* PC19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_CLK CLK13 */
  115. /* PC18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC Tx Clock (CLK14) */
  116. /* PC17 */ { 0, 0, 0, 1, 0, 0 }, /* PC17 */
  117. /* PC16 */ { 0, 1, 0, 0, 0, 0 }, /* FCC Tx Clock (CLK16) */
  118. /* PC15 */ { 1, 1, 0, 0, 0, 0 }, /* PC15 */
  119. /* PC14 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 EN *CD */
  120. /* PC13 */ { 0, 0, 0, 1, 0, 0 }, /* PC13 */
  121. /* PC12 */ { 0, 1, 0, 1, 0, 0 }, /* PC12 */
  122. /* PC11 */ { 0, 0, 0, 1, 0, 0 }, /* LXT971 transmit control */
  123. /* PC10 */ { 1, 0, 0, 1, 0, 0 }, /* FETHMDC */
  124. /* PC9 */ { 1, 0, 0, 0, 0, 0 }, /* FETHMDIO */
  125. /* PC8 */ { 0, 0, 0, 1, 0, 0 }, /* PC8 */
  126. /* PC7 */ { 0, 0, 0, 1, 0, 0 }, /* PC7 */
  127. /* PC6 */ { 0, 0, 0, 1, 0, 0 }, /* PC6 */
  128. /* PC5 */ { 0, 0, 0, 1, 0, 0 }, /* PC5 */
  129. /* PC4 */ { 0, 0, 0, 1, 0, 0 }, /* PC4 */
  130. /* PC3 */ { 0, 0, 0, 1, 0, 0 }, /* PC3 */
  131. /* PC2 */ { 0, 0, 0, 1, 0, 1 }, /* ENET FDE */
  132. /* PC1 */ { 0, 0, 0, 1, 0, 0 }, /* ENET DSQE */
  133. /* PC0 */ { 0, 0, 0, 1, 0, 0 }, /* ENET LBK */
  134. },
  135. /* Port D */
  136. { /* conf ppar psor pdir podr pdat */
  137. /* PD31 */ { 1, 1, 0, 0, 0, 0 }, /* SCC1 EN RxD */
  138. /* PD30 */ { 1, 1, 1, 1, 0, 0 }, /* SCC1 EN TxD */
  139. /* PD29 */ { 1, 1, 0, 1, 0, 0 }, /* SCC1 EN TENA */
  140. /* PD28 */ { 0, 1, 0, 0, 0, 0 }, /* PD28 */
  141. /* PD27 */ { 0, 1, 1, 1, 0, 0 }, /* PD27 */
  142. /* PD26 */ { 0, 0, 0, 1, 0, 0 }, /* PD26 */
  143. /* PD25 */ { 0, 0, 0, 1, 0, 0 }, /* PD25 */
  144. /* PD24 */ { 0, 0, 0, 1, 0, 0 }, /* PD24 */
  145. /* PD23 */ { 0, 0, 0, 1, 0, 0 }, /* PD23 */
  146. /* PD22 */ { 0, 0, 0, 1, 0, 0 }, /* PD22 */
  147. /* PD21 */ { 0, 0, 0, 1, 0, 0 }, /* PD21 */
  148. /* PD20 */ { 0, 0, 0, 1, 0, 0 }, /* PD20 */
  149. /* PD19 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */
  150. /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */
  151. /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */
  152. /* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXPRTY */
  153. /* PD15 */ { 0, 1, 1, 0, 1, 0 }, /* I2C SDA */
  154. /* PD14 */ { 0, 0, 0, 1, 0, 0 }, /* LED */
  155. /* PD13 */ { 0, 0, 0, 0, 0, 0 }, /* PD13 */
  156. /* PD12 */ { 0, 0, 0, 0, 0, 0 }, /* PD12 */
  157. /* PD11 */ { 0, 0, 0, 0, 0, 0 }, /* PD11 */
  158. /* PD10 */ { 0, 0, 0, 0, 0, 0 }, /* PD10 */
  159. /* PD9 */ { 0, 1, 0, 1, 0, 0 }, /* SMC1 TXD */
  160. /* PD8 */ { 0, 1, 0, 0, 0, 0 }, /* SMC1 RXD */
  161. /* PD7 */ { 0, 0, 0, 1, 0, 1 }, /* PD7 */
  162. /* PD6 */ { 0, 0, 0, 1, 0, 1 }, /* PD6 */
  163. /* PD5 */ { 0, 0, 0, 1, 0, 1 }, /* PD5 */
  164. /* PD4 */ { 0, 0, 0, 1, 0, 1 }, /* PD4 */
  165. /* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  166. /* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  167. /* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
  168. /* PD0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
  169. }
  170. };
  171. int checkboard (void)
  172. {
  173. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  174. char buf[32];
  175. /* PCI slot in USER bits CSR[6:7] by convention. */
  176. uint pci_slot = get_pci_slot ();
  177. uint pci_dual = get_pci_dual (); /* PCI DUAL in CM_PCI[3] */
  178. uint pci1_32 = gur->pordevsr & 0x10000; /* PORDEVSR[15] */
  179. uint pci1_clk_sel = gur->porpllsr & 0x8000; /* PORPLLSR[16] */
  180. uint pci2_clk_sel = gur->porpllsr & 0x4000; /* PORPLLSR[17] */
  181. uint pci1_speed = get_clock_freq (); /* PCI PSPEED in [4:5] */
  182. uint cpu_board_rev = get_cpu_board_revision ();
  183. printf ("Board: CDS Version 0x%02x, PCI Slot %d\n",
  184. get_board_version (), pci_slot);
  185. printf ("CPU Board Revision %d.%d (0x%04x)\n",
  186. MPC85XX_CPU_BOARD_MAJOR (cpu_board_rev),
  187. MPC85XX_CPU_BOARD_MINOR (cpu_board_rev), cpu_board_rev);
  188. printf("PCI1: %d bit, %s MHz, %s\n",
  189. (pci1_32) ? 32 : 64,
  190. strmhz(buf, pci1_speed),
  191. pci1_clk_sel ? "sync" : "async");
  192. if (pci_dual) {
  193. printf("PCI2: 32 bit, 66 MHz, %s\n",
  194. pci2_clk_sel ? "sync" : "async");
  195. } else {
  196. printf("PCI2: disabled\n");
  197. }
  198. /*
  199. * Initialize local bus.
  200. */
  201. local_bus_init ();
  202. return 0;
  203. }
  204. /*
  205. * Initialize Local Bus
  206. */
  207. void
  208. local_bus_init(void)
  209. {
  210. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  211. volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
  212. uint clkdiv;
  213. uint lbc_hz;
  214. sys_info_t sysinfo;
  215. uint temp_lbcdll;
  216. /*
  217. * Errata LBC11.
  218. * Fix Local Bus clock glitch when DLL is enabled.
  219. *
  220. * If localbus freq is < 66MHz, DLL bypass mode must be used.
  221. * If localbus freq is > 133MHz, DLL can be safely enabled.
  222. * Between 66 and 133, the DLL is enabled with an override workaround.
  223. */
  224. get_sys_info(&sysinfo);
  225. clkdiv = lbc->lcrr & LCRR_CLKDIV;
  226. lbc_hz = sysinfo.freq_systembus / 1000000 / clkdiv;
  227. if (lbc_hz < 66) {
  228. lbc->lcrr |= LCRR_DBYP; /* DLL Bypass */
  229. } else if (lbc_hz >= 133) {
  230. lbc->lcrr &= (~LCRR_DBYP); /* DLL Enabled */
  231. } else {
  232. lbc->lcrr &= (~LCRR_DBYP); /* DLL Enabled */
  233. udelay(200);
  234. /*
  235. * Sample LBC DLL ctrl reg, upshift it to set the
  236. * override bits.
  237. */
  238. temp_lbcdll = gur->lbcdllcr;
  239. gur->lbcdllcr = (((temp_lbcdll & 0xff) << 16) | 0x80000000);
  240. asm("sync;isync;msync");
  241. }
  242. }
  243. /*
  244. * Initialize SDRAM memory on the Local Bus.
  245. */
  246. void lbc_sdram_init(void)
  247. {
  248. #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM)
  249. uint idx;
  250. volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
  251. uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE;
  252. uint cpu_board_rev;
  253. uint lsdmr_common;
  254. puts("LBC SDRAM: ");
  255. print_size(CONFIG_SYS_LBC_SDRAM_SIZE * 1024 * 1024,
  256. "\n ");
  257. /*
  258. * Setup SDRAM Base and Option Registers
  259. */
  260. set_lbc_or(2, CONFIG_SYS_OR2_PRELIM);
  261. set_lbc_br(2, CONFIG_SYS_BR2_PRELIM);
  262. lbc->lbcr = CONFIG_SYS_LBC_LBCR;
  263. asm("msync");
  264. lbc->lsrt = CONFIG_SYS_LBC_LSRT;
  265. lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
  266. asm("msync");
  267. /*
  268. * Determine which address lines to use baed on CPU board rev.
  269. */
  270. cpu_board_rev = get_cpu_board_revision();
  271. lsdmr_common = CONFIG_SYS_LBC_LSDMR_COMMON;
  272. if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_0) {
  273. lsdmr_common |= LSDMR_BSMA1617;
  274. } else if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_1) {
  275. lsdmr_common |= LSDMR_BSMA1516;
  276. } else {
  277. /*
  278. * Assume something unable to identify itself is
  279. * really old, and likely has lines 16/17 mapped.
  280. */
  281. lsdmr_common |= LSDMR_BSMA1617;
  282. }
  283. /*
  284. * Issue PRECHARGE ALL command.
  285. */
  286. lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL;
  287. asm("sync;msync");
  288. *sdram_addr = 0xff;
  289. ppcDcbf((unsigned long) sdram_addr);
  290. udelay(100);
  291. /*
  292. * Issue 8 AUTO REFRESH commands.
  293. */
  294. for (idx = 0; idx < 8; idx++) {
  295. lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH;
  296. asm("sync;msync");
  297. *sdram_addr = 0xff;
  298. ppcDcbf((unsigned long) sdram_addr);
  299. udelay(100);
  300. }
  301. /*
  302. * Issue 8 MODE-set command.
  303. */
  304. lbc->lsdmr = lsdmr_common | LSDMR_OP_MRW;
  305. asm("sync;msync");
  306. *sdram_addr = 0xff;
  307. ppcDcbf((unsigned long) sdram_addr);
  308. udelay(100);
  309. /*
  310. * Issue NORMAL OP command.
  311. */
  312. lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL;
  313. asm("sync;msync");
  314. *sdram_addr = 0xff;
  315. ppcDcbf((unsigned long) sdram_addr);
  316. udelay(200); /* Overkill. Must wait > 200 bus cycles */
  317. #endif /* enable SDRAM init */
  318. }
  319. #ifdef CONFIG_PCI
  320. /* For some reason the Tundra PCI bridge shows up on itself as a
  321. * different device. Work around that by refusing to configure it
  322. */
  323. void dummy_func(struct pci_controller* hose, pci_dev_t dev, struct pci_config_table *tab) { }
  324. static struct pci_config_table pci_mpc85xxcds_config_table[] = {
  325. {0x10e3, 0x0513, PCI_ANY_ID, 1, 3, PCI_ANY_ID, dummy_func, {0,0,0}},
  326. {0x1106, 0x0686, PCI_ANY_ID, 1, VIA_ID, 0, mpc85xx_config_via, {0,0,0}},
  327. {0x1106, 0x0571, PCI_ANY_ID, 1, VIA_ID, 1,
  328. mpc85xx_config_via_usbide, {0,0,0}},
  329. {0x1105, 0x3038, PCI_ANY_ID, 1, VIA_ID, 2,
  330. mpc85xx_config_via_usb, {0,0,0}},
  331. {0x1106, 0x3038, PCI_ANY_ID, 1, VIA_ID, 3,
  332. mpc85xx_config_via_usb2, {0,0,0}},
  333. {0x1106, 0x3058, PCI_ANY_ID, 1, VIA_ID, 5,
  334. mpc85xx_config_via_power, {0,0,0}},
  335. {0x1106, 0x3068, PCI_ANY_ID, 1, VIA_ID, 6,
  336. mpc85xx_config_via_ac97, {0,0,0}},
  337. {},
  338. };
  339. static struct pci_controller hose[] = {
  340. {
  341. config_table: pci_mpc85xxcds_config_table,
  342. },
  343. #ifdef CONFIG_MPC85XX_PCI2
  344. {},
  345. #endif
  346. };
  347. #endif
  348. void
  349. pci_init_board(void)
  350. {
  351. #ifdef CONFIG_PCI
  352. pci_mpc85xx_init(hose);
  353. #endif
  354. }
  355. #if defined(CONFIG_OF_BOARD_SETUP)
  356. void
  357. ft_pci_setup(void *blob, bd_t *bd)
  358. {
  359. int node, tmp[2];
  360. const char *path;
  361. node = fdt_path_offset(blob, "/aliases");
  362. tmp[0] = 0;
  363. if (node >= 0) {
  364. #ifdef CONFIG_PCI1
  365. path = fdt_getprop(blob, node, "pci0", NULL);
  366. if (path) {
  367. tmp[1] = hose[0].last_busno - hose[0].first_busno;
  368. do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
  369. }
  370. #endif
  371. #ifdef CONFIG_MPC85XX_PCI2
  372. path = fdt_getprop(blob, node, "pci1", NULL);
  373. if (path) {
  374. tmp[1] = hose[1].last_busno - hose[1].first_busno;
  375. do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
  376. }
  377. #endif
  378. }
  379. }
  380. #endif