aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-25hisi_sas: Add dev_found and dev_goneJohn Garry3-0/+142
Add functions to deal with lldd_dev_found and lldd_dev_gone. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add cq interrupt handlerJohn Garry3-0/+389
Add cq interrupt handler and also slot error handler function. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add ssp command functionJohn Garry3-0/+458
Add path to send ssp command to HW. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add path from phyup irq to SAS frameworkJohn Garry3-0/+66
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add v1 hardware interrupt initJohn Garry2-0/+166
Add code to interrupts, so now we can get a phy up interrupt when a disk is connected. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add v1 hardware initialisation codeJohn Garry3-0/+342
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add v1 hardware register definitionsJohn Garry1-0/+389
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add v1 hw module initJohn Garry3-0/+57
Add module init code for v1 hw. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add timer and spinlock initJohn Garry2-0/+5
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add phy and port initJohn Garry2-0/+46
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add hisi sas device typeJohn Garry2-0/+18
Include initialisation. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add hisi_hba workqueueJohn Garry2-0/+9
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Set dev DMA maskJohn Garry1-0/+8
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add phy SAS ADDR initializationJohn Garry2-0/+13
The SAS address for the HBA comes from the device tree. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add cq structure initializationJohn Garry2-0/+13
Each completion queue has a structure. This is mainly for passing to irq handler so we know which queue the irq occured on. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add slot init codeJohn Garry2-0/+27
Add functionality to init slot indexing. Slot indexing is for the host to track which slots (or tags) are free and which are used. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add hisi_sas_removeJohn Garry1-1/+70
This patch also includes relevant memory/pool freeing and sas/scsi host removal. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Allocate memories and create poolsJohn Garry2-0/+124
Allocate DMA and non-DMA memories for the controller. Also create DMA pools. These include: - Delivery queues - Completion queues - Command status buffer - Command table - ITCT (For device context) - Host slot info - IO status - Breakpoint - host slot indexing - SG data - FIS - interrupts names Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add HW DMA structuresJohn Garry1-0/+131
Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Scan device treeJohn Garry2-1/+54
Scan the device tree for all properties. Also do this: - do ioremap for SAS registers - allocate memory for interrupt names Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add scsi host registrationJohn Garry2-0/+150
Add functionality to register device as a scsi host. The SAS domain transport ops are empty at this point. Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25hisi_sas: Add initial bare main driverJohn Garry6-0/+78
This patch adds the initial bare main driver for the HiSilicon SAS HBA. This only introduces the changes to build and load the main driver module. The complete driver consists of the core main module and also a module platform driver for driving the hw. The HBA is a platform device. Signed-off-by: John Garry <[email protected]> Signed-off-by: Zhangfei Gao <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25devicetree: bindings: scsi: HiSi SASJohn Garry1-0/+69
Add devicetree bindings for HiSilicon SAS driver. Signed-off-by: John Garry <[email protected]> Signed-off-by: Zhangfei Gao <[email protected]> Acked-by: Rob Herring <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25scsi: Centralise ssp frame information unitsJohn Garry2-43/+80
The xfer_rdy, command, and task frame's iu structures are not available in <scsi/sas.h>, but only aic94xx driver folder. Add them to include/scsi/sas.h Signed-off-by: John Garry <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Introduce atp870_init()Ondrej Zary1-50/+54
Move 870-specific init code to a separate function atp870_init() Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Introduce atp885_init()Ondrej Zary1-118/+113
Move 885-specific init code to a separate function atp885_init() Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Introduce atp880_init()Ondrej Zary1-86/+88
Move 880-specific init code to a separate function atp880_init() Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Initialize tables earlierOndrej Zary1-16/+6
Call _init_tables before chip-specific initialization. This avoids code duplication and fixes a bug(?) in 880 init where the values read from flash into atpdev->sp are then overwritten by calling init_tables. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove scam_on from struct atp_unitOndrej Zary2-8/+7
scam_on is used only during probe, no need to keep it later. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Request IRQ later, remove weird lockingOndrej Zary1-35/+12
Allocate IRQ later during probe to avoid code duplication and also remove the need for weird locking in _probe. (It was probably there to prevent race with the IRQ handler?) Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Use pci_request_regionsOndrej Zary1-11/+10
Use pci_request_regions and do it before accessing the I/O ports. Also add missing pci_disable_device() call to atp870u_remove(). Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Introduce is880(), is885() and remove dev_idOndrej Zary2-33/+38
Introduce chip type inline functions to simplify code, allowing to delete dev_id from struct atp_unit. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Simplify _probe()Ondrej Zary1-37/+28
Move shpnt common code to the top, remove base_io, use pci_resource_len. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove chip_ver from struct atp_unitOndrej Zary2-26/+14
chip_ver is used for wide chip detection only. Remove it and use a local variable instead (for 870; 880 and 885 are always wide). Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Improve unsupported chip detectionOndrej Zary1-12/+8
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Improve _probe()Ondrej Zary1-123/+113
Move scsi_host_alloc() to the top of _probe() to remove code duplication, *p and unneeded atpdev (de)allocation and copying. While at it, fix the error paths to return real error codes and also add missing pci_disble_device() call. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove unused irq from struct atp_unitOndrej Zary1-1/+0
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove useless and broken card countingOndrej Zary1-6/+4
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Use n_io_port in request_region and release_regionOndrej Zary1-17/+3
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Use module_pci_driverOndrej Zary1-19/+1
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove empty tscam_885()Ondrej Zary1-14/+1
tscam_885() is empty (except a delay) so remove it. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Reduce log spam on module load/unloadOndrej Zary1-6/+1
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Introduce atp_set_host_idOndrej Zary1-39/+18
The code for setting host adapter ID is the same for all chips. Move it to a common function. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Fix incorrect writeb_io access to register 0x3aOndrej Zary1-4/+4
The ioport region is 0x20 bytes long so accessing 0x3a register using writeb_io is incorrect. Use writeb_base instead. There's no change in behavior as 870 chips have ioport = baseport. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Replace port 0x80 delay by udelayOndrej Zary1-9/+9
tscam() is using port 0x80 access for delays but that's x86-only. Use udelay(2) instead. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Convert remaining in[bwl] and out[bwl] to wrappersOndrej Zary1-104/+118
Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Rename is885() to atp_is()Ondrej Zary1-6/+6
Now that all the is* functions except is885() are gone, rename is885() to atp_is() to avoid confusion. Don't know what "is" means, though... Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Remove is870()Ondrej Zary1-426/+1
Now that is885() supports everything from is870() and the rest of the code is almost identical, remove is870() and use is885() instead. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Move 870-specific code out of is870()Ondrej Zary1-3/+2
Move few remaining 870-specific code lines out of is870() Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2015-11-25atp870u: Add remaining 870 support to is885()Ondrej Zary1-14/+31
Add remaining 870 support to is885(): - different synw, no synuw - synu[4] = 0x0c - atp_writeb_io(dev, c, 0x04, 0x00); instead of atp_writeb_io(dev, c, 0x14, 0x00); (isn't that a bug?) - atp_writeb_io(dev, c, 0x14, 0xff); instead of atp_writeb_io(dev, c, 0x14, 0x06); - different mbuf[3] and mbuf[4] checks Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Hannes Reinicke <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>