blob: 06a5e674401f02d64d1ccc6ae200c6e4156969fd [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Implementation of outs{bwl} for BlackFin processors using zero overhead loops.
Bryan Wu1394f032007-05-06 14:50:22 -07003 *
Robin Getz96f10502009-09-24 14:11:24 +00004 * Copyright 2005-2009 Analog Devices Inc.
5 * 2005 BuyWays BV
6 * Bas Vermeulen <bas@buyways.nl>
Bryan Wu1394f032007-05-06 14:50:22 -07007 *
Robin Getz96f10502009-09-24 14:11:24 +00008 * Licensed under the GPL-2.
Bryan Wu1394f032007-05-06 14:50:22 -07009 */
10
11#include <linux/linkage.h>
12
13.align 2
14
15ENTRY(_outsl)
Mike Frysingerbb7b1122011-01-26 18:10:44 +000016 CC = R2 == 0;
17 IF CC JUMP 1f;
Bryan Wu1394f032007-05-06 14:50:22 -070018 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 Frysingerbb7b1122011-01-26 18:10:44 +0000251: RTS;
Mike Frysinger51be24c2007-06-11 15:31:30 +080026ENDPROC(_outsl)
Bryan Wu1394f032007-05-06 14:50:22 -070027
28ENTRY(_outsw)
Mike Frysingerbb7b1122011-01-26 18:10:44 +000029 CC = R2 == 0;
30 IF CC JUMP 1f;
Bryan Wu1394f032007-05-06 14:50:22 -070031 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 Frysingerbb7b1122011-01-26 18:10:44 +0000381: RTS;
Mike Frysinger51be24c2007-06-11 15:31:30 +080039ENDPROC(_outsw)
Bryan Wu1394f032007-05-06 14:50:22 -070040
41ENTRY(_outsb)
Mike Frysingerbb7b1122011-01-26 18:10:44 +000042 CC = R2 == 0;
43 IF CC JUMP 1f;
Bryan Wu1394f032007-05-06 14:50:22 -070044 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 Frysingerbb7b1122011-01-26 18:10:44 +0000511: RTS;
Mike Frysinger51be24c2007-06-11 15:31:30 +080052ENDPROC(_outsb)
Michael Hennerich59069672008-05-17 16:38:52 +080053
54ENTRY(_outsw_8)
Mike Frysingerbb7b1122011-01-26 18:10:44 +000055 CC = R2 == 0;
56 IF CC JUMP 1f;
Michael Hennerich59069672008-05-17 16:38:52 +080057 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 Frysingerbb7b1122011-01-26 18:10:44 +0000671: RTS;
Bryan Wuca56d9a2008-05-20 16:45:29 +080068ENDPROC(_outsw_8)