Release 4.7 drivers/scsi/arm/oak.c
/*
* Oak Generic NCR5380 driver
*
* Copyright 1995-2002, Russell King
*/
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/init.h>
#include <asm/ecard.h>
#include <asm/io.h>
#include <scsi/scsi_host.h>
#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
#define NCR5380_read(reg) \
readb(priv(instance)->base + ((reg) << 2))
#define NCR5380_write(reg, value) \
writeb(value, priv(instance)->base + ((reg) << 2))
#define NCR5380_dma_xfer_len(instance, cmd, phase) (0)
#define NCR5380_dma_recv_setup oakscsi_pread
#define NCR5380_dma_send_setup oakscsi_pwrite
#define NCR5380_dma_residual(instance) (0)
#define NCR5380_queue_command oakscsi_queue_command
#define NCR5380_info oakscsi_info
#define NCR5380_implementation_fields \
void __iomem *base
#include "../NCR5380.h"
#undef START_DMA_INITIATOR_RECEIVE_REG
#define START_DMA_INITIATOR_RECEIVE_REG (128 + 7)
#define STAT ((128 + 16) << 2)
#define DATA ((128 + 8) << 2)
static inline int oakscsi_pwrite(struct Scsi_Host *instance,
unsigned char *addr, int len)
{
void __iomem *base = priv(instance)->base;
printk("writing %p len %d\n",addr, len);
while(1)
{
int status;
while (((status = readw(base + STAT)) & 0x100)==0);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 57 | 78.08% | 1 | 25.00% |
russell king | russell king | 12 | 16.44% | 1 | 25.00% |
finn thain | finn thain | 4 | 5.48% | 2 | 50.00% |
| Total | 73 | 100.00% | 4 | 100.00% |
static inline int oakscsi_pread(struct Scsi_Host *instance,
unsigned char *addr, int len)
{
void __iomem *base = priv(instance)->base;
printk("reading %p len %d\n", addr, len);
while(len > 0)
{
unsigned int status, timeout;
unsigned long b;
timeout = 0x01FFFFFF;
while (((status = readw(base + STAT)) & 0x100)==0)
{
timeout--;
if(status & 0x200 || !timeout)
{
printk("status = %08X\n", status);
return -1;
}
}
if(len >= 128)
{
readsw(base + DATA, addr, 128);
addr += 128;
len -= 128;
}
else
{
b = (unsigned long) readw(base + DATA);
*addr ++ = b;
len -= 1;
if(len)
*addr ++ = b>>8;
len -= 1;
}
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 160 | 88.40% | 1 | 25.00% |
russell king | russell king | 19 | 10.50% | 1 | 25.00% |
finn thain | finn thain | 2 | 1.10% | 2 | 50.00% |
| Total | 181 | 100.00% | 4 | 100.00% |
#undef STAT
#undef DATA
#include "../NCR5380.c"
static struct scsi_host_template oakscsi_template = {
.module = THIS_MODULE,
.name = "Oak 16-bit SCSI",
.info = oakscsi_info,
.queuecommand = oakscsi_queue_command,
.eh_abort_handler = NCR5380_abort,
.eh_bus_reset_handler = NCR5380_bus_reset,
.can_queue = 16,
.this_id = 7,
.sg_tablesize = SG_ALL,
.cmd_per_lun = 2,
.use_clustering = DISABLE_CLUSTERING,
.proc_name = "oakscsi",
.cmd_size = NCR5380_CMD_SIZE,
.max_sectors = 128,
};
static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{
struct Scsi_Host *host;
int ret = -ENOMEM;
ret = ecard_request_resources(ec);
if (ret)
goto out;
host = scsi_host_alloc(&oakscsi_template, sizeof(struct NCR5380_hostdata));
if (!host) {
ret = -ENOMEM;
goto release;
}
priv(host)->base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC),
ecard_resource_len(ec, ECARD_RES_MEMC));
if (!priv(host)->base) {
ret = -ENOMEM;
goto unreg;
}
host->irq = NO_IRQ;
host->n_io_port = 255;
ret = NCR5380_init(host, FLAG_DMA_FIXUP | FLAG_LATE_DMA_SETUP);
if (ret)
goto out_unmap;
NCR5380_maybe_reset_bus(host);
ret = scsi_add_host(host, &ec->dev);
if (ret)
goto out_exit;
scsi_scan_host(host);
goto out;
out_exit:
NCR5380_exit(host);
out_unmap:
iounmap(priv(host)->base);
unreg:
scsi_host_put(host);
release:
ecard_release_resources(ec);
out:
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
russell king | russell king | 162 | 75.35% | 3 | 25.00% |
finn thain | finn thain | 26 | 12.09% | 5 | 41.67% |
linus torvalds | linus torvalds | 12 | 5.58% | 1 | 8.33% |
christoph hellwig | christoph hellwig | 10 | 4.65% | 2 | 16.67% |
mike anderson | mike anderson | 5 | 2.33% | 1 | 8.33% |
| Total | 215 | 100.00% | 12 | 100.00% |
static void oakscsi_remove(struct expansion_card *ec)
{
struct Scsi_Host *host = ecard_get_drvdata(ec);
ecard_set_drvdata(ec, NULL);
scsi_remove_host(host);
NCR5380_exit(host);
iounmap(priv(host)->base);
scsi_host_put(host);
ecard_release_resources(ec);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
russell king | russell king | 49 | 84.48% | 2 | 40.00% |
james bottomley | james bottomley | 5 | 8.62% | 1 | 20.00% |
linus torvalds | linus torvalds | 3 | 5.17% | 1 | 20.00% |
christoph hellwig | christoph hellwig | 1 | 1.72% | 1 | 20.00% |
| Total | 58 | 100.00% | 5 | 100.00% |
static const struct ecard_id oakscsi_cids[] = {
{ MANU_OAK, PROD_OAK_SCSI },
{ 0xffff, 0xffff }
};
static struct ecard_driver oakscsi_driver = {
.probe = oakscsi_probe,
.remove = oakscsi_remove,
.id_table = oakscsi_cids,
.drv = {
.name = "oakscsi",
},
};
static int __init oakscsi_init(void)
{
return ecard_register_driver(&oakscsi_driver);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
russell king | russell king | 13 | 81.25% | 1 | 50.00% |
linus torvalds | linus torvalds | 3 | 18.75% | 1 | 50.00% |
| Total | 16 | 100.00% | 2 | 100.00% |
static void __exit oakscsi_exit(void)
{
ecard_remove_driver(&oakscsi_driver);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
linus torvalds | linus torvalds | 13 | 86.67% | 1 | 50.00% |
russell king | russell king | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
module_init(oakscsi_init);
module_exit(oakscsi_exit);
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("Oak SCSI driver");
MODULE_LICENSE("GPL");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
russell king | russell king | 364 | 44.07% | 6 | 20.00% |
pre-git | pre-git | 254 | 30.75% | 1 | 3.33% |
linus torvalds | linus torvalds | 107 | 12.95% | 3 | 10.00% |
finn thain | finn thain | 76 | 9.20% | 13 | 43.33% |
christoph hellwig | christoph hellwig | 13 | 1.57% | 3 | 10.00% |
james bottomley | james bottomley | 5 | 0.61% | 1 | 3.33% |
mike anderson | mike anderson | 5 | 0.61% | 1 | 3.33% |
arjan van de ven | arjan van de ven | 1 | 0.12% | 1 | 3.33% |
adrian bunk | adrian bunk | 1 | 0.12% | 1 | 3.33% |
greg kroah-hartman | greg kroah-hartman | | 0.00% | 0 | 0.00% |
| Total | 826 | 100.00% | 30 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.