diff options
author | Lukasz Majewski <lukma@denx.de> | 2019-09-03 16:38:43 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2019-10-08 16:35:59 +0200 |
commit | e95b4bdd8dcadeecd516406387604aa56b76804c (patch) | |
tree | e9a117941ee1b6378441b0ffd4d334d969f0e9f5 /board/liebherr/display5/display5.c | |
parent | 32e07513833515c6684f8819e176cb62adb55c4d (diff) | |
download | u-boot-e95b4bdd8dcadeecd516406387604aa56b76804c.tar.gz |
DM: SPI: Convert display5 to use SPI with DM/DTS (but no in SPL)
The DM/DTS support for SPI is disabled on purpose for SPL, as it is not
supported as of time of this conversion.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'board/liebherr/display5/display5.c')
-rw-r--r-- | board/liebherr/display5/display5.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c index e008ea9a3f..541e3e94a5 100644 --- a/board/liebherr/display5/display5.c +++ b/board/liebherr/display5/display5.c @@ -19,7 +19,6 @@ #include <malloc.h> #include <asm/mach-imx/iomux-v3.h> #include <asm/mach-imx/boot_mode.h> -#include <asm/mach-imx/spi.h> #include <miiphy.h> #include <netdev.h> #include <i2c.h> @@ -28,11 +27,6 @@ #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h> -#ifndef CONFIG_MXC_SPI -#error "CONFIG_SPI must be set for this board" -#error "Please check your config file" -#endif - #include "common.h" DECLARE_GLOBAL_DATA_PTR; @@ -140,21 +134,6 @@ iomux_v3_cfg_t const misc_pads[] = { MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL), }; -static void displ5_setup_ecspi(void) -{ - int ret; - - displ5_set_iomux_ecspi(); - - ret = gpio_request(IMX_GPIO_NR(5, 29), "spi2_cs0"); - if (!ret) - gpio_direction_output(IMX_GPIO_NR(5, 29), 1); - - ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp"); - if (!ret) - gpio_direction_output(IMX_GPIO_NR(7, 0), 1); -} - /* * Do not overwrite the console * Always use serial for U-Boot console @@ -188,7 +167,7 @@ int board_phy_config(struct phy_device *phydev) int board_init(void) { - struct gpio_desc phy_int_gbe; + struct gpio_desc phy_int_gbe, spi2_wp; int ret; debug("board init\n"); @@ -197,9 +176,6 @@ int board_init(void) /* Setup iomux for non console UARTS */ displ5_set_iomux_uart(); - - displ5_setup_ecspi(); - /* Setup misc (application specific) stuff */ SETUP_IOMUX_PADS(misc_pads); @@ -229,6 +205,17 @@ int board_init(void) iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO); enable_fec_anatop_clock(0, ENET_125MHZ); + /* Setup #WP for SPI-NOR memory */ + ret = dm_gpio_lookup_name("GPIO7_0", &spi2_wp); + if (ret) { + printf("Cannot get GPIO7_0\n"); + } else { + ret = dm_gpio_request(&spi2_wp, "spi2_#wp"); + if (!ret) + dm_gpio_set_dir_flags(&spi2_wp, GPIOD_IS_OUT | + GPIOD_IS_OUT_ACTIVE); + } + return 0; } |