mpc8572ds.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * Copyright 2007-2008 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <common.h>
  23. #include <command.h>
  24. #include <pci.h>
  25. #include <asm/processor.h>
  26. #include <asm/mmu.h>
  27. #include <asm/cache.h>
  28. #include <asm/immap_85xx.h>
  29. #include <asm/immap_fsl_pci.h>
  30. #include <asm/fsl_ddr_sdram.h>
  31. #include <asm/io.h>
  32. #include <miiphy.h>
  33. #include <libfdt.h>
  34. #include <fdt_support.h>
  35. #include <tsec.h>
  36. #include "../common/pixis.h"
  37. #include "../common/sgmii_riser.h"
  38. #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  39. extern void ddr_enable_ecc(unsigned int dram_size);
  40. #endif
  41. long int fixed_sdram(void);
  42. int checkboard (void)
  43. {
  44. printf ("Board: MPC8572DS, System ID: 0x%02x, "
  45. "System Version: 0x%02x, FPGA Version: 0x%02x\n",
  46. in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER),
  47. in8(PIXIS_BASE + PIXIS_PVER));
  48. return 0;
  49. }
  50. phys_size_t initdram(int board_type)
  51. {
  52. phys_size_t dram_size = 0;
  53. puts("Initializing....");
  54. #ifdef CONFIG_SPD_EEPROM
  55. dram_size = fsl_ddr_sdram();
  56. dram_size = setup_ddr_tlbs(dram_size / 0x100000);
  57. dram_size *= 0x100000;
  58. #else
  59. dram_size = fixed_sdram();
  60. #endif
  61. #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  62. /*
  63. * Initialize and enable DDR ECC.
  64. */
  65. ddr_enable_ecc(dram_size);
  66. #endif
  67. puts(" DDR: ");
  68. return dram_size;
  69. }
  70. #if !defined(CONFIG_SPD_EEPROM)
  71. /*
  72. * Fixed sdram init -- doesn't use serial presence detect.
  73. */
  74. phys_size_t fixed_sdram (void)
  75. {
  76. volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
  77. volatile ccsr_ddr_t *ddr= &immap->im_ddr;
  78. uint d_init;
  79. ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS;
  80. ddr->cs0_config = CONFIG_SYS_DDR_CS0_CONFIG;
  81. ddr->timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
  82. ddr->timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
  83. ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
  84. ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
  85. ddr->sdram_mode = CONFIG_SYS_DDR_MODE_1;
  86. ddr->sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
  87. ddr->sdram_interval = CONFIG_SYS_DDR_INTERVAL;
  88. ddr->sdram_data_init = CONFIG_SYS_DDR_DATA_INIT;
  89. ddr->sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL;
  90. ddr->sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL2;
  91. #if defined (CONFIG_DDR_ECC)
  92. ddr->err_int_en = CONFIG_SYS_DDR_ERR_INT_EN;
  93. ddr->err_disable = CONFIG_SYS_DDR_ERR_DIS;
  94. ddr->err_sbe = CONFIG_SYS_DDR_SBE;
  95. #endif
  96. asm("sync;isync");
  97. udelay(500);
  98. ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL;
  99. #if defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  100. d_init = 1;
  101. debug("DDR - 1st controller: memory initializing\n");
  102. /*
  103. * Poll until memory is initialized.
  104. * 512 Meg at 400 might hit this 200 times or so.
  105. */
  106. while ((ddr->sdram_cfg_2 & (d_init << 4)) != 0) {
  107. udelay(1000);
  108. }
  109. debug("DDR: memory initialized\n\n");
  110. asm("sync; isync");
  111. udelay(500);
  112. #endif
  113. return 512 * 1024 * 1024;
  114. }
  115. #endif
  116. #ifdef CONFIG_PCIE1
  117. static struct pci_controller pcie1_hose;
  118. #endif
  119. #ifdef CONFIG_PCIE2
  120. static struct pci_controller pcie2_hose;
  121. #endif
  122. #ifdef CONFIG_PCIE3
  123. static struct pci_controller pcie3_hose;
  124. #endif
  125. int first_free_busno=0;
  126. #ifdef CONFIG_PCI
  127. void pci_init_board(void)
  128. {
  129. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  130. uint devdisr = gur->devdisr;
  131. uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
  132. uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
  133. debug (" pci_init_board: devdisr=%x, io_sel=%x, host_agent=%x\n",
  134. devdisr, io_sel, host_agent);
  135. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII1_DIS))
  136. printf (" eTSEC1 is in sgmii mode.\n");
  137. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
  138. printf (" eTSEC2 is in sgmii mode.\n");
  139. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
  140. printf (" eTSEC3 is in sgmii mode.\n");
  141. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII4_DIS))
  142. printf (" eTSEC4 is in sgmii mode.\n");
  143. #ifdef CONFIG_PCIE3
  144. {
  145. volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE3_ADDR;
  146. extern void fsl_pci_init(struct pci_controller *hose);
  147. struct pci_controller *hose = &pcie3_hose;
  148. int pcie_ep = (host_agent == 0) || (host_agent == 3) ||
  149. (host_agent == 5) || (host_agent == 6);
  150. int pcie_configured = io_sel >= 1;
  151. u32 temp32;
  152. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)){
  153. printf ("\n PCIE3 connected to ULI as %s (base address %x)",
  154. pcie_ep ? "End Point" : "Root Complex",
  155. (uint)pci);
  156. if (pci->pme_msg_det) {
  157. pci->pme_msg_det = 0xffffffff;
  158. debug (" with errors. Clearing. Now 0x%08x",pci->pme_msg_det);
  159. }
  160. printf ("\n");
  161. /* inbound */
  162. pci_set_region(hose->regions + 0,
  163. CONFIG_SYS_PCI_MEMORY_BUS,
  164. CONFIG_SYS_PCI_MEMORY_PHYS,
  165. CONFIG_SYS_PCI_MEMORY_SIZE,
  166. PCI_REGION_MEM | PCI_REGION_MEMORY);
  167. /* outbound memory */
  168. pci_set_region(hose->regions + 1,
  169. CONFIG_SYS_PCIE3_MEM_BASE,
  170. CONFIG_SYS_PCIE3_MEM_PHYS,
  171. CONFIG_SYS_PCIE3_MEM_SIZE,
  172. PCI_REGION_MEM);
  173. /* outbound io */
  174. pci_set_region(hose->regions + 2,
  175. CONFIG_SYS_PCIE3_IO_BASE,
  176. CONFIG_SYS_PCIE3_IO_PHYS,
  177. CONFIG_SYS_PCIE3_IO_SIZE,
  178. PCI_REGION_IO);
  179. hose->region_count = 3;
  180. hose->first_busno=first_free_busno;
  181. pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
  182. fsl_pci_init(hose);
  183. first_free_busno=hose->last_busno+1;
  184. printf (" PCIE3 on bus %02x - %02x\n",
  185. hose->first_busno,hose->last_busno);
  186. /*
  187. * Activate ULI1575 legacy chip by performing a fake
  188. * memory access. Needed to make ULI RTC work.
  189. * Device 1d has the first on-board memory BAR.
  190. */
  191. pci_hose_read_config_dword(hose, PCI_BDF(2, 0x1d, 0 ),
  192. PCI_BASE_ADDRESS_1, &temp32);
  193. if (temp32 >= CONFIG_SYS_PCIE3_MEM_PHYS) {
  194. debug(" uli1572 read to %x\n", temp32);
  195. in_be32((unsigned *)temp32);
  196. }
  197. } else {
  198. printf (" PCIE3: disabled\n");
  199. }
  200. }
  201. #else
  202. gur->devdisr |= MPC85xx_DEVDISR_PCIE3; /* disable */
  203. #endif
  204. #ifdef CONFIG_PCIE2
  205. {
  206. volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE2_ADDR;
  207. extern void fsl_pci_init(struct pci_controller *hose);
  208. struct pci_controller *hose = &pcie2_hose;
  209. int pcie_ep = (host_agent == 2) || (host_agent == 4) ||
  210. (host_agent == 6) || (host_agent == 0);
  211. int pcie_configured = io_sel & 4;
  212. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)){
  213. printf ("\n PCIE2 connected to Slot 1 as %s (base address %x)",
  214. pcie_ep ? "End Point" : "Root Complex",
  215. (uint)pci);
  216. if (pci->pme_msg_det) {
  217. pci->pme_msg_det = 0xffffffff;
  218. debug (" with errors. Clearing. Now 0x%08x",pci->pme_msg_det);
  219. }
  220. printf ("\n");
  221. /* inbound */
  222. pci_set_region(hose->regions + 0,
  223. CONFIG_SYS_PCI_MEMORY_BUS,
  224. CONFIG_SYS_PCI_MEMORY_PHYS,
  225. CONFIG_SYS_PCI_MEMORY_SIZE,
  226. PCI_REGION_MEM | PCI_REGION_MEMORY);
  227. /* outbound memory */
  228. pci_set_region(hose->regions + 1,
  229. CONFIG_SYS_PCIE2_MEM_BASE,
  230. CONFIG_SYS_PCIE2_MEM_PHYS,
  231. CONFIG_SYS_PCIE2_MEM_SIZE,
  232. PCI_REGION_MEM);
  233. /* outbound io */
  234. pci_set_region(hose->regions + 2,
  235. CONFIG_SYS_PCIE2_IO_BASE,
  236. CONFIG_SYS_PCIE2_IO_PHYS,
  237. CONFIG_SYS_PCIE2_IO_SIZE,
  238. PCI_REGION_IO);
  239. hose->region_count = 3;
  240. hose->first_busno=first_free_busno;
  241. pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
  242. fsl_pci_init(hose);
  243. first_free_busno=hose->last_busno+1;
  244. printf (" PCIE2 on bus %02x - %02x\n",
  245. hose->first_busno,hose->last_busno);
  246. } else {
  247. printf (" PCIE2: disabled\n");
  248. }
  249. }
  250. #else
  251. gur->devdisr |= MPC85xx_DEVDISR_PCIE2; /* disable */
  252. #endif
  253. #ifdef CONFIG_PCIE1
  254. {
  255. volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE1_ADDR;
  256. extern void fsl_pci_init(struct pci_controller *hose);
  257. struct pci_controller *hose = &pcie1_hose;
  258. int pcie_ep = (host_agent <= 1) || (host_agent == 4) ||
  259. (host_agent == 5);
  260. int pcie_configured = io_sel & 6;
  261. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)){
  262. printf ("\n PCIE1 connected to Slot 2 as %s (base address %x)",
  263. pcie_ep ? "End Point" : "Root Complex",
  264. (uint)pci);
  265. if (pci->pme_msg_det) {
  266. pci->pme_msg_det = 0xffffffff;
  267. debug (" with errors. Clearing. Now 0x%08x",pci->pme_msg_det);
  268. }
  269. printf ("\n");
  270. /* inbound */
  271. pci_set_region(hose->regions + 0,
  272. CONFIG_SYS_PCI_MEMORY_BUS,
  273. CONFIG_SYS_PCI_MEMORY_PHYS,
  274. CONFIG_SYS_PCI_MEMORY_SIZE,
  275. PCI_REGION_MEM | PCI_REGION_MEMORY);
  276. /* outbound memory */
  277. pci_set_region(hose->regions + 1,
  278. CONFIG_SYS_PCIE1_MEM_BASE,
  279. CONFIG_SYS_PCIE1_MEM_PHYS,
  280. CONFIG_SYS_PCIE1_MEM_SIZE,
  281. PCI_REGION_MEM);
  282. /* outbound io */
  283. pci_set_region(hose->regions + 2,
  284. CONFIG_SYS_PCIE1_IO_BASE,
  285. CONFIG_SYS_PCIE1_IO_PHYS,
  286. CONFIG_SYS_PCIE1_IO_SIZE,
  287. PCI_REGION_IO);
  288. hose->region_count = 3;
  289. hose->first_busno=first_free_busno;
  290. pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
  291. fsl_pci_init(hose);
  292. first_free_busno=hose->last_busno+1;
  293. printf(" PCIE1 on bus %02x - %02x\n",
  294. hose->first_busno,hose->last_busno);
  295. } else {
  296. printf (" PCIE1: disabled\n");
  297. }
  298. }
  299. #else
  300. gur->devdisr |= MPC85xx_DEVDISR_PCIE; /* disable */
  301. #endif
  302. }
  303. #endif
  304. int board_early_init_r(void)
  305. {
  306. const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
  307. const u8 flash_esel = 2;
  308. /*
  309. * Remap Boot flash + PROMJET region to caching-inhibited
  310. * so that flash can be erased properly.
  311. */
  312. /* Flush d-cache and invalidate i-cache of any FLASH data */
  313. flush_dcache();
  314. invalidate_icache();
  315. /* invalidate existing TLB entry for flash + promjet */
  316. disable_tlb(flash_esel);
  317. set_tlb(1, flashbase, flashbase, /* tlb, epn, rpn */
  318. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, /* perms, wimge */
  319. 0, flash_esel, BOOKE_PAGESZ_256M, 1); /* ts, esel, tsize, iprot */
  320. return 0;
  321. }
  322. #ifdef CONFIG_GET_CLK_FROM_ICS307
  323. /* decode S[0-2] to Output Divider (OD) */
  324. static unsigned char ics307_S_to_OD[] = {
  325. 10, 2, 8, 4, 5, 7, 3, 6
  326. };
  327. /* Calculate frequency being generated by ICS307-02 clock chip based upon
  328. * the control bytes being programmed into it. */
  329. /* XXX: This function should probably go into a common library */
  330. static unsigned long
  331. ics307_clk_freq (unsigned char cw0, unsigned char cw1, unsigned char cw2)
  332. {
  333. const unsigned long InputFrequency = CONFIG_ICS307_REFCLK_HZ;
  334. unsigned long VDW = ((cw1 << 1) & 0x1FE) + ((cw2 >> 7) & 1);
  335. unsigned long RDW = cw2 & 0x7F;
  336. unsigned long OD = ics307_S_to_OD[cw0 & 0x7];
  337. unsigned long freq;
  338. /* CLK1Frequency = InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD) */
  339. /* cw0: C1 C0 TTL F1 F0 S2 S1 S0
  340. * cw1: V8 V7 V6 V5 V4 V3 V2 V1
  341. * cw2: V0 R6 R5 R4 R3 R2 R1 R0
  342. *
  343. * R6:R0 = Reference Divider Word (RDW)
  344. * V8:V0 = VCO Divider Word (VDW)
  345. * S2:S0 = Output Divider Select (OD)
  346. * F1:F0 = Function of CLK2 Output
  347. * TTL = duty cycle
  348. * C1:C0 = internal load capacitance for cyrstal
  349. */
  350. /* Adding 1 to get a "nicely" rounded number, but this needs
  351. * more tweaking to get a "properly" rounded number. */
  352. freq = 1 + (InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD));
  353. debug("ICS307: CW[0-2]: %02X %02X %02X => %u Hz\n", cw0, cw1, cw2,
  354. freq);
  355. return freq;
  356. }
  357. unsigned long get_board_sys_clk(ulong dummy)
  358. {
  359. return ics307_clk_freq (
  360. in8(PIXIS_BASE + PIXIS_VSYSCLK0),
  361. in8(PIXIS_BASE + PIXIS_VSYSCLK1),
  362. in8(PIXIS_BASE + PIXIS_VSYSCLK2)
  363. );
  364. }
  365. unsigned long get_board_ddr_clk(ulong dummy)
  366. {
  367. return ics307_clk_freq (
  368. in8(PIXIS_BASE + PIXIS_VDDRCLK0),
  369. in8(PIXIS_BASE + PIXIS_VDDRCLK1),
  370. in8(PIXIS_BASE + PIXIS_VDDRCLK2)
  371. );
  372. }
  373. #else
  374. unsigned long get_board_sys_clk(ulong dummy)
  375. {
  376. u8 i;
  377. ulong val = 0;
  378. i = in8(PIXIS_BASE + PIXIS_SPD);
  379. i &= 0x07;
  380. switch (i) {
  381. case 0:
  382. val = 33333333;
  383. break;
  384. case 1:
  385. val = 40000000;
  386. break;
  387. case 2:
  388. val = 50000000;
  389. break;
  390. case 3:
  391. val = 66666666;
  392. break;
  393. case 4:
  394. val = 83333333;
  395. break;
  396. case 5:
  397. val = 100000000;
  398. break;
  399. case 6:
  400. val = 133333333;
  401. break;
  402. case 7:
  403. val = 166666666;
  404. break;
  405. }
  406. return val;
  407. }
  408. unsigned long get_board_ddr_clk(ulong dummy)
  409. {
  410. u8 i;
  411. ulong val = 0;
  412. i = in8(PIXIS_BASE + PIXIS_SPD);
  413. i &= 0x38;
  414. i >>= 3;
  415. switch (i) {
  416. case 0:
  417. val = 33333333;
  418. break;
  419. case 1:
  420. val = 40000000;
  421. break;
  422. case 2:
  423. val = 50000000;
  424. break;
  425. case 3:
  426. val = 66666666;
  427. break;
  428. case 4:
  429. val = 83333333;
  430. break;
  431. case 5:
  432. val = 100000000;
  433. break;
  434. case 6:
  435. val = 133333333;
  436. break;
  437. case 7:
  438. val = 166666666;
  439. break;
  440. }
  441. return val;
  442. }
  443. #endif
  444. #ifdef CONFIG_TSEC_ENET
  445. int board_eth_init(bd_t *bis)
  446. {
  447. struct tsec_info_struct tsec_info[4];
  448. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  449. int num = 0;
  450. #ifdef CONFIG_TSEC1
  451. SET_STD_TSEC_INFO(tsec_info[num], 1);
  452. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII1_DIS))
  453. tsec_info[num].flags |= TSEC_SGMII;
  454. num++;
  455. #endif
  456. #ifdef CONFIG_TSEC2
  457. SET_STD_TSEC_INFO(tsec_info[num], 2);
  458. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
  459. tsec_info[num].flags |= TSEC_SGMII;
  460. num++;
  461. #endif
  462. #ifdef CONFIG_TSEC3
  463. SET_STD_TSEC_INFO(tsec_info[num], 3);
  464. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
  465. tsec_info[num].flags |= TSEC_SGMII;
  466. num++;
  467. #endif
  468. #ifdef CONFIG_TSEC4
  469. SET_STD_TSEC_INFO(tsec_info[num], 4);
  470. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII4_DIS))
  471. tsec_info[num].flags |= TSEC_SGMII;
  472. num++;
  473. #endif
  474. if (!num) {
  475. printf("No TSECs initialized\n");
  476. return 0;
  477. }
  478. fsl_sgmii_riser_init(tsec_info, num);
  479. tsec_eth_init(bis, tsec_info, num);
  480. return 0;
  481. }
  482. #endif
  483. #if defined(CONFIG_OF_BOARD_SETUP)
  484. void ft_board_setup(void *blob, bd_t *bd)
  485. {
  486. int node, tmp[2];
  487. const char *path;
  488. ulong base, size;
  489. ft_cpu_setup(blob, bd);
  490. base = getenv_bootm_low();
  491. size = getenv_bootm_size();
  492. fdt_fixup_memory(blob, (u64)base, (u64)size);
  493. node = fdt_path_offset(blob, "/aliases");
  494. tmp[0] = 0;
  495. if (node >= 0) {
  496. #ifdef CONFIG_PCIE3
  497. path = fdt_getprop(blob, node, "pci0", NULL);
  498. if (path) {
  499. tmp[1] = pcie3_hose.last_busno - pcie3_hose.first_busno;
  500. do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
  501. }
  502. #endif
  503. #ifdef CONFIG_PCIE2
  504. path = fdt_getprop(blob, node, "pci1", NULL);
  505. if (path) {
  506. tmp[1] = pcie2_hose.last_busno - pcie2_hose.first_busno;
  507. do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
  508. }
  509. #endif
  510. #ifdef CONFIG_PCIE1
  511. path = fdt_getprop(blob, node, "pci2", NULL);
  512. if (path) {
  513. tmp[1] = pcie1_hose.last_busno - pcie1_hose.first_busno;
  514. do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
  515. }
  516. #endif
  517. }
  518. }
  519. #endif
  520. #ifdef CONFIG_MP
  521. extern void cpu_mp_lmb_reserve(struct lmb *lmb);
  522. void board_lmb_reserve(struct lmb *lmb)
  523. {
  524. cpu_mp_lmb_reserve(lmb);
  525. }
  526. #endif