blob: f14ec6e042b9ae240b9c5984688325b746496347 [file] [log] [blame]
jack wangdbf9bfe2009-10-14 16:19:21 +08001/*
Sakthivel Ke5742102013-04-17 16:26:36 +05302 * PMC-Sierra 8001/8081/8088/8089 SAS/SATA based host adapters driver
jack wangdbf9bfe2009-10-14 16:19:21 +08003 *
4 * Copyright (c) 2008-2009 USI Co., Ltd.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions, and the following disclaimer,
12 * without modification.
13 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14 * substantially similar to the "NO WARRANTY" disclaimer below
15 * ("Disclaimer") and any redistribution must be conditioned upon
16 * including a substantially similar Disclaimer requirement for further
17 * binary redistribution.
18 * 3. Neither the names of the above-listed copyright holders nor the names
19 * of any contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * Alternatively, this software may be distributed under the terms of the
23 * GNU General Public License ("GPL") version 2 as published by the Free
24 * Software Foundation.
25 *
26 * NO WARRANTY
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGES.
38 *
39 */
40
41#ifndef _PM8001_DEFS_H_
42#define _PM8001_DEFS_H_
43
44enum chip_flavors {
45 chip_8001,
Sakthivel Ke5742102013-04-17 16:26:36 +053046 chip_8008,
47 chip_8009,
48 chip_8018,
Anand Kumar Santhanama9a923e2013-09-03 15:09:42 +053049 chip_8019,
50 chip_8074,
51 chip_8076,
Suresh Thiagarajand8571b12015-02-12 12:04:37 +053052 chip_8077,
53 chip_8006,
jack wangdbf9bfe2009-10-14 16:19:21 +080054};
Sakthivel Ke590adf2013-02-27 20:25:25 +053055
jack wangdbf9bfe2009-10-14 16:19:21 +080056enum phy_speed {
57 PHY_SPEED_15 = 0x01,
58 PHY_SPEED_30 = 0x02,
59 PHY_SPEED_60 = 0x04,
Viswas Gb093d592015-08-11 15:06:25 +053060 PHY_SPEED_120 = 0x08,
jack wangdbf9bfe2009-10-14 16:19:21 +080061};
62
63enum data_direction {
64 DATA_DIR_NONE = 0x0, /* NO TRANSFER */
65 DATA_DIR_IN = 0x01, /* INBOUND */
66 DATA_DIR_OUT = 0x02, /* OUTBOUND */
67 DATA_DIR_BYRECIPIENT = 0x04, /* UNSPECIFIED */
68};
69
70enum port_type {
71 PORT_TYPE_SAS = (1L << 1),
72 PORT_TYPE_SATA = (1L << 0),
73};
74
75/* driver compile-time configuration */
76#define PM8001_MAX_CCB 512 /* max ccbs supported */
Mark Salyzyn99c72eb2012-04-25 13:02:04 -040077#define PM8001_MPI_QUEUE 1024 /* maximum mpi queue entries */
jack wangdbf9bfe2009-10-14 16:19:21 +080078#define PM8001_MAX_INB_NUM 1
79#define PM8001_MAX_OUTB_NUM 1
Sakthivel Ke5742102013-04-17 16:26:36 +053080#define PM8001_MAX_SPCV_INB_NUM 1
81#define PM8001_MAX_SPCV_OUTB_NUM 4
Mark Salyzyn99c72eb2012-04-25 13:02:04 -040082#define PM8001_CAN_QUEUE 508 /* SCSI Queue depth */
jack wangdbf9bfe2009-10-14 16:19:21 +080083
Sakthivel Ke5742102013-04-17 16:26:36 +053084/* Inbound/Outbound queue size */
85#define IOMB_SIZE_SPC 64
86#define IOMB_SIZE_SPCV 128
87
jack wangdbf9bfe2009-10-14 16:19:21 +080088/* unchangeable hardware details */
Sakthivel Ke5742102013-04-17 16:26:36 +053089#define PM8001_MAX_PHYS 16 /* max. possible phys */
90#define PM8001_MAX_PORTS 16 /* max. possible ports */
91#define PM8001_MAX_DEVICES 2048 /* max supported device */
92#define PM8001_MAX_MSIX_VEC 64 /* max msi-x int for spcv/ve */
jack wangdbf9bfe2009-10-14 16:19:21 +080093
Sakthivel K1c75a672013-03-19 18:06:40 +053094#define USI_MAX_MEMCNT_BASE 5
Sakthivel Ke590adf2013-02-27 20:25:25 +053095#define IB (USI_MAX_MEMCNT_BASE + 1)
96#define CI (IB + PM8001_MAX_SPCV_INB_NUM)
97#define OB (CI + PM8001_MAX_SPCV_INB_NUM)
98#define PI (OB + PM8001_MAX_SPCV_OUTB_NUM)
99#define USI_MAX_MEMCNT (PI + PM8001_MAX_SPCV_OUTB_NUM)
100#define PM8001_MAX_DMA_SG SG_ALL
jack wangdbf9bfe2009-10-14 16:19:21 +0800101enum memory_region_num {
102 AAP1 = 0x0, /* application acceleration processor */
103 IOP, /* IO processor */
jack wangdbf9bfe2009-10-14 16:19:21 +0800104 NVMD, /* NVM device */
105 DEV_MEM, /* memory for devices */
106 CCB_MEM, /* memory for command control block */
Anand Kumar Santhanamd078b512013-09-04 12:57:00 +0530107 FW_FLASH, /* memory for fw flash update */
108 FORENSIC_MEM /* memory for fw forensic data */
jack wangdbf9bfe2009-10-14 16:19:21 +0800109};
110#define PM8001_EVENT_LOG_SIZE (128 * 1024)
111
112/*error code*/
113enum mpi_err {
114 MPI_IO_STATUS_SUCCESS = 0x0,
115 MPI_IO_STATUS_BUSY = 0x01,
116 MPI_IO_STATUS_FAIL = 0x02,
117};
118
119/**
120 * Phy Control constants
121 */
122enum phy_control_type {
123 PHY_LINK_RESET = 0x01,
124 PHY_HARD_RESET = 0x02,
125 PHY_NOTIFY_ENABLE_SPINUP = 0x10,
126};
127
128enum pm8001_hba_info_flags {
129 PM8001F_INIT_TIME = (1U << 0),
130 PM8001F_RUN_TIME = (1U << 1),
131};
132
133#endif