2 * (C) Copyright 2007-2010
3 * Larry Johnson, lrj@acm.org
5 * (C) Copyright 2006-2007
6 * Stefan Roese, DENX Software Engineering, sr@denx.de.
9 * Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
10 * Alain Saurel, AMCC/IBM, alain.saurel@fr.ibm.com
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <fdt_support.h>
32 #include <asm/ppc440.h>
33 #include <asm/bitops.h>
34 #include <asm/ppc4xx-gpio.h>
36 #include <asm/ppc4xx-uic.h>
37 #include <asm/processor.h>
38 #include <asm/4xx_pci.h>
40 DECLARE_GLOBAL_DATA_PTR;
42 extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
44 ulong flash_get_size(ulong base, int banknum);
46 #if defined(CONFIG_KORAT_PERMANENT)
47 void korat_buzzer(int const on)
50 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x05,
51 in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x05) | 0x80);
53 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x05,
54 in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x05) & ~0x80);
59 int board_early_init_f(void)
61 uint32_t sdr0_pfc1, sdr0_pfc2;
65 #if defined(CONFIG_KORAT_PERMANENT)
68 extern void korat_branch_absolute(uint32_t addr);
70 for (mscount = 0; mscount < CONFIG_SYS_KORAT_MAN_RESET_MS; ++mscount) {
72 if (gpio_read_in_bit(CONFIG_SYS_GPIO_RESET_PRESSED_)) {
73 /* This call does not return. */
74 korat_branch_absolute(
75 CONFIG_SYS_FLASH1_TOP - 2 * CONFIG_ENV_SECT_SIZE - 4);
79 while (!gpio_read_in_bit(CONFIG_SYS_GPIO_RESET_PRESSED_))
85 mtdcr(EBC0_CFGADDR, EBC0_CFG);
86 mtdcr(EBC0_CFGDATA, 0xb8400000);
89 * Setup the interrupt controller polarities, triggers, etc.
91 mtdcr(UIC0SR, 0xffffffff); /* clear all */
92 mtdcr(UIC0ER, 0x00000000); /* disable all */
93 mtdcr(UIC0CR, 0x00000005); /* ATI & UIC1 crit are critical */
94 mtdcr(UIC0PR, 0xfffff7ff); /* per ref-board manual */
95 mtdcr(UIC0TR, 0x00000000); /* per ref-board manual */
96 mtdcr(UIC0VR, 0x00000000); /* int31 highest, base=0x000 */
97 mtdcr(UIC0SR, 0xffffffff); /* clear all */
99 mtdcr(UIC1SR, 0xffffffff); /* clear all */
100 mtdcr(UIC1ER, 0x00000000); /* disable all */
101 mtdcr(UIC1CR, 0x00000000); /* all non-critical */
102 mtdcr(UIC1PR, 0xffffffff); /* per ref-board manual */
103 mtdcr(UIC1TR, 0x00000000); /* per ref-board manual */
104 mtdcr(UIC1VR, 0x00000000); /* int31 highest, base=0x000 */
105 mtdcr(UIC1SR, 0xffffffff); /* clear all */
107 mtdcr(UIC2SR, 0xffffffff); /* clear all */
108 mtdcr(UIC2ER, 0x00000000); /* disable all */
109 mtdcr(UIC2CR, 0x00000000); /* all non-critical */
110 mtdcr(UIC2PR, 0xffffffff); /* per ref-board manual */
111 mtdcr(UIC2TR, 0x00000000); /* per ref-board manual */
112 mtdcr(UIC2VR, 0x00000000); /* int31 highest, base=0x000 */
113 mtdcr(UIC2SR, 0xffffffff); /* clear all */
116 * Take sim card reader and CF controller out of reset. Also enable PHY
117 * auto-detect until board-specific PHY resets are available.
119 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x02, 0xC0);
121 /* Configure the two Ethernet PHYs. For each PHY, configure for fiber
122 * if the SFP module is present, and for copper if it is not present.
124 for (eth = 0; eth < 2; ++eth) {
125 if (gpio_read_in_bit(CONFIG_SYS_GPIO_SFP0_PRESENT_ + eth)) {
126 /* SFP module not present: configure PHY for copper. */
127 /* Set PHY to autonegotate 10 MB, 100MB, or 1 GB */
128 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x03,
129 in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x03) |
132 /* SFP module present: configure PHY for fiber and
134 gpio_write_bit(CONFIG_SYS_GPIO_PHY0_FIBER_SEL + eth, 1);
135 gpio_write_bit(CONFIG_SYS_GPIO_SFP0_TX_EN_ + eth, 0);
138 /* enable Ethernet: set GPIO45 and GPIO46 to 1 */
139 gpio_write_bit(CONFIG_SYS_GPIO_PHY0_EN, 1);
140 gpio_write_bit(CONFIG_SYS_GPIO_PHY1_EN, 1);
142 /* Wait 1 ms, then enable Fiber signal detect to PHYs. */
144 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x03,
145 in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x03) | 0x88);
147 /* select Ethernet (and optionally IIC1) pins */
148 mfsdr(SDR0_PFC1, sdr0_pfc1);
149 sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
150 SDR0_PFC1_SELECT_CONFIG_4;
151 #ifdef CONFIG_I2C_MULTI_BUS
152 sdr0_pfc1 |= ((sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL);
154 mfsdr(SDR0_PFC2, sdr0_pfc2);
155 sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
156 SDR0_PFC2_SELECT_CONFIG_4;
157 mtsdr(SDR0_PFC2, sdr0_pfc2);
158 mtsdr(SDR0_PFC1, sdr0_pfc1);
160 /* PCI arbiter enabled */
161 mfsdr(SDR0_PCI0, reg);
162 mtsdr(SDR0_PCI0, 0x80000000 | reg);
168 * The boot flash on CS0 normally has its write-enable pin disabled, and so will
169 * not respond to CFI commands. This routine therefore fills in the flash
170 * information for the boot flash. (The flash at CS1 operates normally.)
172 ulong board_flash_get_legacy (ulong base, int banknum, flash_info_t * info)
180 info->size = CONFIG_SYS_FLASH0_SIZE;
181 info->sector_count = CONFIG_SYS_FLASH0_SIZE / 0x20000;
182 info->flash_id = 0x01000000;
185 info->buffer_size = 32;
186 info->erase_blk_tout = 16384;
187 info->write_tout = 2;
188 info->buffer_write_tout = 5;
190 info->cmd_reset = 0x00F0;
192 info->legacy_unlock = 0;
193 info->manufacturer_id = 1;
194 info->device_id = 0x007E;
196 #if CONFIG_SYS_FLASH0_SIZE == 0x01000000
197 info->device_id2 = 0x2101;
198 #elif CONFIG_SYS_FLASH0_SIZE == 0x04000000
199 info->device_id2 = 0x2301;
201 #error Unable to set device_id2 for current CONFIG_SYS_FLASH0_SIZE
204 info->ext_addr = 0x0040;
205 info->cfi_version = 0x3133;
206 info->cfi_offset = 0x0055;
207 info->addr_unlock1 = 0x00000555;
208 info->addr_unlock2 = 0x000002AA;
209 info->name = "CFI conformant";
210 for (i = 0, addr = -info->size;
211 i < info->sector_count;
212 ++i, addr += 0x20000) {
213 info->start[i] = addr;
214 info->protect[i] = 0x00;
219 static int man_data_read(unsigned int addr)
222 * Read an octet of data from address "addr" in the manufacturer's
223 * information serial EEPROM, or -1 on error.
227 if (0 != i2c_probe(MAN_DATA_EEPROM_ADDR) ||
228 0 != i2c_read(MAN_DATA_EEPROM_ADDR, addr, 1, data, 1)) {
229 debug("man_data_read(0x%02X) failed\n", addr);
232 debug("man_info_read(0x%02X) returned 0x%02X\n", addr, data[0]);
236 static unsigned int man_data_field_addr(unsigned int const field)
239 * The manufacturer's information serial EEPROM contains a sequence of
240 * zero-delimited fields. Return the starting address of field "field",
245 if (0 == field || 'A' != man_data_read(0) || '\0' != man_data_read(1))
246 /* Only format "A" is currently supported */
249 for (addr = 2, i = 1; i < field && addr < 256; ++addr) {
250 if ('\0' == man_data_read(addr))
253 return (addr < 256) ? addr : 0;
256 static char *man_data_read_field(char s[], unsigned const field,
257 unsigned const length)
260 * Place the null-terminated contents of field "field" of length
261 * "length" from the manufacturer's information serial EEPROM into
262 * string "s[length + 1]" and return a pointer to s, or return 0 on
263 * error. In either case the original contents of s[] is not preserved.
267 addr = man_data_field_addr(field);
268 if (0 == addr || addr + length >= 255)
271 for (i = 0; i < length; ++i) {
272 int const c = man_data_read(addr++);
279 if (0 != man_data_read(addr))
286 static void set_serial_number(void)
289 * If the environmental variable "serial#" is not set, try to set it
290 * from the manufacturer's information serial EEPROM.
292 char s[MAN_INFO_LENGTH + MAN_MAC_ADDR_LENGTH + 2];
294 if (getenv("serial#"))
297 if (!man_data_read_field(s, MAN_INFO_FIELD, MAN_INFO_LENGTH))
300 s[MAN_INFO_LENGTH] = '-';
301 if (!man_data_read_field(s + MAN_INFO_LENGTH + 1, MAN_MAC_ADDR_FIELD,
302 MAN_MAC_ADDR_LENGTH))
305 setenv("serial#", s);
308 static void set_mac_addresses(void)
311 * If the environmental variables "ethaddr" and/or "eth1addr" are not
312 * set, try to set them from the manufacturer's information serial
316 #if MAN_MAC_ADDR_LENGTH % 2 != 0
317 #error MAN_MAC_ADDR_LENGTH must be an even number
320 char s[(3 * MAN_MAC_ADDR_LENGTH) / 2];
324 if (0 != getenv("ethaddr") && 0 != getenv("eth1addr"))
327 if (0 == man_data_read_field(s + (MAN_MAC_ADDR_LENGTH / 2) - 1,
328 MAN_MAC_ADDR_FIELD, MAN_MAC_ADDR_LENGTH))
331 for (src = s + (MAN_MAC_ADDR_LENGTH / 2) - 1, dst = s; src != dst;) {
336 if (0 == getenv("ethaddr"))
337 setenv("ethaddr", s);
339 if (0 == getenv("eth1addr")) {
340 ++s[((3 * MAN_MAC_ADDR_LENGTH) / 2) - 2];
341 setenv("eth1addr", s);
345 int misc_init_r(void)
350 unsigned long usb2d0cr = 0;
351 unsigned long usb2phy0cr, usb2h0cr = 0;
352 unsigned long sdr0_pfc1;
353 uint32_t const flash1_size = gd->bd->bi_flashsize - CONFIG_SYS_FLASH0_SIZE;
354 char const *const act = getenv("usbact");
355 char const *const usbcf = getenv("korat_usbcf");
358 * Re-do FLASH1 sizing and adjust flash start and offset.
360 gd->bd->bi_flashstart = CONFIG_SYS_FLASH1_TOP - flash1_size;
361 gd->bd->bi_flashoffset = 0;
363 mtdcr(EBC0_CFGADDR, PB1CR);
364 pbcr = mfdcr(EBC0_CFGDATA);
365 size_val = ffs(flash1_size) - 21;
366 pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
367 mtdcr(EBC0_CFGADDR, PB1CR);
368 mtdcr(EBC0_CFGDATA, pbcr);
371 * Re-check to get correct base address
373 flash_get_size(gd->bd->bi_flashstart, 0);
376 * Re-do FLASH1 sizing and adjust flash offset to reserve space for
379 gd->bd->bi_flashoffset =
380 CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - CONFIG_SYS_FLASH1_ADDR;
382 mtdcr(EBC0_CFGADDR, PB1CR);
383 pbcr = mfdcr(EBC0_CFGDATA);
384 size_val = ffs(gd->bd->bi_flashsize - CONFIG_SYS_FLASH0_SIZE) - 21;
385 pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
386 mtdcr(EBC0_CFGADDR, PB1CR);
387 mtdcr(EBC0_CFGDATA, pbcr);
389 /* Monitor protection ON by default */
390 #if defined(CONFIG_KORAT_PERMANENT)
391 (void)flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE,
392 CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN - 1,
395 (void)flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE,
396 CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN - 1,
399 /* Env protection ON by default */
400 (void)flash_protect(FLAG_PROTECT_SET, CONFIG_ENV_ADDR,
401 CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
403 (void)flash_protect(FLAG_PROTECT_SET, CONFIG_ENV_ADDR_REDUND,
404 CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
411 * Select the USB controller on the 440EPx ("ppc") or on the PCI bus
412 * ("pci") for the CompactFlash.
414 if (usbcf != NULL && (strcmp(usbcf, "ppc") == 0)) {
416 * If environment variable "usbcf" is defined and set to "ppc",
417 * then connect the CompactFlash controller to the PowerPC USB
420 printf("Attaching CompactFlash controller to PPC USB\n");
421 out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x02,
422 in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x02) | 0x10);
424 if (usbcf != NULL && (strcmp(usbcf, "pci") != 0))
425 printf("Warning: \"korat_usbcf\" is not set to a legal "
426 "value (\"ppc\" or \"pci\")\n");
428 printf("Attaching CompactFlash controller to PCI USB\n");
430 if (act == NULL || strcmp(act, "hostdev") == 0) {
432 mfsdr(SDR0_PFC1, sdr0_pfc1);
433 mfsdr(SDR0_USB2D0CR, usb2d0cr);
434 mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
435 mfsdr(SDR0_USB2H0CR, usb2h0cr);
437 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
438 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
439 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
440 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ;
441 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
442 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
443 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
444 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
445 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
446 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
449 * An 8-bit/60MHz interface is the only possible alternative
450 * when connecting the Device to the PHY
452 usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
453 usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ;
456 * To enable the USB 2.0 Device function
457 * through the UTMI interface
459 usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
460 usb2d0cr = usb2d0cr | SDR0_USB2D0CR_USB2DEV_SELECTION;
462 sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
463 sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_USB2D_SEL;
465 mtsdr(SDR0_PFC1, sdr0_pfc1);
466 mtsdr(SDR0_USB2D0CR, usb2d0cr);
467 mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
468 mtsdr(SDR0_USB2H0CR, usb2h0cr);
472 mtsdr(SDR0_SRST1, 0x00000000);
474 mtsdr(SDR0_SRST0, 0x00000000);
476 printf("USB: Host(int phy) Device(ext phy)\n");
478 } else if (strcmp(act, "dev") == 0) {
479 /*-------------------PATCH-------------------------------*/
480 mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
482 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
483 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
484 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
485 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
486 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
487 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
488 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
489 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
490 mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
493 mtsdr(SDR0_SRST1, 0x672c6000);
496 mtsdr(SDR0_SRST0, 0x00000080);
499 mtsdr(SDR0_SRST1, 0x60206000);
501 *(unsigned int *)(0xe0000350) = 0x00000001;
504 mtsdr(SDR0_SRST1, 0x60306000);
505 /*-------------------PATCH-------------------------------*/
508 mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
509 mfsdr(SDR0_USB2H0CR, usb2h0cr);
510 mfsdr(SDR0_USB2D0CR, usb2d0cr);
511 mfsdr(SDR0_PFC1, sdr0_pfc1);
513 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
514 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
515 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
516 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ;
517 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
518 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN;
519 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
520 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV;
521 usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
522 usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV;
524 usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
525 usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ;
527 usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
528 usb2d0cr = usb2d0cr | SDR0_USB2D0CR_EBC_SELECTION;
530 sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
531 sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL;
533 mtsdr(SDR0_USB2H0CR, usb2h0cr);
534 mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
535 mtsdr(SDR0_USB2D0CR, usb2d0cr);
536 mtsdr(SDR0_PFC1, sdr0_pfc1);
540 mtsdr(SDR0_SRST1, 0x00000000);
542 mtsdr(SDR0_SRST0, 0x00000000);
544 printf("USB: Device(int phy)\n");
547 mfsdr(SDR0_SRST1, reg); /* enable security/kasumi engines */
548 reg &= ~(SDR0_SRST1_CRYP0 | SDR0_SRST1_KASU0);
549 mtsdr(SDR0_SRST1, reg);
552 * Clear PLB4A0_ACR[WRP]
553 * This fix will make the MAL burst disabling patch for the Linux
554 * EMAC driver obsolete.
556 reg = mfdcr(PLB4A0_ACR) & ~PLB4Ax_ACR_WRP_MASK;
557 mtdcr(PLB4A0_ACR, reg);
561 gpio_write_bit(CONFIG_SYS_GPIO_ATMEGA_RESET_, 1);
568 char const *const s = getenv("serial#");
569 u8 const rev = in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0);
571 printf("Board: Korat, Rev. %X", rev);
573 printf(", serial# %s", s);
575 printf(".\n Ethernet PHY 0: ");
576 if (gpio_read_out_bit(CONFIG_SYS_GPIO_PHY0_FIBER_SEL))
582 if (gpio_read_out_bit(CONFIG_SYS_GPIO_PHY1_FIBER_SEL))
588 #if defined(CONFIG_KORAT_PERMANENT)
589 printf(" Executing permanent copy of U-Boot.\n");
594 #if defined(CONFIG_PCI) && defined(CONFIG_PCI_PNP)
596 * Assign interrupts to PCI devices.
598 void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
600 pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, VECNUM_EIRQ2);
607 * The bootstrap configuration provides default settings for the pci
608 * inbound map (PIM). But the bootstrap config choices are limited and
609 * may not be sufficient for a given board.
611 #if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT)
612 void pci_target_init(struct pci_controller *hose)
614 /* First do 440EP(x) common setup */
615 __pci_target_init(hose);
618 * Set up Configuration registers for on-board NEC uPD720101 USB
621 pci_write_config_dword(PCI_BDF(0x0, 0xC, 0x0), 0xE4, 0x00000020);
623 #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
625 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
626 void ft_board_setup(void *blob, bd_t *bd)
631 ft_cpu_setup(blob, bd);
633 /* Fixup NOR mapping */
634 val[0] = 1; /* chip select number */
635 val[1] = 0; /* always 0 */
636 val[2] = gd->bd->bi_flashstart;
637 val[3] = gd->bd->bi_flashsize - CONFIG_SYS_FLASH0_SIZE;
638 rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
639 val, sizeof(val), 1);
641 printf("Unable to update property NOR mapping, err=%s\n",
644 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */