From patchwork Wed Apr 17 11:57:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: linux-kernel-dev X-Patchwork-Id: 1086928 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=beckhoff.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44kgkw2k6Jz9s3q for ; Wed, 17 Apr 2019 21:59:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 2F092C21EC3; Wed, 17 Apr 2019 11:58:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 97DE4C21E4F; Wed, 17 Apr 2019 11:57:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8EE62C21C6A; Wed, 17 Apr 2019 11:57:45 +0000 (UTC) Received: from Netsrv01.beckhoff.com (netsrv01.beckhoff.com [62.159.14.10]) by lists.denx.de (Postfix) with ESMTPS id 383FBC21DD7 for ; Wed, 17 Apr 2019 11:57:45 +0000 (UTC) Received: from std-laptop.beckhoff.com (172.17.66.103) by NT-Mail06.beckhoff.com (10.1.0.30) with Microsoft SMTP Server (TLS) id 14.3.301.0; Wed, 17 Apr 2019 13:57:41 +0200 From: To: Date: Wed, 17 Apr 2019 13:57:14 +0200 Message-ID: <20190417115719.22407-2-linux-kernel-dev@beckhoff.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190417115719.22407-1-linux-kernel-dev@beckhoff.com> References: <20190417115719.22407-1-linux-kernel-dev@beckhoff.com> MIME-Version: 1.0 X-Originating-IP: [172.17.66.103] X-OLX-Disclaimer: Done Cc: Tom Rini , u-boot@steffen.cc, Patrick Bruenn , s.dirkwinkel@beckhoff.com Subject: [U-Boot] [PATCH v1 1/6] dm: arm: imx: cx9020: enable DM_GPIO X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Steffen Dirkwinkel Switch to DM_GPIO and add gpio_request where necessary. This is needed for DM_VIDEO and fixes an issue with sd card detection which was introduced by the combination of these commits: commit 7a0425dd969c ("mmc: fsl_esdhc: make get_cd work well in dm_mmc_ops") commit 7e04b4c751a1 ("dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC") Acked-by: Patrick Bruenn Signed-off-by: Steffen Dirkwinkel --- board/beckhoff/mx53cx9020/mx53cx9020.c | 25 ++++++++++++++++---- board/beckhoff/mx53cx9020/mx53cx9020_video.c | 1 + configs/mx53cx9020_defconfig | 2 ++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c b/board/beckhoff/mx53cx9020/mx53cx9020.c index 79d8a62cf1b..79ea4560283 100644 --- a/board/beckhoff/mx53cx9020/mx53cx9020.c +++ b/board/beckhoff/mx53cx9020/mx53cx9020.c @@ -91,6 +91,9 @@ void weim_cs0_settings(u32 mode) static void setup_gpio_eim(void) { + gpio_request(GPIO_C3_STATUS, "GPIO_C3_STATUS"); + gpio_request(GPIO_C3_DONE, "GPIO_C3_DONE"); + gpio_request(GPIO_C3_CONFIG, "GPIO_C3_CONFIG"); gpio_direction_input(GPIO_C3_STATUS); gpio_direction_input(GPIO_C3_DONE); gpio_direction_output(GPIO_C3_CONFIG, 1); @@ -100,6 +103,7 @@ static void setup_gpio_eim(void) static void setup_gpio_sups(void) { + gpio_request(GPIO_SUPS_INT, "GPIO_SUPS_INT"); gpio_direction_input(GPIO_SUPS_INT); static const int BLINK_INTERVALL = 50000; @@ -116,6 +120,16 @@ static void setup_gpio_sups(void) static void setup_gpio_leds(void) { + gpio_request(GPIO_LED_SD2_R, "GPIO_LED_SD2_R"); + gpio_request(GPIO_LED_SD2_B, "GPIO_LED_SD2_B"); + gpio_request(GPIO_LED_SD2_G, "GPIO_LED_SD2_G"); + gpio_request(GPIO_LED_SD1_R, "GPIO_LED_SD1_R"); + gpio_request(GPIO_LED_SD1_B, "GPIO_LED_SD1_B"); + gpio_request(GPIO_LED_SD1_G, "GPIO_LED_SD1_G"); + gpio_request(GPIO_LED_PWR_R, "GPIO_LED_PWR_R"); + gpio_request(GPIO_LED_PWR_B, "GPIO_LED_PWR_B"); + gpio_request(GPIO_LED_PWR_G, "GPIO_LED_PWR_G"); + gpio_direction_output(GPIO_LED_SD2_R, 0); gpio_direction_output(GPIO_LED_SD2_B, 0); gpio_direction_output(GPIO_LED_SD2_G, 0); @@ -147,6 +161,8 @@ int board_mmc_getcd(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; int ret; + gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD"); + gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD"); gpio_direction_input(GPIO_SD1_CD); gpio_direction_input(GPIO_SD2_CD); @@ -212,10 +228,6 @@ static void clock_1GHz(void) int board_early_init_f(void) { - setup_gpio_leds(); - setup_gpio_sups(); - setup_gpio_eim(); - setup_iomux_lcd(); return 0; } @@ -235,6 +247,11 @@ int board_init(void) mxc_set_sata_internal_clock(); + setup_gpio_leds(); + setup_gpio_sups(); + setup_gpio_eim(); + setup_iomux_lcd(); + return 0; } diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c b/board/beckhoff/mx53cx9020/mx53cx9020_video.c index 4055bccc2b7..85f1cdae8af 100644 --- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c +++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c @@ -36,6 +36,7 @@ void setup_iomux_lcd(void) { /* Turn on DVI_PWD */ imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1); + gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD"); gpio_direction_output(CX9020_DVI_PWD, 1); } diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig index 831d50925f3..93c113aba73 100644 --- a/configs/mx53cx9020_defconfig +++ b/configs/mx53cx9020_defconfig @@ -24,7 +24,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020" CONFIG_ENV_IS_IN_MMC=y CONFIG_FPGA_ALTERA=y CONFIG_FPGA_CYCLON2=y +CONFIG_DM=y CONFIG_DM_MMC=y +CONFIG_DM_GPIO=y CONFIG_FSL_ESDHC=y CONFIG_FEC_MXC=y CONFIG_MII=y