All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH 11/11] imx: ventana: enable dm for SPI
Date: Mon,  1 Mar 2021 14:33:37 -0800	[thread overview]
Message-ID: <20210301223337.7763-12-tharvey@gateworks.com> (raw)
In-Reply-To: <20210301223337.7763-1-tharvey@gateworks.com>

Enable driver model for SPI which allows us to remove the iomux
and init.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/gw_ventana.c | 27 -------------------------
 configs/gwventana_emmc_defconfig        |  3 +++
 configs/gwventana_gw5904_defconfig      |  3 +++
 configs/gwventana_nand_defconfig        |  3 +++
 4 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index c86e7a4a0c..e16288d33d 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -18,7 +18,6 @@
 #include <asm/gpio.h>
 #include <asm/mach-imx/boot_mode.h>
 #include <asm/mach-imx/sata.h>
-#include <asm/mach-imx/spi.h>
 #include <asm/mach-imx/video.h>
 #include <asm/io.h>
 #include <asm/setup.h>
@@ -40,7 +39,6 @@
 #include <power/pfuze100_pmic.h>
 #include <fdt_support.h>
 #include <jffs2/load_kernel.h>
-#include <spi_flash.h>
 
 #include "gsc.h"
 #include "common.h"
@@ -126,28 +124,6 @@ int board_ehci_hcd_init(int port)
 }
 #endif /* CONFIG_USB_EHCI_MX6 */
 
-#ifdef CONFIG_MXC_SPI
-iomux_v3_cfg_t const ecspi1_pads[] = {
-	/* SS1 */
-	IOMUX_PADS(PAD_EIM_D19__GPIO3_IO19  | MUX_PAD_CTRL(SPI_PAD_CTRL)),
-	IOMUX_PADS(PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL)),
-	IOMUX_PADS(PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL)),
-	IOMUX_PADS(PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL)),
-};
-
-int board_spi_cs_gpio(unsigned bus, unsigned cs)
-{
-	return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(3, 19)) : -1;
-}
-
-static void setup_spi(void)
-{
-	gpio_request(IMX_GPIO_NR(3, 19), "spi_cs");
-	gpio_direction_output(IMX_GPIO_NR(3, 19), 1);
-	SETUP_IOMUX_PADS(ecspi1_pads);
-}
-#endif
-
 /* configure eth0 PHY board-specific LED behavior */
 int board_phy_config(struct phy_device *phydev)
 {
@@ -590,9 +566,6 @@ int board_init(void)
 	setup_ventana_i2c(0);
 	board_type = read_eeprom(CONFIG_I2C_GSC, &ventana_info);
 
-#ifdef CONFIG_MXC_SPI
-	setup_spi();
-#endif
 	setup_ventana_i2c(1);
 	setup_ventana_i2c(2);
 
diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index d383a85f8b..d5270c5232 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -96,6 +96,9 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/gwventana_gw5904_defconfig b/configs/gwventana_gw5904_defconfig
index b6ef9e6f8a..091bf30c3b 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -100,6 +100,9 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index ea5ed052b5..0ccd3e9dfd 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -102,6 +102,9 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
-- 
2.17.1

  parent reply	other threads:[~2021-03-01 22:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 22:33 [PATCH 00/11] imx: ventana: convert Gateworks Ventana to dm Tim Harvey
2021-03-01 22:33 ` [PATCH 01/11] spl: fit: nand: skip bad block handling if NAND chip not fully defined Tim Harvey
2021-03-02 13:28   ` Tom Rini
2021-04-08 20:57   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 02/11] spl: fit: nand: allow for non-page-aligned elements Tim Harvey
2021-03-02 13:28   ` Tom Rini
2021-04-08 20:58   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 03/11] dt-bindings: add tda1997x and bindings Tim Harvey
2021-03-02 13:28   ` Tom Rini
2021-04-08 20:57   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 04/11] imx: ventana: add Gateworks Ventana dts Tim Harvey
2021-04-08 20:57   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 05/11] arm: dts: imx6qdl-gw*: add dr_mode prop to dt to avoid error Tim Harvey
2021-04-05 21:27   ` Peter Robinson
2021-04-05 23:46     ` Tim Harvey
2021-04-08 20:57   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 06/11] imx: ventana: convert U-Boot to OF_CONTROL using FIT image Tim Harvey
2021-04-08 20:57   ` sbabic at denx.de
     [not found]   ` <606f6e37.1c69fb81.a6d7.559aSMTPIN_ADDED_MISSING@mx.google.com>
2021-04-09 19:52     ` Tim Harvey
2021-04-09 20:00       ` Stefano Babic
2021-04-09 20:08         ` Tim Harvey
2021-04-09 20:14           ` Tim Harvey
2021-04-10  0:32             ` Tim Harvey
2021-03-01 22:33 ` [PATCH 07/11] imx: ventana: add pinctrl and remove unneeded UART init and config Tim Harvey
2021-04-08 20:57   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 08/11] imx: ventana: enable dm support for USB Tim Harvey
2021-04-08 20:59   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 09/11] imx: ventana: enable dm support for MMC and SATA Tim Harvey
2021-03-01 22:48   ` Peter Robinson
2021-03-02  0:19     ` Fabio Estevam
2021-03-02  1:41       ` Tim Harvey
2021-03-02 13:28         ` Tom Rini
2021-03-03  1:15     ` Kever Yang
2021-04-08 20:58   ` sbabic at denx.de
2021-03-01 22:33 ` [PATCH 10/11] imx: ventana: enable dm for MTD and NAND Tim Harvey
2021-04-08 20:59   ` sbabic at denx.de
2021-03-01 22:33 ` Tim Harvey [this message]
2021-04-08 20:57   ` [PATCH 11/11] imx: ventana: enable dm for SPI sbabic at denx.de
2021-03-25 13:59 ` [PATCH 00/11] imx: ventana: convert Gateworks Ventana to dm Tim Harvey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301223337.7763-12-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.