Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fpga: dfl: afu: add STP (SignalTap) support

STP (SignalTap) is one of the private features under the port for
debugging. This patch adds private feature driver support for it
to allow userspace applications to mmap related mmio region and
provide STP service.

Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Wu Hao <hao.wu@intel.com>
Acked-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Moritz Fischer <mdf@kernel.org>

authored by

Wu Hao and committed by
Moritz Fischer
bd127b81 44d24753

+25
+25
drivers/fpga/dfl-afu-main.c
··· 508 508 .init = port_afu_init, 509 509 }; 510 510 511 + static int port_stp_init(struct platform_device *pdev, 512 + struct dfl_feature *feature) 513 + { 514 + struct resource *res = &pdev->resource[feature->resource_index]; 515 + 516 + return afu_mmio_region_add(dev_get_platdata(&pdev->dev), 517 + DFL_PORT_REGION_INDEX_STP, 518 + resource_size(res), res->start, 519 + DFL_PORT_REGION_MMAP | DFL_PORT_REGION_READ | 520 + DFL_PORT_REGION_WRITE); 521 + } 522 + 523 + static const struct dfl_feature_id port_stp_id_table[] = { 524 + {.id = PORT_FEATURE_ID_STP,}, 525 + {0,} 526 + }; 527 + 528 + static const struct dfl_feature_ops port_stp_ops = { 529 + .init = port_stp_init, 530 + }; 531 + 511 532 static struct dfl_feature_driver port_feature_drvs[] = { 512 533 { 513 534 .id_table = port_hdr_id_table, ··· 541 520 { 542 521 .id_table = port_err_id_table, 543 522 .ops = &port_err_ops, 523 + }, 524 + { 525 + .id_table = port_stp_id_table, 526 + .ops = &port_stp_ops, 544 527 }, 545 528 { 546 529 .ops = NULL,