summaryrefslogtreecommitdiffstats
path: root/cf-fsi-test.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-10 15:18:14 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-10 15:18:14 +1000
commit6daf2cbaf306ab990f6d0bba8c85ad8ec53cfad4 (patch)
treea51388ae9275f78893fa2c22bcc80a10e91fe9ea /cf-fsi-test.c
parentf50ec8699ed913ada82c031c8396c8ed0f1bbf29 (diff)
downloadcf-fsi-6daf2cbaf306ab990f6d0bba8c85ad8ec53cfad4.tar.gz
cf-fsi-6daf2cbaf306ab990f6d0bba8c85ad8ec53cfad4.zip
sync with kernel code
Diffstat (limited to 'cf-fsi-test.c')
-rw-r--r--cf-fsi-test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cf-fsi-test.c b/cf-fsi-test.c
index 6494ea3..ef9435b 100644
--- a/cf-fsi-test.c
+++ b/cf-fsi-test.c
@@ -430,6 +430,12 @@ static void msg_push_crc(struct fsi_gpio_msg *msg)
msg_push_bits(msg, crc, 4);
}
+static void msg_finish_cmd(struct fsi_gpio_msg *cmd)
+{
+ /* Left align message */
+ cmd->msg <<= (64 - cmd->bits);
+}
+
static bool check_same_address(int id, uint32_t addr)
{
/* this will also handle LAST_ADDR_INVALID */
@@ -531,6 +537,7 @@ static void build_ar_command(struct fsi_gpio_msg *cmd, uint8_t id,
msg_push_bits(cmd, ((uint8_t *)data)[i], 8);
msg_push_crc(cmd);
+ msg_finish_cmd(cmd);
}
static void dump_stuff(void)
@@ -610,9 +617,6 @@ int test_rw(uint32_t addr, bool is_write, uint32_t *data)
} else
build_ar_command(&cmd, 0, addr, 4, NULL);
- /* Left align message */
- cmd.msg <<= (64 - cmd.bits);
-
/* Store message into SRAM */
writel(htonl(cmd.msg >> 32), sysreg + SRAM_BASE + CMD_DATA);
writel(htonl(cmd.msg & 0xffffffff), sysreg + SRAM_BASE + CMD_DATA + 4);
OpenPOWER on IntegriCloud