2 * Intel MIC Platform Software Stack (MPSS)
4 * Copyright(c) 2013 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
18 * Intel MIC Host driver.
21 #ifndef _MIC_DEVICE_H_
22 #define _MIC_DEVICE_H_
24 #include <linux/idr.h>
28 /* The maximum number of MIC devices supported in a single host system. */
29 #define MIC_MAX_NUM_DEVS 256
32 * enum mic_hw_family - The hardware family to which a device belongs.
40 * enum mic_stepping - MIC stepping ids.
50 * struct mic_device - MIC device information for each card.
52 * @mmio: MMIO bar information.
53 * @aper: Aperture bar information.
54 * @family: The MIC family to which this device belongs.
55 * @ops: MIC HW specific operations.
56 * @id: The unique device id for this MIC device.
57 * @stepping: Stepping ID.
58 * @attr_group: Pointer to list of sysfs attribute groups.
59 * @sdev: Device for sysfs entries.
60 * @mic_mutex: Mutex for synchronizing access to mic_device.
61 * @intr_ops: HW specific interrupt operations.
62 * @smpt_ops: Hardware specific SMPT operations.
63 * @smpt: MIC SMPT information.
64 * @intr_info: H/W specific interrupt information.
65 * @irq_info: The OS specific irq information
70 enum mic_hw_family family
;
71 struct mic_hw_ops
*ops
;
73 enum mic_stepping stepping
;
74 const struct attribute_group
**attr_group
;
76 struct mutex mic_mutex
;
77 struct mic_hw_intr_ops
*intr_ops
;
78 struct mic_smpt_ops
*smpt_ops
;
79 struct mic_smpt_info
*smpt
;
80 struct mic_intr_info
*intr_info
;
81 struct mic_irq_info irq_info
;
85 * struct mic_hw_ops - MIC HW specific operations.
86 * @aper_bar: Aperture bar resource number.
87 * @mmio_bar: MMIO bar resource number.
88 * @read_spad: Read from scratch pad register.
89 * @write_spad: Write to scratch pad register.
90 * @send_intr: Send an interrupt for a particular doorbell on the card.
91 * @ack_interrupt: Hardware specific operations to ack the h/w on
92 * receipt of an interrupt.
97 u32 (*read_spad
)(struct mic_device
*mdev
, unsigned int idx
);
98 void (*write_spad
)(struct mic_device
*mdev
, unsigned int idx
, u32 val
);
99 void (*send_intr
)(struct mic_device
*mdev
, int doorbell
);
100 u32 (*ack_interrupt
)(struct mic_device
*mdev
);
104 * mic_mmio_read - read from an MMIO register.
105 * @mw: MMIO register base virtual address.
106 * @offset: register offset.
108 * RETURNS: register value.
110 static inline u32
mic_mmio_read(struct mic_mw
*mw
, u32 offset
)
112 return ioread32(mw
->va
+ offset
);
116 * mic_mmio_write - write to an MMIO register.
117 * @mw: MMIO register base virtual address.
118 * @val: the data value to put into the register
119 * @offset: register offset.
124 mic_mmio_write(struct mic_mw
*mw
, u32 val
, u32 offset
)
126 iowrite32(val
, mw
->va
+ offset
);
129 void mic_sysfs_init(struct mic_device
*mdev
);
This page took 0.035027 seconds and 5 git commands to generate.