Skip to content

Commit f143304

Browse files
committed
fsi: scom: Add register definitions
Add a few more register and bit definitions, also define and use SCOM_READ_CMD (which is 0 but it makes the code clearer) Signed-off-by: Benjamin Herrenschmidt <[email protected]> Reviewed-by: Eddie James <[email protected]>
1 parent 5a3c2f7 commit f143304

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/fsi/fsi-scom.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,25 @@
3030
#define SCOM_DATA0_REG 0x00
3131
#define SCOM_DATA1_REG 0x04
3232
#define SCOM_CMD_REG 0x08
33+
#define SCOM_FSI2PIB_RESET_REG 0x18
34+
#define SCOM_STATUS_REG 0x1C /* Read */
35+
#define SCOM_PIB_RESET_REG 0x1C /* Write */
3336

37+
/* Command register */
3438
#define SCOM_WRITE_CMD 0x80000000
39+
#define SCOM_READ_CMD 0x00000000
40+
41+
/* Status register bits */
42+
#define SCOM_STATUS_ERR_SUMMARY 0x80000000
43+
#define SCOM_STATUS_PROTECTION 0x01000000
44+
#define SCOM_STATUS_PIB_ABORT 0x00100000
45+
#define SCOM_STATUS_PIB_RESP_MASK 0x00007000
46+
#define SCOM_STATUS_PIB_RESP_SHIFT 12
47+
48+
#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_ERR_SUMMARY | \
49+
SCOM_STATUS_PROTECTION | \
50+
SCOM_STATUS_PIB_ABORT | \
51+
SCOM_STATUS_PIB_RESP_MASK)
3552

3653
struct scom_device {
3754
struct list_head link;
@@ -85,7 +102,7 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value,
85102

86103
mutex_lock(&scom_dev->lock);
87104
*value = 0ULL;
88-
data = cpu_to_be32(addr);
105+
data = cpu_to_be32(SCOM_READ_CMD | addr);
89106
rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data,
90107
sizeof(uint32_t));
91108
if (rc)

0 commit comments

Comments
 (0)