John Garry | e8899fa | 2015-11-18 00:50:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 Linaro Ltd. |
| 3 | * Copyright (c) 2015 Hisilicon Limited. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | */ |
| 11 | |
| 12 | #ifndef _HISI_SAS_H_ |
| 13 | #define _HISI_SAS_H_ |
| 14 | |
| 15 | #include <linux/dmapool.h> |
| 16 | #include <linux/mfd/syscon.h> |
| 17 | #include <linux/module.h> |
| 18 | #include <linux/of_address.h> |
| 19 | #include <linux/of_irq.h> |
| 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/regmap.h> |
| 22 | #include <scsi/libsas.h> |
| 23 | |
| 24 | #define DRV_VERSION "v1.0" |
| 25 | |
John Garry | 7eb7869 | 2015-11-18 00:50:31 +0800 | [diff] [blame^] | 26 | #define HISI_SAS_MAX_PHYS 9 |
| 27 | #define HISI_SAS_MAX_ITCT_ENTRIES 4096 |
| 28 | #define HISI_SAS_MAX_DEVICES HISI_SAS_MAX_ITCT_ENTRIES |
| 29 | #define HISI_SAS_COMMAND_ENTRIES 8192 |
| 30 | |
| 31 | struct hisi_sas_phy { |
| 32 | struct asd_sas_phy sas_phy; |
| 33 | }; |
| 34 | |
| 35 | struct hisi_sas_port { |
| 36 | struct asd_sas_port sas_port; |
| 37 | }; |
| 38 | |
| 39 | struct hisi_sas_hw { |
| 40 | }; |
| 41 | |
| 42 | struct hisi_hba { |
| 43 | /* This must be the first element, used by SHOST_TO_SAS_HA */ |
| 44 | struct sas_ha_struct *p; |
| 45 | |
| 46 | struct platform_device *pdev; |
| 47 | u8 sas_addr[SAS_ADDR_SIZE]; |
| 48 | |
| 49 | int n_phy; |
| 50 | |
| 51 | /* SCSI/SAS glue */ |
| 52 | struct sas_ha_struct sha; |
| 53 | struct Scsi_Host *shost; |
| 54 | struct hisi_sas_phy phy[HISI_SAS_MAX_PHYS]; |
| 55 | struct hisi_sas_port port[HISI_SAS_MAX_PHYS]; |
| 56 | const struct hisi_sas_hw *hw; /* Low level hw interface */ |
| 57 | }; |
| 58 | |
| 59 | #define HISI_SAS_SGE_PAGE_CNT SCSI_MAX_SG_SEGMENTS |
John Garry | e8899fa | 2015-11-18 00:50:30 +0800 | [diff] [blame] | 60 | #endif |