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) |
| 16 | P0 = R0; /* P0 = port */ |
| 17 | P1 = R1; /* P1 = address */ |
| 18 | P2 = R2; /* P2 = count */ |
| 19 | |
| 20 | LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2; |
| 21 | .Llong_loop_s: R0 = [P1++]; |
| 22 | .Llong_loop_e: [P0] = R0; |
| 23 | RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 24 | ENDPROC(_outsl) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 25 | |
| 26 | ENTRY(_outsw) |
| 27 | P0 = R0; /* P0 = port */ |
| 28 | P1 = R1; /* P1 = address */ |
| 29 | P2 = R2; /* P2 = count */ |
| 30 | |
| 31 | LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2; |
| 32 | .Lword_loop_s: R0 = W[P1++]; |
| 33 | .Lword_loop_e: W[P0] = R0; |
| 34 | RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 35 | ENDPROC(_outsw) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 36 | |
| 37 | ENTRY(_outsb) |
| 38 | P0 = R0; /* P0 = port */ |
| 39 | P1 = R1; /* P1 = address */ |
| 40 | P2 = R2; /* P2 = count */ |
| 41 | |
| 42 | LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2; |
| 43 | .Lbyte_loop_s: R0 = B[P1++]; |
| 44 | .Lbyte_loop_e: B[P0] = R0; |
| 45 | RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 46 | ENDPROC(_outsb) |
Michael Hennerich | 5906967 | 2008-05-17 16:38:52 +0800 | [diff] [blame] | 47 | |
| 48 | ENTRY(_outsw_8) |
| 49 | P0 = R0; /* P0 = port */ |
| 50 | P1 = R1; /* P1 = address */ |
| 51 | P2 = R2; /* P2 = count */ |
| 52 | |
| 53 | LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2; |
| 54 | .Lword8_loop_s: R1 = B[P1++]; |
| 55 | R0 = B[P1++]; |
| 56 | R0 = R0 << 8; |
| 57 | R0 = R0 + R1; |
| 58 | .Lword8_loop_e: W[P0] = R0; |
| 59 | RTS; |
Bryan Wu | ca56d9a | 2008-05-20 16:45:29 +0800 | [diff] [blame] | 60 | ENDPROC(_outsw_8) |