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