summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorLiu Gang <Gang.Liu@nxp.com>2016-08-11 11:14:30 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:40 (GMT)
commit237c326f4d008225de9bc06efcdf115b4ff03429 (patch)
tree1567d25a0955601ae090002351df18d9b91ac114 /drivers/pci
parentea1e295a8a216bb4adf75eb48428446416bb0ef8 (diff)
downloadlinux-237c326f4d008225de9bc06efcdf115b4ff03429.tar.xz
pci-ep/ls1046a: Add new input parameter to set transfer data
Add a new input parameter for PCI-EP test to set the different transfer data for each test time. Signed-off-by: Liu Gang <Gang.Liu@nxp.com> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pci-layerscape-ep-debugfs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/pci/host/pci-layerscape-ep-debugfs.c b/drivers/pci/host/pci-layerscape-ep-debugfs.c
index 53a037c..eb79222 100644
--- a/drivers/pci/host/pci-layerscape-ep-debugfs.c
+++ b/drivers/pci/host/pci-layerscape-ep-debugfs.c
@@ -72,6 +72,7 @@ struct ls_ep_test {
struct completion done;
u32 len;
int loop;
+ char data;
enum test_dirt dirt;
enum test_type type;
enum test_status status;
@@ -138,7 +139,7 @@ static int ls_pcie_ep_test_dma(struct ls_ep_test *test)
return -EINVAL;
}
- memset(test->buf, 0x5a, test->len);
+ memset(test->buf, test->data, test->len);
if (test->dirt == TEST_DIRT_WRITE) {
src = test->buf_addr;
@@ -226,7 +227,7 @@ static int ls_pcie_ep_test_cpy(struct ls_ep_test *test)
struct timespec start, end, period;
int i = 0;
- memset(test->buf, 0xa5, test->len);
+ memset(test->buf, test->data, test->len);
if (test->dirt == TEST_DIRT_WRITE) {
dst = test->out;
@@ -394,6 +395,7 @@ static int ls_pcie_ep_start_test(struct ls_ep_dev *ep, char *cmd)
enum test_type type;
enum test_dirt dirt;
u32 cnt, len, loop;
+ unsigned int data;
char dirt_str[2];
int ret;
@@ -402,10 +404,10 @@ static int ls_pcie_ep_start_test(struct ls_ep_dev *ep, char *cmd)
else
type = TEST_TYPE_MEMCPY;
- cnt = sscanf(&cmd[3], "%1s %u %u", dirt_str, &len, &loop);
- if (cnt != 3) {
+ cnt = sscanf(&cmd[4], "%1s %u %u %x", dirt_str, &len, &loop, &data);
+ if (cnt != 4) {
dev_info(&ep->dev, "format error %s", cmd);
- dev_info(&ep->dev, "dma/cpy <r/w> <packet_size> <loop>\n");
+ dev_info(&ep->dev, "dma/cpy <r/w> <packet_size> <loop> <data>\n");
return -EINVAL;
}
@@ -432,6 +434,7 @@ static int ls_pcie_ep_start_test(struct ls_ep_dev *ep, char *cmd)
test->len = len;
test->loop = loop;
test->type = type;
+ test->data = (char)data;
test->dirt = dirt;
strcpy(test->cmd, cmd);
test->thread = kthread_run(ls_pcie_ep_test_thread, test,