blob: a265a8380fef61d7fa87c8467db51b5dd539f904 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Timur Tabi2ad6b512006-10-31 18:44:42 -06002/*
Kumar Gala4c2e3da2009-07-28 21:49:52 -05003 * Copyright (C) Freescale Semiconductor, Inc. 2006.
Timur Tabi2ad6b512006-10-31 18:44:42 -06004 */
5
6#include <common.h>
Simon Glass807765b2019-12-28 10:44:54 -07007#include <fdt_support.h>
Simon Glass691d7192020-05-10 11:40:02 -06008#include <init.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -06009#include <ioports.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -060010#include <log.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -060011#include <mpc83xx.h>
12#include <i2c.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -060013#include <miiphy.h>
Timur Tabi89c77842008-02-08 13:15:55 -060014#include <vsc7385.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -060015#ifdef CONFIG_PCI
16#include <asm/mpc8349_pci.h>
17#include <pci.h>
18#endif
Timur Tabi2ad6b512006-10-31 18:44:42 -060019#include <spd_sdram.h>
Simon Glasscd93d622020-05-10 11:40:13 -060020#include <asm/bitops.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -060021#include <asm/mmu.h>
Kim Phillipsb3458d22007-12-20 15:57:28 -060022#if defined(CONFIG_OF_LIBFDT)
Masahiro Yamadab08c8c42018-03-05 01:20:11 +090023#include <linux/libfdt.h>
Kim Phillipsbf0b5422006-11-01 00:10:40 -060024#endif
Simon Glassc05ed002020-05-10 11:40:11 -060025#include <linux/delay.h>
Timur Tabi2ad6b512006-10-31 18:44:42 -060026
Mario Six21c15022019-01-21 09:17:54 +010027#include "../../../arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h"
Mario Sixfe7d6542019-01-21 09:18:03 +010028#include "../../../arch/powerpc/cpu/mpc83xx/elbc/elbc.h"
Mario Six21c15022019-01-21 09:17:54 +010029
Simon Glass088454c2017-03-31 08:40:25 -060030DECLARE_GLOBAL_DATA_PTR;
31
Timur Tabi2ad6b512006-10-31 18:44:42 -060032#ifndef CONFIG_SPD_EEPROM
33/*************************************************************************
34 * fixed sdram init -- doesn't use serial presence detect.
35 ************************************************************************/
36int fixed_sdram(void)
37{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020038 volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
Joe Hershberger2e651b22011-10-11 23:57:31 -050039 /* The size of RAM, in bytes */
40 u32 ddr_size = CONFIG_SYS_DDR_SIZE << 20;
41 u32 ddr_size_log2 = __ilog2(ddr_size);
Timur Tabi2ad6b512006-10-31 18:44:42 -060042
43 im->sysconf.ddrlaw[0].ar =
44 LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE);
Mario Six133ec602019-01-21 09:18:16 +010045 im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xfffff000;
Timur Tabi2ad6b512006-10-31 18:44:42 -060046
Mario Six133ec602019-01-21 09:18:16 +010047#if ((CONFIG_SYS_SDRAM_BASE & 0x00FFFFFF) != 0)
Joe Hershberger2e651b22011-10-11 23:57:31 -050048#warning Chip select bounds is only configurable in 16MB increments
49#endif
50 im->ddr.csbnds[0].csbnds =
Mario Six133ec602019-01-21 09:18:16 +010051 ((CONFIG_SYS_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) |
52 (((CONFIG_SYS_SDRAM_BASE + ddr_size - 1) >>
Joe Hershberger2e651b22011-10-11 23:57:31 -050053 CSBNDS_EA_SHIFT) & CSBNDS_EA);
54 im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
55
56 /* Only one CS for DDR */
57 im->ddr.cs_config[1] = 0;
58 im->ddr.cs_config[2] = 0;
59 im->ddr.cs_config[3] = 0;
Timur Tabi2ad6b512006-10-31 18:44:42 -060060
61 debug("cs0_bnds = 0x%08x\n", im->ddr.csbnds[0].csbnds);
62 debug("cs0_config = 0x%08x\n", im->ddr.cs_config[0]);
63
64 debug("DDR:bar=0x%08x\n", im->sysconf.ddrlaw[0].bar);
65 debug("DDR:ar=0x%08x\n", im->sysconf.ddrlaw[0].ar);
66
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020067 im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
68 im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;/* Was "2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT" */
Kim Phillipsbbea46f2007-08-16 22:52:48 -050069 im->ddr.sdram_cfg = SDRAM_CFG_SREN | SDRAM_CFG_SDRAM_TYPE_DDR1;
Timur Tabi2ad6b512006-10-31 18:44:42 -060070 im->ddr.sdram_mode =
71 (0x0000 << SDRAM_MODE_ESD_SHIFT) | (0x0032 << SDRAM_MODE_SD_SHIFT);
72 im->ddr.sdram_interval =
73 (0x0410 << SDRAM_INTERVAL_REFINT_SHIFT) | (0x0100 <<
74 SDRAM_INTERVAL_BSTOPRE_SHIFT);
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020075 im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_SDRAM_CLK_CNTL;
Timur Tabi2ad6b512006-10-31 18:44:42 -060076
77 udelay(200);
78
79 im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
80
81 debug("DDR:timing_cfg_1=0x%08x\n", im->ddr.timing_cfg_1);
82 debug("DDR:timing_cfg_2=0x%08x\n", im->ddr.timing_cfg_2);
83 debug("DDR:sdram_mode=0x%08x\n", im->ddr.sdram_mode);
84 debug("DDR:sdram_interval=0x%08x\n", im->ddr.sdram_interval);
85 debug("DDR:sdram_cfg=0x%08x\n", im->ddr.sdram_cfg);
86
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020087 return CONFIG_SYS_DDR_SIZE;
Timur Tabi2ad6b512006-10-31 18:44:42 -060088}
89#endif
90
91#ifdef CONFIG_PCI
92/*
93 * Initialize PCI Devices, report devices found
94 */
95#ifndef CONFIG_PCI_PNP
96static struct pci_config_table pci_mpc83xxmitx_config_table[] = {
97 {
98 PCI_ANY_ID,
99 PCI_ANY_ID,
100 PCI_ANY_ID,
101 PCI_ANY_ID,
102 0x0f,
103 PCI_ANY_ID,
104 pci_cfgfunc_config_device,
105 {
106 PCI_ENET0_IOADDR,
107 PCI_ENET0_MEMADDR,
108 PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER}
109 },
110 {}
111}
112#endif
113
114volatile static struct pci_controller hose[] = {
115 {
116#ifndef CONFIG_PCI_PNP
117 config_table:pci_mpc83xxmitx_config_table,
118#endif
119 },
120 {
121#ifndef CONFIG_PCI_PNP
122 config_table:pci_mpc83xxmitx_config_table,
123#endif
124 }
125};
126#endif /* CONFIG_PCI */
127
Simon Glassf1683aa2017-04-06 12:47:05 -0600128int dram_init(void)
Timur Tabi2ad6b512006-10-31 18:44:42 -0600129{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200130 volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600131 u32 msize = 0;
132#ifdef CONFIG_DDR_ECC
133 volatile ddr83xx_t *ddr = &im->ddr;
134#endif
135
136 if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
Simon Glass088454c2017-03-31 08:40:25 -0600137 return -ENXIO;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600138
139 /* DDR SDRAM - Main SODIMM */
Mario Six8a81bfd2019-01-21 09:18:15 +0100140 im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600141#ifdef CONFIG_SPD_EEPROM
142 msize = spd_sdram();
143#else
144 msize = fixed_sdram();
145#endif
146
147#ifdef CONFIG_DDR_ECC
148 if (ddr->sdram_cfg & SDRAM_CFG_ECC_EN)
149 /* Unlike every other board, on the 83xx spd_sdram() returns
150 megabytes instead of just bytes. That's why we need to
151 multiple by 1MB when calling ddr_enable_ecc(). */
152 ddr_enable_ecc(msize * 1048576);
153#endif
154
Timur Tabifab16802007-01-31 15:54:20 -0600155 /* return total bus RAM size(bytes) */
Simon Glass088454c2017-03-31 08:40:25 -0600156 gd->ram_size = msize * 1024 * 1024;
157
158 return 0;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600159}
160
161int checkboard(void)
162{
Mario Six4cb06d32019-01-21 09:17:44 +0100163#ifdef CONFIG_TARGET_MPC8349ITX
Timur Tabibe5e6182006-11-03 19:15:00 -0600164 puts("Board: Freescale MPC8349E-mITX\n");
Timur Tabi7a78f142007-01-31 15:54:29 -0600165#else
166 puts("Board: Freescale MPC8349E-mITX-GP\n");
167#endif
Timur Tabi2ad6b512006-10-31 18:44:42 -0600168
169 return 0;
170}
171
Timur Tabibe5e6182006-11-03 19:15:00 -0600172/*
Timur Tabi2ad6b512006-10-31 18:44:42 -0600173 * Implement a work-around for a hardware problem with compact
174 * flash.
175 *
176 * Program the UPM if compact flash is enabled.
177 */
178int misc_init_f(void)
179{
Timur Tabi89c77842008-02-08 13:15:55 -0600180#ifdef CONFIG_VSC7385_ENET
Timur Tabi2ad6b512006-10-31 18:44:42 -0600181 volatile u32 *vsc7385_cpuctrl;
182
183 /* 0x1c0c0 is the VSC7385 CPU Control (CPUCTRL) Register. The power up
184 default of VSC7385 L1_IRQ and L2_IRQ requests are active high. That
185 means it is 0 when the IRQ is not active. This makes the wire-AND
186 logic always assert IRQ7 to CPU even if there is no request from the
187 switch. Since the compact flash and the switch share the same IRQ,
188 the Linux kernel will think that the compact flash is requesting irq
189 and get stuck when it tries to clear the IRQ. Thus we need to set
190 the L2_IRQ0 and L2_IRQ1 to active low.
191
192 The following code sets the L1_IRQ and L2_IRQ polarity to active low.
193 Without this code, compact flash will not work in Linux because
194 unlike U-Boot, Linux uses the IRQ, so this code is necessary if we
195 don't enable compact flash for U-Boot.
196 */
197
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200198 vsc7385_cpuctrl = (volatile u32 *)(CONFIG_SYS_VSC7385_BASE + 0x1c0c0);
Timur Tabi2ad6b512006-10-31 18:44:42 -0600199 *vsc7385_cpuctrl |= 0x0c;
Timur Tabi7a78f142007-01-31 15:54:29 -0600200#endif
Timur Tabi2ad6b512006-10-31 18:44:42 -0600201
202#ifdef CONFIG_COMPACT_FLASH
203 /* UPM Table Configuration Code */
204 static uint UPMATable[] = {
205 0xcffffc00, 0x0fffff00, 0x0fafff00, 0x0fafff00,
206 0x0faffd00, 0x0faffc04, 0x0ffffc00, 0x3ffffc01,
207 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
208 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
209 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfff7fc00,
210 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
211 0xcffffc00, 0x0fffff00, 0x0ff3ff00, 0x0ff3ff00,
212 0x0ff3fe00, 0x0ffffc00, 0x3ffffc05, 0xfffffc00,
213 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
214 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
215 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
216 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
217 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
218 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
219 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
220 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01
221 };
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200222 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600223
Becky Brucef51cdaf2010-06-17 11:37:20 -0500224 set_lbc_br(3, CONFIG_SYS_BR3_PRELIM);
225 set_lbc_or(3, CONFIG_SYS_OR3_PRELIM);
Timur Tabi2ad6b512006-10-31 18:44:42 -0600226
227 /* Program the MAMR. RFEN=0, OP=00, UWPL=1, AM=000, DS=01, G0CL=000,
228 GPL4=0, RLF=0001, WLF=0001, TLF=0001, MAD=000000
229 */
Becky Brucef51cdaf2010-06-17 11:37:20 -0500230 immap->im_lbc.mamr = 0x08404440;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600231
232 upmconfig(0, UPMATable, sizeof(UPMATable) / sizeof(UPMATable[0]));
233
234 puts("UPMA: Configured for compact flash\n");
235#endif
236
237 return 0;
238}
239
Timur Tabibe5e6182006-11-03 19:15:00 -0600240/*
Timur Tabi89c77842008-02-08 13:15:55 -0600241 * Miscellaneous late-boot configurations
242 *
Timur Tabi2ad6b512006-10-31 18:44:42 -0600243 * Make sure the EEPROM has the HRCW correctly programmed.
244 * Make sure the RTC is correctly programmed.
245 *
246 * The MPC8349E-mITX can be configured to load the HRCW from
247 * EEPROM instead of flash. This is controlled via jumpers
248 * LGPL0, 1, and 3. Normally, these jumpers are set to 000 (all
249 * jumpered), but if they're set to 001 or 010, then the HRCW is
250 * read from the "I2C EEPROM".
251 *
252 * This function makes sure that the I2C EEPROM is programmed
253 * correctly.
Timur Tabi89c77842008-02-08 13:15:55 -0600254 *
255 * If a VSC7385 microcode image is present, then upload it.
Timur Tabi2ad6b512006-10-31 18:44:42 -0600256 */
257int misc_init_r(void)
258{
259 int rc = 0;
260
Heiko Schocher00f792e2012-10-24 13:48:22 +0200261#if defined(CONFIG_SYS_I2C)
Sam Song05031db2006-12-14 19:03:21 +0800262 unsigned int orig_bus = i2c_get_bus_num();
Timur Tabibe5e6182006-11-03 19:15:00 -0600263 u8 i2c_data;
Timur Tabi2ad6b512006-10-31 18:44:42 -0600264
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200265#ifdef CONFIG_SYS_I2C_RTC_ADDR
Timur Tabie857a5b2006-11-28 12:09:35 -0600266 u8 ds1339_data[17];
Timur Tabi2ad6b512006-10-31 18:44:42 -0600267#endif
268
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200269#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
Timur Tabi2ad6b512006-10-31 18:44:42 -0600270 static u8 eeprom_data[] = /* HRCW data */
271 {
Timur Tabi7a78f142007-01-31 15:54:29 -0600272 0xAA, 0x55, 0xAA, /* Preamble */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200273 0x7C, /* ACS=0, BYTE_EN=1111, CONT=1 */
274 0x02, 0x40, /* RCWL ADDR=0x0_0900 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200275 (CONFIG_SYS_HRCW_LOW >> 24) & 0xFF,
276 (CONFIG_SYS_HRCW_LOW >> 16) & 0xFF,
277 (CONFIG_SYS_HRCW_LOW >> 8) & 0xFF,
278 CONFIG_SYS_HRCW_LOW & 0xFF,
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200279 0x7C, /* ACS=0, BYTE_EN=1111, CONT=1 */
Timur Tabi7a78f142007-01-31 15:54:29 -0600280 0x02, 0x41, /* RCWH ADDR=0x0_0904 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200281 (CONFIG_SYS_HRCW_HIGH >> 24) & 0xFF,
282 (CONFIG_SYS_HRCW_HIGH >> 16) & 0xFF,
283 (CONFIG_SYS_HRCW_HIGH >> 8) & 0xFF,
284 CONFIG_SYS_HRCW_HIGH & 0xFF
Timur Tabi2ad6b512006-10-31 18:44:42 -0600285 };
286
287 u8 data[sizeof(eeprom_data)];
Timur Tabibe5e6182006-11-03 19:15:00 -0600288#endif
Timur Tabi2ad6b512006-10-31 18:44:42 -0600289
Timur Tabibe5e6182006-11-03 19:15:00 -0600290 printf("Board revision: ");
Timur Tabi9ca880a2006-10-31 21:23:16 -0600291 i2c_set_bus_num(1);
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200292 if (i2c_read(CONFIG_SYS_I2C_8574A_ADDR2, 0, 0, &i2c_data, sizeof(i2c_data)) == 0)
Timur Tabibe5e6182006-11-03 19:15:00 -0600293 printf("%u.%u (PCF8475A)\n", (i2c_data & 0x02) >> 1, i2c_data & 0x01);
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200294 else if (i2c_read(CONFIG_SYS_I2C_8574_ADDR2, 0, 0, &i2c_data, sizeof(i2c_data)) == 0)
Timur Tabibe5e6182006-11-03 19:15:00 -0600295 printf("%u.%u (PCF8475)\n", (i2c_data & 0x02) >> 1, i2c_data & 0x01);
296 else {
297 printf("Unknown\n");
298 rc = 1;
299 }
300
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200301#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
Timur Tabibe5e6182006-11-03 19:15:00 -0600302 i2c_set_bus_num(0);
Timur Tabi2ad6b512006-10-31 18:44:42 -0600303
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200304 if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, data, sizeof(data)) == 0) {
Timur Tabi2ad6b512006-10-31 18:44:42 -0600305 if (memcmp(data, eeprom_data, sizeof(data)) != 0) {
306 if (i2c_write
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200307 (CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, eeprom_data,
Timur Tabi2ad6b512006-10-31 18:44:42 -0600308 sizeof(eeprom_data)) != 0) {
309 puts("Failure writing the HRCW to EEPROM via I2C.\n");
310 rc = 1;
311 }
312 }
313 } else {
314 puts("Failure reading the HRCW from EEPROM via I2C.\n");
315 rc = 1;
316 }
317#endif
318
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200319#ifdef CONFIG_SYS_I2C_RTC_ADDR
Timur Tabibe5e6182006-11-03 19:15:00 -0600320 i2c_set_bus_num(1);
Timur Tabi2ad6b512006-10-31 18:44:42 -0600321
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200322 if (i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, ds1339_data, sizeof(ds1339_data))
Timur Tabi2ad6b512006-10-31 18:44:42 -0600323 == 0) {
324
325 /* Work-around for MPC8349E-mITX bug #13601.
326 If the RTC does not contain valid register values, the DS1339
327 Linux driver will not work.
328 */
329
330 /* Make sure status register bits 6-2 are zero */
331 ds1339_data[0x0f] &= ~0x7c;
332
333 /* Check for a valid day register value */
334 ds1339_data[0x03] &= ~0xf8;
335 if (ds1339_data[0x03] == 0) {
336 ds1339_data[0x03] = 1;
337 }
338
339 /* Check for a valid date register value */
340 ds1339_data[0x04] &= ~0xc0;
341 if ((ds1339_data[0x04] == 0) ||
342 ((ds1339_data[0x04] & 0x0f) > 9) ||
343 (ds1339_data[0x04] >= 0x32)) {
344 ds1339_data[0x04] = 1;
345 }
346
347 /* Check for a valid month register value */
348 ds1339_data[0x05] &= ~0x60;
349
350 if ((ds1339_data[0x05] == 0) ||
351 ((ds1339_data[0x05] & 0x0f) > 9) ||
352 ((ds1339_data[0x05] >= 0x13)
353 && (ds1339_data[0x05] <= 0x19))) {
354 ds1339_data[0x05] = 1;
355 }
356
357 /* Enable Oscillator and rate select */
358 ds1339_data[0x0e] = 0x1c;
359
360 /* Work-around for MPC8349E-mITX bug #13330.
361 Ensure that the RTC control register contains the value 0x1c.
362 This affects SATA performance.
363 */
364
365 if (i2c_write
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200366 (CONFIG_SYS_I2C_RTC_ADDR, 0, 1, ds1339_data,
Timur Tabi2ad6b512006-10-31 18:44:42 -0600367 sizeof(ds1339_data))) {
368 puts("Failure writing to the RTC via I2C.\n");
369 rc = 1;
370 }
371 } else {
372 puts("Failure reading from the RTC via I2C.\n");
373 rc = 1;
374 }
375#endif
376
377 i2c_set_bus_num(orig_bus);
378#endif
379
Timur Tabi89c77842008-02-08 13:15:55 -0600380#ifdef CONFIG_VSC7385_IMAGE
381 if (vsc7385_upload_firmware((void *) CONFIG_VSC7385_IMAGE,
382 CONFIG_VSC7385_IMAGE_SIZE)) {
383 puts("Failure uploading VSC7385 microcode.\n");
384 rc = 1;
385 }
386#endif
387
Timur Tabi2ad6b512006-10-31 18:44:42 -0600388 return rc;
389}
Kim Phillipsbf0b5422006-11-01 00:10:40 -0600390
Kim Phillips3fde9e82007-08-15 22:30:33 -0500391#if defined(CONFIG_OF_BOARD_SETUP)
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +0900392int ft_board_setup(void *blob, struct bd_info *bd)
Kim Phillipsbf0b5422006-11-01 00:10:40 -0600393{
Kim Phillips3fde9e82007-08-15 22:30:33 -0500394 ft_cpu_setup(blob, bd);
395#ifdef CONFIG_PCI
396 ft_pci_setup(blob, bd);
397#endif
Simon Glasse895a4b2014-10-23 18:58:47 -0600398
399 return 0;
Kim Phillipsbf0b5422006-11-01 00:10:40 -0600400}
401#endif