1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * FUJITSU Extended Socket Network Device driver
4 * Copyright (c) 2015 FUJITSU LIMITED
10 #include <linux/bitops.h>
12 #define XSCT_DEVICE_REGISTER_SIZE 0x1000
15 /* Information registers */
16 #define XSCT_OWNER_EPID 0x0000 /* Owner EPID */
17 #define XSCT_MAX_EP 0x0004 /* Maximum EP */
19 /* Device Control registers */
20 #define XSCT_DCTL 0x0010 /* Device Control */
22 /* Command Control registers */
23 #define XSCT_CR 0x0020 /* Command request */
24 #define XSCT_CS 0x0024 /* Command status */
25 #define XSCT_SHSTSAL 0x0028 /* Share status address Low */
26 #define XSCT_SHSTSAH 0x002C /* Share status address High */
28 #define XSCT_REQBL 0x0034 /* Request Buffer length */
29 #define XSCT_REQBAL 0x0038 /* Request Buffer Address Low */
30 #define XSCT_REQBAH 0x003C /* Request Buffer Address High */
32 #define XSCT_RESPBL 0x0044 /* Response Buffer Length */
33 #define XSCT_RESPBAL 0x0048 /* Response Buffer Address Low */
34 #define XSCT_RESPBAH 0x004C /* Response Buffer Address High */
36 /* Interrupt Control registers */
37 #define XSCT_IS 0x0080 /* Interrupt status */
38 #define XSCT_IMS 0x0084 /* Interrupt mask set */
39 #define XSCT_IMC 0x0088 /* Interrupt mask clear */
40 #define XSCT_IG 0x008C /* Interrupt generator */
41 #define XSCT_ICTL 0x0090 /* Interrupt control */
43 /* register structure */
44 /* Information registers */
45 union REG_OWNER_EPID
{
61 /* Device Control registers */
71 /* Command Control registers */
92 /* Interrupt Control registers */
102 REG_ICTL_MASK_INFO_UPDATE
= 1 << 20,
103 REG_ICTL_MASK_DEV_STOP_REQ
= 1 << 19,
104 REG_ICTL_MASK_TXRX_STOP_REQ
= 1 << 18,
105 REG_ICTL_MASK_TXRX_STOP_DONE
= 1 << 17,
106 REG_ICTL_MASK_RX_DATA
= 1 << 16,
107 REG_ICTL_MASK_ALL
= GENMASK(20, 16),
111 REG_IS_MASK_IS_ASSERT
= 1 << 31,
112 REG_IS_MASK_EPID
= GENMASK(15, 0),
117 u32
fjes_hw_rd32(struct fjes_hw
*hw
, u32 reg
);
119 #define wr32(reg, val) \
121 u8 *base = hw->base; \
122 writel((val), &base[(reg)]); \
125 #define rd32(reg) (fjes_hw_rd32(hw, reg))
127 #endif /* FJES_REGS_H_ */