1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2010 by Spencer Oliver *
5 * spen@spen-soft.co.uk *
6 ***************************************************************************/
23 mov r4, #0x10000000 /* set DWPG bit */
24 str r4, [r2, #0x0] /* FLASH_CR0 */
25 str r1, [r2, #0x10] /* FLASH_AR */
26 ldr r4, [r0], #4 /* load data */
27 str r4, [r2, #0x8] /* FLASH_DR0 */
28 ldr r4, [r0], #4 /* load data */
29 str r4, [r2, #0xc] /* FLASH_DR1 */
30 mov r4, #0x90000000 /* set DWPG and WMS bits */
31 str r4, [r2, #0x0] /* FLASH_CR0 */
33 ldr r4, [r2, #0x0] /* FLASH_CR0 */
36 ldr r4, [r2, #0x14] /* FLASH_ER */
37 tst r4, #0xff /* do we have errors */
38 tsteq r4, #0x100 /* write protection set */
40 add r1, r1, #0x8 /* next 8 bytes */
41 subs r3, r3, #1 /* decrement dword count */