2 * FUJITSU Extended Socket Network Device driver
3 * Copyright (c) 2015 FUJITSU LIMITED
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, see <http://www.gnu.org/licenses/>.
17 * The full GNU General Public License is included in this distribution in
18 * the file called "COPYING".
25 #include <linux/bitops.h>
27 #define XSCT_DEVICE_REGISTER_SIZE 0x1000
30 /* Information registers */
31 #define XSCT_OWNER_EPID 0x0000 /* Owner EPID */
32 #define XSCT_MAX_EP 0x0004 /* Maximum EP */
34 /* Device Control registers */
35 #define XSCT_DCTL 0x0010 /* Device Control */
37 /* Command Control registers */
38 #define XSCT_CR 0x0020 /* Command request */
39 #define XSCT_CS 0x0024 /* Command status */
40 #define XSCT_SHSTSAL 0x0028 /* Share status address Low */
41 #define XSCT_SHSTSAH 0x002C /* Share status address High */
43 #define XSCT_REQBL 0x0034 /* Request Buffer length */
44 #define XSCT_REQBAL 0x0038 /* Request Buffer Address Low */
45 #define XSCT_REQBAH 0x003C /* Request Buffer Address High */
47 #define XSCT_RESPBL 0x0044 /* Response Buffer Length */
48 #define XSCT_RESPBAL 0x0048 /* Response Buffer Address Low */
49 #define XSCT_RESPBAH 0x004C /* Response Buffer Address High */
51 /* Interrupt Control registers */
52 #define XSCT_IS 0x0080 /* Interrupt status */
53 #define XSCT_IMS 0x0084 /* Interrupt mask set */
54 #define XSCT_IMC 0x0088 /* Interrupt mask clear */
55 #define XSCT_IG 0x008C /* Interrupt generator */
56 #define XSCT_ICTL 0x0090 /* Interrupt control */
58 /* register structure */
59 /* Information registers */
60 union REG_OWNER_EPID
{
76 /* Device Control registers */
86 /* Command Control registers */
107 /* Interrupt Control registers */
117 REG_ICTL_MASK_INFO_UPDATE
= 1 << 20,
118 REG_ICTL_MASK_DEV_STOP_REQ
= 1 << 19,
119 REG_ICTL_MASK_TXRX_STOP_REQ
= 1 << 18,
120 REG_ICTL_MASK_TXRX_STOP_DONE
= 1 << 17,
121 REG_ICTL_MASK_RX_DATA
= 1 << 16,
122 REG_ICTL_MASK_ALL
= GENMASK(20, 16),
126 REG_IS_MASK_IS_ASSERT
= 1 << 31,
127 REG_IS_MASK_EPID
= GENMASK(15, 0),
132 u32
fjes_hw_rd32(struct fjes_hw
*hw
, u32 reg
);
134 #define wr32(reg, val) \
136 u8 *base = hw->base; \
137 writel((val), &base[(reg)]); \
140 #define rd32(reg) (fjes_hw_rd32(hw, reg))
142 #endif /* FJES_REGS_H_ */