mirror of
https://git.code.sf.net/p/openocd/code
synced 2024-11-25 16:56:30 +00:00
a126229dff
Replace the GPLv2-or-later boilerplate with the SPDX tag. The SPDX tag on files *.c is incorrect, as it should use the C99 single line comment using '//'. But current checkpatch doesn't allow C99 comments, so keep using standard C comments, by now. Change-Id: I380d552940f1c405309a3346454251c0e80b5a45 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7159 Tested-by: jenkins
44 lines
1021 B
ArmAsm
44 lines
1021 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/***************************************************************************
|
|
* Copyright (C) 2010 by Spencer Oliver *
|
|
* spen@spen-soft.co.uk *
|
|
***************************************************************************/
|
|
|
|
.text
|
|
.arm
|
|
.arch armv5t
|
|
|
|
.section .init
|
|
/*
|
|
r0 source address (in)
|
|
r1 target address (in)
|
|
r2 word count (in)
|
|
r3 result (out)
|
|
*/
|
|
|
|
write:
|
|
bic r4, r1, #3 /* word address */
|
|
mov r3, #0x40 /* write command */
|
|
strh r3, [r4, #0]
|
|
ldrh r3, [r0], #2 /* read data */
|
|
strh r3, [r1], #2 /* write data */
|
|
mov r3, #0x70 /* status command */
|
|
strh r3, [r4, #0]
|
|
busy:
|
|
ldrb r3, [r4, #0] /* status */
|
|
tst r3, #0x80
|
|
beq busy
|
|
mov r5, #0x50 /* clear status command */
|
|
strh r5, [r4, #0]
|
|
mov r5, #0xFF /* read array */
|
|
strh r5, [r4, #0]
|
|
tst r3, #0x12
|
|
bne exit
|
|
subs r2, r2, #1 /* decrement word count */
|
|
bne write
|
|
exit:
|
|
bkpt #0
|
|
|
|
.end
|