[U-Boot] [PATCH 1/9] spi: zynq_qspi: Add quad support for zynq qspi

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Mon Jun 6 11:44:46 CEST 2016


Add quad commands supports for zynq qspi driver

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
---
- Tested on zc702 board
---
 drivers/spi/zynq_qspi.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
index b98663c..e636244 100644
--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
@@ -11,7 +11,9 @@
 #include <dm.h>
 #include <malloc.h>
 #include <spi.h>
+#include <spi_flash.h>
 #include <asm/io.h>
+#include "../mtd/spi/sf_internal.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -156,6 +158,17 @@ static void zynq_qspi_init_hw(struct zynq_qspi_priv *priv)
 	writel(ZYNQ_QSPI_ENR_SPI_EN_MASK, &regs->enr);
 }
 
+static int zynq_qspi_child_pre_probe(struct udevice *bus)
+{
+	struct spi_slave *slave = dev_get_parent_priv(bus);
+
+	slave->mode_rx = QUAD_OUTPUT_FAST;
+	slave->mode = SPI_TX_QUAD;
+	slave->no_all_quad = 1;
+
+	return 0;
+}
+
 static int zynq_qspi_probe(struct udevice *bus)
 {
 	struct zynq_qspi_platdata *plat = dev_get_platdata(bus);
@@ -627,4 +640,5 @@ U_BOOT_DRIVER(zynq_qspi) = {
 	.platdata_auto_alloc_size = sizeof(struct zynq_qspi_platdata),
 	.priv_auto_alloc_size = sizeof(struct zynq_qspi_priv),
 	.probe  = zynq_qspi_probe,
+	.child_pre_probe = zynq_qspi_child_pre_probe,
 };
-- 
1.7.1



More information about the U-Boot mailing list