mpc8541cds.c 16 KB

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