diff options
| author | Aaron Wu <aaron.wu@analog.com> | 2018-03-15 06:50:11 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2018-03-26 09:56:37 -0400 |
| commit | dabad54949930844d237af4b55c14eaff829c888 (patch) | |
| tree | b6926e97e750e913bed9851cea058a63d670064d /drivers/misc/echo/echo.c | |
| parent | 64f5fdd951d5e1558d355aefbe661739eef0c8e4 (diff) | |
misc: Remove Blackfin DSP echo support
Remove Blackfin DSP echo support
Signed-off-by: Aaron Wu <aaron.wu@analog.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/misc/echo/echo.c')
| -rw-r--r-- | drivers/misc/echo/echo.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/drivers/misc/echo/echo.c b/drivers/misc/echo/echo.c index 9597e9523cac..8a5adc0d2e88 100644 --- a/drivers/misc/echo/echo.c +++ b/drivers/misc/echo/echo.c | |||
| @@ -115,78 +115,6 @@ | |||
| 115 | 115 | ||
| 116 | /* adapting coeffs using the traditional stochastic descent (N)LMS algorithm */ | 116 | /* adapting coeffs using the traditional stochastic descent (N)LMS algorithm */ |
| 117 | 117 | ||
| 118 | #ifdef __bfin__ | ||
| 119 | static inline void lms_adapt_bg(struct oslec_state *ec, int clean, int shift) | ||
| 120 | { | ||
| 121 | int i; | ||
| 122 | int offset1; | ||
| 123 | int offset2; | ||
| 124 | int factor; | ||
| 125 | int exp; | ||
| 126 | int16_t *phist; | ||
| 127 | int n; | ||
| 128 | |||
| 129 | if (shift > 0) | ||
| 130 | factor = clean << shift; | ||
| 131 | else | ||
| 132 | factor = clean >> -shift; | ||
| 133 | |||
| 134 | /* Update the FIR taps */ | ||
| 135 | |||
| 136 | offset2 = ec->curr_pos; | ||
| 137 | offset1 = ec->taps - offset2; | ||
| 138 | phist = &ec->fir_state_bg.history[offset2]; | ||
| 139 | |||
| 140 | /* st: and en: help us locate the assembler in echo.s */ | ||
| 141 | |||
| 142 | /* asm("st:"); */ | ||
| 143 | n = ec->taps; | ||
| 144 | for (i = 0; i < n; i++) { | ||
| 145 | exp = *phist++ * factor; | ||
| 146 | ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); | ||
| 147 | } | ||
| 148 | /* asm("en:"); */ | ||
| 149 | |||
| 150 | /* Note the asm for the inner loop above generated by Blackfin gcc | ||
| 151 | 4.1.1 is pretty good (note even parallel instructions used): | ||
| 152 | |||
| 153 | R0 = W [P0++] (X); | ||
| 154 | R0 *= R2; | ||
| 155 | R0 = R0 + R3 (NS) || | ||
| 156 | R1 = W [P1] (X) || | ||
| 157 | nop; | ||
| 158 | R0 >>>= 15; | ||
| 159 | R0 = R0 + R1; | ||
| 160 | W [P1++] = R0; | ||
| 161 | |||
| 162 | A block based update algorithm would be much faster but the | ||
| 163 | above can't be improved on much. Every instruction saved in | ||
| 164 | the loop above is 2 MIPs/ch! The for loop above is where the | ||
| 165 | Blackfin spends most of it's time - about 17 MIPs/ch measured | ||
| 166 | with speedtest.c with 256 taps (32ms). Write-back and | ||
| 167 | Write-through cache gave about the same performance. | ||
| 168 | */ | ||
| 169 | } | ||
| 170 | |||
| 171 | /* | ||
| 172 | IDEAS for further optimisation of lms_adapt_bg(): | ||
| 173 | |||
| 174 | 1/ The rounding is quite costly. Could we keep as 32 bit coeffs | ||
| 175 | then make filter pluck the MS 16-bits of the coeffs when filtering? | ||
| 176 | However this would lower potential optimisation of filter, as I | ||
| 177 | think the dual-MAC architecture requires packed 16 bit coeffs. | ||
| 178 | |||
| 179 | 2/ Block based update would be more efficient, as per comments above, | ||
| 180 | could use dual MAC architecture. | ||
| 181 | |||
| 182 | 3/ Look for same sample Blackfin LMS code, see if we can get dual-MAC | ||
| 183 | packing. | ||
| 184 | |||
| 185 | 4/ Execute the whole e/c in a block of say 20ms rather than sample | ||
| 186 | by sample. Processing a few samples every ms is inefficient. | ||
| 187 | */ | ||
| 188 | |||
| 189 | #else | ||
| 190 | static inline void lms_adapt_bg(struct oslec_state *ec, int clean, int shift) | 118 | static inline void lms_adapt_bg(struct oslec_state *ec, int clean, int shift) |
| 191 | { | 119 | { |
| 192 | int i; | 120 | int i; |
| @@ -215,7 +143,6 @@ static inline void lms_adapt_bg(struct oslec_state *ec, int clean, int shift) | |||
| 215 | ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); | 143 | ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); |
| 216 | } | 144 | } |
| 217 | } | 145 | } |
| 218 | #endif | ||
| 219 | 146 | ||
| 220 | static inline int top_bit(unsigned int bits) | 147 | static inline int top_bit(unsigned int bits) |
| 221 | { | 148 | { |
