crypto: caam - add backward compatible string sec4.0
In some device trees of previous version, there were string "fsl,sec4.0". To be backward compatible with device trees, we have CAAM driver first check "fsl,sec-v4.0", if it fails, then check for "fsl,sec4.0". Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Acked-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
6a76a69923
commit
a0ea0f6d17
2 changed files with 26 additions and 4 deletions
|
@ -2267,8 +2267,11 @@ static void __exit caam_algapi_exit(void)
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
|
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
|
||||||
if (!dev_node)
|
if (!dev_node) {
|
||||||
return;
|
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
|
||||||
|
if (!dev_node)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pdev = of_find_device_by_node(dev_node);
|
pdev = of_find_device_by_node(dev_node);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
|
@ -2350,8 +2353,11 @@ static int __init caam_algapi_init(void)
|
||||||
int i = 0, err = 0;
|
int i = 0, err = 0;
|
||||||
|
|
||||||
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
|
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
|
||||||
if (!dev_node)
|
if (!dev_node) {
|
||||||
return -ENODEV;
|
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
|
||||||
|
if (!dev_node)
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
pdev = of_find_device_by_node(dev_node);
|
pdev = of_find_device_by_node(dev_node);
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
|
|
|
@ -98,6 +98,12 @@ static int caam_probe(struct platform_device *pdev)
|
||||||
rspec = 0;
|
rspec = 0;
|
||||||
for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring")
|
for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring")
|
||||||
rspec++;
|
rspec++;
|
||||||
|
if (!rspec) {
|
||||||
|
/* for backward compatible with device trees */
|
||||||
|
for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring")
|
||||||
|
rspec++;
|
||||||
|
}
|
||||||
|
|
||||||
ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL);
|
ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL);
|
||||||
if (ctrlpriv->jrdev == NULL) {
|
if (ctrlpriv->jrdev == NULL) {
|
||||||
iounmap(&topregs->ctrl);
|
iounmap(&topregs->ctrl);
|
||||||
|
@ -111,6 +117,13 @@ static int caam_probe(struct platform_device *pdev)
|
||||||
ctrlpriv->total_jobrs++;
|
ctrlpriv->total_jobrs++;
|
||||||
ring++;
|
ring++;
|
||||||
}
|
}
|
||||||
|
if (!ring) {
|
||||||
|
for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") {
|
||||||
|
caam_jr_probe(pdev, np, ring);
|
||||||
|
ctrlpriv->total_jobrs++;
|
||||||
|
ring++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to see if QI present. If so, enable */
|
/* Check to see if QI present. If so, enable */
|
||||||
ctrlpriv->qi_present = !!(rd_reg64(&topregs->ctrl.perfmon.comp_parms) &
|
ctrlpriv->qi_present = !!(rd_reg64(&topregs->ctrl.perfmon.comp_parms) &
|
||||||
|
@ -226,6 +239,9 @@ static struct of_device_id caam_match[] = {
|
||||||
{
|
{
|
||||||
.compatible = "fsl,sec-v4.0",
|
.compatible = "fsl,sec-v4.0",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.compatible = "fsl,sec4.0",
|
||||||
|
},
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, caam_match);
|
MODULE_DEVICE_TABLE(of, caam_match);
|
||||||
|
|
Loading…
Add table
Reference in a new issue