Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Implementation of outs{bwl} for BlackFin processors using zero overhead loops. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 3 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * Copyright 2005-2009 Analog Devices Inc. |
| 5 | * 2005 BuyWays BV |
| 6 | * Bas Vermeulen <bas@buyways.nl> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 7 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 8 | * Licensed under the GPL-2. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <linux/linkage.h> |
| 12 | |
| 13 | .align 2 |
| 14 | |
| 15 | ENTRY(_outsl) |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 16 | CC = R2 == 0; |
| 17 | IF CC JUMP 1f; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 18 | P0 = R0; /* P0 = port */ |
| 19 | P1 = R1; /* P1 = address */ |
| 20 | P2 = R2; /* P2 = count */ |
| 21 | |
| 22 | LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2; |
| 23 | .Llong_loop_s: R0 = [P1++]; |
| 24 | .Llong_loop_e: [P0] = R0; |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 25 | 1: RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 26 | ENDPROC(_outsl) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 27 | |
| 28 | ENTRY(_outsw) |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 29 | CC = R2 == 0; |
| 30 | IF CC JUMP 1f; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 31 | P0 = R0; /* P0 = port */ |
| 32 | P1 = R1; /* P1 = address */ |
| 33 | P2 = R2; /* P2 = count */ |
| 34 | |
| 35 | LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2; |
| 36 | .Lword_loop_s: R0 = W[P1++]; |
| 37 | .Lword_loop_e: W[P0] = R0; |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 38 | 1: RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 39 | ENDPROC(_outsw) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 40 | |
| 41 | ENTRY(_outsb) |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 42 | CC = R2 == 0; |
| 43 | IF CC JUMP 1f; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 44 | P0 = R0; /* P0 = port */ |
| 45 | P1 = R1; /* P1 = address */ |
| 46 | P2 = R2; /* P2 = count */ |
| 47 | |
| 48 | LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2; |
| 49 | .Lbyte_loop_s: R0 = B[P1++]; |
| 50 | .Lbyte_loop_e: B[P0] = R0; |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 51 | 1: RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 52 | ENDPROC(_outsb) |
Michael Hennerich | 5906967 | 2008-05-17 16:38:52 +0800 | [diff] [blame] | 53 | |
| 54 | ENTRY(_outsw_8) |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 55 | CC = R2 == 0; |
| 56 | IF CC JUMP 1f; |
Michael Hennerich | 5906967 | 2008-05-17 16:38:52 +0800 | [diff] [blame] | 57 | P0 = R0; /* P0 = port */ |
| 58 | P1 = R1; /* P1 = address */ |
| 59 | P2 = R2; /* P2 = count */ |
| 60 | |
| 61 | LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2; |
| 62 | .Lword8_loop_s: R1 = B[P1++]; |
| 63 | R0 = B[P1++]; |
| 64 | R0 = R0 << 8; |
| 65 | R0 = R0 + R1; |
| 66 | .Lword8_loop_e: W[P0] = R0; |
Mike Frysinger | bb7b112 | 2011-01-26 18:10:44 +0000 | [diff] [blame] | 67 | 1: RTS; |
Bryan Wu | ca56d9a | 2008-05-20 16:45:29 +0800 | [diff] [blame] | 68 | ENDPROC(_outsw_8) |