From patchwork Tue Apr 19 20:59:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 612363 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qqHlh09wMz9t6J for ; Wed, 20 Apr 2016 07:12:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BF25A7957; Tue, 19 Apr 2016 23:06:00 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wgj5X0lX9X3m; Tue, 19 Apr 2016 23:06:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 05E45B388A; Tue, 19 Apr 2016 23:02:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4AF42A7711 for ; Tue, 19 Apr 2016 23:02:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jWsBJHmCCJK4 for ; Tue, 19 Apr 2016 23:02:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 1F03DA7712 for ; Tue, 19 Apr 2016 23:00:51 +0200 (CEST) Received: from swarren-lx1.nvidia.com (thunderhill.nvidia.com [216.228.112.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPSA id 08C071C0422; Tue, 19 Apr 2016 15:00:47 -0600 (MDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99 at avon.wwwdotorg.org From: Stephen Warren To: u-boot@lists.denx.de, Simon Glass , Tom Warren , Stephen Warren Date: Tue, 19 Apr 2016 14:59:34 -0600 Message-Id: <1461099580-3866-55-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461099580-3866-1-git-send-email-swarren@wwwdotorg.org> References: <1461099580-3866-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public Subject: [U-Boot] [PATCH 54/60] video: tegra: move pinmux setup to board files X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stephen Warren Remove funcmux calls from the Tegra20 video driver. Knowledge of pinmux setup must come from either board files or DT; it should not be embedded into board-agnostic driver code. The DT pinmux bindings do not allow drivers to derive funcmux-style information, since the DT bindings are pin-based whereas funcmux is controller-based, so there's no good way to call the existing funcmux APIs from drivers. Converting drivers to use a new (as yet non-existent in U-Boot) API that pulls pinmux information from DT isn't useful for Tegra, since Tegra's DT files don't contain any per-device pinmux tables, so this would simply be extra code that has no effect; doesn't actually set up the pinmux. We are left with moving the pinmux setup functionality into board files. In theory the board files could be converted later to use DT, but that would be a separate change. Signed-off-by: Stephen Warren Reviewed-by: Simon Glass --- board/avionic-design/common/tamonten.c | 1 + board/compal/paz00/paz00.c | 3 +++ board/nvidia/harmony/harmony.c | 1 + board/nvidia/seaboard/seaboard.c | 1 + board/toradex/colibri_t20/colibri_t20.c | 1 + drivers/video/tegra.c | 3 --- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c index 4727ebdc72c8..e5748b01722a 100644 --- a/board/avionic-design/common/tamonten.c +++ b/board/avionic-design/common/tamonten.c @@ -37,4 +37,5 @@ void tegra_board_early_init_f(void) pinmux_tristate_disable(PMUX_PINGRP_ATA); /* for CD GPIO PH2 */ pinmux_tristate_disable(PMUX_PINGRP_ATD); + funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); } diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c index 562a4df1f262..98e7cfdc352c 100644 --- a/board/compal/paz00/paz00.c +++ b/board/compal/paz00/paz00.c @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include #include @@ -39,4 +41,5 @@ void tegra_board_early_init_f(void) pinmux_tristate_disable(PMUX_PINGRP_UAC); /* For CD GPIO PV5 */ pinmux_tristate_disable(PMUX_PINGRP_GPV); + funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); } diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c index 9429b3b70cc4..f40b9c3b3152 100644 --- a/board/nvidia/harmony/harmony.c +++ b/board/nvidia/harmony/harmony.c @@ -42,4 +42,5 @@ void tegra_board_early_init_f(void) pinmux_tristate_disable(PMUX_PINGRP_DTB); /* For CD GPIO PI5 */ pinmux_tristate_disable(PMUX_PINGRP_ATC); + funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); } diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index 5bd00278e203..8958de2bdcd8 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -41,4 +41,5 @@ void tegra_board_early_init_f(void) /* For CD GPIO PI5 */ pinmux_tristate_disable(PMUX_PINGRP_ATC); funcmux_select(PERIPH_ID_KBC, FUNCMUX_DEFAULT); + funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); } diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c index 6af76d68392e..aff036ab243c 100644 --- a/board/toradex/colibri_t20/colibri_t20.c +++ b/board/toradex/colibri_t20/colibri_t20.c @@ -62,6 +62,7 @@ void tegra_board_early_init_f(void) pinmux_set_func(PMUX_PINGRP_ATC, PMUX_FUNC_GMI); funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_4_BIT); pinmux_tristate_disable(PMUX_PINGRP_GMB); + funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); } int tegra_board_init(void) diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c index 5b778777619f..8543c2980cf8 100644 --- a/drivers/video/tegra.c +++ b/drivers/video/tegra.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include "tegra_dc.h" @@ -381,8 +380,6 @@ static int handle_stage(const void *blob, struct tegra_lcd_priv *priv) * remove all mention of lcd in the stdout environment * variable. */ - - funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT); break; case STAGE_PANEL_VDD: if (dm_gpio_is_valid(&priv->panel_vdd))