Message ID | 20230721161217.904008-4-bmeng.cn@gmail.com |
---|---|
State | Superseded |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=poLaqvIR; dkim-atps=neutral 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6vjS3sVzz1yYm for <incoming@patchwork.ozlabs.org>; Sat, 22 Jul 2023 02:13:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C724F867D6; Fri, 21 Jul 2023 18:12:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="poLaqvIR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C1808672B; Fri, 21 Jul 2023 18:12:31 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 8B0EF867C9 for <u-boot@lists.denx.de>; Fri, 21 Jul 2023 18:12:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b89114266dso16014755ad.0 for <u-boot@lists.denx.de>; Fri, 21 Jul 2023 09:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689955947; x=1690560747; 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=nRsJcx1H1+Ud2EWbfMFE1Ox+VDZALr7dmzor/BqbLLo=; b=poLaqvIRtIh03yx3QJqGh748wapwnkLTCeg2nj4Pb8UaFqNWuA6395vnjQ+NsPxU9s kt8cuXFZCrLcyxUeqbG1t1dqfbHjjFMVzsmTCiQYKUW9VFr3NMuxAfXr+KtyLXnj5W6E vvZVsyvo3Vi545/3Ej1VAdmidoJbGWuFt++zsHZgLaCvpKIDawJsM6bRQD97qbC72UeI CdUiQYDgfW70Hpz9VHhD+wFBQlgmHOM5ofr6zyPCKTQNYdmSM+UC2edjTduaCFmGqkF1 rzWIP0Y2mxagdvvkhuIuIVT+bX1YWQ1jLdJZPD3UPES9AX/giNMP+YMjqlT7j6+5lgS0 yHbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689955947; x=1690560747; 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=nRsJcx1H1+Ud2EWbfMFE1Ox+VDZALr7dmzor/BqbLLo=; b=Xprlt/8krxVKBKyNeGr0U9r/vb4fXaAqeLvNpMv9lcJheRK849Cm3zrI0Q9HASsiZ7 8vvqpywc1YVIJY5Nqf9U6BOJu2pB3fcrxKjMCNBjBTOQ8mSc0e/AebI6gbnufQKFIp1I uFT2CogxrLVmHCYL0yWMVIhmcM55bagwpShb5qESNa0WVZltVJrW8BbJn9UrOI3pyUze lzS8wc3994Bz7Czo86mmdl55Gd/TLlg550/Re+UbWRoRg64JkHK16SK427tjoYLSFEp/ t1MGppiguZOHBfPF+k0capyPH1aP5N3l2xGmgYvzV1tY/uydjf3hk+N0MOz5NS6TTPG0 3nNg== X-Gm-Message-State: ABy/qLYe3FMCpLkaaCT6MOQu/z5pBhYvMuaTnfe/4KYi/j6CyZmztYy4 9g2TP/mRC7NjbH4T3ibmx8G/r2g8jiXKNX/e X-Google-Smtp-Source: APBJJlGTDl6zD+TS1TYRSuDrtrxJ4o7cLG1E9J0Dxnr60Z4G5W4BapOKHSbtmmMxo1PLmPAEkxa5eQ== X-Received: by 2002:a17:902:ea04:b0:1b9:e81f:fb08 with SMTP id s4-20020a170902ea0400b001b9e81ffb08mr2897519plg.55.1689955946843; Fri, 21 Jul 2023 09:12:26 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id jw22-20020a170903279600b001b9da42cd7dsm3658239plb.279.2023.07.21.09.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 09:12:26 -0700 (PDT) From: Bin Meng <bmeng.cn@gmail.com> To: Simon Glass <sjg@chromium.org> Cc: u-boot@lists.denx.de Subject: [PATCH 4/5] video: vesa: Use mtrr_set_next_var() for graphics memory Date: Sat, 22 Jul 2023 00:12:16 +0800 Message-Id: <20230721161217.904008-4-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230721161217.904008-1-bmeng.cn@gmail.com> References: <20230721161217.904008-1-bmeng.cn@gmail.com> 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 <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
[1/5] x86: fsp: Use mtrr_set_next_var() for graphics memory
|
expand
|
diff --git a/drivers/video/vesa.c b/drivers/video/vesa.c index cac3bb0c33..50912c5c8b 100644 --- a/drivers/video/vesa.c +++ b/drivers/video/vesa.c @@ -23,8 +23,7 @@ static int vesa_video_probe(struct udevice *dev) /* Use write-combining for the graphics memory, 256MB */ fbbase = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base; - mtrr_add_request(MTRR_TYPE_WRCOMB, fbbase, 256 << 20); - mtrr_commit(true); + mtrr_set_next_var(MTRR_TYPE_WRCOMB, fbbase, 256 << 20); return 0; }
At present this uses mtrr_add_request() & mtrr_commit() combination to program the MTRR for graphics memory. This usage has two major issues as below: - mtrr_commit() will re-initialize all MTRR registers from index 0, using the settings previously added by mtrr_add_request() and saved in gd->arch.mtrr_req[], which won't cause any issue but is unnecessary - The way such combination works is based on the assumption that U-Boot has full control with MTRR programming (e.g.: U-Boot without any blob that does all low-level initialization on its own, or using FSP2 which does not touch MTRR), but this is not the case with FSP. FSP programs some MTRRs during its execution but U-Boot does not have the settings saved in gd->arch.mtrr_req[] and when doing mtrr_commit() it will corrupt what was already programmed previously. Correct this to use mtrr_set_next_var() instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> --- drivers/video/vesa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)