Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94F6E606A327 for ; Wed, 2 Dec 2026 04:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=OKnhyi8S; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=LtabC66f; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Xy006LaD Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F0D99408BC; Wed, 2 Dec 2026 04:59:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Kbo2ABSi4F-N; Wed, 2 Dec 2026 04:59:15 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org 29ABA408B3 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796187555; b=V5qvC9W4BoVf+yt3udo3c/nNQyZrCDY91pF1B7LK7e2Z+yMXdOaeNvSXFWkFnh9KUsvL baiiGEnk2e60kdMEPKuqUmhxQTemDzaR+6VwtAaFEixNaO5wTyqTkelm2JiinE/P/ezpO IuyUivZwplbYRk33QD2gbqXenFmATJk6EOuR1UhXSJRZJmyg6Y57j88KX/h0q/9Y0Dfpq g/sXdF26KOwM3Li7SqtQ2/sLFXOH73NLgD3xDTsR5NvlWrvp4HlnUW+X7LwfnsNBZ3ipo EM8IfAVwV93i32hHwNBMu6/EgyeROVOoSc9YwZ4r7goja+VKlG0g433nxvfWOYrO0Uw== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796187555; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:Received:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key:X-Authority-Analysis: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details:X-BeenThere:X-Mailman-Version:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=uL0IDeP2uCgZhbpATV3J/7+iE9JMEv3bFUK2kbD/veg=; b=MKWkAtYNDEwBB8mVZwyOITx862WfL2Aqr4+spgbBBQCBx6zT5nZdpTAPsLEWzU9zUgnr /UvbIxvcCuajDT/sQ+oiWGt7gUUdvSxscr9nErSvgmRUExxuTeuw6VhxByGfgaofv+qx5 jFDVmKImY4a1Ovp590yjIPnp95bNKCbM4slODiwCxW1ACaF106tC63HxAtypyk+tFEZUK pl3I5JkRoa7hG7Xq5TtPN7a35cG9NCJsHa+iGaUfVaUVJe+UFD058eEtcrWcXhJAPFXlx vylACUKfpDFaZnxwe1RTmPhftTHLfWiY4wXSjkUKVuSEBAN4UXj1qmN1zMzgVcclo6g== ARC-Authentication-Results: i=1; smtp4.osuosl.org; dmarc=pass header.from=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=LtabC66f; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Xy006LaD; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796187555; bh=uL0IDeP2uCgZhbpATV3J/7+iE9JMEv3bFUK2kbD/veg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OKnhyi8Sq6SCK96KpBf0RspRKxOltV147BM8L0TaypfVMAGcp5CuEcGOfVmu9AuA8 Ux+jAhD14/QTQxiJxJ0so5OWoFiHYDPsMMoyHFNpQ5iMVckzm+p6+SEoKq46OWSpD/ NT7+0k5R0Uz7LApRh6iLbrds6+dHs3z1D+50nw7SgmC+4oig9PDQpG7+S8jwMjjj+T Lf35SGlbvwpzRRNbQvfMtWIMfVwMjjm+8Nibq67bVW2geoocKFbnlK93HVyurJHdRn 4NmpGik9yr0emamSBf+5o24JbzTY+/apWsGCRZrGsszKeTwK3ihmXnQjf4Lg3E9mwp 2FiWsrDSD7HqQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 29ABA408B3; Wed, 2 Dec 2026 04:59:15 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 12ACA325 for ; Wed, 2 Dec 2026 04:59:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 03E72408B2 for ; Wed, 2 Dec 2026 04:59:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id EkMhWoRaHz5u for ; Wed, 2 Dec 2026 04:59:13 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org EBD68408B5 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip=205.220.168.131 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=205.220.168.131; helo=mx0a-0031df01.pphosted.com; envelope-from=balaji.selvanathan@oss.qualcomm.com; receiver= Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=LtabC66f; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Xy006LaD Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by smtp4.osuosl.org (Postfix) with ESMTPS id EBD68408B5 for ; Wed, 2 Dec 2026 04:59:12 +0000 (UTC) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B22u4Ta3048623 for ; Wed, 2 Dec 2026 04:59:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= uL0IDeP2uCgZhbpATV3J/7+iE9JMEv3bFUK2kbD/veg=; b=LtabC66fsN8iw80y iweFEDPcHtdMEnifm1G892JE29TVXJLJv1rYvonqdVZJu4v8bVqWw+zfJ1tXPELe C7f5KaXtC8tlRFNL2w2aAmDUFoVJTf1t+LLjkZNvmhtTBM5fYVWmgTwPp3kjCQXZ HmRXQqpFfAJHstiFmwe5nm8zCbD8Vp2io+Iih83mj0l+TTTY/ssdyoQXBAeAeUv6 F3Tg6QwbZS/NwYY1kwb0UoVSDP/xIsy0H3vd6oyLG/tlu6G22zlvr26utMCY/Vi1 outYB08x8sqAeA/lT+C5GoL3YzkJaPJQoDFjoE60ob3MgykOlIGrnkleNosmRqSq 72GIeA== Received: from mail-dl1-f72.google.com (mail-dl1-f72.google.com [74.125.82.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja3aj24tp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 04:59:11 +0000 (GMT) Received: by mail-dl1-f72.google.com with SMTP id a92af1059eb24-1b59dfe467eso3140487c88.1 for ; Tue, 01 Dec 2026 20:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796187551; x=1796792351; darn=lists.u-boot-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uL0IDeP2uCgZhbpATV3J/7+iE9JMEv3bFUK2kbD/veg=; b=Xy006LaDWZZHrvBqxVfcltYfHGheWrc4Hd20sgQjT0j1ipr23vGlt5XPkQ8YE6uOwy L1xNcC+pYGLEiNyf+pJjyXmjoWvta1C1jFU5imfh6omhBy/3MIr3ClFV/DS8r+NXKR/T 5s+74GEjqPExrnQgmTIk9xVU+FatDaKJH2TJwc/6SGTHogYUxblplmZ1X9KBhp4fxB57 t316LrfAPBLaffY/v+kEXATdcSes9UvFj5W5GANvdlpCaQMX4NGWp0IHMJIxAhatGwLW FSL1cqdN+E94qF//9pinGKaEkH9nCynpXLph+55hMwauSsNu1p2cBlvPfvCgpFcFozp/ l4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796187551; x=1796792351; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uL0IDeP2uCgZhbpATV3J/7+iE9JMEv3bFUK2kbD/veg=; b=cqCkZTyzrophtHowZohmh2zu+xfs0L62eoiY0lgQdrfPTSVMORihu7jnUjgvZfMeu8 CmpOBWBatFYHkpGXI6LjStr2MN9o5a5ThVKDbuMM6EIbObLXmX6doWVYZhOqUC+Yc8Hs J8MYuBw0pPnKjXOFDPgixYCemb7/lVAJNrCwD4kovLljI0AGGAsCsyQR32GSqNWSpBZN c9t0INaRVaZwuN7lAmoCj2tisksBnhrYyE/CfbWbMcjuhz1kHWhoFcEEh1Zm7JBxIs9D u1jtSPyLrpgpDoWENxn4FHmkbEFMwaSHWEp6meBJEZjg6y36prWrSFg6UXX9bYySRolB J/lg== X-Gm-Message-State: APuU4Z+T6VwiLWD6Os2luY6Ov0+ZxbTRYEG0FVT0mEHEhYzno3pT+xO0 ck3sEQimqZwG8jlJeM3Y93asTx0UmiMA0rYrss/eXwNXnxydXkvkoyp7T8EJgl1T7u+3jC1DrBy Oy8t/56eCDtK52UYdiHbnDbKJVQa7dkiI0V9SSFcyYea67AaTFlUEpbref5vUSuFucN1XgyE= X-Gm-Gg: AZFdTZd4G1qNPYRdY1FcLM9GGxYaQbY3y657rKfN1RoJlV+ld4Ia4moBeVhTHGoQxmh dLY9PSDRIvOpPTbMWPzuhVBNQd9ST5OsQ5uC9ahW65YSOTOR8UNoZzMh91yyPVkoA6IIKFZihQu AGRZtHBEAzjSnVYhxHsDJ3D/3bYMsbSQzbOYIoEVOvg7+H2SGPDJDZcwhZApW1z7spJRu4GvqTB rICZ/X5nr1m5KIHbCDPE547cCZsQs93uOn+KgoXwcSXn9MNourw8K5KQwjg7+6Hf4P7WYclVdY4 V7K7ZunWleG1Vh/f2tTGYekP/oCYwa/nWm9J2tqYsTKSD3k5tZSQyFWHNHZgK3AJ1H2mLdyRmfs /FT8SXwqxx5s4yWz6Y03S4TvkKoq5tbwEIEu1ZY6HGV6YnjVDLyAnQXkDBU3n04OPJj2IUpleB4 gUuQnmGBaowG10ZEvkUh1wVuR95HqGm2k25TaL9CUZj+/i01dimB5H+000ZA4+3D0+6sL7QGs3N gdujQ== X-Received: by 2002:a05:7022:3f0d:b0:16c:3408:760b with SMTP id a92af1059eb24-1b5568dabf1mr38056811c88.32.1796187550843; Tue, 01 Dec 2026 20:59:10 -0800 (PST) X-Received: by 2002:a05:7022:3f0d:b0:16c:3408:760b with SMTP id a92af1059eb24-1b5568dabf1mr38056782c88.32.1796187550306; Tue, 01 Dec 2026 20:59:10 -0800 (PST) Received: from hu-bselvana-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38566fdce48sm121634180eec.14.2026.12.01.20.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 20:59:10 -0800 (PST) From: Balaji Selvanathan Date: Wed, 02 Dec 2026 10:28:48 +0530 Subject: [PATCH v12 2/7] arm: snapdragon: Disable MMU early before U-Boot reset vector X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-snagboot-v12-2-ecff58506766@oss.qualcomm.com> References: <20261202-snagboot-v12-0-ecff58506766@oss.qualcomm.com> In-Reply-To: <20261202-snagboot-v12-0-ecff58506766@oss.qualcomm.com> To: u-boot@lists.u-boot-project.org, Sumit Garg , u-boot-qcom@groups.io Cc: Rayagonda Kokatanur , Tom Rini , Ilias Apalodimas , Casey Connolly , Neil Armstrong , Johan Jonker , Tien Fong Chee , Michael Srba , Sumit Garg , Aswin Murugan , Simon Glass , Hongyang Zhao , Linus Walleij , Balaji Selvanathan X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796187532; l=2747; i=balaji.selvanathan@oss.qualcomm.com; s=20260213; h=from:subject:message-id; bh=b2MZNvbz8+ULKdUaGCWt92X71yqfoatohCj+7IFSRxw=; b=OnC76WHVjPxsFtWlXuol7GWQumZtOeXkscTik0RjpAapK7DiI7W4cp7uKSH4yV369lJavwMhw fwhuLHhEYnWC5u4IGtOZ3lPr1t78lNcTqlTMePGb0UmH4FnUmq73Cee X-Developer-Key: i=balaji.selvanathan@oss.qualcomm.com; a=ed25519; pk=CDpYiUU3SH7KGEtsBvY2tBGPiWfMxqWJF0p2LftOfnc= X-Authority-Analysis: v=2.4 cv=Y7xtIReN c=1 sm=1 tr=0 ts=6b0fa59f cx=c_pps a=bS7HVuBVfinNPG3f6cIo3Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=Q-CY8eKHVbgcYtpEucYA:9 a=QEXdDO2ut3YA:10 a=vBUdepa8ALXHeOFLBtFW:22 X-Proofpoint-GUID: 8lBH8M-80TOmisSTmxe822D0u3vbW_B5 X-Proofpoint-ORIG-GUID: 8lBH8M-80TOmisSTmxe822D0u3vbW_B5 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAxOSBTYWx0ZWRfX1aKKlB25ABhY ypZ17nmdU/u2s4jdV9GtW7WKWeNGzBUS7p2QcgzOnxrEI9PFHaNoWh8Zd7VITic9iEhBvVjz6Fm kZeokEwuBa7KHYegxk/xL1/qzYRobxg= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAxOSBTYWx0ZWRfX3UdEeHnZK3dt nj6+7aWGwzmFQkjJZN8sjoCSbEEHcDhRZsWhFpQ2GZQyR4Twk5pAwJv1AeiMDaZEgkNCFIhLO20 BZql+R8wybOt/R6zNr/CgCVnRX9f8GMat96IYmCoaB15Uo2+sFpRGz/QinZCMf66UUZT03XkBki hifWz0/11sBrY3NNR2QKj+L+jX+AxJgl9aX3G/BTd7RzoiPY2cbY/KS1/tK1yELLpKnFRFpLekS 6XY1QttxrYRKRwwPUrPWt8oRtzUWtZQqPvbXPsPQGuaEm71IKCCBk9CWZuoXuy0GbzeYizu5N9M 3sVgAhsByMpZHlcHKmZ0Wo4BqviQyS39UJw06Vtz8B0zEMSH1VtUEIQUSvzveJ7CuHNcZTs/P0Y A82rd46e4VsR6Lrq98m7KQ3jwnQAYTjvhqIaptKyDZD+ZbX/+HofCFwf9TzSbOE2aIkrPciwz0a 6tdOhNo5MZ8tase8jmQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_01,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 clxscore=1015 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020019 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 When U-Boot is loaded by XBL in Snagboot mode, XBL leaves the MMU enabled with its own page tables. This causes stale TLB entries and incorrect memory mappings when U-Boot initializes its own MMU. Disable the MMU and invalidate TLBs before branching to the reset vector. This ensures a clean MMU state for U-Boot initialization in Snagboot mode. Signed-off-by: Balaji Selvanathan --- Changes in v10: - Rebase to latest boot0.h file - Add missing newline at end of snagboot_boot0.h Changes in v7: - No changes Changes iv v5: - Clear C bit (Dcache enable) also during MMU disable Changes iv v4: - Remove handling for EL1 or EL2 entry as for Snagboot we would only enter U-Boot in EL3 from previous bootloader Changes in v3: - Brought the MMU disable logic under CONFIG_QCOM_SNAGBOOT_SUPPORT ifdef condition - Moved the MMU disable codes to a new seperate file Changes in v2: - Newly introduced in v2 --- arch/arm/mach-snapdragon/include/mach/boot0.h | 2 ++ .../mach-snapdragon/include/mach/snagboot_boot0.h | 27 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/arch/arm/mach-snapdragon/include/mach/boot0.h b/arch/arm/mach-snapdragon/include/mach/boot0.h index c34627cf62c..0e199b973a9 100644 --- a/arch/arm/mach-snapdragon/include/mach/boot0.h +++ b/arch/arm/mach-snapdragon/include/mach/boot0.h @@ -10,6 +10,8 @@ #include "msm8916_boot0.h" #elif defined(CONFIG_QCOM_EL2_GUNYAH_EXIT_SUPPORT) #include "gunyah_exit_boot0.h" +#elif defined(CONFIG_QCOM_BOOT0_SNAGBOOT_MODE) +#include "snagboot_boot0.h" #else b reset #endif diff --git a/arch/arm/mach-snapdragon/include/mach/snagboot_boot0.h b/arch/arm/mach-snapdragon/include/mach/snagboot_boot0.h new file mode 100644 index 00000000000..899a37092f8 --- /dev/null +++ b/arch/arm/mach-snapdragon/include/mach/snagboot_boot0.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Early MMU Disable for Snagboot Mode + * + * Disable MMU at the earliest possible point for EL3 entry. + * Snagboot mode always enters U-Boot at EL3. + * + * After disabling MMU, invalidate TLB to clear any stale entries that might + * cause issues when MMU is re-enabled later. + */ + + mrs x0, CurrentEL + cmp x0, #(3 << 2) /* Verify EL3 entry */ + b.ne reset /* Unexpected: not at EL3 */ + + /* Disable MMU at EL3 */ + mrs x0, sctlr_el3 + bic x0, x0, #1 /* Clear M bit (MMU enable) */ + bic x0, x0, #(1 << 2) /* Clear C bit (Dcache enable) */ + bic x0, x0, #(1 << 19) /* Clear WXN bit (Write XOR Execute) */ + msr sctlr_el3, x0 + isb + /* Invalidate entire TLB for all ELs */ + tlbi alle3 + dsb sy + isb + b reset -- 2.34.1