view target-utils/tf-breakin/payload.S @ 497:74610c4f10f7

target-utils: added 10 ms delay at the end of abb_power_off() The deosmification of the ABB access code (replacement of osmo_delay_ms() bogus delays with correctly-timed ones, which are significantly shorter) had one annoying side effect: when executing the poweroff command from any of the programs, one last '=' prompt character was being sent (and received by the x86 host) as the Calypso board powers off. With delays being shorter now, the abb_power_off() function was returning and the standalone program's main loop was printing its prompt before the Iota chip fully executed the switch-off sequence! I thought about inserting an endless tight loop at the end of the abb_power_off() function, but the implemented solution of a 10 ms delay is a little nicer IMO because if the DEVOFF operation doesn't happen for some reason in a manual hacking scenario, there won't be an artificial blocker in the form of a tight loop keeping us from further poking around.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 25 May 2019 20:44:05 +0000
parents e7502631a0f9
children
line wrap: on
line source

	.text
	.org	0

@ allow entry in Thumb state
	.code	16
	bx	pc
	nop

	.code	32

@ set CPSR like mot931c payload does
	msr	CPSR_c, #0xd3
@ disable the watchdog
	ldr	r1, =0xfffff802
	mov	r0, #0xf5
	strh	r0, [r1, #2]
	mov	r0, #0xa0
	strh	r0, [r1, #2]
@ MODEM UART
	ldr	r6, =0xffff5800
@ wait for any previous output to flush out
1:	ldrb	r0, [r6, #5]
	tst	r0, #0x20
	beq	1b
@ send our indication
	adr	r1, outstr
	mov	r2, #6
1:	ldrb	r0, [r1], #1
	strb	r0, [r6]
	subs	r2, r2, #1
	bne	1b
@ wait for this output to go out to the TxD pin
1:	ldrb	r0, [r6, #5]
	tst	r0, #0x40
	beq	1b
@ enable the Calypso boot ROM
	ldr	r1, =0xFFFFFB10
	mov	r2, #0x0100
	strh	r2, [r1]
@ jump to it!
	mov	pc, #0
	.ltorg
outstr:	.byte	2,2,2,'O','K',2