summaryrefslogtreecommitdiff
path: root/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/samsung/yh920/lcd-as-yh920.S')
-rw-r--r--firmware/target/arm/samsung/yh920/lcd-as-yh920.S168
1 files changed, 168 insertions, 0 deletions
diff --git a/firmware/target/arm/samsung/yh920/lcd-as-yh920.S b/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
new file mode 100644
index 0000000000..93beec4673
--- /dev/null
+++ b/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
@@ -0,0 +1,168 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Jens Arnold
11 * Modified from ipod/lcd-as-gray.S for YH920 by Rafaël Carré
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "cpu.h"
25
26 .text
27 .align 2
28
29
30 .global lcd_write_data
31 .type lcd_write_data,%function
32
33lcd_write_data:
34 ldr r12, =LCD1_BASE
35
36.loop:
37 ldrb r2, [r0], #1
38
391:
40 ldr r3, [r12]
41 tst r3, #LCD1_BUSY_MASK
42 bne 1b
43 str r2, [r12, #0x10]
44
45 ldrb r2, [r0], #1
461:
47 ldr r3, [r12]
48 tst r3, #LCD1_BUSY_MASK
49 bne 1b
50 str r2, [r12, #0x10]
51
52 subs r1, r1, #1
53 bne .loop
54
55 bx lr
56 .size lcd_write_data,.-lcd_write_data
57
58
59 .global lcd_mono_data
60 .type lcd_mono_data,%function
61
62lcd_mono_data:
63 stmfd sp!, {r4, lr}
64 ldr lr, =LCD1_BASE
65 ldr r12, =lcd_dibits
66
67.mloop:
68 ldrb r2, [r0], #1
69 mov r3, r2, lsr #4
70 ldrb r4, [r12, r3]
71
721:
73 ldr r3, [lr]
74 tst r3, #LCD1_BUSY_MASK
75 bne 1b
76 str r4, [lr, #0x10]
77
78 and r3, r2, #0x0f
79 ldrb r4, [r12, r3]
801:
81 ldr r3, [lr]
82 tst r3, #LCD1_BUSY_MASK
83 bne 1b
84 str r4, [lr, #0x10]
85
86 subs r1, r1, #1
87 bne .mloop
88
89 ldmfd sp!, {r4, pc}
90
91 .size lcd_mono_data,.-lcd_mono_data
92
93
94 .global lcd_grey_data
95 .type lcd_grey_data,%function
96
97/* A high performance function to write grey phase data to the display,
98 * one or multiple pixels.
99 *
100 * Arguments:
101 * r0 - pixel value data address
102 * r1 - pixel phase data address
103 * r2 - pixel block count
104 *
105 * Register usage:
106 * r3/r4 - current block of phases
107 * r5/r6 - current block of values
108 * r7 - lcd data accumulator
109 * r8 - phase signs mask
110 * lr - lcd bridge address
111 */
112
113lcd_grey_data:
114 stmfd sp!, {r4-r7, lr}
115 mov r12, #0x80
116 orr r12, r12, r12, lsl #8
117 orr r12, r12, r12, lsl #16
118 ldr lr, =LCD1_BASE
119
120.greyloop:
121 ldmia r1, {r3-r4} /* Fetch 8 pixel phases */
122 ldmia r0!, {r5-r6} /* Fetch 8 pixel values */
123
124 mov r7, #0
125 tst r3, #0x80
126 orreq r7, r7, #0xc0
127 tst r3, #0x8000
128 orreq r7, r7, #0x30
129 tst r3, #0x800000
130 orreq r7, r7, #0x0c
131 tst r3, #0x80000000
132 orreq r7, r7, #0x03
133 bic r3, r3, r12
134 add r3, r3, r5
135
1361:
137 ldr r5, [lr]
138 tst r5, #LCD1_BUSY_MASK
139 bne 1b
140
141 str r7, [lr, #0x10]
142 mov r7, #0
143
144 tst r4, #0x80
145 orreq r7, r7, #0xc0
146 tst r4, #0x8000
147 orreq r7, r7, #0x30
148 tst r4, #0x800000
149 orreq r7, r7, #0x0c
150 tst r4, #0x80000000
151 orreq r7, r7, #0x03
152 bic r4, r4, r12
153 add r4, r4, r6
154
155 stmia r1!, {r3-r4}
156
1571:
158 ldr r5, [lr]
159 tst r5, #LCD1_BUSY_MASK
160 bne 1b
161 str r7, [lr, #0x10]
162
163 subs r2, r2, #1
164 bne .greyloop
165
166 ldmfd sp!, {r4-r7, pc}
167 .size lcd_grey_data,.-lcd_grey_data
168