]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/xilinx_spi.c
ddr: altera: stratix10: Add DDR support for Stratix10 SoC
[u-boot] / drivers / spi / xilinx_spi.c
index 76201630e5109b07f0400246ff3f994edd63b0ea..8f0f32f68f6bcb4fe15cb3c2ed5c050b2ba6b95d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Xilinx SPI driver
  *
@@ -9,8 +10,6 @@
  * Copyright (c) 2010 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
  * Copyright (c) 2010 Thomas Chou <thomas@wytron.com.tw>
  * Copyright (c) 2005-2008 Analog Devices Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 #define SPISR_RX_EMPTY         BIT(0)
 
 /* SPI Data Transmit Register (spidtr), [1] p12, [2] p12 */
-#define SPIDTR_8BIT_MASK       (0xff << 0)
-#define SPIDTR_16BIT_MASK      (0xffff << 0)
-#define SPIDTR_32BIT_MASK      (0xffffffff << 0)
+#define SPIDTR_8BIT_MASK       GENMASK(7, 0)
+#define SPIDTR_16BIT_MASK      GENMASK(15, 0)
+#define SPIDTR_32BIT_MASK      GENMASK(31, 0)
 
 /* SPI Data Receive Register (spidrr), [1] p12, [2] p12 */
-#define SPIDRR_8BIT_MASK       (0xff << 0)
-#define SPIDRR_16BIT_MASK      (0xffff << 0)
-#define SPIDRR_32BIT_MASK      (0xffffffff << 0)
+#define SPIDRR_8BIT_MASK       GENMASK(7, 0)
+#define SPIDRR_16BIT_MASK      GENMASK(15, 0)
+#define SPIDRR_32BIT_MASK      GENMASK(31, 0)
 
 /* SPI Slave Select Register (spissr), [1] p13, [2] p13 */
 #define SPISSR_MASK(cs)                (1 << (cs))
@@ -75,7 +74,7 @@
 #define XILSPI_SPICR_DFLT_OFF  (SPICR_MASTER_INHIBIT | SPICR_MANUAL_SS)
 
 #ifndef CONFIG_XILINX_SPI_IDLE_VAL
-#define CONFIG_XILINX_SPI_IDLE_VAL     0xff
+#define CONFIG_XILINX_SPI_IDLE_VAL     GENMASK(7, 0)
 #endif
 
 #ifndef CONFIG_SYS_XILINX_SPI_LIST
@@ -287,7 +286,8 @@ static const struct dm_spi_ops xilinx_spi_ops = {
 };
 
 static const struct udevice_id xilinx_spi_ids[] = {
-       { .compatible = "xlnx,xilinx-spi" },
+       { .compatible = "xlnx,xps-spi-2.00.a" },
+       { .compatible = "xlnx,xps-spi-2.00.b" },
        { }
 };