summaryrefslogtreecommitdiffstats
path: root/drivers/acorn
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
commit7fd36ebeeec9244a7431bb010e6e3c5e4848a0d5 (patch)
tree5fb03a9aafdd1cec5f4f6ff7f1873174cb89b66c /drivers/acorn
parentba2dacab305c598cd4c34a604f8e276bf5bab5ff (diff)
Merge with Linux 2.3.99-pre8. Linus must hate me, too man patches ;-)
Diffstat (limited to 'drivers/acorn')
-rw-r--r--drivers/acorn/scsi/arxescsi.c83
-rw-r--r--drivers/acorn/scsi/arxescsi.h2
-rw-r--r--drivers/acorn/scsi/cumana_2.h2
3 files changed, 61 insertions, 26 deletions
diff --git a/drivers/acorn/scsi/arxescsi.c b/drivers/acorn/scsi/arxescsi.c
index 27e5b266a..2e04df6ca 100644
--- a/drivers/acorn/scsi/arxescsi.c
+++ b/drivers/acorn/scsi/arxescsi.c
@@ -1,7 +1,7 @@
/*
* linux/arch/arm/drivers/scsi/arxescsi.c
*
- * Copyright (C) 1997-2000 Russell King
+ * Copyright (C) 1997-2000 Russell King, Stefan Hanske
*
* This driver is based on experimentation. Hence, it may have made
* assumptions about the particular card that I have available, and
@@ -11,9 +11,11 @@
* 30-08-1997 RMK 0.0.0 Created, READONLY version as cumana_2.c
* 22-01-1998 RMK 0.0.1 Updated to 2.1.80
* 15-04-1998 RMK 0.0.1 Only do PIO if FAS216 will allow it.
- * 11-06-1998 0.0.2 Changed to support ARXE 16-bit SCSI card, enabled writing
- * by Stefan Hanske
- * 02-04-2000 RMK 0.0.3 Updated for new error handling code.
+ * 11-06-1998 SH 0.0.2 Changed to support ARXE 16-bit SCSI card
+ * enabled writing
+ * 01-01-2000 SH 0.1.0 Added *real* pseudo dma writing
+ * (arxescsi_pseudo_dma_write)
+ * 02-04-2000 RMK 0.1.1 Updated for new error handling code.
*/
#include <linux/module.h>
@@ -54,8 +56,8 @@
* Version
*/
#define VER_MAJOR 0
-#define VER_MINOR 0
-#define VER_PATCH 3
+#define VER_MINOR 1
+#define VER_PATCH 1
static struct expansion_card *ecs[MAX_ECARDS];
@@ -115,6 +117,33 @@ static __inline__ void putw(unsigned int address, unsigned int reg, unsigned lon
: "r" (value), "r" (address), "r" (reg) );
}
+void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io)
+{
+ __asm__ __volatile__(
+ " stmdb sp!, {r0-r12}\n"
+ " mov r3, %0\n"
+ " mov r1, %1\n"
+ " add r2, r1, #512\n"
+ " mov r4, #256\n"
+ ".loop_1: ldmia r3!, {r6, r8, r10, r12}\n"
+ " mov r5, r6, lsl #16\n"
+ " mov r7, r8, lsl #16\n"
+ ".loop_2: ldrb r0, [r1, #1536]\n"
+ " tst r0, #1\n"
+ " beq .loop_2\n"
+ " stmia r2, {r5-r8}\n\t"
+ " mov r9, r10, lsl #16\n"
+ " mov r11, r12, lsl #16\n"
+ ".loop_3: ldrb r0, [r1, #1536]\n"
+ " tst r0, #1\n"
+ " beq .loop_3\n"
+ " stmia r2, {r9-r12}\n"
+ " subs r4, r4, #16\n"
+ " bne .loop_1\n"
+ " ldmia sp!, {r0-r12}\n"
+ :
+ : "r" (addr), "r" (io) );
+}
/*
* Function: int arxescsi_dma_pseudo(host, SCpnt, direction, transfer)
@@ -136,26 +165,36 @@ void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
io = __ioaddr(host->io_port);
if (direction == DMA_OUT) {
- while (length > 0) {
- unsigned long word;
-
-
- word = *addr | *(addr + 1) << 8;
- if (getb(io, 4) & STAT_INT)
+ unsigned int word;
+ while (length > 256) {
+ if (getb(io, 4) & STAT_INT) {
+ error=1;
break;
+ }
+ arxescsi_pseudo_dma_write(addr, io);
+ addr += 256;
+ length -= 256;
+ }
+
+ if (!error)
+ while (length > 0) {
+ if (getb(io, 4) & STAT_INT)
+ break;
+
+ if (!(getb(io, 48) & CSTATUS_IRQ))
+ continue;
- if (!(getb(io, 48) & CSTATUS_IRQ))
- continue;
+ word = *addr | *(addr + 1) << 8;
- putw(io, 16, word);
- if (length > 1) {
- addr += 2;
- length -= 2;
- } else {
- addr += 1;
- length -= 1;
+ putw(io, 16, word);
+ if (length > 1) {
+ addr += 2;
+ length -= 2;
+ } else {
+ addr += 1;
+ length -= 1;
+ }
}
- }
}
else {
if (transfer && (transfer & 255)) {
diff --git a/drivers/acorn/scsi/arxescsi.h b/drivers/acorn/scsi/arxescsi.h
index dd97233ae..b95c9340a 100644
--- a/drivers/acorn/scsi/arxescsi.h
+++ b/drivers/acorn/scsi/arxescsi.h
@@ -41,9 +41,7 @@ extern int arxescsi_proc_info (char *buffer, char **start, off_t offset,
#include <scsi/scsicam.h>
-#ifndef HOSTS_C
#include "fas216.h"
-#endif
#define ARXEScsi { \
proc_info: arxescsi_proc_info, \
diff --git a/drivers/acorn/scsi/cumana_2.h b/drivers/acorn/scsi/cumana_2.h
index 48ac695b7..ec63eb347 100644
--- a/drivers/acorn/scsi/cumana_2.h
+++ b/drivers/acorn/scsi/cumana_2.h
@@ -39,9 +39,7 @@ extern int cumanascsi_2_proc_info (char *buffer, char **start, off_t offset,
#include <scsi/scsicam.h>
-#ifndef HOSTS_C
#include "fas216.h"
-#endif
#define CUMANASCSI_2 { \
proc_info: cumanascsi_2_proc_info, \