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 1E162C46467 for ; Sun, 15 Jan 2023 21:17:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA7248559D; Sun, 15 Jan 2023 22:16:42 +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="PI2xV/+4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 01BA58551E; Sun, 15 Jan 2023 22:16:33 +0100 (CET) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 9CA4785531 for ; Sun, 15 Jan 2023 22:16:27 +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@chromium.org Received: by mail-io1-xd36.google.com with SMTP id e129so12857390iof.3 for ; Sun, 15 Jan 2023 13:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=npNG1+qEcTdsSTiVh7C2n9xddC2f8W3kC1I2CePNgX8=; b=PI2xV/+49k6tkmgGmmvGJax10bWgWSYa2Ud9ED0I+ROdWuSWQB+DnMx54CV1eXh8bJ V8xjz2CVonkbdECFwAqftwteL6Eh4msugQPVJ+HAVkXiA3l7Y4p69kNNpSUcH/Hm7OmL L0vSO67CqFsi8rs9Lv3Csz1AQC9aDArptkoXw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=npNG1+qEcTdsSTiVh7C2n9xddC2f8W3kC1I2CePNgX8=; b=ouS4vJslZdpmVbKil8cz8qMHrYjxmBawVjM+fRJ1nOCqHyYI/ZEnEagfz2ic7JZxPA Ltsu1/uk/ax0V6BWdpYk2d3CYivtoBNEFSwfL3AwF6hXaY7FVlt2/gJ20OoY5RATkExT G69zR7EtgYeRm1j243SF+AUOmwQrXHpoZNaWuh2gjle+Y/JUnzsPiWaEiCuQu6vFQb3C /WQQepYP+EOb1A+b1R0sR9LKS9c1IOzyoxHbcu7RDSH+ihn2I/XpVknhRTMeEwfy5cTM ywFQ1pV1TZe3BR5rBYbe5cNXwPgxd35IiLLvgZE7Bm8IFFfTclctWgzVnteqC0q3oHH0 j/Cw== X-Gm-Message-State: AFqh2krCQSkH639ASVb6c/Qm3nuTMBv9eIAho2NyRIaKbLHskwHtVVOp R6/B070ElJgmK2e/o4wm3V9AFHWIUBMirZ15oYE= X-Google-Smtp-Source: AMrXdXtGsc/aqc7VHiMFfWc6ABX98+JpG26VdReW3pvyZHepYTR4ILpYq/HMPe+AY7DuUL7KxOBsNw== X-Received: by 2002:a05:6602:1789:b0:6bc:d712:8bbc with SMTP id y9-20020a056602178900b006bcd7128bbcmr64486845iox.4.1673817386219; Sun, 15 Jan 2023 13:16:26 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id j6-20020a6bf906000000b007046e9e138esm4329107iog.22.2023.01.15.13.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:16:26 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Dzmitry Sankouski , Marek Vasut , Ovidiu Panait , Pavel Herrmann , Rasmus Villemoes , Stefan Roese Subject: [PATCH 04/24] dm: Allow serial output during the relocation process Date: Sun, 15 Jan 2023 14:15:41 -0700 Message-Id: <20230115211602.1127661-5-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230115211602.1127661-1-sjg@chromium.org> References: <20230115211602.1127661-1-sjg@chromium.org> MIME-Version: 1.0 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 Reset the serial flags so that the debug UART can be used (if enabled) in the small window where there is no serial device. This can avoid a hang in some cases. Signed-off-by: Simon Glass --- common/board_r.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index 3618acad437..5f3c3db476d 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -796,6 +796,15 @@ static init_fnc_t init_sequence_r[] = { void board_init_r(gd_t *new_gd, ulong dest_addr) { + /* + * The pre-relocation drivers may be using memory that has now gone + * away. Mark serial as unavailable - this will fall back to the debug + * UART if available. + * + * Do the same with log drivers since the memory may not be available. + */ + gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY); + /* * Set up the new global data pointer. So far only x86 does this * here. -- 2.39.0.314.g84b9a713c41-goog