blob: 664135cf703d47aa1d6e175bff8029885798b849 [file] [log] [blame]
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -05001/*
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
23#include <common.h>
24#include <command.h>
25#include <pci.h>
26#include <asm/processor.h>
27#include <asm/mmu.h>
28#include <asm/cache.h>
29#include <asm/immap_85xx.h>
30#include <asm/fsl_pci.h>
31#include <asm/fsl_ddr_sdram.h>
32#include <asm/io.h>
33#include <miiphy.h>
34#include <libfdt.h>
35#include <fdt_support.h>
36#include <tsec.h>
37#include <asm/fsl_law.h>
38#include <asm/mp.h>
Roy Zang29c35182009-06-30 13:56:23 +080039#include <netdev.h>
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050040
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050041#include "../common/sgmii_riser.h"
42
43DECLARE_GLOBAL_DATA_PTR;
44
45phys_size_t fixed_sdram(void);
46
47int checkboard(void)
48{
Kumar Gala6bb5b412009-07-14 22:42:01 -050049 u8 sw7;
50 u8 *pixis_base = (u8 *)PIXIS_BASE;
51
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050052 puts("Board: P2020DS ");
53#ifdef CONFIG_PHYS_64BIT
54 puts("(36-bit addrmap) ");
55#endif
Kumar Gala6bb5b412009-07-14 22:42:01 -050056
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050057 printf("Sys ID: 0x%02x, "
Kumar Gala6bb5b412009-07-14 22:42:01 -050058 "Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
59 in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER),
60 in_8(pixis_base + PIXIS_PVER));
61
62 sw7 = in_8(pixis_base + PIXIS_SW(7));
63 switch ((sw7 & PIXIS_SW7_LBMAP) >> 6) {
64 case 0:
65 case 1:
66 printf ("vBank: %d\n", ((sw7 & PIXIS_SW7_VBANK) >> 4));
67 break;
68 case 2:
69 case 3:
70 puts ("Promjet\n");
71 break;
72 }
73
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050074 return 0;
75}
76
77phys_size_t initdram(int board_type)
78{
79 phys_size_t dram_size = 0;
80
81 puts("Initializing....");
82
83#ifdef CONFIG_SPD_EEPROM
84 dram_size = fsl_ddr_sdram();
85#else
86 dram_size = fixed_sdram();
87
88 if (set_ddr_laws(CONFIG_SYS_DDR_SDRAM_BASE,
89 dram_size,
90 LAW_TRGT_IF_DDR) < 0) {
91 printf("ERROR setting Local Access Windows for DDR\n");
92 return 0;
93 };
94#endif
95 dram_size = setup_ddr_tlbs(dram_size / 0x100000);
96 dram_size *= 0x100000;
97
98 puts(" DDR: ");
99 return dram_size;
100}
101
102#if !defined(CONFIG_SPD_EEPROM)
103/*
104 * Fixed sdram init -- doesn't use serial presence detect.
105 */
106
107phys_size_t fixed_sdram(void)
108{
109 volatile ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC85xx_DDR_ADDR;
110 uint d_init;
111
112 ddr->cs0_config = CONFIG_SYS_DDR_CS0_CONFIG;
113 ddr->timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
114 ddr->timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
115 ddr->sdram_mode = CONFIG_SYS_DDR_MODE_1;
116 ddr->sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
117 ddr->sdram_md_cntl = CONFIG_SYS_DDR_MODE_CTRL;
118 ddr->sdram_interval = CONFIG_SYS_DDR_INTERVAL;
119 ddr->sdram_data_init = CONFIG_SYS_DDR_DATA_INIT;
120 ddr->sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL;
121 ddr->sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL2;
122 ddr->ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CNTL;
123 ddr->ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CNTL;
124 ddr->ddr_cdr1 = CONFIG_SYS_DDR_CDR1;
125 ddr->timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4;
126 ddr->timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5;
127
128 if (!strcmp("performance", getenv("perf_mode"))) {
129 /* Performance Mode Values */
130
131 ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG_PERF;
132 ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS_PERF;
133 ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS_PERF;
134 ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_PERF;
135 ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_PERF;
136
137 asm("sync;isync");
138
139 udelay(500);
140
141 ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL_PERF;
142 } else {
143 /* Stable Mode Values */
144
145 ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG;
146 ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS;
147 ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS;
148 ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
149 ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
150
151 /* ECC will be assumed in stable mode */
152 ddr->err_int_en = CONFIG_SYS_DDR_ERR_INT_EN;
153 ddr->err_disable = CONFIG_SYS_DDR_ERR_DIS;
154 ddr->err_sbe = CONFIG_SYS_DDR_SBE;
155
156 asm("sync;isync");
157
158 udelay(500);
159
160 ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL;
161 }
162
163#if defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
164 d_init = 1;
165 debug("DDR - 1st controller: memory initializing\n");
166 /*
167 * Poll until memory is initialized.
168 * 512 Meg at 400 might hit this 200 times or so.
169 */
170 while ((ddr->sdram_cfg_2 & (d_init << 4)) != 0)
171 udelay(1000);
172 debug("DDR: memory initialized\n\n");
173 asm("sync; isync");
174 udelay(500);
175#endif
176
177 return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
178}
179
180#endif
181
182#ifdef CONFIG_PCIE1
183static struct pci_controller pcie1_hose;
184#endif
185
186#ifdef CONFIG_PCIE2
187static struct pci_controller pcie2_hose;
188#endif
189
190#ifdef CONFIG_PCIE3
191static struct pci_controller pcie3_hose;
192#endif
193
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500194#ifdef CONFIG_PCI
195void pci_init_board(void)
196{
197 volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
Kumar Gala4958af82009-09-03 09:42:01 -0500198 struct fsl_pci_info pci_info[3];
Kumar Gala9263e822009-11-04 13:01:51 -0600199 u32 devdisr, pordevsr, io_sel;
Kumar Gala4958af82009-09-03 09:42:01 -0500200 int first_free_busno = 0;
201 int num = 0;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500202
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500203 int pcie_ep, pcie_configured;
Kumar Gala4958af82009-09-03 09:42:01 -0500204
205 devdisr = in_be32(&gur->devdisr);
206 pordevsr = in_be32(&gur->pordevsr);
207 io_sel = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500208
Kumar Gala9263e822009-11-04 13:01:51 -0600209 debug (" pci_init_board: devdisr=%x, io_sel=%x\n", devdisr, io_sel);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500210
Kumar Gala4958af82009-09-03 09:42:01 -0500211 if (!(pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500212 printf(" eTSEC2 is in sgmii mode.\n");
Kumar Gala4958af82009-09-03 09:42:01 -0500213 if (!(pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500214 printf(" eTSEC3 is in sgmii mode.\n");
215
Kumar Gala4958af82009-09-03 09:42:01 -0500216 puts("\n");
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500217#ifdef CONFIG_PCIE2
Kumar Gala3e7b6c12009-09-02 09:03:08 -0500218 pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_2, io_sel);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500219
220 if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE2)) {
Kumar Gala4958af82009-09-03 09:42:01 -0500221 SET_STD_PCIE_INFO(pci_info[num], 2);
Kumar Gala9263e822009-11-04 13:01:51 -0600222 pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs);
Kumar Gala4958af82009-09-03 09:42:01 -0500223 printf(" PCIE2 connected to ULI as %s (base addr %lx)\n",
Peter Tyser64917ca2010-01-17 15:38:26 -0600224 pcie_ep ? "Endpoint" : "Root Complex",
Kumar Gala4958af82009-09-03 09:42:01 -0500225 pci_info[num].regs);
226 first_free_busno = fsl_pci_init_port(&pci_info[num++],
Kumar Gala01471d52009-11-04 01:29:04 -0600227 &pcie2_hose, first_free_busno);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500228
229 /*
230 * The workaround doesn't work on p2020 because the location
231 * we try and read isn't valid on p2020, fix this later
232 */
233#if 0
234 /*
235 * Activate ULI1575 legacy chip by performing a fake
236 * memory access. Needed to make ULI RTC work.
237 * Device 1d has the first on-board memory BAR.
238 */
239
240 pci_hose_read_config_dword(hose, PCI_BDF(2, 0x1d, 0),
241 PCI_BASE_ADDRESS_1, &temp32);
242 if (temp32 >= CONFIG_SYS_PCIE3_MEM_BUS) {
243 void *p = pci_mem_to_virt(PCI_BDF(2, 0x1d, 0),
244 temp32, 4, 0);
245 debug(" uli1575 read to %p\n", p);
246 in_be32(p);
247 }
248#endif
249 } else {
250 printf(" PCIE2: disabled\n");
251 }
Kumar Gala4958af82009-09-03 09:42:01 -0500252 puts("\n");
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500253#else
Kumar Gala4958af82009-09-03 09:42:01 -0500254 setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCIE2); /* disable */
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500255#endif
256
257#ifdef CONFIG_PCIE3
Kumar Gala3e7b6c12009-09-02 09:03:08 -0500258 pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_3, io_sel);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500259
260 if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE3)) {
Kumar Gala4958af82009-09-03 09:42:01 -0500261 SET_STD_PCIE_INFO(pci_info[num], 3);
Kumar Gala9263e822009-11-04 13:01:51 -0600262 pcie_ep = fsl_setup_hose(&pcie3_hose, pci_info[num].regs);
Kumar Gala4958af82009-09-03 09:42:01 -0500263 printf(" PCIE3 connected to Slot 1 as %s (base addr %lx)\n",
Peter Tyser64917ca2010-01-17 15:38:26 -0600264 pcie_ep ? "Endpoint" : "Root Complex",
Kumar Gala4958af82009-09-03 09:42:01 -0500265 pci_info[num].regs);
266 first_free_busno = fsl_pci_init_port(&pci_info[num++],
Kumar Gala01471d52009-11-04 01:29:04 -0600267 &pcie3_hose, first_free_busno);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500268 } else {
269 printf(" PCIE3: disabled\n");
270 }
Kumar Gala4958af82009-09-03 09:42:01 -0500271 puts("\n");
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500272#else
Kumar Gala4958af82009-09-03 09:42:01 -0500273 setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCIE3); /* disable */
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500274#endif
275
276#ifdef CONFIG_PCIE1
Kumar Gala3e7b6c12009-09-02 09:03:08 -0500277 pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500278
279 if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)) {
Kumar Gala4958af82009-09-03 09:42:01 -0500280 SET_STD_PCIE_INFO(pci_info[num], 1);
Kumar Gala9263e822009-11-04 13:01:51 -0600281 pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs);
Kumar Gala4958af82009-09-03 09:42:01 -0500282 printf(" PCIE1 connected to Slot 2 as %s (base addr %lx)\n",
Peter Tyser64917ca2010-01-17 15:38:26 -0600283 pcie_ep ? "Endpoint" : "Root Complex",
Kumar Gala4958af82009-09-03 09:42:01 -0500284 pci_info[num].regs);
285 first_free_busno = fsl_pci_init_port(&pci_info[num++],
Kumar Gala01471d52009-11-04 01:29:04 -0600286 &pcie1_hose, first_free_busno);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500287 } else {
288 printf(" PCIE1: disabled\n");
289 }
Kumar Gala4958af82009-09-03 09:42:01 -0500290 puts("\n");
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500291#else
Kumar Gala4958af82009-09-03 09:42:01 -0500292 setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCIE); /* disable */
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500293#endif
294}
295#endif
296
297int board_early_init_r(void)
298{
299 const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
Kumar Gala5fb6ea32009-11-13 09:25:07 -0600300 const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500301
302 /*
303 * Remap Boot flash + PROMJET region to caching-inhibited
304 * so that flash can be erased properly.
305 */
306
307 /* Flush d-cache and invalidate i-cache of any FLASH data */
308 flush_dcache();
309 invalidate_icache();
310
311 /* invalidate existing TLB entry for flash + promjet */
312 disable_tlb(flash_esel);
313
314 set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
315 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
316 0, flash_esel, BOOKE_PAGESZ_256M, 1);
317
318 return 0;
319}
320
321#ifdef CONFIG_GET_CLK_FROM_ICS307
322/* decode S[0-2] to Output Divider (OD) */
323static unsigned char ics307_S_to_OD[] = {
324 10, 2, 8, 4, 5, 7, 3, 6
325};
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 */
330static unsigned long
331ics307_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
339 /* CLK1Frequency = InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD) */
340
341 /* cw0: C1 C0 TTL F1 F0 S2 S1 S0
342 * cw1: V8 V7 V6 V5 V4 V3 V2 V1
343 * cw2: V0 R6 R5 R4 R3 R2 R1 R0
344 *
345 * R6:R0 = Reference Divider Word (RDW)
346 * V8:V0 = VCO Divider Word (VDW)
347 * S2:S0 = Output Divider Select (OD)
348 * F1:F0 = Function of CLK2 Output
349 * TTL = duty cycle
350 * C1:C0 = internal load capacitance for cyrstal
351 */
352
353 /* Adding 1 to get a "nicely" rounded number, but this needs
354 * more tweaking to get a "properly" rounded number. */
355
356 freq = 1 + (InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD));
357
358 debug("ICS307: CW[0-2]: %02X %02X %02X => %lu Hz\n", cw0, cw1, cw2,
359 freq);
360 return freq;
361}
362
363unsigned long get_board_sys_clk(ulong dummy)
364{
365 return gd->bus_clk;
366}
367
368unsigned long get_board_ddr_clk(ulong dummy)
369{
370 return gd->mem_clk;
371}
372
373unsigned long
374calculate_board_sys_clk(ulong dummy)
375{
376 ulong val;
Kumar Gala048e7ef2009-07-22 10:12:39 -0500377 u8 *pixis_base = (u8 *)PIXIS_BASE;
378
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500379 val = ics307_clk_freq(
Kumar Gala048e7ef2009-07-22 10:12:39 -0500380 in_8(pixis_base + PIXIS_VSYSCLK0),
381 in_8(pixis_base + PIXIS_VSYSCLK1),
382 in_8(pixis_base + PIXIS_VSYSCLK2));
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500383 debug("sysclk val = %lu\n", val);
384 return val;
385}
386
387unsigned long
388calculate_board_ddr_clk(ulong dummy)
389{
390 ulong val;
Kumar Gala048e7ef2009-07-22 10:12:39 -0500391 u8 *pixis_base = (u8 *)PIXIS_BASE;
392
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500393 val = ics307_clk_freq(
Kumar Gala048e7ef2009-07-22 10:12:39 -0500394 in_8(pixis_base + PIXIS_VDDRCLK0),
395 in_8(pixis_base + PIXIS_VDDRCLK1),
396 in_8(pixis_base + PIXIS_VDDRCLK2));
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500397 debug("ddrclk val = %lu\n", val);
398 return val;
399}
400#else
401unsigned long get_board_sys_clk(ulong dummy)
402{
403 u8 i;
404 ulong val = 0;
Kumar Gala048e7ef2009-07-22 10:12:39 -0500405 u8 *pixis_base = (u8 *)PIXIS_BASE;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500406
Kumar Gala048e7ef2009-07-22 10:12:39 -0500407 i = in_8(pixis_base + PIXIS_SPD);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500408 i &= 0x07;
409
410 switch (i) {
411 case 0:
412 val = 33333333;
413 break;
414 case 1:
415 val = 40000000;
416 break;
417 case 2:
418 val = 50000000;
419 break;
420 case 3:
421 val = 66666666;
422 break;
423 case 4:
424 val = 83333333;
425 break;
426 case 5:
427 val = 100000000;
428 break;
429 case 6:
430 val = 133333333;
431 break;
432 case 7:
433 val = 166666666;
434 break;
435 }
436
437 return val;
438}
439
440unsigned long get_board_ddr_clk(ulong dummy)
441{
442 u8 i;
443 ulong val = 0;
Kumar Gala048e7ef2009-07-22 10:12:39 -0500444 u8 *pixis_base = (u8 *)PIXIS_BASE;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500445
Kumar Gala048e7ef2009-07-22 10:12:39 -0500446 i = in_8(pixis_base + PIXIS_SPD);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500447 i &= 0x38;
448 i >>= 3;
449
450 switch (i) {
451 case 0:
452 val = 33333333;
453 break;
454 case 1:
455 val = 40000000;
456 break;
457 case 2:
458 val = 50000000;
459 break;
460 case 3:
461 val = 66666666;
462 break;
463 case 4:
464 val = 83333333;
465 break;
466 case 5:
467 val = 100000000;
468 break;
469 case 6:
470 val = 133333333;
471 break;
472 case 7:
473 val = 166666666;
474 break;
475 }
476 return val;
477}
478#endif
479
480#ifdef CONFIG_TSEC_ENET
481int board_eth_init(bd_t *bis)
482{
483 struct tsec_info_struct tsec_info[4];
484 volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
485 int num = 0;
486
487#ifdef CONFIG_TSEC1
488 SET_STD_TSEC_INFO(tsec_info[num], 1);
489 num++;
490#endif
491#ifdef CONFIG_TSEC2
492 SET_STD_TSEC_INFO(tsec_info[num], 2);
493 if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS))
494 tsec_info[num].flags |= TSEC_SGMII;
495 num++;
496#endif
497#ifdef CONFIG_TSEC3
498 SET_STD_TSEC_INFO(tsec_info[num], 3);
499 if (!(gur->pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS))
500 tsec_info[num].flags |= TSEC_SGMII;
501 num++;
502#endif
503
504 if (!num) {
505 printf("No TSECs initialized\n");
506
507 return 0;
508 }
509
510#ifdef CONFIG_FSL_SGMII_RISER
511 fsl_sgmii_riser_init(tsec_info, num);
512#endif
513
514 tsec_eth_init(bis, tsec_info, num);
515
Roy Zang29c35182009-06-30 13:56:23 +0800516 return pci_eth_init(bis);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500517}
518#endif
519
520#if defined(CONFIG_OF_BOARD_SETUP)
521void ft_board_setup(void *blob, bd_t *bd)
522{
523 phys_addr_t base;
524 phys_size_t size;
525
526 ft_cpu_setup(blob, bd);
527
528 base = getenv_bootm_low();
529 size = getenv_bootm_size();
530
531 fdt_fixup_memory(blob, (u64)base, (u64)size);
532
533#ifdef CONFIG_PCIE3
534 ft_fsl_pci_setup(blob, "pci0", &pcie3_hose);
535#endif
536#ifdef CONFIG_PCIE2
537 ft_fsl_pci_setup(blob, "pci1", &pcie2_hose);
538#endif
539#ifdef CONFIG_PCIE1
540 ft_fsl_pci_setup(blob, "pci2", &pcie1_hose);
541#endif
542#ifdef CONFIG_FSL_SGMII_RISER
543 fsl_sgmii_riser_fdt_fixup(blob);
544#endif
545}
546#endif
547
548#ifdef CONFIG_MP
549void board_lmb_reserve(struct lmb *lmb)
550{
551 cpu_mp_lmb_reserve(lmb);
552}
553#endif