1 /*******************************************************************************
2 Copyright (C) Marvell International Ltd. and its affiliates
4 This software file (the "File") is owned and distributed by Marvell
5 International Ltd. and/or its affiliates ("Marvell") under the following
6 alternative licensing terms. Once you have made an election to distribute the
7 File under one of the following license alternatives, please (i) delete this
8 introductory statement regarding license alternatives, (ii) delete the two
9 license alternatives that you have not elected to use and (iii) preserve the
10 Marvell copyright notice above.
13 ********************************************************************************
14 Marvell GPL License Option
16 If you received this File from Marvell, you may opt to use, redistribute and/or
17 modify this File in accordance with the terms and conditions of the General
18 Public License Version 2, June 1991 (the "GPL License"), a copy of which is
19 available along with the File in the license.txt file or by writing to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
21 on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
23 THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
24 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
25 DISCLAIMED. The GPL License provides additional details about this warranty
27 *******************************************************************************/
28 /*******************************************************************************
29 * mvOsLinux.h - O.S. interface header file for Linux
32 * This header file contains OS dependent definition under Linux
35 * Linux kernel header files.
37 * FILE REVISION NUMBER:
39 *******************************************************************************/
41 #ifndef __INCmvOsLinuxh
42 #define __INCmvOsLinuxh
45 #include <linux/autoconf.h>
46 #include <linux/module.h>
47 #include <linux/types.h>
48 #include <linux/string.h>
49 #include <linux/kernel.h>
50 #include <linux/timer.h>
52 #include <linux/interrupt.h>
53 #include <linux/major.h>
54 #include <linux/errno.h>
55 #include <linux/genhd.h>
56 #include <linux/slab.h>
57 #include <linux/delay.h>
58 #include <linux/ide.h>
59 #include <linux/pci.h>
61 #include <asm/byteorder.h>
63 #include <asm/uaccess.h>
69 #define MV_DEFAULT_QUEUE_DEPTH 2
70 #define MV_SATA_SUPPORT_EDMA_SINGLE_DATA_REGION
71 #define MV_SATA_SUPPORT_GEN2E_128_QUEUE_LEN
73 #ifdef CONFIG_MV88F6082
74 #define MV_SATA_OVERRIDE_SW_QUEUE_SIZE
75 #define MV_SATA_REQUESTED_SW_QUEUE_SIZE 2
76 #undef MV_SATA_SUPPORT_GEN2E_128_QUEUE_LEN
79 /* System dependent macro for flushing CPU write cache */
80 #if defined (MV_BRIDGE_SYNC_REORDER)
81 #define MV_CPU_WRITE_BUFFER_FLUSH() do { \
83 mvOsBridgeReorderWA(); \
86 #define MV_CPU_WRITE_BUFFER_FLUSH() wmb()
87 #endif /* CONFIG_MV78XX0 */
89 /* System dependent little endian from / to CPU conversions */
90 #define MV_CPU_TO_LE16(x) cpu_to_le16(x)
91 #define MV_CPU_TO_LE32(x) cpu_to_le32(x)
93 #define MV_LE16_TO_CPU(x) le16_to_cpu(x)
94 #define MV_LE32_TO_CPU(x) le32_to_cpu(x)
96 #ifdef __BIG_ENDIAN_BITFIELD
97 #define MV_BIG_ENDIAN_BITFIELD
100 /* System dependent register read / write in byte/word/dword variants */
101 #define MV_REG_WRITE_BYTE(base, offset, val) writeb(val, base + offset)
102 #define MV_REG_WRITE_WORD(base, offset, val) writew(val, base + offset)
103 #define MV_REG_WRITE_DWORD(base, offset, val) writel(val, base + offset)
104 #define MV_REG_READ_BYTE(base, offset) readb(base + offset)
105 #define MV_REG_READ_WORD(base, offset) readw(base + offset)
106 #define MV_REG_READ_DWORD(base, offset) readl(base + offset)
111 /* System dependant typedefs */
112 typedef void *MV_VOID_PTR
;
113 typedef u32
*MV_U32_PTR
;
114 typedef u16
*MV_U16_PTR
;
115 typedef u8
*MV_U8_PTR
;
116 typedef char *MV_CHAR_PTR
;
117 typedef void *MV_BUS_ADDR_T
;
118 typedef unsigned long MV_CPU_FLAGS
;
122 /* System dependent structure */
123 typedef struct mvOsSemaphore
129 /* Functions (User implemented)*/
131 /* Semaphore init, take and release */
132 #define mvOsSemInit(x) MV_TRUE
133 #define mvOsSemTake(x)
134 #define mvOsSemRelease(x)
136 /* Interrupt masking and unmasking functions */
137 MV_CPU_FLAGS
mvOsSaveFlagsAndMaskCPUInterrupts(MV_VOID
);
138 MV_VOID
mvOsRestoreFlags(MV_CPU_FLAGS
);
140 /* Delay function in micro seconds resolution */
141 void mvMicroSecondsDelay(MV_VOID_PTR
, MV_U32
);
144 typedef enum mvBoolean
149 /* System logging function */
151 /* Enable READ/WRITE Long SCSI command only when driver is compiled for debugging */
153 #define MV_SATA_SUPPORT_READ_WRITE_LONG
156 #define MV_IAL_LOG_ID 3
158 #endif /* __INCmvOsLinuxh */
This page took 0.055338 seconds and 5 git commands to generate.