From patchwork Mon Dec 12 00:09:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 1714749 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NVhqJ5gR4z23pD for ; Mon, 12 Dec 2022 11:10:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 49080853B4; Mon, 12 Dec 2022 01:10:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B3AEA8497E; Mon, 12 Dec 2022 01:09:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.perfora.net (mout.perfora.net [74.208.4.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C5C65853AF for ; Mon, 12 Dec 2022 01:09:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marcel@ziswiler.com Received: from toolbox.int.toradex.com ([106.185.144.150]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MJzil-1p3hRJ2AnF-001TQ9; Mon, 12 Dec 2022 01:09:41 +0100 From: Marcel Ziswiler To: u-boot@lists.denx.de Cc: Marcel Ziswiler Subject: [PATCH v1 03/16] apalis-imx8: turn off lcd backlight before os handover Date: Mon, 12 Dec 2022 01:09:17 +0100 Message-Id: <20221212000930.45505-4-marcel@ziswiler.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221212000930.45505-1-marcel@ziswiler.com> References: <20221212000930.45505-1-marcel@ziswiler.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:lBubJXT9tPYgbmDA5CLmax9JGMN1mz4SGxFVzeeb9lq/RuipqKi Dwb83sLh8kDB9SSy1VrkQGyp+SVqeyYlZD61tM28USyBWVprWQZtFNVNTg6Zmr+TzOAdjOq wBFRpXyg8uXD9W13b5jvzjFVOwweH8V/bsxtqaBy2Uw9aLEk02z0hJweayP1Xx5ceoxhMiK R4o9vpXlr5vSg28vciFjA== UI-OutboundReport: notjunk:1;M01:P0:h03lAP84zQY=;I+DAnEmvMdJtmi6fZnbQXW2s8d2 5qbqCsAK9UquL89hQZAq6azaruxBfFum8Mh5O0NWZbc6Mt4fQe/+hig3dBnz/r77eY85xdNDW TsKPPkzb+aecZNGuerpdm8RXqntUrL9q7xDqGvKJte0OW0iHYpV13mlObmevzTWtpPPSI+2XL EDDRuK4buvAsJjN07J0Yhnw/zGrznefVbt8N+NfqaJ3K41yH0bkqItQtiYx9U/ZrnC0NUZwXE ii+Hj5WF7dyzszxJx7mdvK+5amnahTmxRNCJVZcWqfpb7rCwe9YVGdUR6/AW7HLbiQhejD7vs D7Iolg09XaKJF6XJ+sifMpjYBZ4zgHhKqOe4bJ2xpLKtQu2HCqVOOGhx1YjvLkvqkMBtZy0kw x+/qoByv9GtHcnPog54l0tXP/j9PUsC5S3oZf522hn6+V/kViTgPU54heW5pI9fE63wA28JLM lBo/QS521F1At4JL8+IbUWjZxgEdnBBIbBO3AUAXlCKoyrNlTyTlQyZ6PeNK6EVZ+p7mBU74K 3zRoN/n38L5Q6s/sDh8VrLfEP2/8CslafUXaj/DVGFPHoIVWqo/OAcB6cPRgM6a5xcSijxqFO jRqoKYQYkbM6VY+QXWkxcRE8fYhydrp5IMVCt/SEulrXnK64pDZisswscHRKFRqwLAigB1n5O MvxUUyyB7XjmUbGCNy7kPgBwfDDml9ibDipxNSPl8A== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Marcel Ziswiler U-Boot typically tears down the display controller before handing control over to Linux. On LCD displays disabling pixel clock leads to a fading out effect with vertical/horizontal lines. Make sure to disable back light GPIO Apalis BKL1 before booting Linux. Signed-off-by: Marcel Ziswiler --- board/toradex/apalis-imx8/apalis-imx8.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index d4be999e24d..d8c68765d16 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -182,9 +182,18 @@ int board_early_init_f(void) } #if CONFIG_IS_ENABLED(DM_GPIO) + +#define BKL1_GPIO IMX_GPIO_NR(1, 10) + +static iomux_cfg_t board_gpios[] = { + SC_P_LVDS1_GPIO00 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(GPIO_PAD_CTRL), +}; + static void board_gpio_init(void) { - /* TODO */ + imx8_iomux_setup_multiple_pads(board_gpios, ARRAY_SIZE(board_gpios)); + + gpio_request(BKL1_GPIO, "BKL1_GPIO"); } #else static inline void board_gpio_init(void) {} @@ -202,6 +211,14 @@ int board_phy_config(struct phy_device *phydev) } #endif +/* + * Backlight off before OS handover + */ +void board_preboot_os(void) +{ + gpio_direction_output(BKL1_GPIO, 0); +} + int checkboard(void) { puts("Model: Toradex Apalis iMX8\n");