diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/coldfire/iriver/h100/lcd-as-h100.S | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iriver/h100/lcd-as-h100.S b/firmware/target/coldfire/iriver/h100/lcd-as-h100.S new file mode 100644 index 0000000000..1605b210c1 --- /dev/null +++ b/firmware/target/coldfire/iriver/h100/lcd-as-h100.S | |||
@@ -0,0 +1,96 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 by Jens Arnold | ||
11 | * Based on the work of Alan Korr and Jörg Hohensohn | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #include "config.h" | ||
22 | #include "cpu.h" | ||
23 | |||
24 | .section .icode,"ax",@progbits | ||
25 | |||
26 | .align 2 | ||
27 | .global lcd_write_command | ||
28 | .type lcd_write_command,@function | ||
29 | |||
30 | lcd_write_command: | ||
31 | move.l (4,%sp),%d0 | ||
32 | lea MBAR2,%a1 | ||
33 | move.l #~8,%d1 | ||
34 | and.l %d1,(0xb4,%a1) | ||
35 | move.w %d0,0xf0000000 | ||
36 | rts | ||
37 | .wc_end: | ||
38 | .size lcd_write_command,.wc_end-lcd_write_command | ||
39 | |||
40 | |||
41 | .align 2 | ||
42 | .global lcd_write_command_ex | ||
43 | .type lcd_write_command_ex,@function | ||
44 | |||
45 | lcd_write_command_ex: | ||
46 | lea MBAR2,%a1 | ||
47 | |||
48 | move.l (4,%sp),%d0 /* Command */ | ||
49 | |||
50 | move.l #~8,%d1 /* Set A0 = 0 */ | ||
51 | and.l %d1,(0xb4,%a1) | ||
52 | move.w %d0,0xf0000000 /* Write to LCD */ | ||
53 | |||
54 | not.l %d1 /* Set A0 = 1 */ | ||
55 | or.l %d1,(0xb4,%a1) | ||
56 | |||
57 | move.l (8,%sp),%d0 /* Data */ | ||
58 | cmp.l #0xffffffff,%d0 /* -1? */ | ||
59 | beq.b .last | ||
60 | move.w %d0,0xf0000000 /* Write to LCD */ | ||
61 | |||
62 | move.l (12,%sp),%d0 /* Data */ | ||
63 | cmp.l #0xffffffff,%d0 /* -1? */ | ||
64 | beq.b .last | ||
65 | move.w %d0,0xf0000000 /* Write to LCD */ | ||
66 | |||
67 | .last: | ||
68 | rts | ||
69 | .wcex_end: | ||
70 | .size lcd_write_command_ex,.wcex_end-lcd_write_command_ex | ||
71 | |||
72 | |||
73 | .align 2 | ||
74 | .global lcd_write_data | ||
75 | .type lcd_write_data,@function | ||
76 | |||
77 | lcd_write_data: | ||
78 | move.l (4,%sp),%a0 /* Data pointer */ | ||
79 | move.l (8,%sp),%d0 /* Length */ | ||
80 | lea MBAR2,%a1 | ||
81 | moveq #8,%d1 | ||
82 | or.l %d1,(0xb4,%a1) | ||
83 | |||
84 | lea 0xf0000000,%a1 | ||
85 | .loop: | ||
86 | /* When running in IRAM, this loop takes 7 cycles plus the LCD write. | ||
87 | The 7 cycles are necessary to follow the LCD timing specs | ||
88 | at 140MHz */ | ||
89 | move.b (%a0)+,%d1 /* 3(1/0) */ | ||
90 | move.w %d1,(%a1) /* 1(0/1) */ | ||
91 | subq.l #1,%d0 /* 1(0/0) */ | ||
92 | nop /* 1(0/0) */ | ||
93 | bne .loop /* 2(0/0) */ | ||
94 | rts | ||
95 | .wd_end: | ||
96 | .size lcd_write_data,.wd_end-lcd_write_data | ||