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 40736C636CD for ; Fri, 10 Feb 2023 06:32:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7957857F9; Fri, 10 Feb 2023 07:32: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=1676010760; bh=kd0Hech11mDhlrdrSm7xN1dBIbUSb1x3clXY3/K/aCA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=yw9m6vyXWXS9EBheAhYcZh+OVmEQogk1BPubhkBO+BvXr8juTz0NuKEQMoVO4qtVN dvskIXfQUC3ljflxNtZQvaGr71sO5ceHV/Hz8HD1qSiju8tMWhYD/BITpQAFYD42HO EUjYc+9AopqEmLzKGfCHgKM4Rjm4hr8KqZoY9w0Ju2+ue9oRh/TJ5QNvbSLTY90JA1 hwhG5s7QiLNnMoXE0yW1wsnTZYCgcywHTbGleR2j3dWVYShVNzot62mrmOxIYmvX3p xAewGjT1pIgOqHJrP4mYU4tAzc86lyJ7i9+TzBKx2BLEJsACPeufBJh8V4vcIWLO/X F/dM15j04wtCg== Received: by phobos.denx.de (Postfix, from userid 109) id 53F1B855AC; Fri, 10 Feb 2023 07:32:38 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (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 C02D4855AC for ; Fri, 10 Feb 2023 07:32:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PCkS14B4yz9sSM; Fri, 10 Feb 2023 07:32:33 +0100 (CET) Message-ID: Date: Fri, 10 Feb 2023 07:32:32 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] arm: kirkwood: Enable uart0 dm-pre-reloc for Kirkwood boards To: Tony Dinh , =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: Simon Glass , Michael Walle , U-Boot Mailing List , Tom Rini References: <20230201080210.ypz4nrj4y2igwxz3@pali> <0e3399e8eb49432c810a574b6ee612d1@walle.cc> <20230201190529.z7tvocxfruywsucu@pali> <20230202180445.h3za6q3mvrghey3o@pali> <20230203220533.kuvxmzk6azkpg47u@pali> <5c3a0a80-48d1-6d14-0d8a-4829af994fbd@denx.de> <20230209214541.cisum4l7utoc5z2k@pali> Content-Language: en-US From: Stefan Roese In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Hi Tony, Hi Pali, On 2/10/23 02:37, Tony Dinh wrote: >>>> Could you please check if Pogo V4 boots with >>>> CONFIG_REQUIRE_SERIAL_CONSOLE unset? >>>> >>> Indeed, you're right! unset CONFIG_REQUIRE_SERIAL_CONSOLE allows the >>> Pogo V4 to boot OK, without dm-pre-reloc needed. And it booted >>> normally with kwboot, all serial input/outputs are OK. >>> >>>>> Also, note that just enabling DEBUG_UART would always make the board >>>>> frozen when u-boot starts. >>>> >>>> This should not be the case of course. Are you sure you've correctly >>>> configured the DEBUG UART? >>> >>> I think I did that correctly (we've used that to debug the orion_timer >>> issue previously). Here is how I've configured it: >>> >>> +CONFIG_DEBUG_UART_BASE=0xf1012000 >>> +CONFIG_DEBUG_UART_CLOCK=250000000 >>> +CONFIG_DEBUG_UART=y >> >> Maybe you hit same issue in mach-kirkwood as me in the past for >> mach-mvebu? U-Boot code was trying to initialize UART at the _new_ base >> register address (0xf1012000) when U-Boot was still using the _old_ base >> register address (0xd0012000). >> >> I fixed it by moving code which changes base register address from >> arch_cpu_init() function to arch_very_early_init() function in commit: >> https://source.denx.de/u-boot/u-boot/-/commit/5bb2c550b11eb087437740b2a0d1fe780be5aec3 Thanks Pali, this is very likely the root cause here. > Thanks for the info! Looking at that patch, I think I'm out of my > depth :) Here the line for Kirkwood, re-configuring the base address of the internal registers: https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/mach-kirkwood/cpu.c#L193 You need to make sure, that this configuration is done before you use the DEBUG UART with base address 0xf1xx.xxxx. If you use the DEBUG UART before this, which is very likely, then you could also test if this works for you: CONFIG_DEBUG_UART_BASE=0xd0012000 > For now I will fix this Pogo V4 with the -u-boot.dtsi, so as > not to mess up anybody who might try UART booting with kwboot. Sure, please go ahead this way for now. BTW: Many years ago my intention was to include the Kirkwood support into the "common" Marvell MVEBU support in mach-mvebu. So that mach-kirkwood and it's special handling could be dropped. It's great to see that Kirkwood is getting attention now. Perhaps this move into mach-mvebu could be addressed at some point. Thanks, Stefan > Thanks, > Tony > >>>>> So this was another factor why it took me >>>>> so long to figure this out :) I've just restored everything and >>>>> removed the uart0 node from the Pogo V4 DTS like above and it is >>>>> working. >>>>> >>>>> But of course, we don't want to change the Pogo V4 DTS, so I will >>>>> submit another patch just for the Pogo V4 to add -u-boot.dtsi for this >>>>> box to enable the dm-pre-reloc tag for uart0. >>>> >>>> Understood. >>> >>> Thanks, >>> Tony >>> >>>> >>>> Thanks, >>>> Stefan Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de