1415a613bSKumar Gala /* 26525d51fSKumar Gala * Copyright 2004, 2007, 2009-2010 Freescale Semiconductor, Inc. 3415a613bSKumar Gala * 4415a613bSKumar Gala * (C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com> 5415a613bSKumar Gala * 6415a613bSKumar Gala * See file CREDITS for list of people who contributed to this 7415a613bSKumar Gala * project. 8415a613bSKumar Gala * 9415a613bSKumar Gala * This program is free software; you can redistribute it and/or 10415a613bSKumar Gala * modify it under the terms of the GNU General Public License as 11415a613bSKumar Gala * published by the Free Software Foundation; either version 2 of 12415a613bSKumar Gala * the License, or (at your option) any later version. 13415a613bSKumar Gala * 14415a613bSKumar Gala * This program is distributed in the hope that it will be useful, 15415a613bSKumar Gala * but WITHOUT ANY WARRANTY; without even the implied warranty of 16415a613bSKumar Gala * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17415a613bSKumar Gala * GNU General Public License for more details. 18415a613bSKumar Gala * 19415a613bSKumar Gala * You should have received a copy of the GNU General Public License 20415a613bSKumar Gala * along with this program; if not, write to the Free Software 21415a613bSKumar Gala * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22415a613bSKumar Gala * MA 02111-1307 USA 23415a613bSKumar Gala */ 24415a613bSKumar Gala 25415a613bSKumar Gala #include <common.h> 26415a613bSKumar Gala #include <pci.h> 27415a613bSKumar Gala #include <asm/processor.h> 28e31d2c1eSJon Loeliger #include <asm/mmu.h> 29415a613bSKumar Gala #include <asm/immap_85xx.h> 30c8514622SKumar Gala #include <asm/fsl_pci.h> 31e31d2c1eSJon Loeliger #include <asm/fsl_ddr_sdram.h> 32a30a549aSJon Loeliger #include <spd_sdram.h> 33415a613bSKumar Gala #include <miiphy.h> 34415a613bSKumar Gala #include <libfdt.h> 35415a613bSKumar Gala #include <fdt_support.h> 36415a613bSKumar Gala 37415a613bSKumar Gala #include "../common/cadmus.h" 38415a613bSKumar Gala #include "../common/eeprom.h" 39415a613bSKumar Gala #include "../common/via.h" 40415a613bSKumar Gala 41415a613bSKumar Gala DECLARE_GLOBAL_DATA_PTR; 42415a613bSKumar Gala 43415a613bSKumar Gala void local_bus_init(void); 44415a613bSKumar Gala void sdram_init(void); 45415a613bSKumar Gala 46415a613bSKumar Gala int checkboard (void) 47415a613bSKumar Gala { 486d0f6bcfSJean-Christophe PLAGNIOL-VILLARD volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 496d0f6bcfSJean-Christophe PLAGNIOL-VILLARD volatile ccsr_local_ecm_t *ecm = (void *)(CONFIG_SYS_MPC85xx_ECM_ADDR); 50415a613bSKumar Gala 51415a613bSKumar Gala /* PCI slot in USER bits CSR[6:7] by convention. */ 52415a613bSKumar Gala uint pci_slot = get_pci_slot (); 53415a613bSKumar Gala 54415a613bSKumar Gala uint cpu_board_rev = get_cpu_board_revision (); 55415a613bSKumar Gala 56415a613bSKumar Gala printf ("Board: CDS Version 0x%02x, PCI Slot %d\n", 57415a613bSKumar Gala get_board_version (), pci_slot); 58415a613bSKumar Gala 59415a613bSKumar Gala printf ("CPU Board Revision %d.%d (0x%04x)\n", 60415a613bSKumar Gala MPC85XX_CPU_BOARD_MAJOR (cpu_board_rev), 61415a613bSKumar Gala MPC85XX_CPU_BOARD_MINOR (cpu_board_rev), cpu_board_rev); 62415a613bSKumar Gala /* 63415a613bSKumar Gala * Initialize local bus. 64415a613bSKumar Gala */ 65415a613bSKumar Gala local_bus_init (); 66415a613bSKumar Gala 67415a613bSKumar Gala /* 68415a613bSKumar Gala * Hack TSEC 3 and 4 IO voltages. 69415a613bSKumar Gala */ 70415a613bSKumar Gala gur->tsec34ioovcr = 0xe7e0; /* 1110 0111 1110 0xxx */ 71415a613bSKumar Gala 72415a613bSKumar Gala ecm->eedr = 0xffffffff; /* clear ecm errors */ 73415a613bSKumar Gala ecm->eeer = 0xffffffff; /* enable ecm errors */ 74415a613bSKumar Gala return 0; 75415a613bSKumar Gala } 76415a613bSKumar Gala 779973e3c6SBecky Bruce phys_size_t 78415a613bSKumar Gala initdram(int board_type) 79415a613bSKumar Gala { 80415a613bSKumar Gala long dram_size = 0; 81415a613bSKumar Gala 82415a613bSKumar Gala puts("Initializing\n"); 83415a613bSKumar Gala 84415a613bSKumar Gala #if defined(CONFIG_DDR_DLL) 85415a613bSKumar Gala { 86415a613bSKumar Gala /* 87415a613bSKumar Gala * Work around to stabilize DDR DLL MSYNC_IN. 88415a613bSKumar Gala * Errata DDR9 seems to have been fixed. 89415a613bSKumar Gala * This is now the workaround for Errata DDR11: 90415a613bSKumar Gala * Override DLL = 1, Course Adj = 1, Tap Select = 0 91415a613bSKumar Gala */ 92415a613bSKumar Gala 936d0f6bcfSJean-Christophe PLAGNIOL-VILLARD volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 94415a613bSKumar Gala 95415a613bSKumar Gala gur->ddrdllcr = 0x81000000; 96415a613bSKumar Gala asm("sync;isync;msync"); 97415a613bSKumar Gala udelay(200); 98415a613bSKumar Gala } 99415a613bSKumar Gala #endif 100e31d2c1eSJon Loeliger 101e31d2c1eSJon Loeliger dram_size = fsl_ddr_sdram(); 102e31d2c1eSJon Loeliger dram_size = setup_ddr_tlbs(dram_size / 0x100000); 103e31d2c1eSJon Loeliger dram_size *= 0x100000; 104415a613bSKumar Gala 105415a613bSKumar Gala /* 106415a613bSKumar Gala * SDRAM Initialization 107415a613bSKumar Gala */ 108415a613bSKumar Gala sdram_init(); 109415a613bSKumar Gala 110415a613bSKumar Gala puts(" DDR: "); 111415a613bSKumar Gala return dram_size; 112415a613bSKumar Gala } 113415a613bSKumar Gala 114415a613bSKumar Gala /* 115415a613bSKumar Gala * Initialize Local Bus 116415a613bSKumar Gala */ 117415a613bSKumar Gala void 118415a613bSKumar Gala local_bus_init(void) 119415a613bSKumar Gala { 1206d0f6bcfSJean-Christophe PLAGNIOL-VILLARD volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 121f51cdaf1SBecky Bruce volatile fsl_lbc_t *lbc = LBC_BASE_ADDR; 122415a613bSKumar Gala 123415a613bSKumar Gala uint clkdiv; 124415a613bSKumar Gala uint lbc_hz; 125415a613bSKumar Gala sys_info_t sysinfo; 126415a613bSKumar Gala 127415a613bSKumar Gala get_sys_info(&sysinfo); 128a5d212a2STrent Piepho clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2; 129415a613bSKumar Gala lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv; 130415a613bSKumar Gala 131415a613bSKumar Gala gur->lbiuiplldcr1 = 0x00078080; 132415a613bSKumar Gala if (clkdiv == 16) { 133415a613bSKumar Gala gur->lbiuiplldcr0 = 0x7c0f1bf0; 134415a613bSKumar Gala } else if (clkdiv == 8) { 135415a613bSKumar Gala gur->lbiuiplldcr0 = 0x6c0f1bf0; 136415a613bSKumar Gala } else if (clkdiv == 4) { 137415a613bSKumar Gala gur->lbiuiplldcr0 = 0x5c0f1bf0; 138415a613bSKumar Gala } 139415a613bSKumar Gala 140415a613bSKumar Gala lbc->lcrr |= 0x00030000; 141415a613bSKumar Gala 142415a613bSKumar Gala asm("sync;isync;msync"); 143415a613bSKumar Gala 144415a613bSKumar Gala lbc->ltesr = 0xffffffff; /* Clear LBC error interrupts */ 145415a613bSKumar Gala lbc->lteir = 0xffffffff; /* Enable LBC error interrupts */ 146415a613bSKumar Gala } 147415a613bSKumar Gala 148415a613bSKumar Gala /* 149415a613bSKumar Gala * Initialize SDRAM memory on the Local Bus. 150415a613bSKumar Gala */ 151415a613bSKumar Gala void 152415a613bSKumar Gala sdram_init(void) 153415a613bSKumar Gala { 1546d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM) 155415a613bSKumar Gala 156415a613bSKumar Gala uint idx; 157f51cdaf1SBecky Bruce volatile fsl_lbc_t *lbc = LBC_BASE_ADDR; 1586d0f6bcfSJean-Christophe PLAGNIOL-VILLARD uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE; 159415a613bSKumar Gala uint cpu_board_rev; 160415a613bSKumar Gala uint lsdmr_common; 161415a613bSKumar Gala 162415a613bSKumar Gala puts(" SDRAM: "); 163415a613bSKumar Gala 1646d0f6bcfSJean-Christophe PLAGNIOL-VILLARD print_size (CONFIG_SYS_LBC_SDRAM_SIZE * 1024 * 1024, "\n"); 165415a613bSKumar Gala 166415a613bSKumar Gala /* 167415a613bSKumar Gala * Setup SDRAM Base and Option Registers 168415a613bSKumar Gala */ 169f51cdaf1SBecky Bruce set_lbc_or(2, CONFIG_SYS_OR2_PRELIM); 170f51cdaf1SBecky Bruce set_lbc_br(2, CONFIG_SYS_BR2_PRELIM); 1716d0f6bcfSJean-Christophe PLAGNIOL-VILLARD lbc->lbcr = CONFIG_SYS_LBC_LBCR; 172415a613bSKumar Gala asm("msync"); 173415a613bSKumar Gala 1746d0f6bcfSJean-Christophe PLAGNIOL-VILLARD lbc->lsrt = CONFIG_SYS_LBC_LSRT; 1756d0f6bcfSJean-Christophe PLAGNIOL-VILLARD lbc->mrtpr = CONFIG_SYS_LBC_MRTPR; 176415a613bSKumar Gala asm("msync"); 177415a613bSKumar Gala 178415a613bSKumar Gala /* 179415a613bSKumar Gala * MPC8548 uses "new" 15-16 style addressing. 180415a613bSKumar Gala */ 181415a613bSKumar Gala cpu_board_rev = get_cpu_board_revision(); 1826d0f6bcfSJean-Christophe PLAGNIOL-VILLARD lsdmr_common = CONFIG_SYS_LBC_LSDMR_COMMON; 183b0fe93edSKumar Gala lsdmr_common |= LSDMR_BSMA1516; 184415a613bSKumar Gala 185415a613bSKumar Gala /* 186415a613bSKumar Gala * Issue PRECHARGE ALL command. 187415a613bSKumar Gala */ 188b0fe93edSKumar Gala lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL; 189415a613bSKumar Gala asm("sync;msync"); 190415a613bSKumar Gala *sdram_addr = 0xff; 191415a613bSKumar Gala ppcDcbf((unsigned long) sdram_addr); 192415a613bSKumar Gala udelay(100); 193415a613bSKumar Gala 194415a613bSKumar Gala /* 195415a613bSKumar Gala * Issue 8 AUTO REFRESH commands. 196415a613bSKumar Gala */ 197415a613bSKumar Gala for (idx = 0; idx < 8; idx++) { 198b0fe93edSKumar Gala lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH; 199415a613bSKumar Gala asm("sync;msync"); 200415a613bSKumar Gala *sdram_addr = 0xff; 201415a613bSKumar Gala ppcDcbf((unsigned long) sdram_addr); 202415a613bSKumar Gala udelay(100); 203415a613bSKumar Gala } 204415a613bSKumar Gala 205415a613bSKumar Gala /* 206415a613bSKumar Gala * Issue 8 MODE-set command. 207415a613bSKumar Gala */ 208b0fe93edSKumar Gala lbc->lsdmr = lsdmr_common | LSDMR_OP_MRW; 209415a613bSKumar Gala asm("sync;msync"); 210415a613bSKumar Gala *sdram_addr = 0xff; 211415a613bSKumar Gala ppcDcbf((unsigned long) sdram_addr); 212415a613bSKumar Gala udelay(100); 213415a613bSKumar Gala 214415a613bSKumar Gala /* 215415a613bSKumar Gala * Issue NORMAL OP command. 216415a613bSKumar Gala */ 217b0fe93edSKumar Gala lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL; 218415a613bSKumar Gala asm("sync;msync"); 219415a613bSKumar Gala *sdram_addr = 0xff; 220415a613bSKumar Gala ppcDcbf((unsigned long) sdram_addr); 221415a613bSKumar Gala udelay(200); /* Overkill. Must wait > 200 bus cycles */ 222415a613bSKumar Gala 223415a613bSKumar Gala #endif /* enable SDRAM init */ 224415a613bSKumar Gala } 225415a613bSKumar Gala 226415a613bSKumar Gala #if defined(CONFIG_PCI) || defined(CONFIG_PCI1) 227415a613bSKumar Gala /* For some reason the Tundra PCI bridge shows up on itself as a 228415a613bSKumar Gala * different device. Work around that by refusing to configure it. 229415a613bSKumar Gala */ 230415a613bSKumar Gala void dummy_func(struct pci_controller* hose, pci_dev_t dev, struct pci_config_table *tab) { } 231415a613bSKumar Gala 232415a613bSKumar Gala static struct pci_config_table pci_mpc85xxcds_config_table[] = { 233415a613bSKumar Gala {0x10e3, 0x0513, PCI_ANY_ID, 1, 3, PCI_ANY_ID, dummy_func, {0,0,0}}, 234415a613bSKumar Gala {0x1106, 0x0686, PCI_ANY_ID, 1, VIA_ID, 0, mpc85xx_config_via, {0,0,0}}, 235415a613bSKumar Gala {0x1106, 0x0571, PCI_ANY_ID, 1, VIA_ID, 1, 236415a613bSKumar Gala mpc85xx_config_via_usbide, {0,0,0}}, 237415a613bSKumar Gala {0x1105, 0x3038, PCI_ANY_ID, 1, VIA_ID, 2, 238415a613bSKumar Gala mpc85xx_config_via_usb, {0,0,0}}, 239415a613bSKumar Gala {0x1106, 0x3038, PCI_ANY_ID, 1, VIA_ID, 3, 240415a613bSKumar Gala mpc85xx_config_via_usb2, {0,0,0}}, 241415a613bSKumar Gala {0x1106, 0x3058, PCI_ANY_ID, 1, VIA_ID, 5, 242415a613bSKumar Gala mpc85xx_config_via_power, {0,0,0}}, 243415a613bSKumar Gala {0x1106, 0x3068, PCI_ANY_ID, 1, VIA_ID, 6, 244415a613bSKumar Gala mpc85xx_config_via_ac97, {0,0,0}}, 245415a613bSKumar Gala {}, 246415a613bSKumar Gala }; 247415a613bSKumar Gala 248415a613bSKumar Gala static struct pci_controller pci1_hose = { 249415a613bSKumar Gala config_table: pci_mpc85xxcds_config_table}; 250415a613bSKumar Gala #endif /* CONFIG_PCI */ 251415a613bSKumar Gala 252415a613bSKumar Gala #ifdef CONFIG_PCI2 253415a613bSKumar Gala static struct pci_controller pci2_hose; 254415a613bSKumar Gala #endif /* CONFIG_PCI2 */ 255415a613bSKumar Gala 256415a613bSKumar Gala #ifdef CONFIG_PCIE1 257415a613bSKumar Gala static struct pci_controller pcie1_hose; 258415a613bSKumar Gala #endif /* CONFIG_PCIE1 */ 259415a613bSKumar Gala 2607b626880SKumar Gala void pci_init_board(void) 261415a613bSKumar Gala { 2626d0f6bcfSJean-Christophe PLAGNIOL-VILLARD volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 2637b626880SKumar Gala struct fsl_pci_info pci_info[4]; 2647b626880SKumar Gala u32 devdisr, pordevsr, io_sel; 2657b626880SKumar Gala u32 porpllsr, pci_agent, pci_speed, pci_32, pci_arb, pci_clk_sel; 2667b626880SKumar Gala int first_free_busno = 0; 2677b626880SKumar Gala int num = 0; 268415a613bSKumar Gala 2697b626880SKumar Gala int pcie_ep, pcie_configured; 2707b626880SKumar Gala 2717b626880SKumar Gala devdisr = in_be32(&gur->devdisr); 2727b626880SKumar Gala pordevsr = in_be32(&gur->pordevsr); 2737b626880SKumar Gala porpllsr = in_be32(&gur->porpllsr); 2747b626880SKumar Gala io_sel = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19; 2757b626880SKumar Gala 2767b626880SKumar Gala debug (" pci_init_board: devdisr=%x, io_sel=%x\n", devdisr, io_sel); 277415a613bSKumar Gala 278415a613bSKumar Gala #ifdef CONFIG_PCI1 2797b626880SKumar Gala pci_speed = get_clock_freq (); /* PCI PSPEED in [4:5] */ 2807b626880SKumar Gala pci_32 = pordevsr & MPC85xx_PORDEVSR_PCI1_PCI32; /* PORDEVSR[15] */ 2817b626880SKumar Gala pci_arb = pordevsr & MPC85xx_PORDEVSR_PCI1_ARB; 2827b626880SKumar Gala pci_clk_sel = porpllsr & MPC85xx_PORDEVSR_PCI1_SPD; 283415a613bSKumar Gala 2847b626880SKumar Gala if (!(devdisr & MPC85xx_DEVDISR_PCI1)) { 2857b626880SKumar Gala SET_STD_PCI_INFO(pci_info[num], 1); 2867b626880SKumar Gala pci_agent = fsl_setup_hose(&pci1_hose, pci_info[num].regs); 287*8ca78f2cSPeter Tyser printf("PCI: %d bit, %s MHz, %s, %s, %s (base address %lx)\n", 288415a613bSKumar Gala (pci_32) ? 32 : 64, 289415a613bSKumar Gala (pci_speed == 33333000) ? "33" : 290415a613bSKumar Gala (pci_speed == 66666000) ? "66" : "unknown", 291415a613bSKumar Gala pci_clk_sel ? "sync" : "async", 292415a613bSKumar Gala pci_agent ? "agent" : "host", 2937b626880SKumar Gala pci_arb ? "arbiter" : "external-arbiter", 2947b626880SKumar Gala pci_info[num].regs); 295415a613bSKumar Gala 2967b626880SKumar Gala first_free_busno = fsl_pci_init_port(&pci_info[num++], 2977b626880SKumar Gala &pci1_hose, first_free_busno); 298415a613bSKumar Gala 299415a613bSKumar Gala #ifdef CONFIG_PCIX_CHECK 3007b626880SKumar Gala if (!(pordevsr & MPC85xx_PORDEVSR_PCI1)) { 301415a613bSKumar Gala /* PCI-X init */ 302415a613bSKumar Gala if (CONFIG_SYS_CLK_FREQ < 66000000) 303415a613bSKumar Gala printf("PCI-X will only work at 66 MHz\n"); 304415a613bSKumar Gala 305415a613bSKumar Gala reg16 = PCI_X_CMD_MAX_SPLIT | PCI_X_CMD_MAX_READ 306415a613bSKumar Gala | PCI_X_CMD_ERO | PCI_X_CMD_DPERR_E; 307415a613bSKumar Gala pci_hose_write_config_word(hose, bus, PCIX_COMMAND, reg16); 308415a613bSKumar Gala } 309415a613bSKumar Gala #endif 310415a613bSKumar Gala } else { 311415a613bSKumar Gala printf("PCI: disabled\n"); 312415a613bSKumar Gala } 3137b626880SKumar Gala 3147b626880SKumar Gala puts("\n"); 315415a613bSKumar Gala #else 3167b626880SKumar Gala setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCI1); /* disable */ 317415a613bSKumar Gala #endif 318415a613bSKumar Gala 319415a613bSKumar Gala #ifdef CONFIG_PCI2 320415a613bSKumar Gala { 3217b626880SKumar Gala uint pci2_clk_sel = porpllsr & 0x4000; /* PORPLLSR[17] */ 322415a613bSKumar Gala uint pci_dual = get_pci_dual (); /* PCI DUAL in CM_PCI[3] */ 323415a613bSKumar Gala if (pci_dual) { 324415a613bSKumar Gala printf("PCI2: 32 bit, 66 MHz, %s\n", 325415a613bSKumar Gala pci2_clk_sel ? "sync" : "async"); 326415a613bSKumar Gala } else { 327415a613bSKumar Gala printf("PCI2: disabled\n"); 328415a613bSKumar Gala } 329415a613bSKumar Gala } 330415a613bSKumar Gala #else 3317b626880SKumar Gala setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCI2); /* disable */ 332415a613bSKumar Gala #endif /* CONFIG_PCI2 */ 333415a613bSKumar Gala 334415a613bSKumar Gala #ifdef CONFIG_PCIE1 3357b626880SKumar Gala pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel); 336415a613bSKumar Gala 3377b626880SKumar Gala if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)){ 3387b626880SKumar Gala SET_STD_PCIE_INFO(pci_info[num], 1); 3397b626880SKumar Gala pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); 340*8ca78f2cSPeter Tyser printf("PCIE1: connected to Slot as %s (base addr %lx)\n", 34164917ca3SPeter Tyser pcie_ep ? "Endpoint" : "Root Complex", 3427b626880SKumar Gala pci_info[num].regs); 343415a613bSKumar Gala 3447b626880SKumar Gala first_free_busno = fsl_pci_init_port(&pci_info[num++], 3457b626880SKumar Gala &pcie1_hose, first_free_busno); 346415a613bSKumar Gala } else { 3477b626880SKumar Gala printf("PCIE1: disabled\n"); 348415a613bSKumar Gala } 349415a613bSKumar Gala 3507b626880SKumar Gala puts("\n"); 3517b626880SKumar Gala #else 3527b626880SKumar Gala setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_PCIE); /* disable */ 3537b626880SKumar Gala #endif 354415a613bSKumar Gala } 355415a613bSKumar Gala 356415a613bSKumar Gala int last_stage_init(void) 357415a613bSKumar Gala { 358415a613bSKumar Gala unsigned short temp; 359415a613bSKumar Gala 360415a613bSKumar Gala /* Change the resistors for the PHY */ 361415a613bSKumar Gala /* This is needed to get the RGMII working for the 1.3+ 362415a613bSKumar Gala * CDS cards */ 363415a613bSKumar Gala if (get_board_version() == 0x13) { 364415a613bSKumar Gala miiphy_write(CONFIG_TSEC1_NAME, 365415a613bSKumar Gala TSEC1_PHY_ADDR, 29, 18); 366415a613bSKumar Gala 367415a613bSKumar Gala miiphy_read(CONFIG_TSEC1_NAME, 368415a613bSKumar Gala TSEC1_PHY_ADDR, 30, &temp); 369415a613bSKumar Gala 370415a613bSKumar Gala temp = (temp & 0xf03f); 371415a613bSKumar Gala temp |= 2 << 9; /* 36 ohm */ 372415a613bSKumar Gala temp |= 2 << 6; /* 39 ohm */ 373415a613bSKumar Gala 374415a613bSKumar Gala miiphy_write(CONFIG_TSEC1_NAME, 375415a613bSKumar Gala TSEC1_PHY_ADDR, 30, temp); 376415a613bSKumar Gala 377415a613bSKumar Gala miiphy_write(CONFIG_TSEC1_NAME, 378415a613bSKumar Gala TSEC1_PHY_ADDR, 29, 3); 379415a613bSKumar Gala 380415a613bSKumar Gala miiphy_write(CONFIG_TSEC1_NAME, 381415a613bSKumar Gala TSEC1_PHY_ADDR, 30, 0x8000); 382415a613bSKumar Gala } 383415a613bSKumar Gala 384415a613bSKumar Gala return 0; 385415a613bSKumar Gala } 386415a613bSKumar Gala 387415a613bSKumar Gala 388415a613bSKumar Gala #if defined(CONFIG_OF_BOARD_SETUP) 3892dba0deaSKumar Gala void ft_pci_setup(void *blob, bd_t *bd) 3902dba0deaSKumar Gala { 3916525d51fSKumar Gala FT_FSL_PCI_SETUP; 392415a613bSKumar Gala } 393415a613bSKumar Gala #endif 394