From patchwork Tue May 7 18:41:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Day X-Patchwork-Id: 1932598 X-Patchwork-Delegate: caleb.connolly@linaro.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=samcday.com header.i=@samcday.com header.a=rsa-sha256 header.s=protonmail2 header.b=E4S2nTVj; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VYnDj1nJXz1xnS for ; Wed, 8 May 2024 04:41:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7915B8831C; Tue, 7 May 2024 20:41:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=samcday.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; secure) header.d=samcday.com header.i=@samcday.com header.b="E4S2nTVj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16E698831F; Tue, 7 May 2024 20:41:30 +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,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A8BFD88116 for ; Tue, 7 May 2024 20:41:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=samcday.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=me@samcday.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samcday.com; s=protonmail2; t=1715107286; x=1715366486; bh=DVdgnGSpIo+am3iCcH8zcHK6iJ374tYs/x3qRTUJbhY=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=E4S2nTVj6Igtg/LaR78+3hdFnMl3p6dZPSc+gfx7B4cbnFfMZLE4KrlEUCuzo4O3S K0MHzOyS1ySU5GIHjGNg0WaO3aNo3UHRUmJgB+AupkrqBeYinRxueinw1IDCC2kGPQ kNnPtA6Bt38f4Ch3PV8doHY4Sb+f/srcz7ITkj52E7b3JS9OgatYQke6iRYMz/l759 24ysiMMGqHDgt6IaogpMg2mOfrik1Ox4aRUUe2RU8CnuIUoBe68PRehYvBaXMSxbYZ h4+VDTzlqyiIvANMsdIKiAVlEq7/QMcymCBZos6EBLVFaVO0Idizk6zAkCbu/N3V9L OFAnZFLHuwm+w== Date: Tue, 07 May 2024 18:41:23 +0000 To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg From: Sam Day Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de, Sam Day Subject: [PATCH] mach-snapdragon: do carveouts for qcs404 only Message-ID: <20240507-qcs404-carveout-only-v1-1-93d06884b862@samcday.com> Feedback-ID: 25366008:user:proton X-Pm-Message-ID: cd9e94e31d640f25447f020596271e11ac77cf82 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.8 at phobos.denx.de X-Virus-Status: Clean The newly introduced carve_out_reserved_memory causes issues when U-Boot is chained from the lk2nd bootloader. lk2nd provides a simple-framebuffer device and marks the framebuffer region as no-map in the supplied /reserved-memory. Consequently, the simple_video driver triggers a page fault when it tries to write to this region. As per Caleb's advice, this simple patch only does the carveouts for the qcs404 SoC for which it was originally designed. The intent is to do the carveouts for more Qualcomm SoCs in future. --- I'm not sure if it's feasible to get this in for the 2024.07 release, but it'd be great if we could - it's the only thing that breaks U-Boot master on msm8916 devices that chain from lk2nd. Signed-off-by: Sam Day --- arch/arm/mach-snapdragon/board.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- base-commit: 1c40dda60f5f7e83a6d6f541cf5a57eb7e8ec43c change-id: 20240507-qcs404-carveout-only-7a15bbf3fd89 Best regards, diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 3d5994c878..b439a19ec7 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -467,10 +467,12 @@ void enable_caches(void) gd->arch.tlb_addr = tlb_addr; gd->arch.tlb_size = tlb_size; - carveout_start = get_timer(0); - /* Takes ~20-50ms on SDM845 */ - carve_out_reserved_memory(); - debug("carveout time: %lums\n", get_timer(carveout_start)); - + /* We do the carveouts only for QCS404, for now. */ + if (fdt_node_check_compatible(gd->fdt_blob, 0, "qcom,qcs404") == 0) { + carveout_start = get_timer(0); + /* Takes ~20-50ms on SDM845 */ + carve_out_reserved_memory(); + debug("carveout time: %lums\n", get_timer(carveout_start)); + } dcache_enable(); }