1
2
3
4
5
6
7
8
9#include <linux/linkage.h>
10#include <asm/assembler.h>
11
12
13
14
15
16
17#define SSI_STX0 0x00
18#define SSI_SRX0 0x08
19#define SSI_SISR 0x14
20#define SSI_SIER 0x18
21#define SSI_SACNT 0x38
22
23#define SSI_SACNT_AC97EN (1 << 0)
24
25#define SSI_SIER_TFE0_EN (1 << 0)
26#define SSI_SISR_TFE0 (1 << 0)
27#define SSI_SISR_RFF0 (1 << 2)
28#define SSI_SIER_RFF0_EN (1 << 2)
29
30 .text
31 .global imx_ssi_fiq_start
32 .global imx_ssi_fiq_end
33 .global imx_ssi_fiq_base
34 .global imx_ssi_fiq_rx_buffer
35 .global imx_ssi_fiq_tx_buffer
36
37
38
39
40
41
42
43
44imx_ssi_fiq_start:
45 ldr r12, .L_imx_ssi_fiq_base
46
47
48 ldr r13, .L_imx_ssi_fiq_tx_buffer
49
50
51 ldr r11, [r12,
52 tst r11,
53 beq 1f
54
55
56 ldr r11, [r12,
57 tst r11,
58 beq 1f
59
60 mov r10,
61 sub r10,
62 and r10, r10, r8
63
64 add r13, r13, r10
65
66 ldrh r11, [r13]
67 strh r11, [r12,
68
69 ldrh r11, [r13,
70 strh r11, [r12,
71
72 ldrh r11, [r13,
73 strh r11, [r12,
74
75 ldrh r11, [r13,
76 strh r11, [r12,
77
78 add r10,
79 lsr r11, r8,
80 cmp r10, r11
81 lslgt r8, r11,
82 addle r8,
831:
84
85
86
87 ldr r11, [r12,
88 tst r11,
89 beq 1f
90
91
92 ldr r11, [r12,
93 tst r11,
94 beq 1f
95
96 ldr r13, .L_imx_ssi_fiq_rx_buffer
97
98 mov r10,
99 sub r10,
100 and r10, r10, r9
101
102 add r13, r13, r10
103
104 ldr r11, [r12,
105 tst r11,
106
107 ldr r11, [r12,
108 strh r11, [r13]
109
110 ldr r11, [r12,
111 strh r11, [r13,
112
113
114 ldrne r11, [r12,
115
116 ldr r11, [r12,
117 strh r11, [r13,
118
119 ldr r11, [r12,
120 strh r11, [r13,
121
122
123 ldrne r11, [r12,
124
125 add r10,
126 lsr r11, r9,
127 cmp r10, r11
128 lslgt r9, r11,
129 addle r9,
130
1311:
132 @ return from FIQ
133 subs pc, lr,
134
135 .align
136.L_imx_ssi_fiq_base:
137imx_ssi_fiq_base:
138 .word 0x0
139.L_imx_ssi_fiq_rx_buffer:
140imx_ssi_fiq_rx_buffer:
141 .word 0x0
142.L_imx_ssi_fiq_tx_buffer:
143imx_ssi_fiq_tx_buffer:
144 .word 0x0
145.L_imx_ssi_fiq_end:
146imx_ssi_fiq_end:
147
148