From mboxrd@z Thu Jan 1 00:00:00 1970 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 3F5F4C433EF for ; Thu, 27 Jan 2022 17:33:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B1F3833C2; Thu, 27 Jan 2022 18:33:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ozzsmj7C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 52139835C8; Thu, 27 Jan 2022 18:33:49 +0100 (CET) Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6618A830D0 for ; Thu, 27 Jan 2022 18:33:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vk1-xa36.google.com with SMTP id z15so2290436vkp.13 for ; Thu, 27 Jan 2022 09:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NS04CBMAMw9tNMWW9E6/NGUfg7jzubVvAKR2d+bfgf4=; b=Ozzsmj7CgzRbWrr88AaTpYXBX8BO8FuQgvV00c5uF1skvmDbNiw+EfdD1R7v0+uoht 3YesWzFB+6yDscldrMJ9jpO/vqVmyUyUitaGFqS12Fz3BbNMMD4wCOJXWzwdnafmi9DQ xHG2YQISFB7OT3zkBFNBxYR/LmqVm9uPPEy6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NS04CBMAMw9tNMWW9E6/NGUfg7jzubVvAKR2d+bfgf4=; b=Hi4uZHnO+MvE+k/NbkTlIERl1Ae6l1XtQZqBdn7R5GKpf0XpiJyt7DomuWYmh92sdk 3CnJnc/Eqi4sGSVbfwlClW1bREir1q1J/R22qi36Y7Kpjh7cnzU+Q0tZaiU25bv9uh6C W4BxVOckeSrjlKR2DatQOE3yHRlSmU+QcR5riF1RLvtSvaQ6jQj8vkx2keKqyJ9EK7JV CctWOPRkbHiLxi4qiXUx35z6KmpspSlRJUqQowm5PTTWWbWzTtj5rq/3gKSLFOSn+CZT nJ/pe6mWvegUE2/v4rGzYTuV1WCXafzQeC6+VpbmVxX0z/8b7A8PA1feKXfOv151XZYn 77IA== X-Gm-Message-State: AOAM530eSzCTzsYSXOl5ZWNOkAdkr9v2XRz7/oN05glJhahV2sscz84N Qvc+BTRfErhhko9IsY4lvPeFIrM9MISNzs18suFNw6eZTbk= X-Google-Smtp-Source: ABdhPJzMqfOfmGZccEgEifUNvDLZZ78itj2eON//FKrxRnrfzaLQRRLoNSWsKupsae+mRUuUg+fEevfBlYl+Y0J9h7E= X-Received: by 2002:a05:6122:20a1:: with SMTP id i33mr1859034vkd.16.1643304824773; Thu, 27 Jan 2022 09:33:44 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Simon Glass Date: Thu, 27 Jan 2022 10:33:33 -0700 Message-ID: Subject: Re: Early debug UART not working on AM33XX SoC To: Felix Brack Cc: U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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 Felix, On Thu, 27 Jan 2022 at 09:27, Felix Brack wrote: > > Hello Simon, > > On 27.01.22 16:05, Simon Glass wrote: > > Hi Felix, > > > > On Wed, 26 Jan 2022 at 07:02, Felix Brack wrote: > >> > >> Hello Simon, > >> > >> I am trying to get the current U-Boot master working on the PDU001 > >> board. This involves the use of an early debug UART. > >> > >> With commit 0dba4586 (arm: Init the debug UART) the early debug UART on > >> the AM33XX SoC doesn't work anymore. > >> > >> By looking at the code involved I believe a call to > >> setup_clocks_for_console() implemented in clock_am33xx.c before the call > >> to debug_uart_init() is missing. This is also what happens prior to > >> commit 0dba4586 by a call to early_system_init() which in turn calls > >> setup_early_clocks() which then calls setup_clocks_for_console(). > >> > >> My quick and dirty fix consist of inserting a call in crt0.S to > >> setup_clocks_for_console() just before the call to debug_uart_init() > >> which was added in commit 0dba4586. I have guarded this call with > >> #if/#endif testing for CONFIG_AM33XX. The code sequence in crt0.S now > >> looks like this: > >> > >> #if defined(CONFIG_DEBUG_UART) && CONFIG_IS_ENABLED(SERIAL) > >> #if defined(CONFIG_AM33XX) > >> bl setup_clocks_for_console > >> #endif > >> bl debug_uart_init > >> #endif > >> > >> However, from what I understand the crt0.S is for _all_ ARM boards hence > >> it's probably a bad idea polluting it with such #if/#endif tests for > >> different SoCs. What do you think? > >> > >> If my quick and dirty fix is not that dirty I would be happy to send a > >> patch which would also include the removal of the currently remaining > >> call to debug_uart_init() in am33xx/board.c > >> > >> Please apologize my narrow view of the matter dealing only with AM33XX SoCs. > > > > Are you able to put that call into board_debug_uart_init() and enable > > CONFIG_DEBUG_UART_BOARD_INIT ? > > > Sure I can but there two drawbacks: > 1. this fixes the problem only for my board, others might remain broken I suggest you make the function common to all boards that need it. > 2. the now redundant call to setup_early_clocks() in am33xx/board.c > remains (at least it does not seem to hurt ;-)) Yes, it is possible to use flags to avoid that, but might not be worth it. > > I will prepare a patch with a modified board_debug_uart_init() for the > PDU001 board then. > > -- > Many thanks for your help and kind regards, Felix > Regards, Simon