callout_reboot_pxa300.s

来自「QNX ADS BSP code for i.MX27 chips」· S 代码 · 共 77 行

S
77
字号
#  # Copyright 2007, QNX Software Systems. #  # Licensed under the Apache License, Version 2.0 (the "License"). You # may not reproduce, modify or distribute this software except in # compliance with the License. You may obtain a copy of the License # at: http://www.apache.org/licenses/LICENSE-2.0 #  # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTIES OF ANY KIND, either express or implied.# # This file may contain contributions from others, either as # contributors under the License or as licensors under other terms.  # Please review this entire file for other proprietary rights or license # notices, as well as the QNX Development Suite License Guide at # http://licensing.qnx.com/license-guide/ for other information.# /* * PXA specific reboot. This should be usable by any board * that uses PXA250/PXA270/PXA300.  */#include "callout.ah"/* * ----------------------------------------------------------------------- * Routine to patch callout code * * On entry: *	r0 - physical address of syspage *	r1 - virtual  address of syspage *	r2 - offset from start of syspage to start of the callout routine *	r3 - offset from start of syspage to read/write data used by callout * ----------------------------------------------------------------------- */patch_reboot:	stmdb	sp!,{r4,lr}	add		r4, r0, r2					// address of callout routine	/*	 * Map OS timer registers	 */	mov		r0, #PXA250_TIMER_SIZE	ldr		r1, Lwdreset	bl		callout_io_map	CALLOUT_PATCH	r4, r0, r1, r2, ip	ldmia	sp!,{r4,pc}Lwdreset:	.word	PXA250_TIMER_BASECALLOUT_START(reboot_pxa, 0, patch_reboot)	mov		ip,     #0x000000ff		/* OS timer base address (patched) */	orr		ip, ip, #0x0000ff00	orr		ip, ip, #0x00ff0000	orr		ip, ip, #0xff000000	ldr		r1, [ip, #0x18]	orr		r1, r1, #0x0001		/* set Watchdog Match Enable bit */	str		r1, [ip, #0x18]	/*	 * The OS timer counter wraps around several minutes of interval,	 * so set the Match Register	 */	ldr		r1, [ip, #0x10]	add		r1, r1, #0x800	add		r1, r1, #0x800	str		r1, [ip, #0x0c]loop_forever:	b		loop_foreverCALLOUT_END(reboot_pxa)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?