mpc8555cds.c 15 KB

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