blob: 5b4c290df1493b1987bb7a22acd61279b26ae38d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Timur Tabi054838e2006-10-31 18:44:42 -06002/*
Kumar Gala6a6d9482009-07-28 21:49:52 -05003 * Copyright (C) Freescale Semiconductor, Inc. 2006.
Timur Tabi054838e2006-10-31 18:44:42 -06004 */
5
6#include <common.h>
Simon Glass3bbe70c2019-12-28 10:44:54 -07007#include <fdt_support.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Timur Tabi054838e2006-10-31 18:44:42 -06009#include <ioports.h>
Simon Glass0f2af882020-05-10 11:40:05 -060010#include <log.h>
Timur Tabi054838e2006-10-31 18:44:42 -060011#include <mpc83xx.h>
12#include <i2c.h>
Timur Tabi054838e2006-10-31 18:44:42 -060013#include <miiphy.h>
Timur Tabi3e1d49a2008-02-08 13:15:55 -060014#include <vsc7385.h>
Timur Tabi054838e2006-10-31 18:44:42 -060015#ifdef CONFIG_PCI
16#include <asm/mpc8349_pci.h>
17#include <pci.h>
18#endif
Timur Tabi054838e2006-10-31 18:44:42 -060019#include <spd_sdram.h>
Simon Glass4dcacfc2020-05-10 11:40:13 -060020#include <asm/bitops.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060021#include <asm/global_data.h>
Timur Tabi054838e2006-10-31 18:44:42 -060022#include <asm/mmu.h>
Kim Phillips3204c7c2007-12-20 15:57:28 -060023#if defined(CONFIG_OF_LIBFDT)
Masahiro Yamada75f82d02018-03-05 01:20:11 +090024#include <linux/libfdt.h>
Kim Phillips774e1b52006-11-01 00:10:40 -060025#endif
Simon Glassdbd79542020-05-10 11:40:11 -060026#include <linux/delay.h>
Timur Tabi054838e2006-10-31 18:44:42 -060027
Mario Six94867102019-01-21 09:17:54 +010028#include "../../../arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h"
Mario Six1faf95d2019-01-21 09:18:03 +010029#include "../../../arch/powerpc/cpu/mpc83xx/elbc/elbc.h"
Mario Six94867102019-01-21 09:17:54 +010030
Simon Glass39f90ba2017-03-31 08:40:25 -060031DECLARE_GLOBAL_DATA_PTR;
32
Timur Tabi054838e2006-10-31 18:44:42 -060033#ifndef CONFIG_SPD_EEPROM
34/*************************************************************************
35 * fixed sdram init -- doesn't use serial presence detect.
36 ************************************************************************/
37int fixed_sdram(void)
38{
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020039 volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
Joe Hershberger5ade3902011-10-11 23:57:31 -050040 /* The size of RAM, in bytes */
41 u32 ddr_size = CONFIG_SYS_DDR_SIZE << 20;
42 u32 ddr_size_log2 = __ilog2(ddr_size);
Timur Tabi054838e2006-10-31 18:44:42 -060043
44 im->sysconf.ddrlaw[0].ar =
45 LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE);
Mario Six805cac12019-01-21 09:18:16 +010046 im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xfffff000;
Timur Tabi054838e2006-10-31 18:44:42 -060047
Mario Six805cac12019-01-21 09:18:16 +010048#if ((CONFIG_SYS_SDRAM_BASE & 0x00FFFFFF) != 0)
Joe Hershberger5ade3902011-10-11 23:57:31 -050049#warning Chip select bounds is only configurable in 16MB increments
50#endif
51 im->ddr.csbnds[0].csbnds =
Mario Six805cac12019-01-21 09:18:16 +010052 ((CONFIG_SYS_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) |
53 (((CONFIG_SYS_SDRAM_BASE + ddr_size - 1) >>
Joe Hershberger5ade3902011-10-11 23:57:31 -050054 CSBNDS_EA_SHIFT) & CSBNDS_EA);
55 im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
56
57 /* Only one CS for DDR */
58 im->ddr.cs_config[1] = 0;
59 im->ddr.cs_config[2] = 0;
60 im->ddr.cs_config[3] = 0;
Timur Tabi054838e2006-10-31 18:44:42 -060061
62 debug("cs0_bnds = 0x%08x\n", im->ddr.csbnds[0].csbnds);
63 debug("cs0_config = 0x%08x\n", im->ddr.cs_config[0]);
64
65 debug("DDR:bar=0x%08x\n", im->sysconf.ddrlaw[0].bar);
66 debug("DDR:ar=0x%08x\n", im->sysconf.ddrlaw[0].ar);
67
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020068 im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
69 im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;/* Was "2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT" */
Kim Phillips3b9c20f2007-08-16 22:52:48 -050070 im->ddr.sdram_cfg = SDRAM_CFG_SREN | SDRAM_CFG_SDRAM_TYPE_DDR1;
Timur Tabi054838e2006-10-31 18:44:42 -060071 im->ddr.sdram_mode =
72 (0x0000 << SDRAM_MODE_ESD_SHIFT) | (0x0032 << SDRAM_MODE_SD_SHIFT);
73 im->ddr.sdram_interval =
74 (0x0410 << SDRAM_INTERVAL_REFINT_SHIFT) | (0x0100 <<
75 SDRAM_INTERVAL_BSTOPRE_SHIFT);
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020076 im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_SDRAM_CLK_CNTL;
Timur Tabi054838e2006-10-31 18:44:42 -060077
78 udelay(200);
79
80 im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
81
82 debug("DDR:timing_cfg_1=0x%08x\n", im->ddr.timing_cfg_1);
83 debug("DDR:timing_cfg_2=0x%08x\n", im->ddr.timing_cfg_2);
84 debug("DDR:sdram_mode=0x%08x\n", im->ddr.sdram_mode);
85 debug("DDR:sdram_interval=0x%08x\n", im->ddr.sdram_interval);
86 debug("DDR:sdram_cfg=0x%08x\n", im->ddr.sdram_cfg);
87
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020088 return CONFIG_SYS_DDR_SIZE;
Timur Tabi054838e2006-10-31 18:44:42 -060089}
90#endif
91
92#ifdef CONFIG_PCI
93/*
94 * Initialize PCI Devices, report devices found
95 */
96#ifndef CONFIG_PCI_PNP
97static struct pci_config_table pci_mpc83xxmitx_config_table[] = {
98 {
99 PCI_ANY_ID,
100 PCI_ANY_ID,
101 PCI_ANY_ID,
102 PCI_ANY_ID,
103 0x0f,
104 PCI_ANY_ID,
105 pci_cfgfunc_config_device,
106 {
107 PCI_ENET0_IOADDR,
108 PCI_ENET0_MEMADDR,
109 PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER}
110 },
111 {}
112}
113#endif
114
115volatile static struct pci_controller hose[] = {
116 {
117#ifndef CONFIG_PCI_PNP
118 config_table:pci_mpc83xxmitx_config_table,
119#endif
120 },
121 {
122#ifndef CONFIG_PCI_PNP
123 config_table:pci_mpc83xxmitx_config_table,
124#endif
125 }
126};
127#endif /* CONFIG_PCI */
128
Simon Glassd35f3382017-04-06 12:47:05 -0600129int dram_init(void)
Timur Tabi054838e2006-10-31 18:44:42 -0600130{
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200131 volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
Timur Tabi054838e2006-10-31 18:44:42 -0600132 u32 msize = 0;
133#ifdef CONFIG_DDR_ECC
134 volatile ddr83xx_t *ddr = &im->ddr;
135#endif
136
137 if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
Simon Glass39f90ba2017-03-31 08:40:25 -0600138 return -ENXIO;
Timur Tabi054838e2006-10-31 18:44:42 -0600139
140 /* DDR SDRAM - Main SODIMM */
Mario Sixc9f92772019-01-21 09:18:15 +0100141 im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
Timur Tabi054838e2006-10-31 18:44:42 -0600142#ifdef CONFIG_SPD_EEPROM
143 msize = spd_sdram();
144#else
145 msize = fixed_sdram();
146#endif
147
148#ifdef CONFIG_DDR_ECC
149 if (ddr->sdram_cfg & SDRAM_CFG_ECC_EN)
150 /* Unlike every other board, on the 83xx spd_sdram() returns
151 megabytes instead of just bytes. That's why we need to
152 multiple by 1MB when calling ddr_enable_ecc(). */
153 ddr_enable_ecc(msize * 1048576);
154#endif
155
Timur Tabi3ff11182007-01-31 15:54:20 -0600156 /* return total bus RAM size(bytes) */
Simon Glass39f90ba2017-03-31 08:40:25 -0600157 gd->ram_size = msize * 1024 * 1024;
158
159 return 0;
Timur Tabi054838e2006-10-31 18:44:42 -0600160}
161
162int checkboard(void)
163{
Mario Six5bb7f752019-01-21 09:17:44 +0100164#ifdef CONFIG_TARGET_MPC8349ITX
Timur Tabiab347542006-11-03 19:15:00 -0600165 puts("Board: Freescale MPC8349E-mITX\n");
Timur Tabi435e3a72007-01-31 15:54:29 -0600166#else
167 puts("Board: Freescale MPC8349E-mITX-GP\n");
168#endif
Timur Tabi054838e2006-10-31 18:44:42 -0600169
170 return 0;
171}
172
Timur Tabiab347542006-11-03 19:15:00 -0600173/*
Timur Tabi054838e2006-10-31 18:44:42 -0600174 * Implement a work-around for a hardware problem with compact
175 * flash.
176 *
177 * Program the UPM if compact flash is enabled.
178 */
179int misc_init_f(void)
180{
Timur Tabi3e1d49a2008-02-08 13:15:55 -0600181#ifdef CONFIG_VSC7385_ENET
Timur Tabi054838e2006-10-31 18:44:42 -0600182 volatile u32 *vsc7385_cpuctrl;
183
184 /* 0x1c0c0 is the VSC7385 CPU Control (CPUCTRL) Register. The power up
185 default of VSC7385 L1_IRQ and L2_IRQ requests are active high. That
186 means it is 0 when the IRQ is not active. This makes the wire-AND
187 logic always assert IRQ7 to CPU even if there is no request from the
188 switch. Since the compact flash and the switch share the same IRQ,
189 the Linux kernel will think that the compact flash is requesting irq
190 and get stuck when it tries to clear the IRQ. Thus we need to set
191 the L2_IRQ0 and L2_IRQ1 to active low.
192
193 The following code sets the L1_IRQ and L2_IRQ polarity to active low.
194 Without this code, compact flash will not work in Linux because
195 unlike U-Boot, Linux uses the IRQ, so this code is necessary if we
196 don't enable compact flash for U-Boot.
197 */
198
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200199 vsc7385_cpuctrl = (volatile u32 *)(CONFIG_SYS_VSC7385_BASE + 0x1c0c0);
Timur Tabi054838e2006-10-31 18:44:42 -0600200 *vsc7385_cpuctrl |= 0x0c;
Timur Tabi435e3a72007-01-31 15:54:29 -0600201#endif
Timur Tabi054838e2006-10-31 18:44:42 -0600202
203#ifdef CONFIG_COMPACT_FLASH
204 /* UPM Table Configuration Code */
205 static uint UPMATable[] = {
206 0xcffffc00, 0x0fffff00, 0x0fafff00, 0x0fafff00,
207 0x0faffd00, 0x0faffc04, 0x0ffffc00, 0x3ffffc01,
208 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
209 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
210 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfff7fc00,
211 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
212 0xcffffc00, 0x0fffff00, 0x0ff3ff00, 0x0ff3ff00,
213 0x0ff3fe00, 0x0ffffc00, 0x3ffffc05, 0xfffffc00,
214 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
215 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
216 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
217 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
218 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
219 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
220 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
221 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01
222 };
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200223 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
Timur Tabi054838e2006-10-31 18:44:42 -0600224
Becky Bruce0d4cee12010-06-17 11:37:20 -0500225 set_lbc_br(3, CONFIG_SYS_BR3_PRELIM);
226 set_lbc_or(3, CONFIG_SYS_OR3_PRELIM);
Timur Tabi054838e2006-10-31 18:44:42 -0600227
228 /* Program the MAMR. RFEN=0, OP=00, UWPL=1, AM=000, DS=01, G0CL=000,
229 GPL4=0, RLF=0001, WLF=0001, TLF=0001, MAD=000000
230 */
Becky Bruce0d4cee12010-06-17 11:37:20 -0500231 immap->im_lbc.mamr = 0x08404440;
Timur Tabi054838e2006-10-31 18:44:42 -0600232
233 upmconfig(0, UPMATable, sizeof(UPMATable) / sizeof(UPMATable[0]));
234
235 puts("UPMA: Configured for compact flash\n");
236#endif
237
238 return 0;
239}
240
Timur Tabiab347542006-11-03 19:15:00 -0600241/*
Timur Tabi3e1d49a2008-02-08 13:15:55 -0600242 * Miscellaneous late-boot configurations
243 *
Timur Tabi054838e2006-10-31 18:44:42 -0600244 * Make sure the EEPROM has the HRCW correctly programmed.
245 * Make sure the RTC is correctly programmed.
246 *
247 * The MPC8349E-mITX can be configured to load the HRCW from
248 * EEPROM instead of flash. This is controlled via jumpers
249 * LGPL0, 1, and 3. Normally, these jumpers are set to 000 (all
250 * jumpered), but if they're set to 001 or 010, then the HRCW is
251 * read from the "I2C EEPROM".
252 *
253 * This function makes sure that the I2C EEPROM is programmed
254 * correctly.
Timur Tabi3e1d49a2008-02-08 13:15:55 -0600255 *
256 * If a VSC7385 microcode image is present, then upload it.
Timur Tabi054838e2006-10-31 18:44:42 -0600257 */
258int misc_init_r(void)
259{
260 int rc = 0;
261
Heiko Schocherf2850742012-10-24 13:48:22 +0200262#if defined(CONFIG_SYS_I2C)
Sam Songb7bf05c2006-12-14 19:03:21 +0800263 unsigned int orig_bus = i2c_get_bus_num();
Timur Tabiab347542006-11-03 19:15:00 -0600264 u8 i2c_data;
Timur Tabi054838e2006-10-31 18:44:42 -0600265
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200266#ifdef CONFIG_SYS_I2C_RTC_ADDR
Timur Tabiff0215a2006-11-28 12:09:35 -0600267 u8 ds1339_data[17];
Timur Tabi054838e2006-10-31 18:44:42 -0600268#endif
269
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200270#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
Timur Tabi054838e2006-10-31 18:44:42 -0600271 static u8 eeprom_data[] = /* HRCW data */
272 {
Timur Tabi435e3a72007-01-31 15:54:29 -0600273 0xAA, 0x55, 0xAA, /* Preamble */
Wolfgang Denka1be4762008-05-20 16:00:29 +0200274 0x7C, /* ACS=0, BYTE_EN=1111, CONT=1 */
275 0x02, 0x40, /* RCWL ADDR=0x0_0900 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200276 (CONFIG_SYS_HRCW_LOW >> 24) & 0xFF,
277 (CONFIG_SYS_HRCW_LOW >> 16) & 0xFF,
278 (CONFIG_SYS_HRCW_LOW >> 8) & 0xFF,
279 CONFIG_SYS_HRCW_LOW & 0xFF,
Wolfgang Denka1be4762008-05-20 16:00:29 +0200280 0x7C, /* ACS=0, BYTE_EN=1111, CONT=1 */
Timur Tabi435e3a72007-01-31 15:54:29 -0600281 0x02, 0x41, /* RCWH ADDR=0x0_0904 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200282 (CONFIG_SYS_HRCW_HIGH >> 24) & 0xFF,
283 (CONFIG_SYS_HRCW_HIGH >> 16) & 0xFF,
284 (CONFIG_SYS_HRCW_HIGH >> 8) & 0xFF,
285 CONFIG_SYS_HRCW_HIGH & 0xFF
Timur Tabi054838e2006-10-31 18:44:42 -0600286 };
287
288 u8 data[sizeof(eeprom_data)];
Timur Tabiab347542006-11-03 19:15:00 -0600289#endif
Timur Tabi054838e2006-10-31 18:44:42 -0600290
Timur Tabiab347542006-11-03 19:15:00 -0600291 printf("Board revision: ");
Timur Tabic0b114a2006-10-31 21:23:16 -0600292 i2c_set_bus_num(1);
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200293 if (i2c_read(CONFIG_SYS_I2C_8574A_ADDR2, 0, 0, &i2c_data, sizeof(i2c_data)) == 0)
Timur Tabiab347542006-11-03 19:15:00 -0600294 printf("%u.%u (PCF8475A)\n", (i2c_data & 0x02) >> 1, i2c_data & 0x01);
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200295 else if (i2c_read(CONFIG_SYS_I2C_8574_ADDR2, 0, 0, &i2c_data, sizeof(i2c_data)) == 0)
Timur Tabiab347542006-11-03 19:15:00 -0600296 printf("%u.%u (PCF8475)\n", (i2c_data & 0x02) >> 1, i2c_data & 0x01);
297 else {
298 printf("Unknown\n");
299 rc = 1;
300 }
301
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200302#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
Timur Tabiab347542006-11-03 19:15:00 -0600303 i2c_set_bus_num(0);
Timur Tabi054838e2006-10-31 18:44:42 -0600304
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200305 if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, data, sizeof(data)) == 0) {
Timur Tabi054838e2006-10-31 18:44:42 -0600306 if (memcmp(data, eeprom_data, sizeof(data)) != 0) {
307 if (i2c_write
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200308 (CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, eeprom_data,
Timur Tabi054838e2006-10-31 18:44:42 -0600309 sizeof(eeprom_data)) != 0) {
310 puts("Failure writing the HRCW to EEPROM via I2C.\n");
311 rc = 1;
312 }
313 }
314 } else {
315 puts("Failure reading the HRCW from EEPROM via I2C.\n");
316 rc = 1;
317 }
318#endif
319
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200320#ifdef CONFIG_SYS_I2C_RTC_ADDR
Timur Tabiab347542006-11-03 19:15:00 -0600321 i2c_set_bus_num(1);
Timur Tabi054838e2006-10-31 18:44:42 -0600322
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200323 if (i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, ds1339_data, sizeof(ds1339_data))
Timur Tabi054838e2006-10-31 18:44:42 -0600324 == 0) {
325
326 /* Work-around for MPC8349E-mITX bug #13601.
327 If the RTC does not contain valid register values, the DS1339
328 Linux driver will not work.
329 */
330
331 /* Make sure status register bits 6-2 are zero */
332 ds1339_data[0x0f] &= ~0x7c;
333
334 /* Check for a valid day register value */
335 ds1339_data[0x03] &= ~0xf8;
336 if (ds1339_data[0x03] == 0) {
337 ds1339_data[0x03] = 1;
338 }
339
340 /* Check for a valid date register value */
341 ds1339_data[0x04] &= ~0xc0;
342 if ((ds1339_data[0x04] == 0) ||
343 ((ds1339_data[0x04] & 0x0f) > 9) ||
344 (ds1339_data[0x04] >= 0x32)) {
345 ds1339_data[0x04] = 1;
346 }
347
348 /* Check for a valid month register value */
349 ds1339_data[0x05] &= ~0x60;
350
351 if ((ds1339_data[0x05] == 0) ||
352 ((ds1339_data[0x05] & 0x0f) > 9) ||
353 ((ds1339_data[0x05] >= 0x13)
354 && (ds1339_data[0x05] <= 0x19))) {
355 ds1339_data[0x05] = 1;
356 }
357
358 /* Enable Oscillator and rate select */
359 ds1339_data[0x0e] = 0x1c;
360
361 /* Work-around for MPC8349E-mITX bug #13330.
362 Ensure that the RTC control register contains the value 0x1c.
363 This affects SATA performance.
364 */
365
366 if (i2c_write
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200367 (CONFIG_SYS_I2C_RTC_ADDR, 0, 1, ds1339_data,
Timur Tabi054838e2006-10-31 18:44:42 -0600368 sizeof(ds1339_data))) {
369 puts("Failure writing to the RTC via I2C.\n");
370 rc = 1;
371 }
372 } else {
373 puts("Failure reading from the RTC via I2C.\n");
374 rc = 1;
375 }
376#endif
377
378 i2c_set_bus_num(orig_bus);
379#endif
380
Timur Tabi3e1d49a2008-02-08 13:15:55 -0600381#ifdef CONFIG_VSC7385_IMAGE
382 if (vsc7385_upload_firmware((void *) CONFIG_VSC7385_IMAGE,
383 CONFIG_VSC7385_IMAGE_SIZE)) {
384 puts("Failure uploading VSC7385 microcode.\n");
385 rc = 1;
386 }
387#endif
388
Timur Tabi054838e2006-10-31 18:44:42 -0600389 return rc;
390}
Kim Phillips774e1b52006-11-01 00:10:40 -0600391
Kim Phillips21416812007-08-15 22:30:33 -0500392#if defined(CONFIG_OF_BOARD_SETUP)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +0900393int ft_board_setup(void *blob, struct bd_info *bd)
Kim Phillips774e1b52006-11-01 00:10:40 -0600394{
Kim Phillips21416812007-08-15 22:30:33 -0500395 ft_cpu_setup(blob, bd);
396#ifdef CONFIG_PCI
397 ft_pci_setup(blob, bd);
398#endif
Simon Glass2aec3cc2014-10-23 18:58:47 -0600399
400 return 0;
Kim Phillips774e1b52006-11-01 00:10:40 -0600401}
402#endif