From patchwork Fri May 6 09:05:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1627469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lzAIrRJD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kvl656pttz9sGS for ; Fri, 6 May 2022 19:05:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8AD583C28; Fri, 6 May 2022 11:05:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="lzAIrRJD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF76583C28; Fri, 6 May 2022 11:05:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (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 84D7A81DD6 for ; Fri, 6 May 2022 11:05:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28D13B8346E; Fri, 6 May 2022 09:05:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1F5FC385A8; Fri, 6 May 2022 09:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651827932; bh=dT69K8OIyILDyhC9vXf7Myeaz4bEEvWWl515DGinano=; h=From:To:Cc:Subject:Date:From; b=lzAIrRJDNHJ+19gPqh3HPKxCxqt2kj/QYM+Zx1n8XeHRIeqraMJLuW01XxDxhme3n gNtTfU5iB+g5B0nSoB9eknjSvFzvdiHo2mvPtkVQ2wd47AlWANYibQW1hDMfpWGyat AGd+97Lno0U/Q54FGrM7JKTIDpYXlHEn29sbMZaPORDSciv95oXIBfD4BWPuOC29Vy zT/DmsJmJhV7QjNPAvkxSpsN0bb++hOsGWPl2lVJTdUFTnGDonBMqUzRmV8uP/A1DC 15QlpZ5bxrCnWFi8sl2eW75iydNw9uShRyMotYOAIGisbRCJH666FSG0Z9f5cWfcj6 N19gVx1HWzVvg== Received: by pali.im (Postfix) id E050E1141; Fri, 6 May 2022 11:05:29 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Marek Behun Cc: u-boot@lists.denx.de Subject: [PATCH 0/5] arm: mvebu: turris_omnia: Fix hangup in debug UART Date: Fri, 6 May 2022 11:05:12 +0200 Message-Id: <20220506090517.5935-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 If proper U-Boot on Turris Omnia tries to print something on debug UART then CPU hangs. Reason is that debug UART in proper U-Boot for Turris Omnia has incorrect configuration of base register. Base register is different in SPL and also in different stages of proper U-Boot. Fix all these issues. Introduce new arch_very_early_init() ARM function which will be called at very early stage prior initialization of debug UART. Move code which moves internal mvebu registers to this function. And split configuration of DEBUG_UART_BASE into SPL and proper U-Boot to allow setting different values which matches current HW status. With all these changes, it is possible call "printf" function in Turris Omnia's board_early_init_f() function in both SPL and proper U-Boot. Pali Rohár (5): arm: Add new config option ARCH_VERY_EARLY_INIT arm: mvebu: Move internal registers in arch_very_early_init() function serial: Add new config option SPL_DEBUG_UART_BASE serial: ns16550: Add support for SPL_DEBUG_UART_BASE arm: mvebu: turris_omnia: Fix DEBUG_UART_BASE arch/arm/Kconfig | 6 ++++++ arch/arm/lib/crt0.S | 5 +++++ arch/arm/mach-mvebu/Kconfig | 1 + arch/arm/mach-mvebu/Makefile | 1 + arch/arm/mach-mvebu/cpu.c | 31 ------------------------------- arch/arm/mach-mvebu/lowlevel.S | 27 +++++++++++++++++++++++++++ configs/turris_omnia_defconfig | 3 ++- drivers/serial/Kconfig | 7 +++++++ drivers/serial/ns16550.c | 4 ++-- 9 files changed, 51 insertions(+), 34 deletions(-) create mode 100644 arch/arm/mach-mvebu/lowlevel.S