*
* Support for Tegra Security Engine Elliptic crypto algorithms.
*
- * Copyright (c) 2015-2016, NVIDIA Corporation. All Rights Reserved.
+ * Copyright (c) 2015-2017, NVIDIA Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
struct tegra_se_elp_chipdata {
bool use_key_slot;
+ bool rng1_supported;
};
struct tegra_se_elp_dev {
static struct tegra_se_elp_chipdata tegra18_se_chipdata = {
.use_key_slot = false,
+ .rng1_supported = true,
+};
+
+static struct tegra_se_elp_chipdata tegra21_se_chipdata = {
+ .use_key_slot = false,
+ .rng1_supported = false,
};
static int tegra_se_elp_probe(struct platform_device *pdev)
se_dev->io_reg[i] = devm_ioremap_resource(se_dev->dev, res);
if (IS_ERR(se_dev->io_reg[i]))
return PTR_ERR(se_dev->io_reg[i]);
+
+ if (!se_dev->chipdata->rng1_supported)
+ break;
}
se_dev->c = devm_clk_get(se_dev->dev, "se");
return err;
}
- se_dev->rdata = devm_kzalloc(se_dev->dev,
- sizeof(u32) * 4, GFP_KERNEL);
- if (!se_dev->rdata) {
- err = -ENOMEM;
- goto exit;
+ if (se_dev->chipdata->rng1_supported) {
+ se_dev->rdata = devm_kzalloc(se_dev->dev,
+ sizeof(u32) * 4, GFP_KERNEL);
+ if (!se_dev->rdata) {
+ err = -ENOMEM;
+ goto exit;
+ }
}
elp_dev = se_dev;
{
.compatible = "nvidia,tegra186-se-elp",
.data = &tegra18_se_chipdata,
+ }, {
+ .compatible = "nvidia,tegra214-se-elp",
+ .data = &tegra21_se_chipdata,
}, {
},
};