[U-Boot] [PATCH] spi: xilinx_spi: Add support for Quad mode

Jagan Teki jagannadh.teki at gmail.com
Tue Jul 26 07:45:59 CEST 2016


On 26 July 2016 at 10:44, Siva Durga Prasad Paladugu
<siva.durga.paladugu at xilinx.com> wrote:
> From: Siva Durga Prasad Paladugu <siva.durga.paladugu at xilinx.com>
>
> Add Quad mode support for xilinx spi driver
> Inform the spi framework about quad mode
> capability by reading it from devicetree.
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>  drivers/spi/xilinx_spi.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
> index a951a77..3e01c66 100644
> --- a/drivers/spi/xilinx_spi.c
> +++ b/drivers/spi/xilinx_spi.c
> @@ -21,6 +21,8 @@
>  #include <spi.h>
>  #include <asm/io.h>
>
> +DECLARE_GLOBAL_DATA_PTR;
> +
>  /*
>   * [0]: http://www.xilinx.com/support/documentation
>   *
> @@ -82,6 +84,8 @@
>  #define CONFIG_SYS_XILINX_SPI_LIST     { CONFIG_SYS_SPI_BASE }
>  #endif
>
> +#define XILINX_SPI_QUAD_MODE   2
> +
>  /* xilinx spi register set */
>  struct xilinx_spi_regs {
>         u32 __space0__[7];
> @@ -109,6 +113,22 @@ struct xilinx_spi_priv {
>  };
>
>  static unsigned long xilinx_spi_base_list[] = CONFIG_SYS_XILINX_SPI_LIST;
> +
> +static int xilinx_spi_child_pre_probe(struct udevice *bus)
> +{
> +       struct spi_slave *slave = dev_get_parent_priv(bus);
> +       struct udevice *dev = dev_get_parent(bus);
> +       int spimode;
> +
> +       spimode = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "xlnx,spi-mode",
> +                                -1);
> +
> +       if (spimode == XILINX_SPI_QUAD_MODE)
> +               slave->op_mode_rx = SPI_OPM_RX_QOF;

This is wrong, use platdata in spi-uclass that in-turn detect the mode
from dt and SPI_OPM_RX_QOF is never exit.

thanks!
-- 
Jagan.


More information about the U-Boot mailing list