diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/samsung/yh920/lcd-as-yh920.S | 168 | ||||
-rw-r--r-- | firmware/target/arm/samsung/yh920/lcd-yh920.c | 11 |
2 files changed, 172 insertions, 7 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 | |||
33 | lcd_write_data: | ||
34 | ldr r12, =LCD1_BASE | ||
35 | |||
36 | .loop: | ||
37 | ldrb r2, [r0], #1 | ||
38 | |||
39 | 1: | ||
40 | ldr r3, [r12] | ||
41 | tst r3, #LCD1_BUSY_MASK | ||
42 | bne 1b | ||
43 | str r2, [r12, #0x10] | ||
44 | |||
45 | ldrb r2, [r0], #1 | ||
46 | 1: | ||
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 | |||
62 | lcd_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 | |||
72 | 1: | ||
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] | ||
80 | 1: | ||
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 | |||
113 | lcd_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 | |||
136 | 1: | ||
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 | |||
157 | 1: | ||
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 | |||
diff --git a/firmware/target/arm/samsung/yh920/lcd-yh920.c b/firmware/target/arm/samsung/yh920/lcd-yh920.c index fe64728e21..9b8e8185ab 100644 --- a/firmware/target/arm/samsung/yh920/lcd-yh920.c +++ b/firmware/target/arm/samsung/yh920/lcd-yh920.c | |||
@@ -52,6 +52,9 @@ | |||
52 | #define LCD_CNTL_COLUMN 0x13 | 52 | #define LCD_CNTL_COLUMN 0x13 |
53 | #define LCD_CNTL_DATA_WRITE 0x1d | 53 | #define LCD_CNTL_DATA_WRITE 0x1d |
54 | 54 | ||
55 | /*** shared semi-private declarations ***/ | ||
56 | extern const unsigned char lcd_dibits[16] ICONST_ATTR; | ||
57 | |||
55 | /* lcd commands */ | 58 | /* lcd commands */ |
56 | static void lcd_send_data(unsigned byte) | 59 | static void lcd_send_data(unsigned byte) |
57 | { | 60 | { |
@@ -182,8 +185,6 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | |||
182 | (void)bheight; | 185 | (void)bheight; |
183 | (void)stride; | 186 | (void)stride; |
184 | 187 | ||
185 | #if 0 | ||
186 | /* This is from the h100 lcd code, perhaps we can adapt */ | ||
187 | const unsigned char *src, *src_end; | 188 | const unsigned char *src, *src_end; |
188 | unsigned char *dst_u, *dst_l; | 189 | unsigned char *dst_u, *dst_l; |
189 | static unsigned char upper[LCD_WIDTH] IBSS_ATTR; | 190 | static unsigned char upper[LCD_WIDTH] IBSS_ATTR; |
@@ -219,11 +220,10 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | |||
219 | 220 | ||
220 | data += stride; | 221 | data += stride; |
221 | } | 222 | } |
222 | #endif | ||
223 | } | 223 | } |
224 | 224 | ||
225 | /* Helper function for lcd_grey_phase_blit(). */ | 225 | /* Helper function for lcd_grey_phase_blit(). */ |
226 | /* void lcd_grey_data(unsigned char *values, unsigned char *phases, int count); */ | 226 | void lcd_grey_data(unsigned char *values, unsigned char *phases, int count); |
227 | 227 | ||
228 | /* Performance function that works with an external buffer | 228 | /* Performance function that works with an external buffer |
229 | note that by and bheight are in 4-pixel units! */ | 229 | note that by and bheight are in 4-pixel units! */ |
@@ -238,8 +238,6 @@ void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, | |||
238 | (void)bheight; | 238 | (void)bheight; |
239 | (void)stride; | 239 | (void)stride; |
240 | 240 | ||
241 | #if 0 | ||
242 | /* This is from the h100 lcd code, perhaps we can adapt */ | ||
243 | stride <<= 2; /* 4 pixels per block */ | 241 | stride <<= 2; /* 4 pixels per block */ |
244 | while (bheight--) | 242 | while (bheight--) |
245 | { | 243 | { |
@@ -250,7 +248,6 @@ void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, | |||
250 | values += stride; | 248 | values += stride; |
251 | phases += stride; | 249 | phases += stride; |
252 | } | 250 | } |
253 | #endif | ||
254 | } | 251 | } |
255 | 252 | ||
256 | /* Update a fraction of the display. */ | 253 | /* Update a fraction of the display. */ |