On 23.09.2016 16:44, Jagan Teki wrote:
On Fri, Sep 23, 2016 at 7:58 PM, Stefan Roese <s...@denx.de> wrote:
The SPI IP core in the Marvell Armada 3700 is similar to the one in the
other Armada SoCs. But the differences are big enough that it makes
sense to introduce a new driver instead of cluttering the old
kirkwood driver with #ifdef's.

Signed-off-by: Stefan Roese <s...@denx.de>
Cc: Nadav Haklai <nad...@marvell.com>
Cc: Kostya Porotchkin <kos...@marvell.com>
Cc: Wilson Ding <ding...@marvell.com>
Cc: Victor Gu <x...@marvell.com>
Cc: Hua Jing <jing...@marvell.com>
Cc: Terry Zhou <bjz...@marvell.com>
Cc: Hanna Hawa <han...@marvell.com>
Cc: Haim Boot <ha...@marvell.com>
Cc: Jagan Teki <jt...@openedev.com>
---
v3:
- Really use hz now in equation
- Add comment that the DT property for the input clock is deprecated
  and the clock infrastructure should be used, once available for
  mvebu in U-Boot

v2:
- Evaluated hz and used values provided by the DT in mvebu_spi_set_speed()
  as suggested by Jagan

 drivers/spi/Kconfig           |   7 +
 drivers/spi/Makefile          |   1 +
 drivers/spi/mvebu_a3700_spi.c | 297 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 305 insertions(+)
 create mode 100644 drivers/spi/mvebu_a3700_spi.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 5da66a6..8724f87 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -68,6 +68,13 @@ config ICH_SPI
          access the SPI NOR flash on platforms embedding this Intel
          ICH IP core.

+config MVEBU_A3700_SPI
+       bool "Marvell Armada 3700 SPI driver"
+       help
+         Enable the Marvell Armada 3700 SPI driver. This driver can be
+         used to access the SPI NOR flash on platforms embedding this
+         Marvell IP core.
+
 config PIC32_SPI
        bool "Microchip PIC32 SPI driver"
        depends on MACH_PIC32
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index b1d9e20..247c5f6 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
 obj-$(CONFIG_LPC32XX_SSP) += lpc32xx_ssp.o
 obj-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 obj-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
+obj-$(CONFIG_MVEBU_A3700_SPI) += mvebu_a3700_spi.o
 obj-$(CONFIG_MXC_SPI) += mxc_spi.o
 obj-$(CONFIG_MXS_SPI) += mxs_spi.o
 obj-$(CONFIG_OMAP3_SPI) += omap3_spi.o
diff --git a/drivers/spi/mvebu_a3700_spi.c b/drivers/spi/mvebu_a3700_spi.c
new file mode 100644
index 0000000..0a55f3f
--- /dev/null
+++ b/drivers/spi/mvebu_a3700_spi.c
@@ -0,0 +1,297 @@
+/*
+ * Copyright (C) 2015 Marvell International Ltd.
+ *
+ * Copyright (C) 2016 Stefan Roese <s...@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <malloc.h>
+#include <spi.h>
+#include <wait_bit.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define SPI_TIMEOUT                            10000

Can you remove this - sorry, never looked previously.

Done.

Reviewed-by: Jagan Teki <jt...@openedev.com>

Added.

Thanks,
Stefan
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to