]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/cadence_qspi.c
test/py: fit: Open files as binary files
[u-boot] / drivers / spi / cadence_qspi.c
index 7b312f8e3e6beaea0ad62e193ecebb9d97981958..91742ba5f157ee22a43444ed2f5a40c7c4c50cd3 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2012
  * Altera Corporation <www.altera.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -284,18 +283,9 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
        const void *blob = gd->fdt_blob;
        int node = dev_of_offset(bus);
        int subnode;
-       u32 data[4];
-       int ret;
 
-       /* 2 base addresses are needed, lets get them from the DT */
-       ret = fdtdec_get_int_array(blob, node, "reg", data, ARRAY_SIZE(data));
-       if (ret) {
-               printf("Error: Can't get base addresses (ret=%d)!\n", ret);
-               return -ENODEV;
-       }
-
-       plat->regbase = (void *)data[0];
-       plat->ahbbase = (void *)data[2];
+       plat->regbase = (void *)devfdt_get_addr_index(bus, 0);
+       plat->ahbbase = (void *)devfdt_get_addr_index(bus, 1);
        plat->is_decoded_cs = fdtdec_get_bool(blob, node, "cdns,is-decoded-cs");
        plat->fifo_depth = fdtdec_get_uint(blob, node, "cdns,fifo-depth", 128);
        plat->fifo_width = fdtdec_get_uint(blob, node, "cdns,fifo-width", 4);