mpc85xx.c (209908) | mpc85xx.c (212054) |
---|---|
1/*- 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/powerpc/mpc85xx/mpc85xx.c 209908 2010-07-11 21:08:29Z raj $"); | 28__FBSDID("$FreeBSD: head/sys/powerpc/mpc85xx/mpc85xx.c 212054 2010-08-31 15:27:46Z nwhitehorn $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/lock.h> 33#include <sys/mutex.h> 34#include <sys/rman.h> 35 36#include <vm/vm.h> --- 122 unchanged lines hidden (view full) --- 159 break; 160 default: 161 rv = ENXIO; 162 } 163 *trgt_mem = *trgt_io = trgt; 164 return (rv); 165} 166 | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/lock.h> 33#include <sys/mutex.h> 34#include <sys/rman.h> 35 36#include <vm/vm.h> --- 122 unchanged lines hidden (view full) --- 159 break; 160 default: 161 rv = ENXIO; 162 } 163 *trgt_mem = *trgt_io = trgt; 164 return (rv); 165} 166 |
167void 168cpu_reset(void) 169{ 170 uint32_t ver = SVR_VER(mfspr(SPR_SVR)); 171 172 if (ver == SVR_MPC8572E || ver == SVR_MPC8572 || 173 ver == SVR_MPC8548E || ver == SVR_MPC8548) 174 /* Systems with dedicated reset register */ 175 ccsr_write4(OCP85XX_RSTCR, 2); 176 else { 177 /* Clear DBCR0, disables debug interrupts and events. */ 178 mtspr(SPR_DBCR0, 0); 179 __asm __volatile("isync"); 180 181 /* Enable Debug Interrupts in MSR. */ 182 mtmsr(mfmsr() | PSL_DE); 183 184 /* Enable debug interrupts and issue reset. */ 185 mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | 186 DBCR0_RST_SYSTEM); 187 } 188 189 printf("Reset failed...\n"); 190 while (1); 191} | |