Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 1 | /* |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 2 | * Copyright 2006 Freescale Semiconductor |
| 3 | * Jeff Brown |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 4 | * Srikanth Srinivasan (srikanth.srinivasan@freescale.com) |
| 5 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #include <common.h> |
| 26 | #include <watchdog.h> |
| 27 | #include <command.h> |
| 28 | #include <asm/cache.h> |
| 29 | #include <mpc86xx.h> |
| 30 | |
| 31 | #if defined(CONFIG_OF_FLAT_TREE) |
| 32 | #include <ft_build.h> |
| 33 | #endif |
| 34 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 35 | int |
| 36 | checkcpu(void) |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 37 | { |
| 38 | sys_info_t sysinfo; |
| 39 | uint pvr, svr; |
| 40 | uint ver; |
| 41 | uint major, minor; |
| 42 | uint lcrr; /* local bus clock ratio register */ |
| 43 | uint clkdiv; /* clock divider portion of lcrr */ |
Jon Loeliger | 3b971c9 | 2007-10-16 15:26:51 -0500 | [diff] [blame] | 44 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
| 45 | volatile ccsr_gur_t *gur = &immap->im_gur; |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 46 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 47 | puts("Freescale PowerPC\n"); |
| 48 | |
| 49 | pvr = get_pvr(); |
| 50 | ver = PVR_VER(pvr); |
| 51 | major = PVR_MAJ(pvr); |
| 52 | minor = PVR_MIN(pvr); |
| 53 | |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 54 | puts("CPU:\n"); |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 55 | puts(" Core: "); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 56 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 57 | switch (ver) { |
| 58 | case PVR_VER(PVR_86xx): |
Jon Loeliger | 3b971c9 | 2007-10-16 15:26:51 -0500 | [diff] [blame] | 59 | { |
| 60 | uint msscr0 = mfspr(MSSCR0); |
| 61 | printf("E600 Core %d", (msscr0 & 0x20) ? 1 : 0 ); |
| 62 | if (gur->pordevsr & MPC86xx_PORDEVSR_CORE1TE) |
| 63 | puts("\n Core1Translation Enabled"); |
| 64 | debug(" (MSSCR0=%x, PORDEVSR=%x)", msscr0, gur->pordevsr); |
| 65 | } |
| 66 | break; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 67 | default: |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 68 | puts("Unknown"); |
| 69 | break; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 70 | } |
| 71 | printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); |
| 72 | |
| 73 | svr = get_svr(); |
| 74 | ver = SVR_VER(svr); |
| 75 | major = SVR_MAJ(svr); |
| 76 | minor = SVR_MIN(svr); |
| 77 | |
| 78 | puts(" System: "); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 79 | switch (ver) { |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 80 | case SVR_8641: |
Jon Loeliger | f57e829 | 2006-09-14 08:40:36 -0500 | [diff] [blame] | 81 | if (SVR_SUBVER(svr) == 1) { |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 82 | puts("8641D"); |
Jon Loeliger | f57e829 | 2006-09-14 08:40:36 -0500 | [diff] [blame] | 83 | } else { |
| 84 | puts("8641"); |
| 85 | } |
| 86 | break; |
Jon Loeliger | 3b971c9 | 2007-10-16 15:26:51 -0500 | [diff] [blame] | 87 | case SVR_8610: |
| 88 | puts("8610"); |
| 89 | break; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 90 | default: |
| 91 | puts("Unknown"); |
| 92 | break; |
| 93 | } |
| 94 | printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); |
| 95 | |
| 96 | get_sys_info(&sysinfo); |
| 97 | |
| 98 | puts(" Clocks: "); |
| 99 | printf("CPU:%4lu MHz, ", sysinfo.freqProcessor / 1000000); |
| 100 | printf("MPX:%4lu MHz, ", sysinfo.freqSystemBus / 1000000); |
| 101 | printf("DDR:%4lu MHz, ", sysinfo.freqSystemBus / 2000000); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 102 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 103 | #if defined(CFG_LBC_LCRR) |
| 104 | lcrr = CFG_LBC_LCRR; |
| 105 | #else |
| 106 | { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 107 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
| 108 | volatile ccsr_lbc_t *lbc = &immap->im_lbc; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 109 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 110 | lcrr = lbc->lcrr; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 111 | } |
| 112 | #endif |
| 113 | clkdiv = lcrr & 0x0f; |
| 114 | if (clkdiv == 2 || clkdiv == 4 || clkdiv == 8) { |
| 115 | printf("LBC:%4lu MHz\n", |
| 116 | sysinfo.freqSystemBus / 1000000 / clkdiv); |
| 117 | } else { |
| 118 | printf(" LBC: unknown (lcrr: 0x%08x)\n", lcrr); |
| 119 | } |
| 120 | |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 121 | puts(" L2: "); |
Jon Loeliger | d68e2ba | 2006-05-30 17:47:00 -0500 | [diff] [blame] | 122 | if (get_l2cr() & 0x80000000) |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 123 | puts("Enabled\n"); |
Jon Loeliger | d68e2ba | 2006-05-30 17:47:00 -0500 | [diff] [blame] | 124 | else |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 125 | puts("Disabled\n"); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 126 | |
| 127 | return 0; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 131 | static inline void |
| 132 | soft_restart(unsigned long addr) |
| 133 | { |
Jason Jin | 333dd1d | 2007-10-26 18:32:00 +0800 | [diff] [blame] | 134 | #if !defined(CONFIG_MPC8641HPCN) && !defined(CONFIG_MPC8610HPCD) |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 135 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 136 | /* |
| 137 | * SRR0 has system reset vector, SRR1 has default MSR value |
| 138 | * rfi restores MSR from SRR1 and sets the PC to the SRR0 value |
| 139 | */ |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 140 | |
| 141 | __asm__ __volatile__ ("mtspr 26, %0" :: "r" (addr)); |
| 142 | __asm__ __volatile__ ("li 4, (1 << 6)" ::: "r4"); |
| 143 | __asm__ __volatile__ ("mtspr 27, 4"); |
| 144 | __asm__ __volatile__ ("rfi"); |
| 145 | |
| 146 | #else /* CONFIG_MPC8641HPCN */ |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 147 | |
| 148 | out8(PIXIS_BASE + PIXIS_RST, 0); |
| 149 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 150 | #endif /* !CONFIG_MPC8641HPCN */ |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 151 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 152 | while (1) ; /* not reached */ |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | |
Jon Loeliger | d68e2ba | 2006-05-30 17:47:00 -0500 | [diff] [blame] | 156 | /* |
| 157 | * No generic way to do board reset. Simply call soft_reset. |
| 158 | */ |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 159 | void |
Jon Loeliger | d68e2ba | 2006-05-30 17:47:00 -0500 | [diff] [blame] | 160 | do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 161 | { |
Jason Jin | 333dd1d | 2007-10-26 18:32:00 +0800 | [diff] [blame] | 162 | #if !defined(CONFIG_MPC8641HPCN) && !defined(CONFIG_MPC8610HPCD) |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 163 | |
| 164 | #ifdef CFG_RESET_ADDRESS |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 165 | ulong addr = CFG_RESET_ADDRESS; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 166 | #else |
| 167 | /* |
| 168 | * note: when CFG_MONITOR_BASE points to a RAM address, |
| 169 | * CFG_MONITOR_BASE - sizeof (ulong) is usually a valid |
| 170 | * address. Better pick an address known to be invalid on your |
| 171 | * system and assign it to CFG_RESET_ADDRESS. |
| 172 | */ |
Jon Loeliger | e65e32e | 2006-05-31 12:44:44 -0500 | [diff] [blame] | 173 | ulong addr = CFG_MONITOR_BASE - sizeof(ulong); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 174 | #endif |
| 175 | |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 176 | /* flush and disable I/D cache */ |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 177 | __asm__ __volatile__ ("mfspr 3, 1008" ::: "r3"); |
| 178 | __asm__ __volatile__ ("ori 5, 5, 0xcc00" ::: "r5"); |
| 179 | __asm__ __volatile__ ("ori 4, 3, 0xc00" ::: "r4"); |
| 180 | __asm__ __volatile__ ("andc 5, 3, 5" ::: "r5"); |
| 181 | __asm__ __volatile__ ("sync"); |
| 182 | __asm__ __volatile__ ("mtspr 1008, 4"); |
| 183 | __asm__ __volatile__ ("isync"); |
| 184 | __asm__ __volatile__ ("sync"); |
| 185 | __asm__ __volatile__ ("mtspr 1008, 5"); |
| 186 | __asm__ __volatile__ ("isync"); |
| 187 | __asm__ __volatile__ ("sync"); |
| 188 | |
Jon Loeliger | d68e2ba | 2006-05-30 17:47:00 -0500 | [diff] [blame] | 189 | soft_restart(addr); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 190 | |
| 191 | #else /* CONFIG_MPC8641HPCN */ |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 192 | |
Haiying Wang | 57b6e9c | 2007-01-22 12:37:30 -0600 | [diff] [blame] | 193 | out8(PIXIS_BASE + PIXIS_RST, 0); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 194 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 195 | #endif /* !CONFIG_MPC8641HPCN */ |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 196 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 197 | while (1) ; /* not reached */ |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 201 | /* |
| 202 | * Get timebase clock frequency |
| 203 | */ |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 204 | unsigned long |
| 205 | get_tbclk(void) |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 206 | { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 207 | sys_info_t sys_info; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 208 | |
| 209 | get_sys_info(&sys_info); |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 210 | return (sys_info.freqSystemBus + 3L) / 4L; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 211 | } |
| 212 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 213 | |
| 214 | #if defined(CONFIG_WATCHDOG) |
| 215 | void |
| 216 | watchdog_reset(void) |
| 217 | { |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 218 | } |
| 219 | #endif /* CONFIG_WATCHDOG */ |
| 220 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 221 | |
| 222 | #if defined(CONFIG_DDR_ECC) |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 223 | void |
| 224 | dma_init(void) |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 225 | { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 226 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 227 | volatile ccsr_dma_t *dma = &immap->im_dma; |
| 228 | |
| 229 | dma->satr0 = 0x00040000; |
| 230 | dma->datr0 = 0x00040000; |
| 231 | asm("sync; isync"); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 232 | } |
| 233 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 234 | uint |
| 235 | dma_check(void) |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 236 | { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 237 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 238 | volatile ccsr_dma_t *dma = &immap->im_dma; |
| 239 | volatile uint status = dma->sr0; |
| 240 | |
| 241 | /* While the channel is busy, spin */ |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 242 | while ((status & 4) == 4) { |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 243 | status = dma->sr0; |
| 244 | } |
| 245 | |
| 246 | if (status != 0) { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 247 | printf("DMA Error: status = %x\n", status); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 248 | } |
| 249 | return status; |
| 250 | } |
| 251 | |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 252 | int |
| 253 | dma_xfer(void *dest, uint count, void *src) |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 254 | { |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 255 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 256 | volatile ccsr_dma_t *dma = &immap->im_dma; |
| 257 | |
| 258 | dma->dar0 = (uint) dest; |
| 259 | dma->sar0 = (uint) src; |
| 260 | dma->bcr0 = count; |
| 261 | dma->mr0 = 0xf000004; |
| 262 | asm("sync;isync"); |
| 263 | dma->mr0 = 0xf000005; |
| 264 | asm("sync;isync"); |
| 265 | return dma_check(); |
| 266 | } |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 267 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 268 | #endif /* CONFIG_DDR_ECC */ |
| 269 | |
| 270 | |
| 271 | #ifdef CONFIG_OF_FLAT_TREE |
Jon Loeliger | a129544 | 2006-08-22 12:06:18 -0500 | [diff] [blame] | 272 | void |
| 273 | ft_cpu_setup(void *blob, bd_t *bd) |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 274 | { |
| 275 | u32 *p; |
| 276 | ulong clock; |
| 277 | int len; |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 278 | |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 279 | clock = bd->bi_busfreq; |
| 280 | p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len); |
| 281 | if (p != NULL) |
| 282 | *p = cpu_to_be32(clock); |
| 283 | |
| 284 | p = ft_get_prop(blob, "/" OF_SOC "/serial@4500/clock-frequency", &len); |
| 285 | if (p != NULL) |
| 286 | *p = cpu_to_be32(clock); |
| 287 | |
| 288 | p = ft_get_prop(blob, "/" OF_SOC "/serial@4600/clock-frequency", &len); |
| 289 | if (p != NULL) |
| 290 | *p = cpu_to_be32(clock); |
| 291 | |
Kim Phillips | 177e58f | 2007-05-16 16:52:19 -0500 | [diff] [blame] | 292 | #if defined(CONFIG_TSEC1) |
Jon Loeliger | 58957a5 | 2006-08-03 16:17:56 -0500 | [diff] [blame] | 293 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/mac-address", &len); |
Jon Loeliger | 176f509 | 2007-04-20 14:11:38 -0500 | [diff] [blame] | 294 | if (p != NULL) |
| 295 | memcpy(p, bd->bi_enetaddr, 6); |
Jon Loeliger | abe7bd0 | 2007-04-20 14:12:26 -0500 | [diff] [blame] | 296 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len); |
| 297 | if (p) |
| 298 | memcpy(p, bd->bi_enetaddr, 6); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 299 | #endif |
Jon Loeliger | 465b9d8 | 2006-04-27 10:15:16 -0500 | [diff] [blame] | 300 | |
Kim Phillips | 177e58f | 2007-05-16 16:52:19 -0500 | [diff] [blame] | 301 | #if defined(CONFIG_TSEC2) |
Jon Loeliger | 58957a5 | 2006-08-03 16:17:56 -0500 | [diff] [blame] | 302 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/mac-address", &len); |
Jon Loeliger | 176f509 | 2007-04-20 14:11:38 -0500 | [diff] [blame] | 303 | if (p != NULL) |
| 304 | memcpy(p, bd->bi_enet1addr, 6); |
Jon Loeliger | abe7bd0 | 2007-04-20 14:12:26 -0500 | [diff] [blame] | 305 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len); |
| 306 | if (p != NULL) |
| 307 | memcpy(p, bd->bi_enet1addr, 6); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 308 | #endif |
| 309 | |
Kim Phillips | 177e58f | 2007-05-16 16:52:19 -0500 | [diff] [blame] | 310 | #if defined(CONFIG_TSEC3) |
Jon Loeliger | 58957a5 | 2006-08-03 16:17:56 -0500 | [diff] [blame] | 311 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/mac-address", &len); |
Jon Loeliger | 176f509 | 2007-04-20 14:11:38 -0500 | [diff] [blame] | 312 | if (p != NULL) |
| 313 | memcpy(p, bd->bi_enet2addr, 6); |
Jon Loeliger | abe7bd0 | 2007-04-20 14:12:26 -0500 | [diff] [blame] | 314 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/local-mac-address", &len); |
| 315 | if (p != NULL) |
| 316 | memcpy(p, bd->bi_enet2addr, 6); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 317 | #endif |
| 318 | |
Kim Phillips | 177e58f | 2007-05-16 16:52:19 -0500 | [diff] [blame] | 319 | #if defined(CONFIG_TSEC4) |
Jon Loeliger | 58957a5 | 2006-08-03 16:17:56 -0500 | [diff] [blame] | 320 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/mac-address", &len); |
Jon Loeliger | 176f509 | 2007-04-20 14:11:38 -0500 | [diff] [blame] | 321 | if (p != NULL) |
| 322 | memcpy(p, bd->bi_enet3addr, 6); |
Jon Loeliger | abe7bd0 | 2007-04-20 14:12:26 -0500 | [diff] [blame] | 323 | p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/local-mac-address", &len); |
| 324 | if (p != NULL) |
| 325 | memcpy(p, bd->bi_enet3addr, 6); |
Jon Loeliger | 5c8aa97 | 2006-04-26 17:58:56 -0500 | [diff] [blame] | 326 | #endif |
| 327 | |
| 328 | } |
| 329 | #endif |