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