Message ID | 20230721161217.904008-3-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=gnYVHOlH; 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 4R6vjH02Cdz1yYm for <incoming@patchwork.ozlabs.org>; Sat, 22 Jul 2023 02:12:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB986867E8; Fri, 21 Jul 2023 18:12:34 +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="gnYVHOlH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8EBF7862B6; Fri, 21 Jul 2023 18:12:29 +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-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 0FF2D862B6 for <u-boot@lists.denx.de>; Fri, 21 Jul 2023 18:12:27 +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-x634.google.com with SMTP id d9443c01a7336-1b89cfb4571so15884825ad.3 for <u-boot@lists.denx.de>; Fri, 21 Jul 2023 09:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689955945; x=1690560745; 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=+Wxi+MNKziistkIUTE4qv7vJUaPsqROIIOGJqGV5G7g=; b=gnYVHOlHe3t4rG7j8IiZTk4Mhcr8vDQwA+jI0wGXetrD7k28XbsQ8reMNTm1zq6qPs +lwN+aG1THuw2DE+u2cWMdDph5eDJX0V8AaVDLW1rKwG6cNbEDsIpBHu0aTa6uDMArq7 xrsar2b5elUg+hDPW7OeOfEppZ0q6GmHMZytx8qO9dgHDmwGHTVnnThQZ1RuaQvogFlH 1pB0Dp1Gj6Yu1aXercmni4X5YpAuJYRnttrytPn3R0x1mMlJ5eRhLdAlF9DrmJ9LCmSK x1Hwu5wBA4jyFhHUkmV0nvCA6Ry9hUS6PWbv2NF6igRn/0EtlHfNFa+W3W/7bJ7Q0cKr s0xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689955945; x=1690560745; 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=+Wxi+MNKziistkIUTE4qv7vJUaPsqROIIOGJqGV5G7g=; b=JO1sPmyFEI4JocC5dhA6J7wcTyw/OP8xTXoBtEg9f1OTxRvkPzdYTsHUr/rNbUi5Kr PA+3RzS527ZdQN27JU5bk9K++dswwCPBJWKrbYor/gYbFYFsf5t+V1dEAkBH7lYvbF0p Z8T+KuzXuvhhaonGVP84IdLDcuSgZEKAR5Sl4SZqYn1/SQVqB/bp0ZWPSAmsmLBY08ky RkRpfji7zxq9LEYL37giqYjQq7nBQWE2PZ1GFHMBJq/QvIHsvYgnfScH4epjocYioLUo TgYAcC9I6q9QQqxCt61VJGGrgd1fUbZ6+o9j8SvhUlwHvwlgAbj0ycMB1KFcnEupQyYm pGqQ== X-Gm-Message-State: ABy/qLavHm5AslCQvKtIGtQB4bKJYbuU8HwDhG9SkUHTm0aq2uTgJpgF hWcPXxbswpHCNPAJQC/PHh8HEYkT+90Fn3hu X-Google-Smtp-Source: APBJJlFkMi+Pq0W7b4FDFaVQOOZZj0LlZuZYD4l6wT5BGQn0bmqpilCmRxJYKylWKC+JLQasceM7HQ== X-Received: by 2002:a17:903:11c8:b0:1ae:8892:7d27 with SMTP id q8-20020a17090311c800b001ae88927d27mr2883824plh.42.1689955945208; Fri, 21 Jul 2023 09:12:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 09:12:24 -0700 (PDT) From: Bin Meng <bmeng.cn@gmail.com> To: Simon Glass <sjg@chromium.org> Cc: u-boot@lists.denx.de Subject: [PATCH 3/5] video: ivybridge: Use mtrr_set_next_var() for graphics memory Date: Sat, 22 Jul 2023 00:12:15 +0800 Message-Id: <20230721161217.904008-3-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/ivybridge_igd.c b/drivers/video/ivybridge_igd.c index 9264dd6770..c2cc976618 100644 --- a/drivers/video/ivybridge_igd.c +++ b/drivers/video/ivybridge_igd.c @@ -774,8 +774,7 @@ static int bd82x6x_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/ivybridge_igd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)