From 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 Mon Sep 17 00:00:00 2001 From: Yunhong Jiang Date: Tue, 4 Aug 2015 12:17:53 -0700 Subject: Add the rt linux 4.1.3-rt3 as base Import the rt linux 4.1.3-rt3 as OPNFV kvm base. It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and the base is: commit 0917f823c59692d751951bf5ea699a2d1e2f26a2 Author: Sebastian Andrzej Siewior Date: Sat Jul 25 12:13:34 2015 +0200 Prepare v4.1.3-rt3 Signed-off-by: Sebastian Andrzej Siewior We lose all the git history this way and it's not good. We should apply another opnfv project repo in future. Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423 Signed-off-by: Yunhong Jiang --- kernel/drivers/scsi/a4000t.c | 124 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 kernel/drivers/scsi/a4000t.c (limited to 'kernel/drivers/scsi/a4000t.c') diff --git a/kernel/drivers/scsi/a4000t.c b/kernel/drivers/scsi/a4000t.c new file mode 100644 index 000000000..66c573093 --- /dev/null +++ b/kernel/drivers/scsi/a4000t.c @@ -0,0 +1,124 @@ +/* + * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux. + * Amiga Technologies A4000T SCSI controller. + * + * Written 1997 by Alan Hourihane + * plus modifications of the 53c7xx.c driver to support the Amiga. + * + * Rewritten to use 53c700.c by Kars de Jong + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "53c700.h" + + +static struct scsi_host_template a4000t_scsi_driver_template = { + .name = "A4000T builtin SCSI", + .proc_name = "A4000t", + .this_id = 7, + .module = THIS_MODULE, +}; + + +#define A4000T_SCSI_OFFSET 0x40 + +static int __init amiga_a4000t_scsi_probe(struct platform_device *pdev) +{ + struct resource *res; + phys_addr_t scsi_addr; + struct NCR_700_Host_Parameters *hostdata; + struct Scsi_Host *host; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENODEV; + + if (!request_mem_region(res->start, resource_size(res), + "A4000T builtin SCSI")) + return -EBUSY; + + hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), + GFP_KERNEL); + if (!hostdata) { + dev_err(&pdev->dev, "Failed to allocate host data\n"); + goto out_release; + } + + scsi_addr = res->start + A4000T_SCSI_OFFSET; + + /* Fill in the required pieces of hostdata */ + hostdata->base = ZTWO_VADDR(scsi_addr); + hostdata->clock = 50; + hostdata->chip710 = 1; + hostdata->dmode_extra = DMODE_FC2; + hostdata->dcntl_extra = EA_710; + + /* and register the chip */ + host = NCR_700_detect(&a4000t_scsi_driver_template, hostdata, + &pdev->dev); + if (!host) { + dev_err(&pdev->dev, + "No host detected; board configuration problem?\n"); + goto out_free; + } + + host->this_id = 7; + host->base = scsi_addr; + host->irq = IRQ_AMIGA_PORTS; + + if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi", + host)) { + dev_err(&pdev->dev, "request_irq failed\n"); + goto out_put_host; + } + + platform_set_drvdata(pdev, host); + scsi_scan_host(host); + return 0; + + out_put_host: + scsi_host_put(host); + out_free: + kfree(hostdata); + out_release: + release_mem_region(res->start, resource_size(res)); + return -ENODEV; +} + +static int __exit amiga_a4000t_scsi_remove(struct platform_device *pdev) +{ + struct Scsi_Host *host = platform_get_drvdata(pdev); + struct NCR_700_Host_Parameters *hostdata = shost_priv(host); + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + + scsi_remove_host(host); + NCR_700_release(host); + kfree(hostdata); + free_irq(host->irq, host); + release_mem_region(res->start, resource_size(res)); + return 0; +} + +static struct platform_driver amiga_a4000t_scsi_driver = { + .remove = __exit_p(amiga_a4000t_scsi_remove), + .driver = { + .name = "amiga-a4000t-scsi", + }, +}; + +module_platform_driver_probe(amiga_a4000t_scsi_driver, amiga_a4000t_scsi_probe); + +MODULE_AUTHOR("Alan Hourihane / " + "Kars de Jong "); +MODULE_DESCRIPTION("Amiga A4000T NCR53C710 driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:amiga-a4000t-scsi"); -- cgit 1.2.3-korg