[U-Boot] [PATCH 4/5] spi: cadence_qspi: add reset handling
Simon Goldschmidt
simon.k.r.goldschmidt at gmail.com
Fri Jan 25 20:30:50 UTC 2019
This adds reset handling to the devicetree-enabled denalid nand driver.
For backwards compatibility, only a warning is printed when failing to
get reset handles.
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
---
drivers/spi/cadence_qspi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index 11fce9c4fe..f68c827e6d 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <fdtdec.h>
#include <malloc.h>
+#include <reset.h>
#include <spi.h>
#include <linux/errno.h>
#include "cadence_qspi.h"
@@ -154,10 +155,18 @@ static int cadence_spi_probe(struct udevice *bus)
{
struct cadence_spi_platdata *plat = bus->platdata;
struct cadence_spi_priv *priv = dev_get_priv(bus);
+ struct reset_ctl_bulk reset_bulk;
+ int ret;
priv->regbase = plat->regbase;
priv->ahbbase = plat->ahbbase;
+ ret = reset_get_bulk(bus, &reset_bulk);
+ if (ret)
+ dev_warn(bus, "Cant' get reset: %d\n", ret);
+ else
+ reset_deassert_bulk(&reset_bulk);
+
if (!priv->qspi_is_init) {
cadence_qspi_apb_controller_init(plat);
priv->qspi_is_init = 1;
--
2.17.1
More information about the U-Boot
mailing list