|
@@ -21,6 +21,7 @@
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/pm_runtime.h>
|
|
|
|
+#include <linux/reset.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
|
|
#define RNG_CR 0x00
|
|
#define RNG_CR 0x00
|
|
@@ -46,6 +47,7 @@ struct stm32_rng_private {
|
|
struct hwrng rng;
|
|
struct hwrng rng;
|
|
void __iomem *base;
|
|
void __iomem *base;
|
|
struct clk *clk;
|
|
struct clk *clk;
|
|
|
|
+ struct reset_control *rst;
|
|
};
|
|
};
|
|
|
|
|
|
static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
|
|
static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
|
|
@@ -140,6 +142,13 @@ static int stm32_rng_probe(struct platform_device *ofdev)
|
|
if (IS_ERR(priv->clk))
|
|
if (IS_ERR(priv->clk))
|
|
return PTR_ERR(priv->clk);
|
|
return PTR_ERR(priv->clk);
|
|
|
|
|
|
|
|
+ priv->rst = devm_reset_control_get(&ofdev->dev, NULL);
|
|
|
|
+ if (!IS_ERR(priv->rst)) {
|
|
|
|
+ reset_control_assert(priv->rst);
|
|
|
|
+ udelay(2);
|
|
|
|
+ reset_control_deassert(priv->rst);
|
|
|
|
+ }
|
|
|
|
+
|
|
dev_set_drvdata(dev, priv);
|
|
dev_set_drvdata(dev, priv);
|
|
|
|
|
|
priv->rng.name = dev_driver_string(dev),
|
|
priv->rng.name = dev_driver_string(dev),
|