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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9295C433EF for ; Sat, 23 Oct 2021 23:28:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 40FF960C4D for ; Sat, 23 Oct 2021 23:28:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 40FF960C4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CAFDE83557; Sun, 24 Oct 2021 01:27:37 +0200 (CEST) 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="LfHh5j2Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5462C834E0; Sun, 24 Oct 2021 01:27:04 +0200 (CEST) Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (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 39881834E0 for ; Sun, 24 Oct 2021 01:26:55 +0200 (CEST) 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-oo1-xc30.google.com with SMTP id a17-20020a4a6851000000b002b59bfbf669so2299576oof.9 for ; Sat, 23 Oct 2021 16:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rhWBBwcTGV0zJ1edDcs9RoyM83T2h2nWYGeB3BKvxPs=; b=LfHh5j2ZAfQBUpL1FUF0k/dwZ+0s2zU8n8t+qAQGKxBwxS6tObf9Sc0aH57rSWLgwZ y6ayWeH0XL+ZLTV9O+R2k0I4Zc3iae0DDTLnKVIsvrcAoHSlIbDqbWNVje9oW6a0Jgwm jSDQchvDBUY2k+1nE75dNiHyqRK7fdONRRJAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rhWBBwcTGV0zJ1edDcs9RoyM83T2h2nWYGeB3BKvxPs=; b=FzAHc6CptxkgWkK1nz4b0J7k89d6vsbEJJq2SQXN5c0LxxledUQR31cCuSixyqGb3t hcHI9nldO2rfMKkxde5KkIVAiMFIRqq4mKo5VtjFkuZ1Y1BpO3Qo2arTNlXiYtbaEFMt 04A2uFAf4nxR6pF9F9IJyoPqpqtY3JDf94QsN5eKornFlwc9w213uUqkrH+R1OLyQoup sBzMrLdrWrScjSEEB27rfkkZMVpYrUMMKB26H7Rexm1lnWtRspVN0dr/1LNUtRX8k/yY L6UtHRMFuIKMTWErVkD4SIOaX4yIUR9qTO5kYY1uSLObZjJKpWRdPlVBKF76HaVc6eAj VrXA== X-Gm-Message-State: AOAM531G96N8IVuKwwbosAY/v/SyFI6Aq/EN7QxuBEEltCTeUkhDhI4P BiJlz0Cdwf5F3otZwhkJXORjNHxMrpgGKQ== X-Google-Smtp-Source: ABdhPJxdBtwdr36q8Lc3U2VFDvqOLf6a3cMoidWB98h1zCqQJT6ACIWqEg1s9dGsKIrNG2BXRDyjrQ== X-Received: by 2002:a05:6820:447:: with SMTP id p7mr2956686oou.63.1635031613742; Sat, 23 Oct 2021 16:26:53 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id l24sm2253885oop.4.2021.10.23.16.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Oct 2021 16:26:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Michal Simek , Heinrich Schuchardt , Tom Rini , Ilias Apalodimas , Daniel Schwierzeck , Steffen Jaeckel , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Lukas Auer , Dennis Gilmore , Simon Glass Subject: [PATCH v2 09/41] common: Allow a smaller console-recording pre-reloc Date: Sat, 23 Oct 2021 17:26:03 -0600 Message-Id: <20211023232635.9195-8-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211023232635.9195-1-sjg@chromium.org> References: <20211023232635.9195-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Before relocation there is generally not as much available memory and not that much console output. At present the console-output buffer is the same side before and after relocation. Add a separate Kconfig option to remove this limitation. Signed-off-by: Simon Glass --- (no changes since v1) common/Kconfig | 10 ++++++++++ common/console.c | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common/Kconfig b/common/Kconfig index fdcf4536d0f..fede7e40215 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -32,6 +32,16 @@ config CONSOLE_RECORD_OUT_SIZE more data will be recorded until some is removed. The buffer is allocated immediately after the malloc() region is ready. +config CONSOLE_RECORD_OUT_SIZE_F + hex "Output buffer size before relocation" + depends on CONSOLE_RECORD + default 0x400 if CONSOLE_RECORD + help + Set the size of the console output buffer before relocation. When + this fills up, no more data will be recorded until some is removed. + The buffer is allocated immediately after the early malloc() region is + ready. + config CONSOLE_RECORD_IN_SIZE hex "Input buffer size" depends on CONSOLE_RECORD diff --git a/common/console.c b/common/console.c index 0013d183aeb..0c9099ca52a 100644 --- a/common/console.c +++ b/common/console.c @@ -735,7 +735,9 @@ int console_record_init(void) int ret; ret = membuff_new((struct membuff *)&gd->console_out, - CONFIG_CONSOLE_RECORD_OUT_SIZE); + gd->flags & GD_FLG_RELOC ? + CONFIG_CONSOLE_RECORD_OUT_SIZE : + CONFIG_CONSOLE_RECORD_OUT_SIZE_F); if (ret) return ret; ret = membuff_new((struct membuff *)&gd->console_in, -- 2.33.0.1079.g6e70778dc9-goog