diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2012-03-02 16:28:33 +0100 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2012-03-04 00:34:59 +0100 |
commit | f30043a0dbb61a5b5b61cf73bd588c7f8d966084 (patch) | |
tree | 6e81e57bb637501e7a31d768f69481ad1a79bc4f | |
parent | 4718ff9db0cd5a722da78010d0ed73bfd1dc930c (diff) | |
download | rockbox-f30043a0dbb61a5b5b61cf73bd588c7f8d966084.tar.gz rockbox-f30043a0dbb61a5b5b61cf73bd588c7f8d966084.zip |
rk27xx: add rolo_restart() rk27xx specific variant
Change-Id: Ib786a9ef6318d259ecef783becdd7c0fa6f52730
-rw-r--r-- | firmware/SOURCES | 3 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/rolo_restart.S | 69 |
2 files changed, 71 insertions, 1 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index e8b0df0c31..32fbfbb49b 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1468,7 +1468,6 @@ target/arm/s5l8702/ipod6g/piezo-ipod6g.c | |||
1468 | #if CONFIG_CPU == RK27XX | 1468 | #if CONFIG_CPU == RK27XX |
1469 | target/arm/rk27xx/kernel-rk27xx.c | 1469 | target/arm/rk27xx/kernel-rk27xx.c |
1470 | target/arm/rk27xx/system-rk27xx.c | 1470 | target/arm/rk27xx/system-rk27xx.c |
1471 | target/arm/rk27xx/timer-rk27xx.c | ||
1472 | target/arm/rk27xx/backlight-rk27xx.c | 1471 | target/arm/rk27xx/backlight-rk27xx.c |
1473 | target/arm/rk27xx/adc-rk27xx.c | 1472 | target/arm/rk27xx/adc-rk27xx.c |
1474 | target/arm/rk27xx/sd-rk27xx.c | 1473 | target/arm/rk27xx/sd-rk27xx.c |
@@ -1478,6 +1477,8 @@ target/arm/rk27xx/usb-rk27xx.c | |||
1478 | target/arm/rk27xx/lcdif-rk27xx.c | 1477 | target/arm/rk27xx/lcdif-rk27xx.c |
1479 | target/arm/rk27xx/rkw-loader.c | 1478 | target/arm/rk27xx/rkw-loader.c |
1480 | #ifndef BOOTLOADER | 1479 | #ifndef BOOTLOADER |
1480 | target/arm/rk27xx/timer-rk27xx.c | ||
1481 | target/arm/rk27xx/rolo_restart.S | ||
1481 | target/arm/rk27xx/pcm-rk27xx.c | 1482 | target/arm/rk27xx/pcm-rk27xx.c |
1482 | target/arm/rk27xx/debug-rk27xx.c | 1483 | target/arm/rk27xx/debug-rk27xx.c |
1483 | #endif | 1484 | #endif |
diff --git a/firmware/target/arm/rk27xx/rolo_restart.S b/firmware/target/arm/rk27xx/rolo_restart.S new file mode 100644 index 0000000000..19e4a1c65a --- /dev/null +++ b/firmware/target/arm/rk27xx/rolo_restart.S | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2008 by Michael Sevakis | ||
10 | * Copyright (C) 2012 by Marcin Bukat | ||
11 | * | ||
12 | * RoLo firmware restart code for rk27xx | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | #include "config.h" | ||
24 | #include "cpu.h" | ||
25 | |||
26 | /**************************************************************************** | ||
27 | * void rolo_restart(const unsigned char* source, unsigned char* dest, | ||
28 | * int length); | ||
29 | */ | ||
30 | .section .text, "ax", %progbits | ||
31 | .align 2 | ||
32 | .global rolo_restart | ||
33 | rolo_restart: | ||
34 | /* Disable cache */ | ||
35 | ldr r4, =0xefff0000 | ||
36 | ldrh r5, [r4] | ||
37 | strh r5, [r4] | ||
38 | |||
39 | adr r4, restart_copy_start | ||
40 | adr r5, restart_copy_end | ||
41 | ldr r6, =0x18200000 | ||
42 | mov r7, r6 | ||
43 | |||
44 | /* Copy stub to IRAM */ | ||
45 | 1: | ||
46 | ldr r8, [r4], #4 | ||
47 | str r8, [r7], #4 | ||
48 | cmp r5, r4 | ||
49 | bhi 1b | ||
50 | |||
51 | /* Branch to stub */ | ||
52 | bx r6 | ||
53 | |||
54 | restart_copy_start: | ||
55 | /* Trivial copy of firmware to final location | ||
56 | * this version assumes that src and dst are | ||
57 | * word aligned | ||
58 | */ | ||
59 | mov r4, r1 | ||
60 | 1: | ||
61 | subs r2, r2, #4 | ||
62 | ldr r7, [r0], #4 | ||
63 | str r7, [r4], #4 | ||
64 | bge 1b | ||
65 | |||
66 | /* Branch to destination */ | ||
67 | bx r1 | ||
68 | restart_copy_end: | ||
69 | .size rolo_restart,.-rolo_restart | ||