mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 08:18:47 +00:00
iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions
Some R-Car Gen3 SoCs has hardware restrictions on the IPMMU. So, to check whether this R-Car Gen3 SoC can use the IPMMU correctly, this patch modifies the ipmmu_slave_whitelist(). Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
31fc9763f9
commit
b7ee92c6ff
@ -751,12 +751,6 @@ static int ipmmu_init_platform_device(struct device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ipmmu_slave_whitelist(struct device *dev)
|
|
||||||
{
|
|
||||||
/* By default, do not allow use of IPMMU */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct soc_device_attribute soc_rcar_gen3[] = {
|
static const struct soc_device_attribute soc_rcar_gen3[] = {
|
||||||
{ .soc_id = "r8a774a1", },
|
{ .soc_id = "r8a774a1", },
|
||||||
{ .soc_id = "r8a7795", },
|
{ .soc_id = "r8a7795", },
|
||||||
@ -768,11 +762,35 @@ static const struct soc_device_attribute soc_rcar_gen3[] = {
|
|||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = {
|
||||||
|
{ .soc_id = "r8a7795", .revision = "ES3.*" },
|
||||||
|
{ .soc_id = "r8a77965", },
|
||||||
|
{ .soc_id = "r8a77990", },
|
||||||
|
{ .soc_id = "r8a77995", },
|
||||||
|
{ /* sentinel */ }
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool ipmmu_slave_whitelist(struct device *dev)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* For R-Car Gen3 use a white list to opt-in slave devices.
|
||||||
|
* For Other SoCs, this returns true anyway.
|
||||||
|
*/
|
||||||
|
if (!soc_device_match(soc_rcar_gen3))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* Check whether this R-Car Gen3 can use the IPMMU correctly or not */
|
||||||
|
if (!soc_device_match(soc_rcar_gen3_whitelist))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* By default, do not allow use of IPMMU */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static int ipmmu_of_xlate(struct device *dev,
|
static int ipmmu_of_xlate(struct device *dev,
|
||||||
struct of_phandle_args *spec)
|
struct of_phandle_args *spec)
|
||||||
{
|
{
|
||||||
/* For R-Car Gen3 use a white list to opt-in slave devices */
|
if (!ipmmu_slave_whitelist(dev))
|
||||||
if (soc_device_match(soc_rcar_gen3) && !ipmmu_slave_whitelist(dev))
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
iommu_fwspec_add_ids(dev, spec->args, 1);
|
iommu_fwspec_add_ids(dev, spec->args, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user