]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: ventana: enable dm for SPI
authorTim Harvey <tharvey@gateworks.com>
Mon, 1 Mar 2021 22:33:37 +0000 (14:33 -0800)
committerStefano Babic <sbabic@denx.de>
Thu, 8 Apr 2021 18:29:53 +0000 (20:29 +0200)
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
configs/gwventana_emmc_defconfig
configs/gwventana_gw5904_defconfig
configs/gwventana_nand_defconfig

index 43a8ab6a16d2e4b2ad33277d6e6c180b6a6d7191..5237f2dac431806dec79de08c98df8f31551502b 100644 (file)
@@ -19,7 +19,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>
@@ -41,7 +40,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"
@@ -127,28 +125,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)
 {
@@ -591,9 +567,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);
 
index d383a85f8bf908a31f6419c63364667e33c0cf80..d5270c523212c48bb8ac828e4c70dd3a1e3433ed 100644 (file)
@@ -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
index b6ef9e6f8a706a040fe94ed8636ccc8affdbf80a..091bf30c3b8a04d1b83f70da6deae641e896afc4 100644 (file)
@@ -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
index ea5ed052b52bff21529bea3a51b29d1f581b2671..0ccd3e9dfdc2d9675c45ad08d6938a956010a9e6 100644 (file)
@@ -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