Commit 4f160f84 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5

into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-rmk
parents fc983daf 3e7b7c35
...@@ -411,7 +411,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -411,7 +411,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
return ret; return ret;
} }
static void __devexit arxescsi_release(struct expansion_card *ec) static void __devexit arxescsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
......
...@@ -260,12 +260,12 @@ static Scsi_Host_Template cumanascsi_template = { ...@@ -260,12 +260,12 @@ static Scsi_Host_Template cumanascsi_template = {
}; };
static int __devinit static int __devinit
cumanascsi1_probe(struct expansion_card *ec, struct ecard_ids *id) cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
int ret = -ENOMEM; int ret = -ENOMEM;
host = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); host = scsi_register(&cumanascsi_template, sizeof(struct NCR5380_hostdata));
if (!host) if (!host)
goto out; goto out;
...@@ -294,7 +294,7 @@ cumanascsi1_probe(struct expansion_card *ec, struct ecard_ids *id) ...@@ -294,7 +294,7 @@ cumanascsi1_probe(struct expansion_card *ec, struct ecard_ids *id)
printk("scsi%d: at port 0x%08lx irq %d", printk("scsi%d: at port 0x%08lx irq %d",
host->host_no, host->io_port, host->irq); host->host_no, host->io_port, host->irq);
printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d", printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
tpnt->can_queue, tpnt->cmd_per_lun, CUMANASCSI_PUBLIC_RELEASE); host->can_queue, host->cmd_per_lun, CUMANASCSI_PUBLIC_RELEASE);
printk("\nscsi%d:", host->host_no); printk("\nscsi%d:", host->host_no);
NCR5380_print_options(host); NCR5380_print_options(host);
printk("\n"); printk("\n");
...@@ -321,10 +321,10 @@ static void __devexit cumanascsi1_remove(struct expansion_card *ec) ...@@ -321,10 +321,10 @@ static void __devexit cumanascsi1_remove(struct expansion_card *ec)
scsi_remove_host(host); scsi_remove_host(host);
free_irq(host->irq, host); free_irq(host->irq, host);
release_region(host->io_port, host->n_io_port); release_region(host->io_port, host->n_io_port);
scsi_remove(host); scsi_unregister(host);
} }
static const struct ecard_ids cumanascsi1_cids[] = { static const struct ecard_id cumanascsi1_cids[] = {
{ MANU_CUMANA, PROD_CUMANA_SCSI_1 }, { MANU_CUMANA, PROD_CUMANA_SCSI_1 },
{ 0xffff, 0xffff } { 0xffff, 0xffff }
}; };
......
...@@ -54,6 +54,18 @@ ...@@ -54,6 +54,18 @@
#include "../../scsi/scsi.h" #include "../../scsi/scsi.h"
#include "../../scsi/hosts.h" #include "../../scsi/hosts.h"
#define NCR5380_implementation_fields int port, ctrl
#define NCR5380_local_declare() struct Scsi_Host *_instance
#define NCR5380_setup(instance) _instance = instance
#define NCR5380_read(reg) ecoscsi_read(_instance, reg)
#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value)
#define NCR5380_intr ecoscsi_intr
#define NCR5380_queue_command ecoscsi_queue_command
#define NCR5380_proc_info ecoscsi_proc_info
#include "../../scsi/NCR5380.h" #include "../../scsi/NCR5380.h"
#define ECOSCSI_PUBLIC_RELEASE 1 #define ECOSCSI_PUBLIC_RELEASE 1
...@@ -99,62 +111,45 @@ void ecoscsi_setup(char *str, int *ints) { ...@@ -99,62 +111,45 @@ void ecoscsi_setup(char *str, int *ints) {
int ecoscsi_detect(Scsi_Host_Template * tpnt) int ecoscsi_detect(Scsi_Host_Template * tpnt)
{ {
struct Scsi_Host *instance; struct Scsi_Host *host;
tpnt->proc_name = "ecoscsi"; tpnt->proc_name = "ecoscsi";
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); host = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
if (!instance) if (!host)
return 0; return 0;
instance->io_port = 0x80ce8000; host->io_port = 0x80ce8000;
instance->n_io_port = 144; host->n_io_port = 144;
instance->irq = IRQ_NONE; host->irq = IRQ_NONE;
if ( !(request_region(instance->io_port, instance->n_io_port, "ecoscsi")) ) if ( !(request_region(host->io_port, host->n_io_port, "ecoscsi")) )
goto unregister_scsi; goto unregister_scsi;
ecoscsi_write (instance, MODE_REG, 0x20); /* Is it really SCSI? */ ecoscsi_write (host, MODE_REG, 0x20); /* Is it really SCSI? */
if (ecoscsi_read (instance, MODE_REG) != 0x20) /* Write to a reg. */ if (ecoscsi_read (host, MODE_REG) != 0x20) /* Write to a reg. */
goto release_reg; goto release_reg;
ecoscsi_write( instance, MODE_REG, 0x00 ); /* it back. */ ecoscsi_write( host, MODE_REG, 0x00 ); /* it back. */
if (ecoscsi_read (instance, MODE_REG) != 0x00) if (ecoscsi_read (host, MODE_REG) != 0x00)
goto release_reg; goto release_reg;
NCR5380_init(instance, 0); NCR5380_init(host, 0);
if (instance->irq != IRQ_NONE) {
if (request_irq(instance->irq, do_ecoscsi_intr, SA_INTERRUPT, "ecoscsi", NULL)) {
printk("scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, instance->irq);
instance->irq = IRQ_NONE;
}
}
if (instance->irq != IRQ_NONE) { printk("scsi%d: at port 0x%08lx irqs disabled", host->host_no, host->io_port);
printk("scsi%d: eek! Interrupts enabled, but I don't think\n", instance->host_no);
printk("scsi%d: that the board had an interrupt!\n", instance->host_no);
}
printk("scsi%d: at port %X irq", instance->host_no, instance->io_port);
if (instance->irq == IRQ_NONE)
printk ("s disabled");
else
printk (" %d", instance->irq);
printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d", printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
CAN_QUEUE, CMD_PER_LUN, ECOSCSI_PUBLIC_RELEASE); host->can_queue, host->cmd_per_lun, ECOSCSI_PUBLIC_RELEASE);
printk("\nscsi%d:", instance->host_no); printk("\nscsi%d:", host->host_no);
NCR5380_print_options(instance); NCR5380_print_options(host);
printk("\n"); printk("\n");
return 1; return 1;
release_reg: release_reg:
release_region(instance->io_port, instance->n_io_port); release_region(host->io_port, host->n_io_port);
unregister_scsi: unregister_scsi:
scsi_unregister(instance); scsi_unregister(host);
return 0 return 0;
} }
int ecoscsi_release (struct Scsi_Host *shpnt) int ecoscsi_release (struct Scsi_Host *shpnt)
...@@ -166,17 +161,18 @@ int ecoscsi_release (struct Scsi_Host *shpnt) ...@@ -166,17 +161,18 @@ int ecoscsi_release (struct Scsi_Host *shpnt)
return 0; return 0;
} }
const char * ecoscsi_info (struct Scsi_Host *spnt) { const char * ecoscsi_info (struct Scsi_Host *spnt)
{
return ""; return "";
} }
#if 0 #if 0
#define STAT(p) inw(p + 144) #define STAT(p) inw(p + 144)
static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, static inline int NCR5380_pwrite(struct Scsi_Host *host, unsigned char *addr,
int len) int len)
{ {
int iobase = instance->io_port; int iobase = host->io_port;
printk("writing %p len %d\n",addr, len); printk("writing %p len %d\n",addr, len);
if(!len) return -1; if(!len) return -1;
...@@ -187,11 +183,11 @@ printk("writing %p len %d\n",addr, len); ...@@ -187,11 +183,11 @@ printk("writing %p len %d\n",addr, len);
} }
} }
static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr, static inline int NCR5380_pread(struct Scsi_Host *host, unsigned char *addr,
int len) int len)
{ {
int iobase = instance->io_port; int iobase = host->io_port;
int iobase2= instance->io_port + 0x100; int iobase2= host->io_port + 0x100;
unsigned char *start = addr; unsigned char *start = addr;
int s; int s;
printk("reading %p len %d\n",addr, len); printk("reading %p len %d\n",addr, len);
...@@ -237,22 +233,6 @@ printk("reading %p len %d\n",addr, len); ...@@ -237,22 +233,6 @@ printk("reading %p len %d\n",addr, len);
#endif #endif
#undef STAT #undef STAT
#define NCR5380_implementation_fields \
int port, ctrl
#define NCR5380_local_declare() \
struct Scsi_Host *_instance
#define NCR5380_setup(instance) \
_instance = instance
#define NCR5380_read(reg) ecoscsi_read(_instance, reg)
#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value)
#define NCR5380_intr ecoscsi_intr
#define NCR5380_queue_command ecoscsi_queue_command
#define NCR5380_proc_info ecoscsi_proc_info
int NCR5380_proc_info(char *buffer, char **start, off_t offset, int NCR5380_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout); int length, int hostno, int inout);
......
...@@ -138,11 +138,11 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -138,11 +138,11 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
int ret = -ENOMEM; int ret = -ENOMEM;
host = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); host = scsi_register(&oakscsi_template, sizeof(struct NCR5380_hostdata));
if (!host) if (!host)
goto out; goto out;
host->io_port = ecard_address(ec, ECARD_MEMC, 0) host->io_port = ecard_address(ec, ECARD_MEMC, 0);
host->irq = IRQ_NONE; host->irq = IRQ_NONE;
host->n_io_port = 255; host->n_io_port = 255;
...@@ -155,7 +155,7 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -155,7 +155,7 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
printk("scsi%d: at port 0x%08lx irqs disabled", printk("scsi%d: at port 0x%08lx irqs disabled",
host->host_no, host->io_port); host->host_no, host->io_port);
printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d", printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
tpnt->can_queue, tpnt->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE); host->can_queue, host->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE);
printk("\nscsi%d:", host->host_no); printk("\nscsi%d:", host->host_no);
NCR5380_print_options(host); NCR5380_print_options(host);
printk("\n"); printk("\n");
......
...@@ -96,7 +96,7 @@ extern struct processor { ...@@ -96,7 +96,7 @@ extern struct processor {
/* /*
* Set a PMD (handling IMP bit 4) * Set a PMD (handling IMP bit 4)
*/ */
void (*set_pmd)(pmd_t *pmdp, pmd_t pmd); void (*flush_pmd)(pmd_t *pmdp);
/* /*
* Set a PTE * Set a PTE
*/ */
...@@ -126,7 +126,7 @@ extern const struct processor sa110_processor_functions; ...@@ -126,7 +126,7 @@ extern const struct processor sa110_processor_functions;
#define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp) #define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp)
#define cpu_set_pgd(pgd,mm) processor.pgtable.set_pgd(pgd,mm) #define cpu_set_pgd(pgd,mm) processor.pgtable.set_pgd(pgd,mm)
#define cpu_set_pmd(pmdp, pmd) processor.pgtable.set_pmd(pmdp, pmd) #define cpu_flush_pmd(pmdp) processor.pgtable.flush_pmd(pmdp)
#define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte) #define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte)
#define cpu_switch_mm(pgd,mm) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)),mm) #define cpu_switch_mm(pgd,mm) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)),mm)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#define cpu_icache_invalidate_range __cpu_fn(CPU_NAME,_icache_invalidate_range) #define cpu_icache_invalidate_range __cpu_fn(CPU_NAME,_icache_invalidate_range)
#define cpu_icache_invalidate_page __cpu_fn(CPU_NAME,_icache_invalidate_page) #define cpu_icache_invalidate_page __cpu_fn(CPU_NAME,_icache_invalidate_page)
#define cpu_set_pgd __cpu_fn(CPU_NAME,_set_pgd) #define cpu_set_pgd __cpu_fn(CPU_NAME,_set_pgd)
#define cpu_set_pmd __cpu_fn(CPU_NAME,_set_pmd) #define cpu_flush_pmd __cpu_fn(CPU_NAME,_flush_pmd)
#define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte) #define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -65,7 +65,7 @@ extern void cpu_icache_invalidate_range(unsigned long start, unsigned long end); ...@@ -65,7 +65,7 @@ extern void cpu_icache_invalidate_range(unsigned long start, unsigned long end);
extern void cpu_icache_invalidate_page(void *virt_page); extern void cpu_icache_invalidate_page(void *virt_page);
extern void cpu_set_pgd(unsigned long pgd_phys, struct mm_struct *mm); extern void cpu_set_pgd(unsigned long pgd_phys, struct mm_struct *mm);
extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd); extern void cpu_flush_pmd(pmd_t *pmdp);
extern void cpu_set_pte(pte_t *ptep, pte_t pte); extern void cpu_set_pte(pte_t *ptep, pte_t pte);
extern volatile void cpu_reset(unsigned long addr); extern volatile void cpu_reset(unsigned long addr);
......
...@@ -123,8 +123,8 @@ ...@@ -123,8 +123,8 @@
static inline void pmd_clear(pmd_t *pmdp) static inline void pmd_clear(pmd_t *pmdp)
{ {
pmdp[0], __pmd(0)); pmdp[0] = __pmd(0);
pmdp[1], __pmd(0)); pmdp[1] = __pmd(0);
cpu_flush_pmd(pmdp); cpu_flush_pmd(pmdp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment