platform_mpc85xx.c (235932) | platform_mpc85xx.c (236097) |
---|---|
1/*- 2 * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/powerpc/booke/platform_bare.c 235932 2012-05-24 20:58:40Z marcel $"); | 28__FBSDID("$FreeBSD: head/sys/powerpc/booke/platform_bare.c 236097 2012-05-26 13:36:18Z raj $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/bus.h> 34#include <sys/pcpu.h> 35#include <sys/proc.h> 36#include <sys/smp.h> --- 31 unchanged lines hidden (view full) --- 68static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, 69 struct mem_region **avail, int *availsz); 70static u_long bare_timebase_freq(platform_t, struct cpuref *cpuref); 71static int bare_smp_first_cpu(platform_t, struct cpuref *cpuref); 72static int bare_smp_next_cpu(platform_t, struct cpuref *cpuref); 73static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); 74static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); 75 | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/bus.h> 34#include <sys/pcpu.h> 35#include <sys/proc.h> 36#include <sys/smp.h> --- 31 unchanged lines hidden (view full) --- 68static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, 69 struct mem_region **avail, int *availsz); 70static u_long bare_timebase_freq(platform_t, struct cpuref *cpuref); 71static int bare_smp_first_cpu(platform_t, struct cpuref *cpuref); 72static int bare_smp_next_cpu(platform_t, struct cpuref *cpuref); 73static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); 74static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); 75 |
76static void e500_reset(platform_t); | 76static void booke_reset(platform_t); |
77 78static platform_method_t bare_methods[] = { 79 PLATFORMMETHOD(platform_probe, bare_probe), 80 PLATFORMMETHOD(platform_mem_regions, bare_mem_regions), 81 PLATFORMMETHOD(platform_timebase_freq, bare_timebase_freq), 82 83 PLATFORMMETHOD(platform_smp_first_cpu, bare_smp_first_cpu), 84 PLATFORMMETHOD(platform_smp_next_cpu, bare_smp_next_cpu), 85 PLATFORMMETHOD(platform_smp_get_bsp, bare_smp_get_bsp), 86 PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), 87 | 77 78static platform_method_t bare_methods[] = { 79 PLATFORMMETHOD(platform_probe, bare_probe), 80 PLATFORMMETHOD(platform_mem_regions, bare_mem_regions), 81 PLATFORMMETHOD(platform_timebase_freq, bare_timebase_freq), 82 83 PLATFORMMETHOD(platform_smp_first_cpu, bare_smp_first_cpu), 84 PLATFORMMETHOD(platform_smp_next_cpu, bare_smp_next_cpu), 85 PLATFORMMETHOD(platform_smp_get_bsp, bare_smp_get_bsp), 86 PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), 87 |
88 PLATFORMMETHOD(platform_reset, e500_reset), | 88 PLATFORMMETHOD(platform_reset, booke_reset), |
89 90 { 0, 0 } 91}; 92 93static platform_def_t bare_platform = { 94 "bare metal", 95 bare_methods, 96 0 --- 205 unchanged lines hidden (view full) --- 302 return ((pc->pc_awake) ? 0 : EBUSY); 303#else 304 /* No SMP support */ 305 return (ENXIO); 306#endif 307} 308 309static void | 89 90 { 0, 0 } 91}; 92 93static platform_def_t bare_platform = { 94 "bare metal", 95 bare_methods, 96 0 --- 205 unchanged lines hidden (view full) --- 302 return ((pc->pc_awake) ? 0 : EBUSY); 303#else 304 /* No SMP support */ 305 return (ENXIO); 306#endif 307} 308 309static void |
310e500_reset(platform_t plat) | 310booke_reset(platform_t plat) |
311{ 312 313 /* 314 * Try the dedicated reset register first. 315 * If the SoC doesn't have one, we'll fall 316 * back to using the debug control register. 317 */ 318 ccsr_write4(OCP85XX_RSTCR, 2); --- 4 unchanged lines hidden (view full) --- 323 324 /* Enable Debug Interrupts in MSR. */ 325 mtmsr(mfmsr() | PSL_DE); 326 327 /* Enable debug interrupts and issue reset. */ 328 mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); 329 330 printf("Reset failed...\n"); | 311{ 312 313 /* 314 * Try the dedicated reset register first. 315 * If the SoC doesn't have one, we'll fall 316 * back to using the debug control register. 317 */ 318 ccsr_write4(OCP85XX_RSTCR, 2); --- 4 unchanged lines hidden (view full) --- 323 324 /* Enable Debug Interrupts in MSR. */ 325 mtmsr(mfmsr() | PSL_DE); 326 327 /* Enable debug interrupts and issue reset. */ 328 mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); 329 330 printf("Reset failed...\n"); |
331 while (1); | 331 while (1) 332 ; |
332} 333 | 333} 334 |