From dc37a517739907accf78817778b56b6031e69e7f Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 22 Feb 1998 00:05:00 +0000 Subject: [PATCH] In the future we may want to branch somewhere other than zero when reseting the CPU. Rename the boot0() function to cpu_reset() and provide a variable to hold the cpu reset address. --- sys/arch/arm32/arm32/locore.S | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/arch/arm32/arm32/locore.S b/sys/arch/arm32/arm32/locore.S index ea2f42bacc4d..9095f6bc17ba 100644 --- a/sys/arch/arm32/arm32/locore.S +++ b/sys/arch/arm32/arm32/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.21 1997/10/14 09:54:36 mark Exp $ */ +/* $NetBSD: locore.S,v 1.22 1998/02/22 00:05:00 mark Exp $ */ /* * Copyright (C) 1994-1997 Mark Brinicombe @@ -213,13 +213,16 @@ Wfiq: Lcpufuncs: .word _cpufuncs -ENTRY(boot0) +ENTRY(cpu_reset) mrs r2, cpsr_all bic r2, r2, #(PSR_MODE) orr r2, r2, #(PSR_SVC32_MODE) orr r2, r2, #(I32_bit | F32_bit) msr cpsr_all, r2 + ldr r4, Lcpu_reset_address + ldr r4, [r4] + ldr r0, Lcpufuncs add lr, pc, #Lboot_cache_purged - . - 8 ldr pc, [r0, #CF_CACHE_PURGE_ID] @@ -232,8 +235,16 @@ Lboot_cache_purged: */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) mcr 15, 0, r0, c1, c0, 0 - mov pc, #0 + mov pc, r4 + /* + * _cpu_reset_address contains the address to branch to, to complete + * the cpu reset after turning the MMU off + * This variable is provided by the hardware specific code + */ + +Lcpu_reset_address: + .word _cpu_reset_address /* Debug routine to print trace back information from stack */