From patchwork Tue Jun 4 13:42:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1109923 X-Patchwork-Delegate: sbabic@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=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45JClt5mhYz9s9y for ; Tue, 4 Jun 2019 23:42:34 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 27E0EC21E52; Tue, 4 Jun 2019 13:42:29 +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 3BAD2C21C50; Tue, 4 Jun 2019 13:42:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1413DC21C50; Tue, 4 Jun 2019 13:42:25 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id BDD77C21BE5 for ; Tue, 4 Jun 2019 13:42:24 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45JClh1jtRz1rbMC; Tue, 4 Jun 2019 15:42:24 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45JClh0Kldz1qqkc; Tue, 4 Jun 2019 15:42:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id YzL3fdG24d_H; Tue, 4 Jun 2019 15:42:22 +0200 (CEST) X-Auth-Info: j04whfMaglvoludly/nupfYrx1tB8F7uc8xdlWCWtXk= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 4 Jun 2019 15:42:22 +0200 (CEST) From: Lukasz Majewski To: u-boot@lists.denx.de Date: Tue, 4 Jun 2019 15:42:04 +0200 Message-Id: <20190604134204.30266-1-lukma@denx.de> X-Mailer: git-send-email 2.11.0 Cc: Hannes Schmelzer , Max Krummenacher Subject: [U-Boot] [PATCH] IMX: serial: dm: Set DM_FLAG_PRE_RELOC in the IMX uart driver 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The DM_FLAG_PRE_RELOC shall be set unconditionally as this driver is going to be re-used in both early SPL and U-Boot proper's pre-reloc. For i.MX based devices it is crucial to have available the serial console before relocation (otherwise the board may hand). The device definition may be provided either via device tree description or with U_BOOT_DEVICE(mxc_serial) definition. In the latter case the device will not bind in U-Boot proper when DM_FLAG_PRE_RELOC is not set. The !CONFIG_IS_ENABLED(OF_CONTROL) #if check was set as a "workaround" for DM problem described in following commit 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various drivers"). Let's look on this check more thoroughly - we add this flag if the board doesn't support OF_CONTROL. This is a bit strange as the serial_mxc.c can be used with CONFIG_DM_SERIAL but without corresponding device tree description (OF_CONTROL). In such case the aforementioned U_BOOT_DEVICE(mxc_serial) definition is used. Other boards/SoCs have this flag set unconditionally for serial driver. Signed-off-by: Lukasz Majewski --- drivers/serial/serial_mxc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index c9e7bddb7a..3996ddcf3a 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -366,9 +366,7 @@ U_BOOT_DRIVER(serial_mxc) = { #endif .probe = mxc_serial_probe, .ops = &mxc_serial_ops, -#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, -#endif }; #endif