Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 1 | /* |
Dave Liu | 5245ff5 | 2007-09-18 12:36:11 +0800 | [diff] [blame] | 2 | * Copyright (C) 2004-2007 Freescale Semiconductor, Inc. |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 3 | * |
| 4 | * See file CREDITS for list of people who contributed to this |
| 5 | * project. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; either version 2 of |
| 10 | * the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 20 | * MA 02111-1307 USA |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | /* |
| 24 | * CPU specific code for the MPC83xx family. |
| 25 | * |
| 26 | * Derived from the MPC8260 and MPC85xx. |
| 27 | */ |
| 28 | |
| 29 | #include <common.h> |
| 30 | #include <watchdog.h> |
| 31 | #include <command.h> |
| 32 | #include <mpc83xx.h> |
| 33 | #include <asm/processor.h> |
Gerald Van Baren | d6abef4 | 2007-03-31 12:23:51 -0400 | [diff] [blame] | 34 | #include <libfdt.h> |
Andy Fleming | fecff2b | 2008-08-31 16:33:26 -0500 | [diff] [blame] | 35 | #include <tsec.h> |
Ben Warren | 6773169 | 2008-10-22 23:32:48 -0700 | [diff] [blame] | 36 | #include <netdev.h> |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 37 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 38 | DECLARE_GLOBAL_DATA_PTR; |
| 39 | |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 40 | int checkcpu(void) |
| 41 | { |
Dave Liu | a46daea | 2006-11-03 19:33:44 -0600 | [diff] [blame] | 42 | volatile immap_t *immr; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 43 | ulong clock = gd->cpu_clk; |
| 44 | u32 pvr = get_pvr(); |
Dave Liu | a46daea | 2006-11-03 19:33:44 -0600 | [diff] [blame] | 45 | u32 spridr; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 46 | char buf[32]; |
Kim Phillips | ecb2d6f | 2008-03-28 10:19:07 -0500 | [diff] [blame] | 47 | int i; |
| 48 | |
Kim Phillips | ecb2d6f | 2008-03-28 10:19:07 -0500 | [diff] [blame] | 49 | const struct cpu_type { |
| 50 | char name[15]; |
| 51 | u32 partid; |
| 52 | } cpu_type_list [] = { |
| 53 | CPU_TYPE_ENTRY(8311), |
| 54 | CPU_TYPE_ENTRY(8313), |
| 55 | CPU_TYPE_ENTRY(8314), |
| 56 | CPU_TYPE_ENTRY(8315), |
| 57 | CPU_TYPE_ENTRY(8321), |
| 58 | CPU_TYPE_ENTRY(8323), |
| 59 | CPU_TYPE_ENTRY(8343), |
| 60 | CPU_TYPE_ENTRY(8347_TBGA_), |
| 61 | CPU_TYPE_ENTRY(8347_PBGA_), |
| 62 | CPU_TYPE_ENTRY(8349), |
| 63 | CPU_TYPE_ENTRY(8358_TBGA_), |
| 64 | CPU_TYPE_ENTRY(8358_PBGA_), |
| 65 | CPU_TYPE_ENTRY(8360), |
| 66 | CPU_TYPE_ENTRY(8377), |
| 67 | CPU_TYPE_ENTRY(8378), |
| 68 | CPU_TYPE_ENTRY(8379), |
| 69 | }; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 70 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 71 | immr = (immap_t *)CONFIG_SYS_IMMR; |
Dave Liu | a46daea | 2006-11-03 19:33:44 -0600 | [diff] [blame] | 72 | |
Kim Phillips | d82b077 | 2007-04-30 15:26:21 -0500 | [diff] [blame] | 73 | puts("CPU: "); |
Scott Wood | 7206a99 | 2007-04-16 14:34:16 -0500 | [diff] [blame] | 74 | |
| 75 | switch (pvr & 0xffff0000) { |
| 76 | case PVR_E300C1: |
| 77 | printf("e300c1, "); |
| 78 | break; |
| 79 | |
| 80 | case PVR_E300C2: |
| 81 | printf("e300c2, "); |
| 82 | break; |
| 83 | |
| 84 | case PVR_E300C3: |
| 85 | printf("e300c3, "); |
| 86 | break; |
| 87 | |
Dave Liu | 5245ff5 | 2007-09-18 12:36:11 +0800 | [diff] [blame] | 88 | case PVR_E300C4: |
| 89 | printf("e300c4, "); |
| 90 | break; |
| 91 | |
Scott Wood | 7206a99 | 2007-04-16 14:34:16 -0500 | [diff] [blame] | 92 | default: |
| 93 | printf("Unknown core, "); |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 94 | } |
| 95 | |
Dave Liu | a46daea | 2006-11-03 19:33:44 -0600 | [diff] [blame] | 96 | spridr = immr->sysconf.spridr; |
Kim Phillips | ecb2d6f | 2008-03-28 10:19:07 -0500 | [diff] [blame] | 97 | |
| 98 | for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++) |
| 99 | if (cpu_type_list[i].partid == PARTID_NO_E(spridr)) { |
| 100 | puts("MPC"); |
| 101 | puts(cpu_type_list[i].name); |
| 102 | if (IS_E_PROCESSOR(spridr)) |
| 103 | puts("E"); |
| 104 | if (REVID_MAJOR(spridr) >= 2) |
| 105 | puts("A"); |
| 106 | printf(", Rev: %d.%d", REVID_MAJOR(spridr), |
| 107 | REVID_MINOR(spridr)); |
| 108 | break; |
| 109 | } |
| 110 | |
| 111 | if (i == ARRAY_SIZE(cpu_type_list)) |
| 112 | printf("(SPRIDR %08x unknown), ", spridr); |
| 113 | |
| 114 | printf(" at %s MHz, ", strmhz(buf, clock)); |
Rafal Jaworowski | 384da5e | 2005-10-17 02:39:53 +0200 | [diff] [blame] | 115 | |
Kim Phillips | ecb2d6f | 2008-03-28 10:19:07 -0500 | [diff] [blame] | 116 | printf("CSB: %s MHz\n", strmhz(buf, gd->csb_clk)); |
Kim Phillips | d82b077 | 2007-04-30 15:26:21 -0500 | [diff] [blame] | 117 | |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 118 | return 0; |
| 119 | } |
| 120 | |
| 121 | |
Timur Tabi | ab34754 | 2006-11-03 19:15:00 -0600 | [diff] [blame] | 122 | /* |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 123 | * Program a UPM with the code supplied in the table. |
| 124 | * |
| 125 | * The 'dummy' variable is used to increment the MAD. 'dummy' is |
| 126 | * supposed to be a pointer to the memory of the device being |
| 127 | * programmed by the UPM. The data in the MDR is written into |
Selvamuthukumar | acb53d1 | 2008-10-09 10:29:14 +0530 | [diff] [blame] | 128 | * memory and the MAD is incremented every time there's a write |
| 129 | * to 'dummy'. Unfortunately, the current prototype for this |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 130 | * function doesn't allow for passing the address of this |
| 131 | * device, and changing the prototype will break a number lots |
| 132 | * of other code, so we need to use a round-about way of finding |
| 133 | * the value for 'dummy'. |
| 134 | * |
| 135 | * The value can be extracted from the base address bits of the |
| 136 | * Base Register (BR) associated with the specific UPM. To find |
| 137 | * that BR, we need to scan all 8 BRs until we find the one that |
| 138 | * has its MSEL bits matching the UPM we want. Once we know the |
| 139 | * right BR, we can extract the base address bits from it. |
| 140 | * |
| 141 | * The MxMR and the BR and OR of the chosen bank should all be |
| 142 | * configured before calling this function. |
| 143 | * |
| 144 | * Parameters: |
| 145 | * upm: 0=UPMA, 1=UPMB, 2=UPMC |
| 146 | * table: Pointer to an array of values to program |
| 147 | * size: Number of elements in the array. Must be 64 or less. |
Timur Tabi | ab34754 | 2006-11-03 19:15:00 -0600 | [diff] [blame] | 148 | */ |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 149 | void upmconfig (uint upm, uint *table, uint size) |
| 150 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 151 | volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; |
Haiying Wang | 4f84bbd | 2008-10-29 11:05:55 -0400 | [diff] [blame] | 152 | volatile fsl_lbus_t *lbus = &immap->lbus; |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 153 | volatile uchar *dummy = NULL; |
| 154 | const u32 msel = (upm + 4) << BR_MSEL_SHIFT; /* What the MSEL field in BRn should be */ |
| 155 | volatile u32 *mxmr = &lbus->mamr + upm; /* Pointer to mamr, mbmr, or mcmr */ |
| 156 | uint i; |
| 157 | |
| 158 | /* Scan all the banks to determine the base address of the device */ |
| 159 | for (i = 0; i < 8; i++) { |
| 160 | if ((lbus->bank[i].br & BR_MSEL) == msel) { |
| 161 | dummy = (uchar *) (lbus->bank[i].br & BR_BA); |
| 162 | break; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | if (!dummy) { |
| 167 | printf("Error: %s() could not find matching BR\n", __FUNCTION__); |
| 168 | hang(); |
| 169 | } |
| 170 | |
| 171 | /* Set the OP field in the MxMR to "write" and the MAD field to 000000 */ |
| 172 | *mxmr = (*mxmr & 0xCFFFFFC0) | 0x10000000; |
| 173 | |
| 174 | for (i = 0; i < size; i++) { |
| 175 | lbus->mdr = table[i]; |
| 176 | __asm__ __volatile__ ("sync"); |
Selvamuthukumar | acb53d1 | 2008-10-09 10:29:14 +0530 | [diff] [blame] | 177 | *dummy = 0; /* Write the value to memory and increment MAD */ |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 178 | __asm__ __volatile__ ("sync"); |
Selvamuthukumar | acb53d1 | 2008-10-09 10:29:14 +0530 | [diff] [blame] | 179 | while(((*mxmr & 0x3f) != ((i + 1) & 0x3f))); |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | /* Set the OP field in the MxMR to "normal" and the MAD field to 000000 */ |
| 183 | *mxmr &= 0xCFFFFFC0; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | |
| 187 | int |
| 188 | do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) |
| 189 | { |
Wolfgang Denk | 301d096 | 2005-08-05 19:49:35 +0200 | [diff] [blame] | 190 | ulong msr; |
| 191 | #ifndef MPC83xx_RESET |
| 192 | ulong addr; |
| 193 | #endif |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 194 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 195 | volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 196 | |
| 197 | #ifdef MPC83xx_RESET |
| 198 | /* Interrupts and MMU off */ |
| 199 | __asm__ __volatile__ ("mfmsr %0":"=r" (msr):); |
| 200 | |
| 201 | msr &= ~( MSR_EE | MSR_IR | MSR_DR); |
| 202 | __asm__ __volatile__ ("mtmsr %0"::"r" (msr)); |
| 203 | |
| 204 | /* enable Reset Control Reg */ |
| 205 | immap->reset.rpr = 0x52535445; |
Marian Balakowicz | 919b187 | 2006-03-14 16:12:48 +0100 | [diff] [blame] | 206 | __asm__ __volatile__ ("sync"); |
| 207 | __asm__ __volatile__ ("isync"); |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 208 | |
| 209 | /* confirm Reset Control Reg is enabled */ |
| 210 | while(!((immap->reset.rcer) & RCER_CRE)); |
| 211 | |
| 212 | printf("Resetting the board."); |
| 213 | printf("\n"); |
| 214 | |
| 215 | udelay(200); |
| 216 | |
| 217 | /* perform reset, only one bit */ |
Wolfgang Denk | 301d096 | 2005-08-05 19:49:35 +0200 | [diff] [blame] | 218 | immap->reset.rcr = RCR_SWHR; |
| 219 | |
| 220 | #else /* ! MPC83xx_RESET */ |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 221 | |
Wolfgang Denk | 301d096 | 2005-08-05 19:49:35 +0200 | [diff] [blame] | 222 | immap->reset.rmr = RMR_CSRE; /* Checkstop Reset enable */ |
| 223 | |
| 224 | /* Interrupts and MMU off */ |
| 225 | __asm__ __volatile__ ("mfmsr %0":"=r" (msr):); |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 226 | |
| 227 | msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR); |
| 228 | __asm__ __volatile__ ("mtmsr %0"::"r" (msr)); |
| 229 | |
| 230 | /* |
| 231 | * Trying to execute the next instruction at a non-existing address |
| 232 | * should cause a machine check, resulting in reset |
| 233 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 234 | addr = CONFIG_SYS_RESET_ADDRESS; |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 235 | |
| 236 | printf("resetting the board."); |
| 237 | printf("\n"); |
| 238 | ((void (*)(void)) addr) (); |
Wolfgang Denk | 301d096 | 2005-08-05 19:49:35 +0200 | [diff] [blame] | 239 | #endif /* MPC83xx_RESET */ |
| 240 | |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 241 | return 1; |
| 242 | } |
| 243 | |
| 244 | |
| 245 | /* |
| 246 | * Get timebase clock frequency (like cpu_clk in Hz) |
| 247 | */ |
| 248 | |
| 249 | unsigned long get_tbclk(void) |
| 250 | { |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 251 | ulong tbclk; |
| 252 | |
| 253 | tbclk = (gd->bus_clk + 3L) / 4L; |
| 254 | |
| 255 | return tbclk; |
| 256 | } |
| 257 | |
| 258 | |
| 259 | #if defined(CONFIG_WATCHDOG) |
| 260 | void watchdog_reset (void) |
| 261 | { |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 262 | int re_enable = disable_interrupts(); |
| 263 | |
| 264 | /* Reset the 83xx watchdog */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 265 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 266 | immr->wdt.swsrr = 0x556c; |
| 267 | immr->wdt.swsrr = 0xaa39; |
| 268 | |
| 269 | if (re_enable) |
| 270 | enable_interrupts (); |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 271 | } |
Timur Tabi | 054838e | 2006-10-31 18:44:42 -0600 | [diff] [blame] | 272 | #endif |
Kumar Gala | 5bbb045 | 2006-01-11 16:48:10 -0600 | [diff] [blame] | 273 | |
Marian Balakowicz | 7ec9ebc | 2006-03-14 16:14:48 +0100 | [diff] [blame] | 274 | #if defined(CONFIG_DDR_ECC) |
| 275 | void dma_init(void) |
| 276 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 277 | volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
Dave Liu | f503592 | 2006-10-25 14:41:21 -0500 | [diff] [blame] | 278 | volatile dma83xx_t *dma = &immap->dma; |
Marian Balakowicz | 7ec9ebc | 2006-03-14 16:14:48 +0100 | [diff] [blame] | 279 | volatile u32 status = swab32(dma->dmasr0); |
| 280 | volatile u32 dmamr0 = swab32(dma->dmamr0); |
| 281 | |
| 282 | debug("DMA-init\n"); |
| 283 | |
| 284 | /* initialize DMASARn, DMADAR and DMAABCRn */ |
| 285 | dma->dmadar0 = (u32)0; |
| 286 | dma->dmasar0 = (u32)0; |
| 287 | dma->dmabcr0 = 0; |
| 288 | |
| 289 | __asm__ __volatile__ ("sync"); |
| 290 | __asm__ __volatile__ ("isync"); |
| 291 | |
| 292 | /* clear CS bit */ |
| 293 | dmamr0 &= ~DMA_CHANNEL_START; |
| 294 | dma->dmamr0 = swab32(dmamr0); |
| 295 | __asm__ __volatile__ ("sync"); |
| 296 | __asm__ __volatile__ ("isync"); |
| 297 | |
| 298 | /* while the channel is busy, spin */ |
| 299 | while(status & DMA_CHANNEL_BUSY) { |
| 300 | status = swab32(dma->dmasr0); |
| 301 | } |
| 302 | |
| 303 | debug("DMA-init end\n"); |
| 304 | } |
| 305 | |
| 306 | uint dma_check(void) |
| 307 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 308 | volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
Dave Liu | f503592 | 2006-10-25 14:41:21 -0500 | [diff] [blame] | 309 | volatile dma83xx_t *dma = &immap->dma; |
Marian Balakowicz | 7ec9ebc | 2006-03-14 16:14:48 +0100 | [diff] [blame] | 310 | volatile u32 status = swab32(dma->dmasr0); |
| 311 | volatile u32 byte_count = swab32(dma->dmabcr0); |
| 312 | |
| 313 | /* while the channel is busy, spin */ |
| 314 | while (status & DMA_CHANNEL_BUSY) { |
| 315 | status = swab32(dma->dmasr0); |
| 316 | } |
| 317 | |
| 318 | if (status & DMA_CHANNEL_TRANSFER_ERROR) { |
| 319 | printf ("DMA Error: status = %x @ %d\n", status, byte_count); |
| 320 | } |
| 321 | |
| 322 | return status; |
| 323 | } |
| 324 | |
| 325 | int dma_xfer(void *dest, u32 count, void *src) |
| 326 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 327 | volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
Dave Liu | f503592 | 2006-10-25 14:41:21 -0500 | [diff] [blame] | 328 | volatile dma83xx_t *dma = &immap->dma; |
Marian Balakowicz | 7ec9ebc | 2006-03-14 16:14:48 +0100 | [diff] [blame] | 329 | volatile u32 dmamr0; |
| 330 | |
| 331 | /* initialize DMASARn, DMADAR and DMAABCRn */ |
| 332 | dma->dmadar0 = swab32((u32)dest); |
| 333 | dma->dmasar0 = swab32((u32)src); |
| 334 | dma->dmabcr0 = swab32(count); |
| 335 | |
| 336 | __asm__ __volatile__ ("sync"); |
| 337 | __asm__ __volatile__ ("isync"); |
| 338 | |
| 339 | /* init direct transfer, clear CS bit */ |
| 340 | dmamr0 = (DMA_CHANNEL_TRANSFER_MODE_DIRECT | |
| 341 | DMA_CHANNEL_SOURCE_ADDRESS_HOLD_8B | |
| 342 | DMA_CHANNEL_SOURCE_ADRESSS_HOLD_EN); |
Wolfgang Denk | ebd3deb | 2006-04-16 10:51:58 +0200 | [diff] [blame] | 343 | |
Marian Balakowicz | 7ec9ebc | 2006-03-14 16:14:48 +0100 | [diff] [blame] | 344 | dma->dmamr0 = swab32(dmamr0); |
| 345 | |
| 346 | __asm__ __volatile__ ("sync"); |
| 347 | __asm__ __volatile__ ("isync"); |
| 348 | |
| 349 | /* set CS to start DMA transfer */ |
| 350 | dmamr0 |= DMA_CHANNEL_START; |
| 351 | dma->dmamr0 = swab32(dmamr0); |
| 352 | __asm__ __volatile__ ("sync"); |
| 353 | __asm__ __volatile__ ("isync"); |
| 354 | |
| 355 | return ((int)dma_check()); |
| 356 | } |
| 357 | #endif /*CONFIG_DDR_ECC*/ |
Ben Warren | d448a49 | 2008-06-23 22:57:27 -0700 | [diff] [blame] | 358 | |
Andy Fleming | fecff2b | 2008-08-31 16:33:26 -0500 | [diff] [blame] | 359 | /* |
| 360 | * Initializes on-chip ethernet controllers. |
| 361 | * to override, implement board_eth_init() |
Ben Warren | d448a49 | 2008-06-23 22:57:27 -0700 | [diff] [blame] | 362 | */ |
Ben Warren | d448a49 | 2008-06-23 22:57:27 -0700 | [diff] [blame] | 363 | int cpu_eth_init(bd_t *bis) |
| 364 | { |
Ben Warren | 6773169 | 2008-10-22 23:32:48 -0700 | [diff] [blame] | 365 | #if defined(CONFIG_UEC_ETH1) |
| 366 | uec_initialize(0); |
| 367 | #endif |
| 368 | #if defined(CONFIG_UEC_ETH2) |
| 369 | uec_initialize(1); |
| 370 | #endif |
| 371 | #if defined(CONFIG_UEC_ETH3) |
| 372 | uec_initialize(2); |
| 373 | #endif |
| 374 | #if defined(CONFIG_UEC_ETH4) |
| 375 | uec_initialize(3); |
| 376 | #endif |
| 377 | #if defined(CONFIG_UEC_ETH5) |
| 378 | uec_initialize(4); |
| 379 | #endif |
| 380 | #if defined(CONFIG_UEC_ETH6) |
| 381 | uec_initialize(5); |
| 382 | #endif |
Andy Fleming | fecff2b | 2008-08-31 16:33:26 -0500 | [diff] [blame] | 383 | #if defined(CONFIG_TSEC_ENET) |
| 384 | tsec_standard_init(bis); |
Ben Warren | d448a49 | 2008-06-23 22:57:27 -0700 | [diff] [blame] | 385 | #endif |
Ben Warren | d448a49 | 2008-06-23 22:57:27 -0700 | [diff] [blame] | 386 | return 0; |
| 387 | } |