1acbca876SKumar Gala /*
2*b092072eSZhao Chenhui  * Copyright 2007,2009-2011 Freescale Semiconductor, Inc.
3acbca876SKumar Gala  *
4acbca876SKumar Gala  * (C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com>
5acbca876SKumar Gala  *
6acbca876SKumar Gala  * See file CREDITS for list of people who contributed to this
7acbca876SKumar Gala  * project.
8acbca876SKumar Gala  *
9acbca876SKumar Gala  * This program is free software; you can redistribute it and/or
10acbca876SKumar Gala  * modify it under the terms of the GNU General Public License as
11acbca876SKumar Gala  * published by the Free Software Foundation; either version 2 of
12acbca876SKumar Gala  * the License, or (at your option) any later version.
13acbca876SKumar Gala  *
14acbca876SKumar Gala  * This program is distributed in the hope that it will be useful,
15acbca876SKumar Gala  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16acbca876SKumar Gala  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
17acbca876SKumar Gala  * GNU General Public License for more details.
18acbca876SKumar Gala  *
19acbca876SKumar Gala  * You should have received a copy of the GNU General Public License
20acbca876SKumar Gala  * along with this program; if not, write to the Free Software
21acbca876SKumar Gala  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22acbca876SKumar Gala  * MA 02111-1307 USA
23acbca876SKumar Gala  */
24acbca876SKumar Gala 
25acbca876SKumar Gala #include <common.h>
26acbca876SKumar Gala #include <pci.h>
27acbca876SKumar Gala #include <asm/processor.h>
28e6f5b35bSJon Loeliger #include <asm/mmu.h>
29acbca876SKumar Gala #include <asm/immap_85xx.h>
30c8514622SKumar Gala #include <asm/fsl_pci.h>
31e6f5b35bSJon Loeliger #include <asm/fsl_ddr_sdram.h>
325d27e02cSKumar Gala #include <asm/fsl_serdes.h>
33a30a549aSJon Loeliger #include <spd_sdram.h>
34acbca876SKumar Gala #include <i2c.h>
35acbca876SKumar Gala #include <ioports.h>
36acbca876SKumar Gala #include <libfdt.h>
37acbca876SKumar Gala #include <fdt_support.h>
38acbca876SKumar Gala 
39acbca876SKumar Gala #include "bcsr.h"
40acbca876SKumar Gala 
41acbca876SKumar Gala const qe_iop_conf_t qe_iop_conf_tab[] = {
42acbca876SKumar Gala 	/* GETH1 */
43acbca876SKumar Gala 	{4, 10, 1, 0, 2}, /* TxD0 */
44acbca876SKumar Gala 	{4,  9, 1, 0, 2}, /* TxD1 */
45acbca876SKumar Gala 	{4,  8, 1, 0, 2}, /* TxD2 */
46acbca876SKumar Gala 	{4,  7, 1, 0, 2}, /* TxD3 */
47acbca876SKumar Gala 	{4, 23, 1, 0, 2}, /* TxD4 */
48acbca876SKumar Gala 	{4, 22, 1, 0, 2}, /* TxD5 */
49acbca876SKumar Gala 	{4, 21, 1, 0, 2}, /* TxD6 */
50acbca876SKumar Gala 	{4, 20, 1, 0, 2}, /* TxD7 */
51acbca876SKumar Gala 	{4, 15, 2, 0, 2}, /* RxD0 */
52acbca876SKumar Gala 	{4, 14, 2, 0, 2}, /* RxD1 */
53acbca876SKumar Gala 	{4, 13, 2, 0, 2}, /* RxD2 */
54acbca876SKumar Gala 	{4, 12, 2, 0, 2}, /* RxD3 */
55acbca876SKumar Gala 	{4, 29, 2, 0, 2}, /* RxD4 */
56acbca876SKumar Gala 	{4, 28, 2, 0, 2}, /* RxD5 */
57acbca876SKumar Gala 	{4, 27, 2, 0, 2}, /* RxD6 */
58acbca876SKumar Gala 	{4, 26, 2, 0, 2}, /* RxD7 */
59acbca876SKumar Gala 	{4, 11, 1, 0, 2}, /* TX_EN */
60acbca876SKumar Gala 	{4, 24, 1, 0, 2}, /* TX_ER */
61acbca876SKumar Gala 	{4, 16, 2, 0, 2}, /* RX_DV */
62acbca876SKumar Gala 	{4, 30, 2, 0, 2}, /* RX_ER */
63acbca876SKumar Gala 	{4, 17, 2, 0, 2}, /* RX_CLK */
64acbca876SKumar Gala 	{4, 19, 1, 0, 2}, /* GTX_CLK */
65acbca876SKumar Gala 	{1, 31, 2, 0, 3}, /* GTX125 */
66acbca876SKumar Gala 
67acbca876SKumar Gala 	/* GETH2 */
68acbca876SKumar Gala 	{5, 10, 1, 0, 2}, /* TxD0 */
69acbca876SKumar Gala 	{5,  9, 1, 0, 2}, /* TxD1 */
70acbca876SKumar Gala 	{5,  8, 1, 0, 2}, /* TxD2 */
71acbca876SKumar Gala 	{5,  7, 1, 0, 2}, /* TxD3 */
72acbca876SKumar Gala 	{5, 23, 1, 0, 2}, /* TxD4 */
73acbca876SKumar Gala 	{5, 22, 1, 0, 2}, /* TxD5 */
74acbca876SKumar Gala 	{5, 21, 1, 0, 2}, /* TxD6 */
75acbca876SKumar Gala 	{5, 20, 1, 0, 2}, /* TxD7 */
76acbca876SKumar Gala 	{5, 15, 2, 0, 2}, /* RxD0 */
77acbca876SKumar Gala 	{5, 14, 2, 0, 2}, /* RxD1 */
78acbca876SKumar Gala 	{5, 13, 2, 0, 2}, /* RxD2 */
79acbca876SKumar Gala 	{5, 12, 2, 0, 2}, /* RxD3 */
80acbca876SKumar Gala 	{5, 29, 2, 0, 2}, /* RxD4 */
81acbca876SKumar Gala 	{5, 28, 2, 0, 2}, /* RxD5 */
82acbca876SKumar Gala 	{5, 27, 2, 0, 3}, /* RxD6 */
83acbca876SKumar Gala 	{5, 26, 2, 0, 2}, /* RxD7 */
84acbca876SKumar Gala 	{5, 11, 1, 0, 2}, /* TX_EN */
85acbca876SKumar Gala 	{5, 24, 1, 0, 2}, /* TX_ER */
86acbca876SKumar Gala 	{5, 16, 2, 0, 2}, /* RX_DV */
87acbca876SKumar Gala 	{5, 30, 2, 0, 2}, /* RX_ER */
88acbca876SKumar Gala 	{5, 17, 2, 0, 2}, /* RX_CLK */
89acbca876SKumar Gala 	{5, 19, 1, 0, 2}, /* GTX_CLK */
90acbca876SKumar Gala 	{1, 31, 2, 0, 3}, /* GTX125 */
91acbca876SKumar Gala 	{4,  6, 3, 0, 2}, /* MDIO */
92acbca876SKumar Gala 	{4,  5, 1, 0, 2}, /* MDC */
9364d4bcb0SAnton Vorontsov 
9464d4bcb0SAnton Vorontsov 	/* UART1 */
9564d4bcb0SAnton Vorontsov 	{2, 0, 1, 0, 2}, /* UART_SOUT1 */
9664d4bcb0SAnton Vorontsov 	{2, 1, 1, 0, 2}, /* UART_RTS1 */
9764d4bcb0SAnton Vorontsov 	{2, 2, 2, 0, 2}, /* UART_CTS1 */
9864d4bcb0SAnton Vorontsov 	{2, 3, 2, 0, 2}, /* UART_SIN1 */
9964d4bcb0SAnton Vorontsov 
100acbca876SKumar Gala 	{0,  0, 0, 0, QE_IOP_TAB_END}, /* END of table */
101acbca876SKumar Gala };
102acbca876SKumar Gala 
103acbca876SKumar Gala void local_bus_init(void);
104acbca876SKumar Gala 
105acbca876SKumar Gala int board_early_init_f (void)
106acbca876SKumar Gala {
107acbca876SKumar Gala 	/*
108acbca876SKumar Gala 	 * Initialize local bus.
109acbca876SKumar Gala 	 */
110acbca876SKumar Gala 	local_bus_init ();
111acbca876SKumar Gala 
112acbca876SKumar Gala 	enable_8568mds_duart();
113acbca876SKumar Gala 	enable_8568mds_flash_write();
114ad162249SAnton Vorontsov #if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
115ad162249SAnton Vorontsov 	reset_8568mds_uccs();
116ad162249SAnton Vorontsov #endif
117acbca876SKumar Gala #if defined(CONFIG_QE) && !defined(CONFIG_eTSEC_MDIO_BUS)
118acbca876SKumar Gala 	enable_8568mds_qe_mdio();
119acbca876SKumar Gala #endif
120acbca876SKumar Gala 
1216d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_I2C2_OFFSET
122acbca876SKumar Gala 	/* Enable I2C2_SCL and I2C2_SDA */
123acbca876SKumar Gala 	volatile struct par_io *port_c;
1246d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	port_c = (struct par_io*)(CONFIG_SYS_IMMR + 0xe0140);
125acbca876SKumar Gala 	port_c->cpdir2 |= 0x0f000000;
126acbca876SKumar Gala 	port_c->cppar2 &= ~0x0f000000;
127acbca876SKumar Gala 	port_c->cppar2 |= 0x0a000000;
128acbca876SKumar Gala #endif
129acbca876SKumar Gala 
130acbca876SKumar Gala 	return 0;
131acbca876SKumar Gala }
132acbca876SKumar Gala 
133acbca876SKumar Gala int checkboard (void)
134acbca876SKumar Gala {
135acbca876SKumar Gala 	printf ("Board: 8568 MDS\n");
136acbca876SKumar Gala 
137acbca876SKumar Gala 	return 0;
138acbca876SKumar Gala }
139acbca876SKumar Gala 
140acbca876SKumar Gala /*
141acbca876SKumar Gala  * Initialize Local Bus
142acbca876SKumar Gala  */
143acbca876SKumar Gala void
144acbca876SKumar Gala local_bus_init(void)
145acbca876SKumar Gala {
1466d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
147f51cdaf1SBecky Bruce 	volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
148acbca876SKumar Gala 
149acbca876SKumar Gala 	uint clkdiv;
150acbca876SKumar Gala 	uint lbc_hz;
151acbca876SKumar Gala 	sys_info_t sysinfo;
152acbca876SKumar Gala 
153acbca876SKumar Gala 	get_sys_info(&sysinfo);
154a5d212a2STrent Piepho 	clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2;
155acbca876SKumar Gala 	lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;
156acbca876SKumar Gala 
157acbca876SKumar Gala 	gur->lbiuiplldcr1 = 0x00078080;
158acbca876SKumar Gala 	if (clkdiv == 16) {
159acbca876SKumar Gala 		gur->lbiuiplldcr0 = 0x7c0f1bf0;
160acbca876SKumar Gala 	} else if (clkdiv == 8) {
161acbca876SKumar Gala 		gur->lbiuiplldcr0 = 0x6c0f1bf0;
162acbca876SKumar Gala 	} else if (clkdiv == 4) {
163acbca876SKumar Gala 		gur->lbiuiplldcr0 = 0x5c0f1bf0;
164acbca876SKumar Gala 	}
165acbca876SKumar Gala 
166acbca876SKumar Gala 	lbc->lcrr |= 0x00030000;
167acbca876SKumar Gala 
168acbca876SKumar Gala 	asm("sync;isync;msync");
169acbca876SKumar Gala }
170acbca876SKumar Gala 
171acbca876SKumar Gala /*
172acbca876SKumar Gala  * Initialize SDRAM memory on the Local Bus.
173acbca876SKumar Gala  */
17470961ba4SBecky Bruce void lbc_sdram_init(void)
175acbca876SKumar Gala {
1766d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM)
177acbca876SKumar Gala 
178acbca876SKumar Gala 	uint idx;
179f51cdaf1SBecky Bruce 	volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
1806d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE;
181acbca876SKumar Gala 	uint lsdmr_common;
182acbca876SKumar Gala 
1837ea3871eSBecky Bruce 	puts("LBC SDRAM: ");
1847ea3871eSBecky Bruce 	print_size(CONFIG_SYS_LBC_SDRAM_SIZE * 1024 * 1024,
1857ea3871eSBecky Bruce 		   "\n       ");
186acbca876SKumar Gala 
187acbca876SKumar Gala 	/*
188acbca876SKumar Gala 	 * Setup SDRAM Base and Option Registers
189acbca876SKumar Gala 	 */
190f51cdaf1SBecky Bruce 	set_lbc_or(2, CONFIG_SYS_OR2_PRELIM);
191f51cdaf1SBecky Bruce 	set_lbc_br(2, CONFIG_SYS_BR2_PRELIM);
192acbca876SKumar Gala 	asm("msync");
193acbca876SKumar Gala 
1946d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	lbc->lbcr = CONFIG_SYS_LBC_LBCR;
195acbca876SKumar Gala 	asm("msync");
196acbca876SKumar Gala 
1976d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	lbc->lsrt = CONFIG_SYS_LBC_LSRT;
1986d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
199acbca876SKumar Gala 	asm("msync");
200acbca876SKumar Gala 
201acbca876SKumar Gala 	/*
202acbca876SKumar Gala 	 * MPC8568 uses "new" 15-16 style addressing.
203acbca876SKumar Gala 	 */
2046d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	lsdmr_common = CONFIG_SYS_LBC_LSDMR_COMMON;
205b0fe93edSKumar Gala 	lsdmr_common |= LSDMR_BSMA1516;
206acbca876SKumar Gala 
207acbca876SKumar Gala 	/*
208acbca876SKumar Gala 	 * Issue PRECHARGE ALL command.
209acbca876SKumar Gala 	 */
210b0fe93edSKumar Gala 	lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL;
211acbca876SKumar Gala 	asm("sync;msync");
212acbca876SKumar Gala 	*sdram_addr = 0xff;
213acbca876SKumar Gala 	ppcDcbf((unsigned long) sdram_addr);
214acbca876SKumar Gala 	udelay(100);
215acbca876SKumar Gala 
216acbca876SKumar Gala 	/*
217acbca876SKumar Gala 	 * Issue 8 AUTO REFRESH commands.
218acbca876SKumar Gala 	 */
219acbca876SKumar Gala 	for (idx = 0; idx < 8; idx++) {
220b0fe93edSKumar Gala 		lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH;
221acbca876SKumar Gala 		asm("sync;msync");
222acbca876SKumar Gala 		*sdram_addr = 0xff;
223acbca876SKumar Gala 		ppcDcbf((unsigned long) sdram_addr);
224acbca876SKumar Gala 		udelay(100);
225acbca876SKumar Gala 	}
226acbca876SKumar Gala 
227acbca876SKumar Gala 	/*
228acbca876SKumar Gala 	 * Issue 8 MODE-set command.
229acbca876SKumar Gala 	 */
230b0fe93edSKumar Gala 	lbc->lsdmr = lsdmr_common | LSDMR_OP_MRW;
231acbca876SKumar Gala 	asm("sync;msync");
232acbca876SKumar Gala 	*sdram_addr = 0xff;
233acbca876SKumar Gala 	ppcDcbf((unsigned long) sdram_addr);
234acbca876SKumar Gala 	udelay(100);
235acbca876SKumar Gala 
236acbca876SKumar Gala 	/*
237acbca876SKumar Gala 	 * Issue NORMAL OP command.
238acbca876SKumar Gala 	 */
239b0fe93edSKumar Gala 	lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL;
240acbca876SKumar Gala 	asm("sync;msync");
241acbca876SKumar Gala 	*sdram_addr = 0xff;
242acbca876SKumar Gala 	ppcDcbf((unsigned long) sdram_addr);
243acbca876SKumar Gala 	udelay(200);    /* Overkill. Must wait > 200 bus cycles */
244acbca876SKumar Gala 
245acbca876SKumar Gala #endif	/* enable SDRAM init */
246acbca876SKumar Gala }
247acbca876SKumar Gala 
248acbca876SKumar Gala #if defined(CONFIG_PCI)
249acbca876SKumar Gala #ifndef CONFIG_PCI_PNP
250acbca876SKumar Gala static struct pci_config_table pci_mpc8568mds_config_table[] = {
251acbca876SKumar Gala 	{
252acbca876SKumar Gala 	 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
253acbca876SKumar Gala 	 pci_cfgfunc_config_device,
254acbca876SKumar Gala 	 {PCI_ENET0_IOADDR,
255acbca876SKumar Gala 	  PCI_ENET0_MEMADDR,
256acbca876SKumar Gala 	  PCI_COMMON_MEMORY | PCI_COMMAND_MASTER}
257acbca876SKumar Gala 	 },
258acbca876SKumar Gala 	{}
259acbca876SKumar Gala };
260acbca876SKumar Gala #endif
261acbca876SKumar Gala 
262*b092072eSZhao Chenhui static struct pci_controller pci1_hose;
263acbca876SKumar Gala #endif	/* CONFIG_PCI */
264acbca876SKumar Gala 
265acbca876SKumar Gala /*
266acbca876SKumar Gala  * pib_init() -- Initialize the PCA9555 IO expander on the PIB board
267acbca876SKumar Gala  */
268acbca876SKumar Gala void
269acbca876SKumar Gala pib_init(void)
270acbca876SKumar Gala {
271acbca876SKumar Gala 	u8 val8, orig_i2c_bus;
272acbca876SKumar Gala 	/*
273acbca876SKumar Gala 	 * Assign PIB PMC2/3 to PCI bus
274acbca876SKumar Gala 	 */
275acbca876SKumar Gala 
276acbca876SKumar Gala 	/*switch temporarily to I2C bus #2 */
277acbca876SKumar Gala 	orig_i2c_bus = i2c_get_bus_num();
278acbca876SKumar Gala 	i2c_set_bus_num(1);
279acbca876SKumar Gala 
280acbca876SKumar Gala 	val8 = 0x00;
281acbca876SKumar Gala 	i2c_write(0x23, 0x6, 1, &val8, 1);
282acbca876SKumar Gala 	i2c_write(0x23, 0x7, 1, &val8, 1);
283acbca876SKumar Gala 	val8 = 0xff;
284acbca876SKumar Gala 	i2c_write(0x23, 0x2, 1, &val8, 1);
285acbca876SKumar Gala 	i2c_write(0x23, 0x3, 1, &val8, 1);
286acbca876SKumar Gala 
287acbca876SKumar Gala 	val8 = 0x00;
288acbca876SKumar Gala 	i2c_write(0x26, 0x6, 1, &val8, 1);
289acbca876SKumar Gala 	val8 = 0x34;
290acbca876SKumar Gala 	i2c_write(0x26, 0x7, 1, &val8, 1);
291acbca876SKumar Gala 	val8 = 0xf9;
292acbca876SKumar Gala 	i2c_write(0x26, 0x2, 1, &val8, 1);
293acbca876SKumar Gala 	val8 = 0xff;
294acbca876SKumar Gala 	i2c_write(0x26, 0x3, 1, &val8, 1);
295acbca876SKumar Gala 
296acbca876SKumar Gala 	val8 = 0x00;
297acbca876SKumar Gala 	i2c_write(0x27, 0x6, 1, &val8, 1);
298acbca876SKumar Gala 	i2c_write(0x27, 0x7, 1, &val8, 1);
299acbca876SKumar Gala 	val8 = 0xff;
300acbca876SKumar Gala 	i2c_write(0x27, 0x2, 1, &val8, 1);
301acbca876SKumar Gala 	val8 = 0xef;
302acbca876SKumar Gala 	i2c_write(0x27, 0x3, 1, &val8, 1);
303acbca876SKumar Gala 
304acbca876SKumar Gala 	asm("eieio");
305acbca876SKumar Gala }
306acbca876SKumar Gala 
307acbca876SKumar Gala #ifdef CONFIG_PCI
3084681457eSKumar Gala void pci_init_board(void)
309acbca876SKumar Gala {
3106d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
3113f6f9d76SKumar Gala 	int first_free_busno = 0;
3123f6f9d76SKumar Gala #ifdef CONFIG_PCI1
3133f6f9d76SKumar Gala 	struct fsl_pci_info pci_info;
3144681457eSKumar Gala 	u32 devdisr, pordevsr, io_sel;
3154681457eSKumar Gala 	u32 porpllsr, pci_agent, pci_speed, pci_32, pci_arb, pci_clk_sel;
3164681457eSKumar Gala 
3174681457eSKumar Gala 	devdisr = in_be32(&gur->devdisr);
3184681457eSKumar Gala 	pordevsr = in_be32(&gur->pordevsr);
3194681457eSKumar Gala 	porpllsr = in_be32(&gur->porpllsr);
3204681457eSKumar Gala 	io_sel = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
3214681457eSKumar Gala 
3224681457eSKumar Gala 	debug ("   pci_init_board: devdisr=%x, io_sel=%x\n", devdisr, io_sel);
323acbca876SKumar Gala 
3244681457eSKumar Gala 	pci_speed = 66666000;
3254681457eSKumar Gala 	pci_32 = 1;
3264681457eSKumar Gala 	pci_arb = pordevsr & MPC85xx_PORDEVSR_PCI1_ARB;
3274681457eSKumar Gala 	pci_clk_sel = porpllsr & MPC85xx_PORDEVSR_PCI1_SPD;
328acbca876SKumar Gala 
3294681457eSKumar Gala 	if (!(devdisr & MPC85xx_DEVDISR_PCI1)) {
3303f6f9d76SKumar Gala 		SET_STD_PCI_INFO(pci_info, 1);
3313f6f9d76SKumar Gala 		set_next_law(pci_info.mem_phys,
3323f6f9d76SKumar Gala 			law_size_bits(pci_info.mem_size), pci_info.law);
3333f6f9d76SKumar Gala 		set_next_law(pci_info.io_phys,
3343f6f9d76SKumar Gala 			law_size_bits(pci_info.io_size), pci_info.law);
3353f6f9d76SKumar Gala 
3363f6f9d76SKumar Gala 		pci_agent = fsl_setup_hose(&pci1_hose, pci_info.regs);
3378ca78f2cSPeter Tyser 		printf("PCI: %d bit, %s MHz, %s, %s, %s (base address %lx)\n",
338acbca876SKumar Gala 			(pci_32) ? 32 : 64,
339acbca876SKumar Gala 			(pci_speed == 33333000) ? "33" :
340acbca876SKumar Gala 			(pci_speed == 66666000) ? "66" : "unknown",
341acbca876SKumar Gala 			pci_clk_sel ? "sync" : "async",
342acbca876SKumar Gala 			pci_agent ? "agent" : "host",
3434681457eSKumar Gala 			pci_arb ? "arbiter" : "external-arbiter",
3443f6f9d76SKumar Gala 			pci_info.regs);
345acbca876SKumar Gala 
346*b092072eSZhao Chenhui #ifndef CONFIG_PCI_PNP
347*b092072eSZhao Chenhui 		pci1_hose.config_table = pci_mpc8568mds_config_table;
348*b092072eSZhao Chenhui #endif
3493f6f9d76SKumar Gala 		first_free_busno = fsl_pci_init_port(&pci_info,
3504681457eSKumar Gala 					&pci1_hose, first_free_busno);
351acbca876SKumar Gala 	} else {
352acbca876SKumar Gala 		printf("PCI: disabled\n");
353acbca876SKumar Gala 	}
3544681457eSKumar Gala 
3554681457eSKumar Gala 	puts("\n");
356acbca876SKumar Gala #else
3574681457eSKumar Gala 	setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCI1); /* disable */
358acbca876SKumar Gala #endif
359acbca876SKumar Gala 
3603f6f9d76SKumar Gala 	fsl_pcie_init_board(first_free_busno);
361acbca876SKumar Gala }
362acbca876SKumar Gala #endif /* CONFIG_PCI */
363acbca876SKumar Gala 
364acbca876SKumar Gala #if defined(CONFIG_OF_BOARD_SETUP)
3652dba0deaSKumar Gala void ft_board_setup(void *blob, bd_t *bd)
3662dba0deaSKumar Gala {
367acbca876SKumar Gala 	ft_cpu_setup(blob, bd);
368acbca876SKumar Gala 
3696525d51fSKumar Gala 	FT_FSL_PCI_SETUP;
370acbca876SKumar Gala }
371acbca876SKumar Gala #endif
372