diff options
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/lcd-as-h300.S')
-rwxr-xr-x | firmware/target/coldfire/iriver/h300/lcd-as-h300.S | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/firmware/target/coldfire/iriver/h300/lcd-as-h300.S b/firmware/target/coldfire/iriver/h300/lcd-as-h300.S index c6c1c76136..ae55dfb224 100755 --- a/firmware/target/coldfire/iriver/h300/lcd-as-h300.S +++ b/firmware/target/coldfire/iriver/h300/lcd-as-h300.S | |||
@@ -22,102 +22,6 @@ | |||
22 | 22 | ||
23 | .section .icode, "ax", @progbits | 23 | .section .icode, "ax", @progbits |
24 | 24 | ||
25 | .align 2 | ||
26 | .global lcd_write_data | ||
27 | .type lcd_write_data, @function | ||
28 | |||
29 | lcd_write_data: | ||
30 | move.l (4, %sp), %a0 /* data pointer */ | ||
31 | move.l (8, %sp), %d0 /* length in words */ | ||
32 | add.l %d0, %d0 /* words -> bytes */ | ||
33 | add.l %a0, %d0 /* -> end address */ | ||
34 | lea.l 0xf0000002, %a1 /* LCD data port */ | ||
35 | |||
36 | move.l %a0, %d1 | ||
37 | btst.l #1, %d1 /* already longword aligned? */ | ||
38 | beq.s .word1_end /* yes: skip initial word copy */ | ||
39 | |||
40 | move.w (%a0)+, (%a1) /* transfer initial word */ | ||
41 | |||
42 | .word1_end: /* now longword aligned */ | ||
43 | moveq.l #28, %d1 | ||
44 | add.l %a0, %d1 | ||
45 | and.l #0xFFFFFFF0,%d1 /* %d1 = first line bound + 16 */ | ||
46 | cmp.l %d1, %d0 /* at least one full line to send? */ | ||
47 | blo.s .long2_start /* no: skip to trailing longword handling */ | ||
48 | |||
49 | lea.l (-16, %sp), %sp /* free up some registers */ | ||
50 | movem.l %d2-%d4/%a2, (%sp) | ||
51 | |||
52 | subq.l #8, %d1 | ||
53 | subq.l #8, %d1 /* %d1 = first line bound */ | ||
54 | |||
55 | cmp.l %a0, %d1 /* any leading longwords? */ | ||
56 | bls.s .long1_end /* no: skip leading long loop */ | ||
57 | |||
58 | .long1_loop: | ||
59 | move.l (%a0)+, %d2 /* read longword */ | ||
60 | swap %d2 /* send data to LCD in correct order...*/ | ||
61 | move.w %d2, (%a1) | ||
62 | swap %d2 | ||
63 | move.w %d2, (%a1) | ||
64 | cmp.l %a0, %d1 /* run %a0 up to first line bound */ | ||
65 | bhi.s .long1_loop | ||
66 | |||
67 | .long1_end: | ||
68 | move.l %d0, %a2 | ||
69 | lea.l (-14, %a2), %a2 /* %a2 = end address - 14 (one line/pass) */ | ||
70 | |||
71 | /* burst-optimised line transfers */ | ||
72 | .line_loop: | ||
73 | movem.l (%a0), %d1-%d4 /* burst-read line */ | ||
74 | lea.l (16, %a0), %a0 /* increment address */ | ||
75 | swap %d1 /* send data to LCD in correct order... */ | ||
76 | move.w %d1, (%a1) | ||
77 | swap %d1 | ||
78 | move.w %d1, (%a1) | ||
79 | swap %d2 | ||
80 | move.w %d2, (%a1) | ||
81 | swap %d2 | ||
82 | move.w %d2, (%a1) | ||
83 | swap %d3 | ||
84 | move.w %d3, (%a1) | ||
85 | swap %d3 | ||
86 | move.w %d3, (%a1) | ||
87 | swap %d4 | ||
88 | move.w %d4, (%a1) | ||
89 | swap %d4 | ||
90 | move.w %d4, (%a1) | ||
91 | cmp.l %a0, %a2 /* run %a0 up to last line bound */ | ||
92 | bhi.s .line_loop | ||
93 | |||
94 | movem.l (%sp), %d2-%d4/%a2 | ||
95 | lea.l (16, %sp), %sp /* restore registers */ | ||
96 | |||
97 | .long2_start: | ||
98 | subq.l #2, %d0 /* account for handling 2 words per loop */ | ||
99 | cmp.l %a0, %d0 /* any (trailing longwords? */ | ||
100 | bls.s .long2_end /* no: skip trailing longword loop */ | ||
101 | |||
102 | .long2_loop: | ||
103 | move.l (%a0)+, %d1 /* read longword */ | ||
104 | swap %d1 /* send data to LCD in correct order */ | ||
105 | move.w %d1, (%a1) | ||
106 | swap %d1 | ||
107 | move.w %d1, (%a1) | ||
108 | cmp.l %a0, %d0 /* run %a0 up to last long bound */ | ||
109 | bhi.s .long2_loop | ||
110 | |||
111 | .long2_end: | ||
112 | blo.s .word2_end /* no final word: skip */ | ||
113 | move.w (%a0)+, (%a1) /* transfer final word */ | ||
114 | |||
115 | .word2_end: | ||
116 | rts | ||
117 | .lcd_write_data_end: | ||
118 | .size lcd_write_data, .lcd_write_data_end - lcd_write_data | ||
119 | |||
120 | |||
121 | /* lcd_write_yuv420_lines(), based on lcd-as-x5.S | 25 | /* lcd_write_yuv420_lines(), based on lcd-as-x5.S |
122 | * | 26 | * |
123 | * See http://en.wikipedia.org/wiki/YCbCr | 27 | * See http://en.wikipedia.org/wiki/YCbCr |