hisi_sas.h 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
 * Copyright (c) 2015 Linaro Ltd.
 * Copyright (c) 2015 Hisilicon Limited.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

#ifndef _HISI_SAS_H_
#define _HISI_SAS_H_

#include <linux/dmapool.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <scsi/libsas.h>

#define DRV_VERSION "v1.0"

J
John Garry 已提交
26 27 28 29 30
#define HISI_SAS_MAX_PHYS	9
#define HISI_SAS_MAX_ITCT_ENTRIES 4096
#define HISI_SAS_MAX_DEVICES HISI_SAS_MAX_ITCT_ENTRIES
#define HISI_SAS_COMMAND_ENTRIES 8192

J
John Garry 已提交
31 32
#define HISI_SAS_NAME_LEN 32

J
John Garry 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
struct hisi_sas_phy {
	struct asd_sas_phy	sas_phy;
};

struct hisi_sas_port {
	struct asd_sas_port	sas_port;
};

struct hisi_sas_hw {
};

struct hisi_hba {
	/* This must be the first element, used by SHOST_TO_SAS_HA */
	struct sas_ha_struct *p;

	struct platform_device *pdev;
J
John Garry 已提交
49 50 51 52 53
	void __iomem *regs;
	struct regmap *ctrl;
	u32 ctrl_reset_reg;
	u32 ctrl_reset_sts_reg;
	u32 ctrl_clock_ena_reg;
J
John Garry 已提交
54 55 56 57 58 59 60 61 62
	u8 sas_addr[SAS_ADDR_SIZE];

	int n_phy;

	/* SCSI/SAS glue */
	struct sas_ha_struct sha;
	struct Scsi_Host *shost;
	struct hisi_sas_phy phy[HISI_SAS_MAX_PHYS];
	struct hisi_sas_port port[HISI_SAS_MAX_PHYS];
J
John Garry 已提交
63 64 65

	int	queue_count;
	char	*int_names;
J
John Garry 已提交
66 67 68 69
	const struct hisi_sas_hw *hw;	/* Low level hw interface */
};

#define HISI_SAS_SGE_PAGE_CNT SCSI_MAX_SG_SEGMENTS
70
#endif