p2020ds.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /*
  2. * Copyright 2007-2009 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/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 <asm/fsl_law.h>
  37. #include <asm/mp.h>
  38. #include "../common/pixis.h"
  39. #include "../common/sgmii_riser.h"
  40. DECLARE_GLOBAL_DATA_PTR;
  41. phys_size_t fixed_sdram(void);
  42. int checkboard(void)
  43. {
  44. puts("Board: P2020DS ");
  45. #ifdef CONFIG_PHYS_64BIT
  46. puts("(36-bit addrmap) ");
  47. #endif
  48. printf("Sys ID: 0x%02x, "
  49. "Sys Ver: 0x%02x, FPGA Ver: 0x%02x\n",
  50. in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER),
  51. in8(PIXIS_BASE + PIXIS_PVER));
  52. return 0;
  53. }
  54. phys_size_t initdram(int board_type)
  55. {
  56. phys_size_t dram_size = 0;
  57. puts("Initializing....");
  58. #ifdef CONFIG_SPD_EEPROM
  59. dram_size = fsl_ddr_sdram();
  60. #else
  61. dram_size = fixed_sdram();
  62. if (set_ddr_laws(CONFIG_SYS_DDR_SDRAM_BASE,
  63. dram_size,
  64. LAW_TRGT_IF_DDR) < 0) {
  65. printf("ERROR setting Local Access Windows for DDR\n");
  66. return 0;
  67. };
  68. #endif
  69. dram_size = setup_ddr_tlbs(dram_size / 0x100000);
  70. dram_size *= 0x100000;
  71. puts(" DDR: ");
  72. return dram_size;
  73. }
  74. #if !defined(CONFIG_SPD_EEPROM)
  75. /*
  76. * Fixed sdram init -- doesn't use serial presence detect.
  77. */
  78. phys_size_t fixed_sdram(void)
  79. {
  80. volatile ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC85xx_DDR_ADDR;
  81. uint d_init;
  82. ddr->cs0_config = CONFIG_SYS_DDR_CS0_CONFIG;
  83. ddr->timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
  84. ddr->timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
  85. ddr->sdram_mode = CONFIG_SYS_DDR_MODE_1;
  86. ddr->sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
  87. ddr->sdram_md_cntl = CONFIG_SYS_DDR_MODE_CTRL;
  88. ddr->sdram_interval = CONFIG_SYS_DDR_INTERVAL;
  89. ddr->sdram_data_init = CONFIG_SYS_DDR_DATA_INIT;
  90. ddr->sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL;
  91. ddr->sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL2;
  92. ddr->ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CNTL;
  93. ddr->ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CNTL;
  94. ddr->ddr_cdr1 = CONFIG_SYS_DDR_CDR1;
  95. ddr->timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4;
  96. ddr->timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5;
  97. if (!strcmp("performance", getenv("perf_mode"))) {
  98. /* Performance Mode Values */
  99. ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG_PERF;
  100. ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS_PERF;
  101. ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS_PERF;
  102. ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_PERF;
  103. ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_PERF;
  104. asm("sync;isync");
  105. udelay(500);
  106. ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL_PERF;
  107. } else {
  108. /* Stable Mode Values */
  109. ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG;
  110. ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS;
  111. ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS;
  112. ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
  113. ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
  114. /* ECC will be assumed in stable mode */
  115. ddr->err_int_en = CONFIG_SYS_DDR_ERR_INT_EN;
  116. ddr->err_disable = CONFIG_SYS_DDR_ERR_DIS;
  117. ddr->err_sbe = CONFIG_SYS_DDR_SBE;
  118. asm("sync;isync");
  119. udelay(500);
  120. ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL;
  121. }
  122. #if defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  123. d_init = 1;
  124. debug("DDR - 1st controller: memory initializing\n");
  125. /*
  126. * Poll until memory is initialized.
  127. * 512 Meg at 400 might hit this 200 times or so.
  128. */
  129. while ((ddr->sdram_cfg_2 & (d_init << 4)) != 0)
  130. udelay(1000);
  131. debug("DDR: memory initialized\n\n");
  132. asm("sync; isync");
  133. udelay(500);
  134. #endif
  135. return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
  136. }
  137. #endif
  138. #ifdef CONFIG_PCIE1
  139. static struct pci_controller pcie1_hose;
  140. #endif
  141. #ifdef CONFIG_PCIE2
  142. static struct pci_controller pcie2_hose;
  143. #endif
  144. #ifdef CONFIG_PCIE3
  145. static struct pci_controller pcie3_hose;
  146. #endif
  147. int first_free_busno = 0;
  148. #ifdef CONFIG_PCI
  149. void pci_init_board(void)
  150. {
  151. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  152. uint devdisr = gur->devdisr;
  153. uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
  154. uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
  155. volatile ccsr_fsl_pci_t *pci;
  156. struct pci_controller *hose;
  157. int pcie_ep, pcie_configured;
  158. struct pci_region *r;
  159. /* u32 temp32; */
  160. debug(" pci_init_board: devdisr=%x, io_sel=%x, host_agent=%x\n",
  161. devdisr, io_sel, host_agent);
  162. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
  163. printf(" eTSEC2 is in sgmii mode.\n");
  164. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
  165. printf(" eTSEC3 is in sgmii mode.\n");
  166. #ifdef CONFIG_PCIE2
  167. pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE2_ADDR;
  168. hose = &pcie2_hose;
  169. pcie_ep = (host_agent == 2) || (host_agent == 4) ||
  170. (host_agent == 6) || (host_agent == 0);
  171. pcie_configured = (io_sel == 0x2) || (io_sel == 0xe);
  172. r = hose->regions;
  173. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE2)) {
  174. printf("\n PCIE2 connected to ULI as %s (base addr %x)",
  175. pcie_ep ? "End Point" : "Root Complex",
  176. (uint)pci);
  177. if (pci->pme_msg_det) {
  178. pci->pme_msg_det = 0xffffffff;
  179. debug(" with errors. Clearing. Now 0x%08x",
  180. pci->pme_msg_det);
  181. }
  182. printf("\n");
  183. /* inbound */
  184. r += fsl_pci_setup_inbound_windows(r);
  185. /* outbound memory */
  186. pci_set_region(r++,
  187. CONFIG_SYS_PCIE2_MEM_BUS,
  188. CONFIG_SYS_PCIE2_MEM_PHYS,
  189. CONFIG_SYS_PCIE2_MEM_SIZE,
  190. PCI_REGION_MEM);
  191. /* outbound io */
  192. pci_set_region(r++,
  193. CONFIG_SYS_PCIE2_IO_BUS,
  194. CONFIG_SYS_PCIE2_IO_PHYS,
  195. CONFIG_SYS_PCIE2_IO_SIZE,
  196. PCI_REGION_IO);
  197. hose->region_count = r - hose->regions;
  198. hose->first_busno = first_free_busno;
  199. pci_setup_indirect(hose, (int)&pci->cfg_addr,
  200. (int)&pci->cfg_data);
  201. fsl_pci_init(hose);
  202. first_free_busno = hose->last_busno+1;
  203. printf(" PCIE2 on bus %02x - %02x\n",
  204. hose->first_busno, hose->last_busno);
  205. /*
  206. * The workaround doesn't work on p2020 because the location
  207. * we try and read isn't valid on p2020, fix this later
  208. */
  209. #if 0
  210. /*
  211. * Activate ULI1575 legacy chip by performing a fake
  212. * memory access. Needed to make ULI RTC work.
  213. * Device 1d has the first on-board memory BAR.
  214. */
  215. pci_hose_read_config_dword(hose, PCI_BDF(2, 0x1d, 0),
  216. PCI_BASE_ADDRESS_1, &temp32);
  217. if (temp32 >= CONFIG_SYS_PCIE3_MEM_BUS) {
  218. void *p = pci_mem_to_virt(PCI_BDF(2, 0x1d, 0),
  219. temp32, 4, 0);
  220. debug(" uli1575 read to %p\n", p);
  221. in_be32(p);
  222. }
  223. #endif
  224. } else {
  225. printf(" PCIE2: disabled\n");
  226. }
  227. #else
  228. gur->devdisr |= MPC85xx_DEVDISR_PCIE2; /* disable */
  229. #endif
  230. #ifdef CONFIG_PCIE3
  231. pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE3_ADDR;
  232. hose = &pcie3_hose;
  233. pcie_ep = (host_agent == 0) || (host_agent == 3) ||
  234. (host_agent == 5) || (host_agent == 6);
  235. pcie_configured = (io_sel == 0x2) || (io_sel == 0x4);
  236. r = hose->regions;
  237. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE3)) {
  238. printf("\n PCIE3 connected to Slot 1 as %s (base addr %x)",
  239. pcie_ep ? "End Point" : "Root Complex",
  240. (uint)pci);
  241. if (pci->pme_msg_det) {
  242. pci->pme_msg_det = 0xffffffff;
  243. debug(" with errors. Clearing. Now 0x%08x",
  244. pci->pme_msg_det);
  245. }
  246. printf("\n");
  247. /* inbound */
  248. r += fsl_pci_setup_inbound_windows(r);
  249. /* outbound memory */
  250. pci_set_region(r++,
  251. CONFIG_SYS_PCIE3_MEM_BUS,
  252. CONFIG_SYS_PCIE3_MEM_PHYS,
  253. CONFIG_SYS_PCIE3_MEM_SIZE,
  254. PCI_REGION_MEM);
  255. /* outbound io */
  256. pci_set_region(r++,
  257. CONFIG_SYS_PCIE3_IO_BUS,
  258. CONFIG_SYS_PCIE3_IO_PHYS,
  259. CONFIG_SYS_PCIE3_IO_SIZE,
  260. PCI_REGION_IO);
  261. hose->region_count = r - hose->regions;
  262. hose->first_busno = first_free_busno;
  263. pci_setup_indirect(hose, (int)&pci->cfg_addr,
  264. (int)&pci->cfg_data);
  265. fsl_pci_init(hose);
  266. first_free_busno = hose->last_busno+1;
  267. printf(" PCIE3 on bus %02x - %02x\n",
  268. hose->first_busno, hose->last_busno);
  269. } else {
  270. printf(" PCIE3: disabled\n");
  271. }
  272. #else
  273. gur->devdisr |= MPC85xx_DEVDISR_PCIE3; /* disable */
  274. #endif
  275. #ifdef CONFIG_PCIE1
  276. pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE1_ADDR;
  277. hose = &pcie1_hose;
  278. pcie_ep = (host_agent <= 1) || (host_agent == 4) || (host_agent == 5);
  279. pcie_configured = (io_sel & 6) || (io_sel == 0xE) || (io_sel == 0xF);
  280. r = hose->regions;
  281. if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)) {
  282. printf("\n PCIE1 connected to Slot 2 as %s (base addr %x)",
  283. pcie_ep ? "End Point" : "Root Complex",
  284. (uint)pci);
  285. if (pci->pme_msg_det) {
  286. pci->pme_msg_det = 0xffffffff;
  287. debug(" with errors. Clearing. Now 0x%08x",
  288. pci->pme_msg_det);
  289. }
  290. printf("\n");
  291. /* inbound */
  292. r += fsl_pci_setup_inbound_windows(r);
  293. /* outbound memory */
  294. pci_set_region(r++,
  295. CONFIG_SYS_PCIE1_MEM_BUS,
  296. CONFIG_SYS_PCIE1_MEM_PHYS,
  297. CONFIG_SYS_PCIE1_MEM_SIZE,
  298. PCI_REGION_MEM);
  299. /* outbound io */
  300. pci_set_region(r++,
  301. CONFIG_SYS_PCIE1_IO_BUS,
  302. CONFIG_SYS_PCIE1_IO_PHYS,
  303. CONFIG_SYS_PCIE1_IO_SIZE,
  304. PCI_REGION_IO);
  305. hose->region_count = r - hose->regions;
  306. hose->first_busno = first_free_busno;
  307. pci_setup_indirect(hose, (int)&pci->cfg_addr,
  308. (int)&pci->cfg_data);
  309. fsl_pci_init(hose);
  310. first_free_busno = hose->last_busno+1;
  311. printf(" PCIE1 on bus %02x - %02x\n",
  312. hose->first_busno, hose->last_busno);
  313. } else {
  314. printf(" PCIE1: disabled\n");
  315. }
  316. #else
  317. gur->devdisr |= MPC85xx_DEVDISR_PCIE; /* disable */
  318. #endif
  319. }
  320. #endif
  321. int board_early_init_r(void)
  322. {
  323. const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
  324. const u8 flash_esel = 2;
  325. /*
  326. * Remap Boot flash + PROMJET region to caching-inhibited
  327. * so that flash can be erased properly.
  328. */
  329. /* Flush d-cache and invalidate i-cache of any FLASH data */
  330. flush_dcache();
  331. invalidate_icache();
  332. /* invalidate existing TLB entry for flash + promjet */
  333. disable_tlb(flash_esel);
  334. set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
  335. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  336. 0, flash_esel, BOOKE_PAGESZ_256M, 1);
  337. return 0;
  338. }
  339. #ifdef CONFIG_GET_CLK_FROM_ICS307
  340. /* decode S[0-2] to Output Divider (OD) */
  341. static unsigned char ics307_S_to_OD[] = {
  342. 10, 2, 8, 4, 5, 7, 3, 6
  343. };
  344. /* Calculate frequency being generated by ICS307-02 clock chip based upon
  345. * the control bytes being programmed into it. */
  346. /* XXX: This function should probably go into a common library */
  347. static unsigned long
  348. ics307_clk_freq(unsigned char cw0, unsigned char cw1, unsigned char cw2)
  349. {
  350. const unsigned long InputFrequency = CONFIG_ICS307_REFCLK_HZ;
  351. unsigned long VDW = ((cw1 << 1) & 0x1FE) + ((cw2 >> 7) & 1);
  352. unsigned long RDW = cw2 & 0x7F;
  353. unsigned long OD = ics307_S_to_OD[cw0 & 0x7];
  354. unsigned long freq;
  355. /* CLK1Frequency = InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD) */
  356. /* cw0: C1 C0 TTL F1 F0 S2 S1 S0
  357. * cw1: V8 V7 V6 V5 V4 V3 V2 V1
  358. * cw2: V0 R6 R5 R4 R3 R2 R1 R0
  359. *
  360. * R6:R0 = Reference Divider Word (RDW)
  361. * V8:V0 = VCO Divider Word (VDW)
  362. * S2:S0 = Output Divider Select (OD)
  363. * F1:F0 = Function of CLK2 Output
  364. * TTL = duty cycle
  365. * C1:C0 = internal load capacitance for cyrstal
  366. */
  367. /* Adding 1 to get a "nicely" rounded number, but this needs
  368. * more tweaking to get a "properly" rounded number. */
  369. freq = 1 + (InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD));
  370. debug("ICS307: CW[0-2]: %02X %02X %02X => %lu Hz\n", cw0, cw1, cw2,
  371. freq);
  372. return freq;
  373. }
  374. unsigned long get_board_sys_clk(ulong dummy)
  375. {
  376. return gd->bus_clk;
  377. }
  378. unsigned long get_board_ddr_clk(ulong dummy)
  379. {
  380. return gd->mem_clk;
  381. }
  382. unsigned long
  383. calculate_board_sys_clk(ulong dummy)
  384. {
  385. ulong val;
  386. val = ics307_clk_freq(
  387. in8(PIXIS_BASE + PIXIS_VSYSCLK0),
  388. in8(PIXIS_BASE + PIXIS_VSYSCLK1),
  389. in8(PIXIS_BASE + PIXIS_VSYSCLK2));
  390. debug("sysclk val = %lu\n", val);
  391. return val;
  392. }
  393. unsigned long
  394. calculate_board_ddr_clk(ulong dummy)
  395. {
  396. ulong val;
  397. val = ics307_clk_freq(
  398. in8(PIXIS_BASE + PIXIS_VDDRCLK0),
  399. in8(PIXIS_BASE + PIXIS_VDDRCLK1),
  400. in8(PIXIS_BASE + PIXIS_VDDRCLK2));
  401. debug("ddrclk val = %lu\n", val);
  402. return val;
  403. }
  404. #else
  405. unsigned long get_board_sys_clk(ulong dummy)
  406. {
  407. u8 i;
  408. ulong val = 0;
  409. i = in8(PIXIS_BASE + PIXIS_SPD);
  410. i &= 0x07;
  411. switch (i) {
  412. case 0:
  413. val = 33333333;
  414. break;
  415. case 1:
  416. val = 40000000;
  417. break;
  418. case 2:
  419. val = 50000000;
  420. break;
  421. case 3:
  422. val = 66666666;
  423. break;
  424. case 4:
  425. val = 83333333;
  426. break;
  427. case 5:
  428. val = 100000000;
  429. break;
  430. case 6:
  431. val = 133333333;
  432. break;
  433. case 7:
  434. val = 166666666;
  435. break;
  436. }
  437. return val;
  438. }
  439. unsigned long get_board_ddr_clk(ulong dummy)
  440. {
  441. u8 i;
  442. ulong val = 0;
  443. i = in8(PIXIS_BASE + PIXIS_SPD);
  444. i &= 0x38;
  445. i >>= 3;
  446. switch (i) {
  447. case 0:
  448. val = 33333333;
  449. break;
  450. case 1:
  451. val = 40000000;
  452. break;
  453. case 2:
  454. val = 50000000;
  455. break;
  456. case 3:
  457. val = 66666666;
  458. break;
  459. case 4:
  460. val = 83333333;
  461. break;
  462. case 5:
  463. val = 100000000;
  464. break;
  465. case 6:
  466. val = 133333333;
  467. break;
  468. case 7:
  469. val = 166666666;
  470. break;
  471. }
  472. return val;
  473. }
  474. #endif
  475. #ifdef CONFIG_TSEC_ENET
  476. int board_eth_init(bd_t *bis)
  477. {
  478. struct tsec_info_struct tsec_info[4];
  479. volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  480. int num = 0;
  481. #ifdef CONFIG_TSEC1
  482. SET_STD_TSEC_INFO(tsec_info[num], 1);
  483. num++;
  484. #endif
  485. #ifdef CONFIG_TSEC2
  486. SET_STD_TSEC_INFO(tsec_info[num], 2);
  487. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
  488. tsec_info[num].flags |= TSEC_SGMII;
  489. num++;
  490. #endif
  491. #ifdef CONFIG_TSEC3
  492. SET_STD_TSEC_INFO(tsec_info[num], 3);
  493. if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
  494. tsec_info[num].flags |= TSEC_SGMII;
  495. num++;
  496. #endif
  497. if (!num) {
  498. printf("No TSECs initialized\n");
  499. return 0;
  500. }
  501. #ifdef CONFIG_FSL_SGMII_RISER
  502. fsl_sgmii_riser_init(tsec_info, num);
  503. #endif
  504. tsec_eth_init(bis, tsec_info, num);
  505. return 0;
  506. }
  507. #endif
  508. #if defined(CONFIG_OF_BOARD_SETUP)
  509. void ft_board_setup(void *blob, bd_t *bd)
  510. {
  511. phys_addr_t base;
  512. phys_size_t size;
  513. ft_cpu_setup(blob, bd);
  514. base = getenv_bootm_low();
  515. size = getenv_bootm_size();
  516. fdt_fixup_memory(blob, (u64)base, (u64)size);
  517. #ifdef CONFIG_PCIE3
  518. ft_fsl_pci_setup(blob, "pci0", &pcie3_hose);
  519. #endif
  520. #ifdef CONFIG_PCIE2
  521. ft_fsl_pci_setup(blob, "pci1", &pcie2_hose);
  522. #endif
  523. #ifdef CONFIG_PCIE1
  524. ft_fsl_pci_setup(blob, "pci2", &pcie1_hose);
  525. #endif
  526. #ifdef CONFIG_FSL_SGMII_RISER
  527. fsl_sgmii_riser_fdt_fixup(blob);
  528. #endif
  529. }
  530. #endif
  531. #ifdef CONFIG_MP
  532. void board_lmb_reserve(struct lmb *lmb)
  533. {
  534. cpu_mp_lmb_reserve(lmb);
  535. }
  536. #endif