diff options
Diffstat (limited to 'arch/arm/plat-mxc/ssi-fiq.S')
-rw-r--r-- | arch/arm/plat-mxc/ssi-fiq.S | 89 |
1 files changed, 50 insertions, 39 deletions
diff --git a/arch/arm/plat-mxc/ssi-fiq.S b/arch/arm/plat-mxc/ssi-fiq.S index 8397a2dd19f2..a8b93c5f29b5 100644 --- a/arch/arm/plat-mxc/ssi-fiq.S +++ b/arch/arm/plat-mxc/ssi-fiq.S | |||
@@ -34,91 +34,98 @@ | |||
34 | .global imx_ssi_fiq_rx_buffer | 34 | .global imx_ssi_fiq_rx_buffer |
35 | .global imx_ssi_fiq_tx_buffer | 35 | .global imx_ssi_fiq_tx_buffer |
36 | 36 | ||
37 | /* | ||
38 | * imx_ssi_fiq_start is _intentionally_ not marked as a function symbol | ||
39 | * using ENDPROC(). imx_ssi_fiq_start and imx_ssi_fiq_end are used to | ||
40 | * mark the function body so that it can be copied to the FIQ vector in | ||
41 | * the vectors page. imx_ssi_fiq_start should only be called as the result | ||
42 | * of an FIQ: calling it directly will not work. | ||
43 | */ | ||
37 | imx_ssi_fiq_start: | 44 | imx_ssi_fiq_start: |
38 | ldr r12, imx_ssi_fiq_base | 45 | ldr r12, .L_imx_ssi_fiq_base |
39 | 46 | ||
40 | /* TX */ | 47 | /* TX */ |
41 | ldr r11, imx_ssi_fiq_tx_buffer | 48 | ldr r13, .L_imx_ssi_fiq_tx_buffer |
42 | 49 | ||
43 | /* shall we send? */ | 50 | /* shall we send? */ |
44 | ldr r13, [r12, #SSI_SIER] | 51 | ldr r11, [r12, #SSI_SIER] |
45 | tst r13, #SSI_SIER_TFE0_EN | 52 | tst r11, #SSI_SIER_TFE0_EN |
46 | beq 1f | 53 | beq 1f |
47 | 54 | ||
48 | /* TX FIFO empty? */ | 55 | /* TX FIFO empty? */ |
49 | ldr r13, [r12, #SSI_SISR] | 56 | ldr r11, [r12, #SSI_SISR] |
50 | tst r13, #SSI_SISR_TFE0 | 57 | tst r11, #SSI_SISR_TFE0 |
51 | beq 1f | 58 | beq 1f |
52 | 59 | ||
53 | mov r10, #0x10000 | 60 | mov r10, #0x10000 |
54 | sub r10, #1 | 61 | sub r10, #1 |
55 | and r10, r10, r8 /* r10: current buffer offset */ | 62 | and r10, r10, r8 /* r10: current buffer offset */ |
56 | 63 | ||
57 | add r11, r11, r10 | 64 | add r13, r13, r10 |
58 | 65 | ||
59 | ldrh r13, [r11] | 66 | ldrh r11, [r13] |
60 | strh r13, [r12, #SSI_STX0] | 67 | strh r11, [r12, #SSI_STX0] |
61 | 68 | ||
62 | ldrh r13, [r11, #2] | 69 | ldrh r11, [r13, #2] |
63 | strh r13, [r12, #SSI_STX0] | 70 | strh r11, [r12, #SSI_STX0] |
64 | 71 | ||
65 | ldrh r13, [r11, #4] | 72 | ldrh r11, [r13, #4] |
66 | strh r13, [r12, #SSI_STX0] | 73 | strh r11, [r12, #SSI_STX0] |
67 | 74 | ||
68 | ldrh r13, [r11, #6] | 75 | ldrh r11, [r13, #6] |
69 | strh r13, [r12, #SSI_STX0] | 76 | strh r11, [r12, #SSI_STX0] |
70 | 77 | ||
71 | add r10, #8 | 78 | add r10, #8 |
72 | lsr r13, r8, #16 /* r13: buffer size */ | 79 | lsr r11, r8, #16 /* r11: buffer size */ |
73 | cmp r10, r13 | 80 | cmp r10, r11 |
74 | lslgt r8, r13, #16 | 81 | lslgt r8, r11, #16 |
75 | addle r8, #8 | 82 | addle r8, #8 |
76 | 1: | 83 | 1: |
77 | /* RX */ | 84 | /* RX */ |
78 | 85 | ||
79 | /* shall we receive? */ | 86 | /* shall we receive? */ |
80 | ldr r13, [r12, #SSI_SIER] | 87 | ldr r11, [r12, #SSI_SIER] |
81 | tst r13, #SSI_SIER_RFF0_EN | 88 | tst r11, #SSI_SIER_RFF0_EN |
82 | beq 1f | 89 | beq 1f |
83 | 90 | ||
84 | /* RX FIFO full? */ | 91 | /* RX FIFO full? */ |
85 | ldr r13, [r12, #SSI_SISR] | 92 | ldr r11, [r12, #SSI_SISR] |
86 | tst r13, #SSI_SISR_RFF0 | 93 | tst r11, #SSI_SISR_RFF0 |
87 | beq 1f | 94 | beq 1f |
88 | 95 | ||
89 | ldr r11, imx_ssi_fiq_rx_buffer | 96 | ldr r13, .L_imx_ssi_fiq_rx_buffer |
90 | 97 | ||
91 | mov r10, #0x10000 | 98 | mov r10, #0x10000 |
92 | sub r10, #1 | 99 | sub r10, #1 |
93 | and r10, r10, r9 /* r10: current buffer offset */ | 100 | and r10, r10, r9 /* r10: current buffer offset */ |
94 | 101 | ||
95 | add r11, r11, r10 | 102 | add r13, r13, r10 |
96 | 103 | ||
97 | ldr r13, [r12, #SSI_SACNT] | 104 | ldr r11, [r12, #SSI_SACNT] |
98 | tst r13, #SSI_SACNT_AC97EN | 105 | tst r11, #SSI_SACNT_AC97EN |
99 | 106 | ||
100 | ldr r13, [r12, #SSI_SRX0] | 107 | ldr r11, [r12, #SSI_SRX0] |
101 | strh r13, [r11] | 108 | strh r11, [r13] |
102 | 109 | ||
103 | ldr r13, [r12, #SSI_SRX0] | 110 | ldr r11, [r12, #SSI_SRX0] |
104 | strh r13, [r11, #2] | 111 | strh r11, [r13, #2] |
105 | 112 | ||
106 | /* dummy read to skip slot 12 */ | 113 | /* dummy read to skip slot 12 */ |
107 | ldrne r13, [r12, #SSI_SRX0] | 114 | ldrne r11, [r12, #SSI_SRX0] |
108 | 115 | ||
109 | ldr r13, [r12, #SSI_SRX0] | 116 | ldr r11, [r12, #SSI_SRX0] |
110 | strh r13, [r11, #4] | 117 | strh r11, [r13, #4] |
111 | 118 | ||
112 | ldr r13, [r12, #SSI_SRX0] | 119 | ldr r11, [r12, #SSI_SRX0] |
113 | strh r13, [r11, #6] | 120 | strh r11, [r13, #6] |
114 | 121 | ||
115 | /* dummy read to skip slot 12 */ | 122 | /* dummy read to skip slot 12 */ |
116 | ldrne r13, [r12, #SSI_SRX0] | 123 | ldrne r11, [r12, #SSI_SRX0] |
117 | 124 | ||
118 | add r10, #8 | 125 | add r10, #8 |
119 | lsr r13, r9, #16 /* r13: buffer size */ | 126 | lsr r11, r9, #16 /* r11: buffer size */ |
120 | cmp r10, r13 | 127 | cmp r10, r11 |
121 | lslgt r9, r13, #16 | 128 | lslgt r9, r11, #16 |
122 | addle r9, #8 | 129 | addle r9, #8 |
123 | 130 | ||
124 | 1: | 131 | 1: |
@@ -126,11 +133,15 @@ imx_ssi_fiq_start: | |||
126 | subs pc, lr, #4 | 133 | subs pc, lr, #4 |
127 | 134 | ||
128 | .align | 135 | .align |
136 | .L_imx_ssi_fiq_base: | ||
129 | imx_ssi_fiq_base: | 137 | imx_ssi_fiq_base: |
130 | .word 0x0 | 138 | .word 0x0 |
139 | .L_imx_ssi_fiq_rx_buffer: | ||
131 | imx_ssi_fiq_rx_buffer: | 140 | imx_ssi_fiq_rx_buffer: |
132 | .word 0x0 | 141 | .word 0x0 |
142 | .L_imx_ssi_fiq_tx_buffer: | ||
133 | imx_ssi_fiq_tx_buffer: | 143 | imx_ssi_fiq_tx_buffer: |
134 | .word 0x0 | 144 | .word 0x0 |
145 | .L_imx_ssi_fiq_end: | ||
135 | imx_ssi_fiq_end: | 146 | imx_ssi_fiq_end: |
136 | 147 | ||