Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6685C433EF for ; Mon, 14 Mar 2022 21:51:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 129E0836A9; Mon, 14 Mar 2022 22:51:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=web.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=web.de header.i=@web.de header.b="F74t/01O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04AD183986; Mon, 14 Mar 2022 22:51:50 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.14]) (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 ADE078026F for ; Mon, 14 Mar 2022 22:51:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=web.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=smoch@web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1647294703; bh=AczUMd7CEog55+TVkPEwknMIp5k6jP6+asmJDkHnCSY=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=F74t/01O8pts0GUvoenBSUrgYnXc8FQrX1A485peAzCFoJMQrFhB0/ZhdArv1Fq9Q SOqOtmbyrkrpnUjvElAztwmWxaeWM6KptoDUQW7/J9bl7t3eAynm6ejTnhSVl7Wnfy P9sqFPDDVulhrIcwT9iIEZLC5Elc+guWkU1Rjq0E= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [10.9.8.2] ([80.130.115.51]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Ma0PY-1ng0432HLg-00WEvv; Mon, 14 Mar 2022 22:51:43 +0100 Message-ID: <0774d566-5c4b-28be-9254-dfadd27c7f40@web.de> Date: Mon, 14 Mar 2022 22:51:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 2/2] board: tbs2910: Convert to DM_SERIAL Content-Language: en-GB To: Simon Glass Cc: Tom Rini , Stefano Babic , Fabio Estevam , U-Boot Mailing List References: <20220314082626.96395-1-smoch@web.de> <20220314082626.96395-2-smoch@web.de> <20220314182829.GK9986@bill-the-cat> From: =?UTF-8?Q?S=c3=b6ren_Moch?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zlZxa+JXB2JQt8JO57Lqfa6JraoKOpOiM0seNsXoZAbG4sAG9K0 9DfbLirl+Dgji4xT8z3Ab99NRa99eHfSieBE8mqfMfFiai0Y2c7jYN14wbE8p0ig+o4rrd+ 6ExIP+rFUC2HkvDKNvL0la69KkA3CK0xuOHA6sRDbydKTnCp51aSX9O56Eowipsn7L22VIO F+qCqrrSQvb2DdzeH7VqQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:hr4jl/EAuPU=:QV9nKL/W3e9Ws71Pu/8kLX G+94SxrInfCsGvfvTqY8UnaNGsbVA7phWZBDBLGClY0DKDhkJrv7hp9ki/okF6Lh33n/Kv7/u 9OZaJqAxdpf/G6OtZQW7tkFeLsExghvkpzV0ToU0q4LPNKftK7T332Pzq2DVfa/3/87i8bYIW B6ZETmKJOwh70Aw0Hyqp4kqZVJZD+Tl65xi+KzH3kRYw1EAtOgPOMEXzzn6oicOwiuUbrrFUY uwWF7bDz/VySR1SHWpndsmyDAyQ9+GeU7LSct1YmCTttFSjFgTl9/c+AkJwtdyx5UiNWmqeeW A17tXVJTVNPagI9yO2XmoCyEbyOIub1nyMWJdP5S2cPIfawl1tLLOQJiocL6RjkYmh/tiNXQj n1jH6yjea44Py1EzUUyQUxNQjtaaCEKwNmU6B/Gr/m2q0xaidbKhKymNceSOENz58d5ghc962 TPyLVGJXXSmhAUsV4s4gNUSOFqQy67obRg8jX3ibMUDjproPlF+cj3k/c0Nq++ephaabHbXcN cpxmg8733oaU54QjZvhlRl2CWUKhNtVG0dBgouPGi/AvNzTuuoKb+9mfTRl/BWF434xVxfl4O 5LFn6CU4oGhCGjx7PYZp05mY0HbS1bJY0n99Uuiaio6W8IhGl++qnZjRVXN7kOFmijeqAeuQu IhTJsX/gFBib1tgcJhgrpC6BgZBvypHjJeC886yHbmU1n/4Ev5sBNVLBkcqPrLmyyYr72vhxs 7k7wPiHwIWF9D5IHSnqpxFnNNOM1yW30HfVlEbEKzsNaXBc2OQF35eW664gHxA7iYIh6dLcEV NB3yM5OaxvPWCIKMVT6hcPYRKIph9HWVClLDUMxozyuPo/vVztqEykemc0aeVZeor64czK2UM Pt8gPlJZWqzhNzaC7jquCg1NtzuOaFuVIxYEPOEQE/zn2KpoS82uGHzwcWIyV0K1K4RaYyjfi nu+91JPd3jOzgbtPHZb/9R3dLGG/2Ygl0DSNMlExRUCRRu3JnpogaA8O/A0IADsLxxR7ePmA8 OOp1M9ObKmGfRQaD6aPnf8/vgyRK0JEdAsO0ZG/N/ZzPau+3KRAST1jOBxGVpvrIm9BGvy0r/ EOuHxd++4hvJg3uKZHPNUVh/q5ZlBGy/k2BpKQXiqvZmVdSTj7t+XN38tNLizM71NigPadEBm 5rH4Pe8sBGgwrGOvQx2VTDtwhC 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.5 at phobos.denx.de X-Virus-Status: Clean Hi Simon, On 14.03.22 20:37, Simon Glass wrote: > Hi Soeren, > > On Mon, 14 Mar 2022 at 13:22, Soeren Moch wrote: >> >> On 14.03.22 19:28, Tom Rini wrote: >>> On Mon, Mar 14, 2022 at 12:24:36PM -0600, Simon Glass wrote: >>>> Hi Soeren, >>>> >>>> On Mon, 14 Mar 2022 at 02:26, Soeren Moch wrote: >>>>> ... to get rid of the build warning. >>>>> Unfortunately we still need the board specific serial pin init code. >>>>> Otherwise the first boot messages over the serial console are lost. >>>>> >>>>> Signed-off-by: Soeren Moch >>>>> --- >>>>> Cc: Stefano Babic >>>>> Cc: Fabio Estevam >>>>> Cc: Tom Rini >>>>> Cc: Simon Glass >>>>> Cc: u-boot@lists.denx.de >>>>> >>>>> The whole purpose of DM is somewhat defeated when we still need boar= d >>>>> specific initializations. Any ideas how we can get all boot messages >>>>> without board specific inits? 'u-boot,dm-pre-reloc;' in the uart dev= ice >>>>> tree node did not help. >>>> You can put that in your serial driver, perhaps? Or in the initial So= C >>>> init code? >> Why should I do so? The whole point of DM is initializing devices from >> DT. And when I wish to do so pre-relocation, it is advertised in DM to >> add 'u-boot,dm-pre-reloc;' for this purpose. I tried, it did not work. >> And this is nothing closely related to the serial driver itself, I just >> want the pin setup running pre-relocation and not as late as it is >> running now under DM_SERIAL. > If you have a pinctrl driver it will be used. I don't really > understand your problem. My problem is that pin initializations come too late (just before the "Core" boot message). Apparently I have a pinctrl driver, otherwise the pin init would not be done at all, I guess. >> I also do not want to run this pin setup twice (first in board or SoC >> code and again by DM_SERIAL later). Maybe I miss something obvious, but >> duplication of the setup code cannot be a proper solution. > Well the pinctrl will be triggered before relocation and after, if > enabled. We could solve that but have not tried. My problem is not runtime, if initialization is done twice from the same code this is probably OK. In my setup pins are _not_ initialized before relocation, when not done in board_early_init_f() "by hand", which I would like to avoid since this results in code duplication. Do I need to enable the before-relocation part somewhere? When yes, how exactly? 'u-boot,dm-pre-reloc;' in the uart DT node (as documented) did not work. >>>> Another recent way (in -next) is to use events to monitor the >>>> EVT_DM_PRE_PROBE event for the serial driver. >> I can monitor the probe event, OK. But how can this solve my problem? >> Again, maybe I miss something obvious, please tell me when I do so. >>> It's just the same thing every single imx platform is doing. >>> >> Sorry, I don't understand what you mean here. The reference platform fo= r >> my board is mx6sabresd. This is not converted to DM_SERIAL yet. Most (?= ) >> imx boards use SPL, pin setup is different there. >> I looked into imx boards with DM_SERIAL. They either removed the >> board-specific setup code (which results in missing early boot messages= : >> u-boot version, board name, DDR size, ...) or they are playing tricks i= n >> SPL (not the clean and easy solution that DM promises). Maybe I missed = a >> better reference for the DM_SERIAL conversion without SPL. Can you poin= t >> me to such board? > If you want to use pinctrl in SPL, you can do all of this cleanly. If > you have code-size constraints, then you may want to do something like > rockchip, where only specific peripherals are supported in pinctrl in > SPL. I do not use SPL, only U-Boot proper. > > You could look at firefly-rk3288 (or bob/coral/jerry) which I believe > is done fully with driver model. I want a proper solution without SPL, see above. > Perhaps Tom has a better handle on the problem. "Great." You are forcing everyone in DM conversions with deadlines. This conversion does not work as documented. When asked for help you only provide answers to different questions than what was asked. And you conclude with "create your own solution or ask someone else", at least this is as I understand this. All this while DM conversions only bring additional work for maintainers of existing boards, DM conversions always come with increased code size, and only in the best case everything works like before. On the other hand you complain about slow conversions and maintainers that wait for the very end of the deadline. Do you see the relation? So I ask you again, Simon. How is this DM_SERIAL conversion supposed to be done properly? In general and especially for imx boards without SPL? Or is all this as incomplete as it looks like? In this case the conversion probably will again last until the end of the real deadline, about 3 years from now. And it will be done as in this patch (with your Reviewed-by blessing), papering over the fact that all the old code is still active, only the build warning is silenced. Exactly what we want to avoid, bigger code not better code. I hope we can clean this up in a follow-up patch. Regards, Soeren > > Regards, > Simon