iommu: arm-smmu: Update debugfs path for testbus and capture bus

Since, QCOM_IOMMU_DEBUG is now used for iommu debug instead of
IOMMU_DEBUGFS, Update the debugfs path for testbus and capture bus
with the same. Also add CONFIG_ARM_SMMU_CAPTUREBUS_DEBUGFS
for capture bus debugfs.

Change-Id: I9074e99c6574332464c30f530064b9e062b1e614
Signed-off-by: Vijayanand Jitta <quic_vjitta@quicinc.com>
This commit is contained in:
Vijayanand Jitta 2021-12-22 16:23:19 +05:30
parent 3bd18aada1
commit 7c7851ec2f
2 changed files with 40 additions and 14 deletions

View File

@ -393,13 +393,23 @@ config ARM_SMMU_SELFTEST
config ARM_SMMU_TESTBUS_DEBUGFS
bool "Expose testbus control debugfs nodes"
depends on ARM_SMMU && IOMMU_DEBUGFS
depends on ARM_SMMU && QCOM_IOMMU_DEBUG
help
Support for exposing debugfs nodes to set testbus select values
for selecting a testbus to inspect for a particular TCU/TBU
on an SMMU. This also exposes debugfs nodes to read testbus output
after the output has been selected.
config ARM_SMMU_CAPTUREBUS_DEBUGFS
bool "Expose capturebus control debugfs nodes"
depends on ARM_SMMU && QCOM_IOMMU_DEBUG
help
Support for exposing debugfs nodes to configure capturebus for each
tbu of an SMMU. This also exposes debugfs nodes to get the snapshot
of capturebus.
If unsure, say N here.
config ARM_SMMU_V3
tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
depends on ARM64

View File

@ -415,9 +415,20 @@ static struct qsmmuv500_tbu_device *qsmmuv500_find_tbu(
static DEFINE_MUTEX(capture_reg_lock);
static DEFINE_SPINLOCK(testbus_lock);
#ifdef CONFIG_IOMMU_DEBUGFS
static struct dentry *debugfs_capturebus_dir;
#endif
__maybe_unused static struct dentry *get_iommu_test_dir(void)
{
struct dentry *iommu_test_dir;
int ret;
iommu_test_dir = debugfs_lookup("iommu-test", NULL);
if (IS_ERR_OR_NULL(iommu_test_dir)) {
ret = PTR_ERR(iommu_test_dir);
pr_err_ratelimited("Unable to find iommu-test directory, ret=%d\n",
ret);
return NULL;
}
return iommu_test_dir;
}
#ifdef CONFIG_ARM_SMMU_TESTBUS_DEBUGFS
static struct dentry *debugfs_testbus_dir;
@ -572,14 +583,15 @@ static const struct file_operations arm_smmu_debug_tcu_testbus_fops = {
static int qsmmuv500_tcu_testbus_init(struct arm_smmu_device *smmu)
{
struct dentry *testbus_dir;
struct dentry *testbus_dir, *iommu_test_dir;
if (!iommu_debugfs_dir)
iommu_test_dir = get_iommu_test_dir();
if (!iommu_test_dir)
return 0;
if (!debugfs_testbus_dir) {
debugfs_testbus_dir = debugfs_create_dir("testbus",
iommu_debugfs_dir);
iommu_test_dir);
if (IS_ERR(debugfs_testbus_dir)) {
pr_err_ratelimited("Couldn't create iommu/testbus debugfs directory\n");
return -ENODEV;
@ -664,14 +676,15 @@ static const struct file_operations arm_smmu_debug_tbu_testbus_fops = {
static int qsmmuv500_tbu_testbus_init(struct qsmmuv500_tbu_device *tbu)
{
struct dentry *testbus_dir;
struct dentry *testbus_dir, *iommu_test_dir;
if (!iommu_debugfs_dir)
iommu_test_dir = get_iommu_test_dir();
if (!iommu_test_dir)
return 0;
if (!debugfs_testbus_dir) {
debugfs_testbus_dir = debugfs_create_dir("testbus",
iommu_debugfs_dir);
iommu_test_dir);
if (IS_ERR(debugfs_testbus_dir)) {
pr_err_ratelimited("Couldn't create iommu/testbus debugfs directory\n");
return -ENODEV;
@ -1037,17 +1050,20 @@ static const struct file_operations arm_smmu_debug_capturebus_config_fops = {
.read = arm_smmu_debug_capturebus_config_read,
};
#ifdef CONFIG_IOMMU_DEBUGFS
#ifdef CONFIG_ARM_SMMU_CAPTUREBUS_DEBUGFS
static struct dentry *debugfs_capturebus_dir;
static int qsmmuv500_capturebus_init(struct qsmmuv500_tbu_device *tbu)
{
struct dentry *capturebus_dir;
struct dentry *capturebus_dir, *iommu_test_dir;
if (!iommu_debugfs_dir)
iommu_test_dir = get_iommu_test_dir();
if (!iommu_test_dir)
return 0;
if (!debugfs_capturebus_dir) {
debugfs_capturebus_dir = debugfs_create_dir(
"capturebus", iommu_debugfs_dir);
"capturebus", iommu_test_dir);
if (IS_ERR(debugfs_capturebus_dir)) {
dev_err_ratelimited(tbu->dev, "Couldn't create iommu/capturebus debugfs directory\n");
return PTR_ERR(debugfs_capturebus_dir);