]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/altera_spi.c
dwc2 USB controller hangs with lan78xx
[u-boot] / drivers / spi / altera_spi.c
index e49949b4a2c1190fd4dc3a5a862a541d212773c0..e24deb4f71fac4f3fbc8f81a7b496ac7b9849ee7 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Altera SPI driver
  *
  * based on bfin_spi.c
  * Copyright (c) 2005-2008 Analog Devices Inc.
  * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <dm.h>
@@ -15,8 +14,6 @@
 #include <spi.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define ALTERA_SPI_STATUS_RRDY_MSK     BIT(7)
 #define ALTERA_SPI_CONTROL_SSO_MSK     BIT(10)
 
@@ -174,8 +171,9 @@ static int altera_spi_ofdata_to_platdata(struct udevice *bus)
 {
        struct altera_spi_platdata *plat = dev_get_platdata(bus);
 
-       plat->regs = ioremap(dev_get_addr(bus),
-               sizeof(struct altera_spi_regs));
+       plat->regs = map_physmem(devfdt_get_addr(bus),
+                                sizeof(struct altera_spi_regs),
+                                MAP_NOCACHE);
 
        return 0;
 }
@@ -193,8 +191,8 @@ static const struct dm_spi_ops altera_spi_ops = {
 };
 
 static const struct udevice_id altera_spi_ids[] = {
-       { .compatible = "altr,spi-1.0", },
-       { }
+       { .compatible = "altr,spi-1.0" },
+       {}
 };
 
 U_BOOT_DRIVER(altera_spi) = {