wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 1 | /* |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 2 | * Copyright 2004 Freescale Semiconductor. |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 3 | * (C) Copyright 2002,2003, Motorola Inc. |
| 4 | * Xianghua Xiao, (X.Xiao@motorola.com) |
| 5 | * |
| 6 | * (C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com> |
| 7 | * |
| 8 | * See file CREDITS for list of people who contributed to this |
| 9 | * project. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public License as |
| 13 | * published by the Free Software Foundation; either version 2 of |
| 14 | * the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 24 | * MA 02111-1307 USA |
| 25 | */ |
| 26 | |
| 27 | |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 28 | #include <common.h> |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 29 | #include <pci.h> |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 30 | #include <asm/processor.h> |
| 31 | #include <asm/immap_85xx.h> |
| 32 | #include <spd.h> |
Kumar Gala | 0fd5ec6 | 2007-11-28 22:54:27 -0600 | [diff] [blame] | 33 | #include <libfdt.h> |
| 34 | #include <fdt_support.h> |
Matthew McClintock | 40d5fa3 | 2006-06-28 10:43:36 -0500 | [diff] [blame] | 35 | |
Jon Loeliger | d9b94f2 | 2005-07-25 14:05:07 -0500 | [diff] [blame] | 36 | #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 37 | extern void ddr_enable_ecc(unsigned int dram_size); |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 38 | #endif |
| 39 | |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 40 | extern long int spd_sdram(void); |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 41 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 42 | void local_bus_init(void); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 43 | void sdram_init(void); |
| 44 | long int fixed_sdram(void); |
| 45 | |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 46 | |
wdenk | c837dcb | 2004-01-20 23:12:12 +0000 | [diff] [blame] | 47 | int board_early_init_f (void) |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 48 | { |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 49 | return 0; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | int checkboard (void) |
| 53 | { |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 54 | puts("Board: ADS\n"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 55 | |
| 56 | #ifdef CONFIG_PCI |
| 57 | printf(" PCI1: 32 bit, %d MHz (compiled)\n", |
| 58 | CONFIG_SYS_CLK_FREQ / 1000000); |
| 59 | #else |
| 60 | printf(" PCI1: disabled\n"); |
| 61 | #endif |
| 62 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 63 | /* |
| 64 | * Initialize local bus. |
| 65 | */ |
| 66 | local_bus_init(); |
| 67 | |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 68 | return 0; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 69 | } |
| 70 | |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 71 | |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 72 | long int |
| 73 | initdram(int board_type) |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 74 | { |
| 75 | long dram_size = 0; |
| 76 | extern long spd_sdram (void); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 77 | |
| 78 | puts("Initializing\n"); |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 79 | |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 80 | #if defined(CONFIG_DDR_DLL) |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 81 | { |
Kumar Gala | f59b55a | 2007-11-27 23:25:02 -0600 | [diff] [blame] | 82 | volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR); |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 83 | uint temp_ddrdll = 0; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 84 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 85 | /* |
| 86 | * Work around to stabilize DDR DLL |
| 87 | */ |
| 88 | temp_ddrdll = gur->ddrdllcr; |
| 89 | gur->ddrdllcr = ((temp_ddrdll & 0xff) << 16) | 0x80000000; |
| 90 | asm("sync;isync;msync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 91 | } |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 92 | #endif |
| 93 | |
| 94 | #if defined(CONFIG_SPD_EEPROM) |
| 95 | dram_size = spd_sdram (); |
| 96 | #else |
| 97 | dram_size = fixed_sdram (); |
| 98 | #endif |
| 99 | |
Jon Loeliger | d9b94f2 | 2005-07-25 14:05:07 -0500 | [diff] [blame] | 100 | #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 101 | /* |
| 102 | * Initialize and enable DDR ECC. |
| 103 | */ |
| 104 | ddr_enable_ecc(dram_size); |
| 105 | #endif |
| 106 | |
| 107 | /* |
| 108 | * Initialize SDRAM. |
| 109 | */ |
| 110 | sdram_init(); |
| 111 | |
| 112 | puts(" DDR: "); |
| 113 | return dram_size; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | /* |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 118 | * Initialize Local Bus |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 119 | */ |
| 120 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 121 | void |
| 122 | local_bus_init(void) |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 123 | { |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 124 | volatile immap_t *immap = (immap_t *)CFG_IMMR; |
Kumar Gala | f59b55a | 2007-11-27 23:25:02 -0600 | [diff] [blame] | 125 | volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 126 | volatile ccsr_lbc_t *lbc = &immap->im_lbc; |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 127 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 128 | uint clkdiv; |
| 129 | uint lbc_hz; |
| 130 | sys_info_t sysinfo; |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 131 | |
| 132 | /* |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 133 | * Errata LBC11. |
| 134 | * Fix Local Bus clock glitch when DLL is enabled. |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 135 | * |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 136 | * If localbus freq is < 66Mhz, DLL bypass mode must be used. |
| 137 | * If localbus freq is > 133Mhz, DLL can be safely enabled. |
| 138 | * Between 66 and 133, the DLL is enabled with an override workaround. |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 139 | */ |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 140 | |
| 141 | get_sys_info(&sysinfo); |
| 142 | clkdiv = lbc->lcrr & 0x0f; |
| 143 | lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv; |
| 144 | |
| 145 | if (lbc_hz < 66) { |
| 146 | lbc->lcrr = CFG_LBC_LCRR | 0x80000000; /* DLL Bypass */ |
| 147 | |
| 148 | } else if (lbc_hz >= 133) { |
| 149 | lbc->lcrr = CFG_LBC_LCRR & (~0x80000000); /* DLL Enabled */ |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 150 | |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 151 | } else { |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 152 | /* |
| 153 | * On REV1 boards, need to change CLKDIV before enable DLL. |
| 154 | * Default CLKDIV is 8, change it to 4 temporarily. |
| 155 | */ |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 156 | uint pvr = get_pvr(); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 157 | uint temp_lbcdll = 0; |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 158 | |
| 159 | if (pvr == PVR_85xx_REV1) { |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 160 | /* FIXME: Justify the high bit here. */ |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 161 | lbc->lcrr = 0x10000004; |
wdenk | 97d80fc | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 162 | } |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 163 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 164 | lbc->lcrr = CFG_LBC_LCRR & (~0x80000000); /* DLL Enabled */ |
| 165 | udelay(200); |
| 166 | |
| 167 | /* |
| 168 | * Sample LBC DLL ctrl reg, upshift it to set the |
| 169 | * override bits. |
| 170 | */ |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 171 | temp_lbcdll = gur->lbcdllcr; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 172 | gur->lbcdllcr = (((temp_lbcdll & 0xff) << 16) | 0x80000000); |
| 173 | asm("sync;isync;msync"); |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 174 | } |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | |
| 178 | /* |
| 179 | * Initialize SDRAM memory on the Local Bus. |
| 180 | */ |
| 181 | |
| 182 | void |
| 183 | sdram_init(void) |
| 184 | { |
| 185 | volatile immap_t *immap = (immap_t *)CFG_IMMR; |
| 186 | volatile ccsr_lbc_t *lbc= &immap->im_lbc; |
| 187 | uint *sdram_addr = (uint *)CFG_LBC_SDRAM_BASE; |
| 188 | |
| 189 | puts(" SDRAM: "); |
| 190 | print_size (CFG_LBC_SDRAM_SIZE * 1024 * 1024, "\n"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 191 | |
| 192 | /* |
| 193 | * Setup SDRAM Base and Option Registers |
| 194 | */ |
| 195 | lbc->or2 = CFG_OR2_PRELIM; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 196 | lbc->br2 = CFG_BR2_PRELIM; |
| 197 | lbc->lbcr = CFG_LBC_LBCR; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 198 | asm("msync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 199 | |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 200 | lbc->lsrt = CFG_LBC_LSRT; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 201 | lbc->mrtpr = CFG_LBC_MRTPR; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 202 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 203 | |
| 204 | /* |
| 205 | * Configure the SDRAM controller. |
| 206 | */ |
| 207 | lbc->lsdmr = CFG_LBC_LSDMR_1; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 208 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 209 | *sdram_addr = 0xff; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 210 | ppcDcbf((unsigned long) sdram_addr); |
| 211 | udelay(100); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 212 | |
| 213 | lbc->lsdmr = CFG_LBC_LSDMR_2; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 214 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 215 | *sdram_addr = 0xff; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 216 | ppcDcbf((unsigned long) sdram_addr); |
| 217 | udelay(100); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 218 | |
| 219 | lbc->lsdmr = CFG_LBC_LSDMR_3; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 220 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 221 | *sdram_addr = 0xff; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 222 | ppcDcbf((unsigned long) sdram_addr); |
| 223 | udelay(100); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 224 | |
| 225 | lbc->lsdmr = CFG_LBC_LSDMR_4; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 226 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 227 | *sdram_addr = 0xff; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 228 | ppcDcbf((unsigned long) sdram_addr); |
| 229 | udelay(100); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 230 | |
| 231 | lbc->lsdmr = CFG_LBC_LSDMR_5; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 232 | asm("sync"); |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 233 | *sdram_addr = 0xff; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 234 | ppcDcbf((unsigned long) sdram_addr); |
| 235 | udelay(100); |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | |
| 239 | #if defined(CFG_DRAM_TEST) |
| 240 | int testdram (void) |
| 241 | { |
| 242 | uint *pstart = (uint *) CFG_MEMTEST_START; |
| 243 | uint *pend = (uint *) CFG_MEMTEST_END; |
| 244 | uint *p; |
| 245 | |
| 246 | printf("SDRAM test phase 1:\n"); |
| 247 | for (p = pstart; p < pend; p++) |
| 248 | *p = 0xaaaaaaaa; |
| 249 | |
| 250 | for (p = pstart; p < pend; p++) { |
| 251 | if (*p != 0xaaaaaaaa) { |
| 252 | printf ("SDRAM test fails at: %08x\n", (uint) p); |
| 253 | return 1; |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | printf("SDRAM test phase 2:\n"); |
| 258 | for (p = pstart; p < pend; p++) |
| 259 | *p = 0x55555555; |
| 260 | |
| 261 | for (p = pstart; p < pend; p++) { |
| 262 | if (*p != 0x55555555) { |
| 263 | printf ("SDRAM test fails at: %08x\n", (uint) p); |
| 264 | return 1; |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | printf("SDRAM test passed.\n"); |
| 269 | return 0; |
| 270 | } |
| 271 | #endif |
| 272 | |
| 273 | |
| 274 | #if !defined(CONFIG_SPD_EEPROM) |
| 275 | /************************************************************************* |
| 276 | * fixed sdram init -- doesn't use serial presence detect. |
| 277 | ************************************************************************/ |
| 278 | long int fixed_sdram (void) |
| 279 | { |
| 280 | #ifndef CFG_RAMBOOT |
| 281 | volatile immap_t *immap = (immap_t *)CFG_IMMR; |
| 282 | volatile ccsr_ddr_t *ddr= &immap->im_ddr; |
| 283 | |
| 284 | ddr->cs0_bnds = CFG_DDR_CS0_BNDS; |
| 285 | ddr->cs0_config = CFG_DDR_CS0_CONFIG; |
| 286 | ddr->timing_cfg_1 = CFG_DDR_TIMING_1; |
| 287 | ddr->timing_cfg_2 = CFG_DDR_TIMING_2; |
| 288 | ddr->sdram_mode = CFG_DDR_MODE; |
| 289 | ddr->sdram_interval = CFG_DDR_INTERVAL; |
| 290 | #if defined (CONFIG_DDR_ECC) |
| 291 | ddr->err_disable = 0x0000000D; |
| 292 | ddr->err_sbe = 0x00ff0000; |
| 293 | #endif |
| 294 | asm("sync;isync;msync"); |
| 295 | udelay(500); |
| 296 | #if defined (CONFIG_DDR_ECC) |
| 297 | /* Enable ECC checking */ |
| 298 | ddr->sdram_cfg = (CFG_DDR_CONTROL | 0x20000000); |
| 299 | #else |
| 300 | ddr->sdram_cfg = CFG_DDR_CONTROL; |
| 301 | #endif |
| 302 | asm("sync; isync; msync"); |
| 303 | udelay(500); |
| 304 | #endif |
wdenk | 0ac6f8b | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 305 | return CFG_SDRAM_SIZE * 1024 * 1024; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 306 | } |
| 307 | #endif /* !defined(CONFIG_SPD_EEPROM) */ |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 308 | |
| 309 | |
| 310 | #if defined(CONFIG_PCI) |
| 311 | /* |
| 312 | * Initialize PCI Devices, report devices found. |
| 313 | */ |
| 314 | |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 315 | |
Matthew McClintock | 52c7a68 | 2006-06-28 10:45:41 -0500 | [diff] [blame] | 316 | static struct pci_controller hose; |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 317 | |
| 318 | #endif /* CONFIG_PCI */ |
| 319 | |
| 320 | |
| 321 | void |
| 322 | pci_init_board(void) |
| 323 | { |
| 324 | #ifdef CONFIG_PCI |
wdenk | 9aea953 | 2004-08-01 23:02:45 +0000 | [diff] [blame] | 325 | pci_mpc85xx_init(&hose); |
| 326 | #endif /* CONFIG_PCI */ |
| 327 | } |
Matthew McClintock | 40d5fa3 | 2006-06-28 10:43:36 -0500 | [diff] [blame] | 328 | |
| 329 | |
Kumar Gala | 0fd5ec6 | 2007-11-28 22:54:27 -0600 | [diff] [blame] | 330 | #if defined(CONFIG_OF_BOARD_SETUP) |
Matthew McClintock | 40d5fa3 | 2006-06-28 10:43:36 -0500 | [diff] [blame] | 331 | void |
| 332 | ft_board_setup(void *blob, bd_t *bd) |
| 333 | { |
Kumar Gala | 0fd5ec6 | 2007-11-28 22:54:27 -0600 | [diff] [blame] | 334 | int node, tmp[2]; |
| 335 | const char *path; |
Matthew McClintock | 40d5fa3 | 2006-06-28 10:43:36 -0500 | [diff] [blame] | 336 | |
| 337 | ft_cpu_setup(blob, bd); |
| 338 | |
Kumar Gala | 0fd5ec6 | 2007-11-28 22:54:27 -0600 | [diff] [blame] | 339 | node = fdt_path_offset(blob, "/aliases"); |
| 340 | tmp[0] = 0; |
| 341 | if (node >= 0) { |
| 342 | #ifdef CONFIG_PCI |
| 343 | path = fdt_getprop(blob, node, "pci0", NULL); |
| 344 | if (path) { |
| 345 | tmp[1] = hose.last_busno - hose.first_busno; |
| 346 | do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1); |
| 347 | } |
| 348 | #endif |
Matthew McClintock | 40d5fa3 | 2006-06-28 10:43:36 -0500 | [diff] [blame] | 349 | } |
| 350 | } |
| 351 | #endif |