From patchwork Wed Feb 5 09:04:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 1233725 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.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 Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=JzGVkkU4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48CFxt06Btz9sSS for ; Wed, 5 Feb 2020 20:04:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A4938199B; Wed, 5 Feb 2020 10:04:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1580893480; bh=dFKuYREc/K/fJqT5uDn1FqnxmQPJngjsH9JuMn7Ictk=; h=To:From:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To:Cc:From; b=JzGVkkU42H+S0WLTNN/8h+9DKUtJDDbjV9cFxS5hLL4SKb7jpFfToc9CTQ3l6Cwyo +cdIqzqUnFdSuG5wX9Pn4OXigEA32ds9FlGTQXcxOtMI67U5pX+ta0EFFDwWl+9SDE eB1eoPYrvfwwj8PAtYjuqa9BF/naJqRiO40I/pUpQmpkhDRwj5Opxa7Mgfb4+KV1do /QkQCzCPR4WCzMO6qeAKI9tROpPI7nxwgbNknzFSU/u3Zq0ev15nXH+g0e19jLr+SY xGvzZNRz6vlU/4vwiDP/3RjhV5eQ1kjfcht0dMJSwTWe00capksgpHwSTyd31sbByC bATFtMcQbngXg== Received: by phobos.denx.de (Postfix, from userid 109) id 801C6819A1; Wed, 5 Feb 2020 10:04:38 +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=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 101DA81994 for ; Wed, 5 Feb 2020 10:04:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hs@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48CFxb58r7z1rj68; Wed, 5 Feb 2020 10:04:35 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48CFxb4R4qz1qyWT; Wed, 5 Feb 2020 10:04:35 +0100 (CET) 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 xn1seJAqkgla; Wed, 5 Feb 2020 10:04:34 +0100 (CET) X-Auth-Info: IO5tOPTzjQfC/ERuhWLNGWa59Ci52CtTF34/uFLrqP0= Received: from [192.168.1.106] (82-131-137-103.pool.digikabel.hu [82.131.137.103]) (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; Wed, 5 Feb 2020 10:04:34 +0100 (CET) To: Bin Meng , Simon Glass From: Heiko Schocher Subject: dm, serial: problem with using ns16550 driver before relocation on mpc83xx Message-ID: Date: Wed, 5 Feb 2020 10:04:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: hs@denx.de Cc: "u-boot@lists.denx.de" , Dirk Eibach Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Hello Bin, Simon, I just porting the mpc83xx based kmcoge5ne board support DTS and got problems using the serial ns16550 driver. I need the serial driver before rolcation, so I enabled "u-boot,dm-pre-reloc;" as usual in the device tree, but board does not boot ... I found the commit: commit 4687919684e0e4390b9fc20d1809ecaa9dc3cb81 Author: Bin Meng Date: Wed Oct 24 06:36:36 2018 -0700 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers which added to the ns16550 serial driver: and board boots fine with the flag "u-boot,dm-pre-reloc" in DTS ... May I do something wrong here? I found in mainline for example the "arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi" board, which has the exactly same dts settings than I have now. @Dirk: Can you check, if this board boots with current mainline? Shouldn;t be the logic, that in case OF_CONTROL is enabled and if flag "u-boot,dm-pre-reloc" is set in DTS for the device, the device should be bound before relocation, and we do not need to check, if the driver sets DM_FLAG_PRE_RELOC ? But may I miss here something ... Any hints? bye, Heiko diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 04b604fa2c..1e6fc6c668 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -487,7 +487,9 @@ U_BOOT_DRIVER(ns16550_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif }; #endif #endif /* SERIAL_PRESENT */ So, as OF_CONTROL is defined for me, the flag "u-boot,dm-pre-reloc" seems not working anymore ... Adding this back: hs@xmglap:u-boot-secu [20200205-temp] $ git diff diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 9851663dc5..386ca9cffa 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -528,7 +528,7 @@ U_BOOT_DRIVER(ns16550_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, -#if !CONFIG_IS_ENABLED(OF_CONTROL) +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .flags = DM_FLAG_PRE_RELOC, #endif };