Skip to content

Commit 9466a08

Browse files
Dylan.WuDylan.Wu
authored andcommitted
ACPI: Add helper to check OEM_ID in ACPI IORT table
adds a utility function acpi_check_oem_id() to detect whether the system firmware identifies a specific OEM_ID in the ACPI IORT table Signed-off-by: wenxue.ding <[email protected]> Signed-off-by: Dylan.Wu" <[email protected]>
1 parent 5315839 commit 9466a08

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,6 +2880,34 @@ static int arm_smmu_dev_disable_feature(struct device *dev,
28802880
}
28812881
}
28822882

2883+
/*
2884+
* Check OEM_ID with a specific OEM provider.
2885+
*/
2886+
#ifdef CONFIG_ACPI
2887+
static bool acpi_check_oem_id(struct device *dev, const char *oem_id)
2888+
{
2889+
if (oem_id && has_acpi_companion(dev)) {
2890+
struct acpi_table_header *iort_table;
2891+
2892+
acpi_status status = acpi_get_table(ACPI_SIG_IORT, 0, &iort_table);
2893+
2894+
if (ACPI_FAILURE(status)) {
2895+
if (status != AE_NOT_FOUND) {
2896+
const char *msg = acpi_format_exception(status);
2897+
2898+
pr_warn("Failed to get table, %s\n", msg);
2899+
}
2900+
return 0;
2901+
}
2902+
2903+
if (!strncmp(iort_table->oem_id, oem_id, 6))
2904+
return 1;
2905+
2906+
}
2907+
return 0;
2908+
}
2909+
#endif
2910+
28832911
/*
28842912
* HiSilicon PCIe tune and trace device can be used to trace TLP headers on the
28852913
* PCIe link and save the data to memory by DMA. The hardware is restricted to

0 commit comments

Comments
 (0)