]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: xilinx: Read reg base address from DTS file
authorMichal Simek <michal.simek@xilinx.com>
Sat, 30 Jun 2018 02:45:17 +0000 (08:15 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 16 Jul 2018 08:31:20 +0000 (14:01 +0530)
This patch added support to read register base address from DTS file.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
drivers/spi/xilinx_spi.c

index 8f0f32f68f6bcb4fe15cb3c2ed5c050b2ba6b95d..cc5ac5183f5f98ea96a9e4641e3496afcd76fa17 100644 (file)
 #define CONFIG_XILINX_SPI_IDLE_VAL     GENMASK(7, 0)
 #endif
 
-#ifndef CONFIG_SYS_XILINX_SPI_LIST
-#define CONFIG_SYS_XILINX_SPI_LIST     { CONFIG_SYS_SPI_BASE }
-#endif
-
 /* xilinx spi register set */
 struct xilinx_spi_regs {
        u32 __space0__[7];
@@ -107,13 +103,12 @@ struct xilinx_spi_priv {
        unsigned int mode;
 };
 
-static unsigned long xilinx_spi_base_list[] = CONFIG_SYS_XILINX_SPI_LIST;
 static int xilinx_spi_probe(struct udevice *bus)
 {
        struct xilinx_spi_priv *priv = dev_get_priv(bus);
        struct xilinx_spi_regs *regs = priv->regs;
 
-       priv->regs = (struct xilinx_spi_regs *)xilinx_spi_base_list[bus->seq];
+       priv->regs = (struct xilinx_spi_regs *)devfdt_get_addr(bus);
 
        writel(SPISSR_RESET_VALUE, &regs->srr);