From patchwork Thu Nov 7 02:58:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 841386 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp859923wru; Wed, 6 Nov 2024 18:58:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVro181qfJ4VVxIkbEYLks/VSBxXJwOsfs6wQkM97lojPP+mhrRbPYYDe28NTjoTQ7Npk9SfQ==@linaro.org X-Google-Smtp-Source: AGHT+IG6i4oOeQQXFzlLIxovzAdxe/r0Mp1Q9wrRh9ge8KXQIV/rd2/yy47VOcMREdepvtqwEEVv X-Received: by 2002:a05:600c:3054:b0:431:44fe:fd9f with SMTP id 5b1f17b1804b1-4328327ec3cmr165349885e9.23.1730948319046; Wed, 06 Nov 2024 18:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730948319; cv=none; d=google.com; s=arc-20240605; b=goc9hsGF5F//TA3xWFtNtQ49M7jP7ZxEOwoy7/9Gxtp3dB6GtqEo29kngT0Dv46IqI WSliiBsy86TMkZ+nJNfxCOUKZlRiORxgbwdrR7WWJ8eszrHtS1dimMw3z9vyjuqpbuJH wt/EPlMuxSCM842ZKZIY+iBC3vGPecAii6Jf64ZLv7hKeCX5CpdQq1TUfn8iNnBFzEUM r8luynmtSOv1vVuR/9HPBNveOdU5D9ZZ5nd2EQ3IDbGkVmqPJ/xr9xw7wf6M1mtqKK/1 FgJE1V8gD4kI7VzufQ2RqFeyqemB2BiGcDViEKy27uECa4uoLvq8m01/BaadD1FgIDJ0 KSZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=TNE21ZH5+wzDSDaWBE/g3mpXJTJhpQotd7ensLGy83M=; fh=/+H77JcHNvnX+Q0p6vbw9iZRocQKAeP3hketlvrQae4=; b=NVTc8XlCFzgyEBA746qH0H3IbsYVRdIp/ZoI81FGhFQop4Em3ezyQGzRqekk7yySQm og66pu0ToVk6x66l0PSW9kjjzyCJjo/1aZKGdJZ1rbylw5c783CmQ5+6sE0P09GYom3o CCHWdTm0UGa6IH8BhHIsyWoMdHDEiF3tNnXlu1JJmv5yRzUEIGTIOHnjRvSQBuQOgEmr HN3PapKbQIzlZXYyTNKcORq0a2BO2MOcdf9y1N7VcjXzhj8VXX4pinoO6NiTOVpORIaE 0F5JRITc4H9AApLy/W3EgS3z4Rypjn9Br6Xr1exVhdUfL5zYVq0iVClQ5dSN4eVYIytD 1LNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kJiK5BpU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 5b1f17b1804b1-432b061181dsi3368855e9.98.2024.11.06.18.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kJiK5BpU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B7C8788CD9; Thu, 7 Nov 2024 03:58:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="kJiK5BpU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA707891D7; Thu, 7 Nov 2024 03:58:36 +0100 (CET) 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_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 389DC88A9D for ; Thu, 7 Nov 2024 03:58:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3e5f86e59f1so332200b6e.1 for ; Wed, 06 Nov 2024 18:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730948313; x=1731553113; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TNE21ZH5+wzDSDaWBE/g3mpXJTJhpQotd7ensLGy83M=; b=kJiK5BpUd1VZsyKpAm2brhpok9W0U9j+Ns/7C6awumzq8Q8S2pOvoYefTzMCkmcbc9 DfVnTf523WEDoSpSFu9mM+I8kt3W62Z8JU6NIYbwFAaBj5SMynKF3TyvzjZDA/I8fanI geuhzYYWdioSiwY42LR93kBn2toWfp5+D2Km+9NgHt3aYijYLXOkYmX+BZtrN5gic4SH AQAO478SicJXsV/0xWqFswQ5pVshjvg5R3XkGIuQ0RnOD7BWR1aFrVcWs7x0UfIXGqdu WD+gKQ9A34XLKZ+w5So36pnt6hYJDCE/30/qpA1MTnxfuPWOTSQIcCKRE0gbg+TKdV80 aPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730948313; x=1731553113; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TNE21ZH5+wzDSDaWBE/g3mpXJTJhpQotd7ensLGy83M=; b=RNYRKn8i1HxG0WjSBNmxTJzSXBQ7Z/DsaGLXxlZP0vs4ExF/f2THZce86c6v9c3UC7 aJnQo50oGWEqv437Rr43lZHpQ7cNpsQtvVlJhWu5OmQyrjVK83gRjZDBB6tju3tJ9eqh DmlvylDLKkPr7iWmCatH7ga8s9grqf27KViUWwRc5D9PNSjIEN3fcZXdkqBSVKAmGJP8 S94ZAPtFIvJM6hakiOHb3k4Ln08q/mOGqL5lvqU43/l8t7veo+i+hkc1xMY07oGNWb0h fWmfqCRPBHPrKHkfIvwUKEQ4tVkqXDVdHqVd2mVjrvEgP8h0+Ej+OBrex9b3ppSMuw2Z QATw== X-Forwarded-Encrypted: i=1; AJvYcCUhDsxtoq2BaO1mHlyef5kjBf51q1TTXJySdgblXbiQg61P/G2YOjFDkrGhjrOGEpvcy5HaEmI=@lists.denx.de X-Gm-Message-State: AOJu0YxQil8eotS8IhzBPSCbkTValHHrM4IWazfTkKRxQF9kxnZ1IBqu 3RKLOWqa2XlgvfWcNXOJvOk3oHwByP31cxYfo1c2N59QMuM7OFIFtubW+3ra32E= X-Received: by 2002:a05:6808:1922:b0:3e3:c411:adf0 with SMTP id 5614622812f47-3e78d35aaaemr443899b6e.21.1730948312845; Wed, 06 Nov 2024 18:58:32 -0800 (PST) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3e78cc80866sm94907b6e.16.2024.11.06.18.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:58:32 -0800 (PST) From: Sam Protsenko To: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt Cc: David Feng , u-boot@lists.denx.de Subject: [PATCH v2 1/2] armv8: Fix get_sctlr() return type Date: Wed, 6 Nov 2024 20:58:30 -0600 Message-Id: <20241107025831.5459-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.5 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 SCTLR_EL2 is a 64-bit register [1]. Return its value as long (64 bit) instead of int (32 bit) in get_sctlr() to make sure it's not trimmed. [1] https://developer.arm.com/documentation/ddi0595/2021-06/AArch64-Registers/SCTLR-EL2--System-Control-Register--EL2-?lang=en Fixes: 0ae7653128c8 ("arm64: core support") Suggested-by: Heinrich Schuchardt Signed-off-by: Sam Protsenko Reviewed-by: Ilias Apalodimas --- Changes in v2: - None (this patch was introduced in v2) arch/arm/cpu/armv8/cache_v8.c | 2 +- arch/arm/include/asm/system.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c index e6be6359c5d9..5d6953ffedd1 100644 --- a/arch/arm/cpu/armv8/cache_v8.c +++ b/arch/arm/cpu/armv8/cache_v8.c @@ -825,7 +825,7 @@ void dcache_enable(void) void dcache_disable(void) { - uint32_t sctlr; + unsigned long sctlr; sctlr = get_sctlr(); diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 52f6c9b934d7..dbf9ab43e280 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -171,7 +171,7 @@ static inline unsigned int current_el(void) return 3 & (el >> 2); } -static inline unsigned int get_sctlr(void) +static inline unsigned long get_sctlr(void) { unsigned int el; unsigned long val; From patchwork Thu Nov 7 02:58:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 841387 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp859969wru; Wed, 6 Nov 2024 18:58:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVspL3hUiUt3SsU+cbCFQCE1jPrGBEgHD8AZQLKmrCrQ+OwaUCqU4Ios9gR3mrmzacuBKX5mA==@linaro.org X-Google-Smtp-Source: AGHT+IFQJuEOhSNSuBZA+ncsSBATtvjHgV7D7EkVUvLcxvSn2oN7LeyHFlpBm9oeYSwbiaWmRILG X-Received: by 2002:a05:6000:2c8:b0:37c:d1bc:2666 with SMTP id ffacd0b85a97d-381c7a472f7mr20584874f8f.4.1730948328539; Wed, 06 Nov 2024 18:58:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730948328; cv=none; d=google.com; s=arc-20240605; b=XyAx2PO7G0ptFfTqoUtlFRAdzzbSz3Pknz70NjiFUpWiXdPjY79idoDvWyc1GKZlml /REsZe51rPAi9CGXV3XREsSNK+ze4p6l4f+egaf6nJ+NbSjrtctRmIY4hNx/uaeqXvEx oRdnNZzeNy34mzu3qkpGCU6AO8viFUBTWaZ2XrFydrYHtvmfuocXxXowwYUQdAZG278/ DrkDMHrq/QfMJc6XLyO8N8/CBf27ML0UYX9xJoinnxZMHhe1wbgYfNPrKs48IS+eVbId xl2cz/qu0jC+WvrcCzXyBk8dXYrjFXhA+paLctBfqnsemE9wqaBIK+Lt9vcZ37fruCCg JOVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=27I/8DAFwpgBTnzNDA2ziB6i+v5XF25fCmsqLLE1Nhg=; fh=w8A7yscQmxwNHfJHKdrYbwdFgD2ojQ+oA0QQUiZK68E=; b=VrBN4/ic1UV8Ks8UC4kGhlCpd97CbF+gAJhoxTq6IoBzCQJYiqKfLeVSN8sPH+x7+H 4QPSTdUbd7PugP3UXUtfSBbea7UoKmV6THX1mQzqwkxaRhR6NbmrHshLZscnyRsKrzLN V8hIAURLc8RhSQeQmI9g6T0SWiCfYWVCbZWS5yszZ+DhRkIssvFK3ep6+7hdYn5BuDkw qgWwpTdWYlEISe2R2Zdbn5JzAIMvFOmrXkVjMok3j5PGCAKO9zFO4FrC9i7ws122k8+X ZOBKfadI6bnvF10JFjknh1X1YhFOeyzTbHTQ00AB/OmzLnFMqj2wgak1FuoLxKnAwzS9 r8/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDHkoFVB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ffacd0b85a97d-381ed98b1a9si266827f8f.206.2024.11.06.18.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:58:48 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDHkoFVB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3FCDD891E8; Thu, 7 Nov 2024 03:58:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="YDHkoFVB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8160888A9D; Thu, 7 Nov 2024 03:58:37 +0100 (CET) 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_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) (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 EAEE688F14 for ; Thu, 7 Nov 2024 03:58:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-28862804c9dso284059fac.0 for ; Wed, 06 Nov 2024 18:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730948314; x=1731553114; darn=lists.denx.de; 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=27I/8DAFwpgBTnzNDA2ziB6i+v5XF25fCmsqLLE1Nhg=; b=YDHkoFVB/AWqYYKAoR+au0X5x9NxLvLRqVQsa0/TFTVP2oq000x8DsINQHVlAUrzsP Avo7KaOT7bREjMenbqM0b9XzucNiBrdTotTY7UL9plHKuczM7G0uglqhYNog6EXP+ga6 TI7M0YJK34DNkTt6VZj9Qs3Plzcfs55S4sncPrulaOh0OCl1XpDhn1fLN1UWCEMpwPMH Onkq1y8GRkhjIerlF7G5u5CKqmELeBgz9c37RsGZ6k3yuoZuhecb5HBd71rZBUL3/Wjh 7/Evouu2hJ0eD6Ukual8qNjreEGipEnrAFnrW25ESs5gSHpFqNaHduCSKch4boC7tnCF N0Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730948314; x=1731553114; 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=27I/8DAFwpgBTnzNDA2ziB6i+v5XF25fCmsqLLE1Nhg=; b=i4LTxpAkVn3t56IhFN2QJpVhCfTPg9xajVG6q7B6YRA3W8yfVo4q094l6CFP2QZVKM Mh/B4h1kaVyUBiBVmRNaRifL6zt8LKd4eRC/De1Mm4EGhMcLZ9rHAoDRk7zOeD4STzoT mmrGwUNjgj+4J4QrmaKdQjElqD+1VbSBiSeCxFUl2RixAb3lY0o/6eOfablRORkhnaX1 UXY/3au+W66fnz/+hTpzBPP2PkpeqeoNY4i/Ir0SGqg43NQW/KqYEZjfiZ7Ohpf32hfl JGQPpdAiUm+f3InEQX8n/ky6PLHjw6O4TJWBaIZXIjQv70dpHHWsaT9uKkvgObusAQy8 4OwQ== X-Forwarded-Encrypted: i=1; AJvYcCUOLFJlzJDY1QtcApaHqS9zzgOQUsXqG96fTZumeW9g2OQTQDBgd/WLY5jgBk05srz77lKyaSs=@lists.denx.de X-Gm-Message-State: AOJu0YzWFcK39vTtQI5A+VCq0L06+p1AVoCU2QEDZdNHeba2u7qIjSZc LV9u/T4E5DnVLh3bhxaZfjlDj+E6Cu/RK0KC/pDWPm5ZWTkcIbG7BUXcZE4Vp2E= X-Received: by 2002:a05:6870:1995:b0:265:b32b:c465 with SMTP id 586e51a60fabf-295429773cbmr937410fac.9.1730948313716; Wed, 06 Nov 2024 18:58:33 -0800 (PST) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29546edff0fsm155636fac.43.2024.11.06.18.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:58:33 -0800 (PST) From: Sam Protsenko To: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt Cc: David Feng , u-boot@lists.denx.de Subject: [PATCH v2 2/2] armv8: cpu: Implement allow_unaligned() Date: Wed, 6 Nov 2024 20:58:31 -0600 Message-Id: <20241107025831.5459-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241107025831.5459-1-semen.protsenko@linaro.org> References: <20241107025831.5459-1-semen.protsenko@linaro.org> 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 Usually ARMv8 platforms allow unaligned access for Normal memory. But some chips might not allow it by default, having SCTLR.A bit set to 1 before U-Boot execution. One such example is Exynos850 SoC. As allow_unaligned() is not implemented for ARMv8 at the moment, its __weak implementation is used, which does nothing. That might lead to unaligned access abort, for example when running EFI selftest. Fix that by implementing allow_unaligned() for ARMv8. The issue was found when running EFI selftest on E850-96 board (Exynos850 based): => bootefi selftest $fdtcontroladdr ... Executing 'HII database protocols' "Synchronous Abort" handler, esr 0x96000021, far 0xbaac0991 ... resetting ... Unaligned abort happens in u16_strnlen(), which is called from efi_hii_sibt_string_ucs2_block_next(): u16_strlen(blk->string_text) where 'blk' type is struct efi_hii_sibt_string_ucs2_block. Because this struct is packed, doing "->string_text" makes 'blk' address incremented by 1 byte, which makes it unaligned. Although allow_unaligned() was called in efi_init_early() before EFI selftest execution, it wasn't implemented for ARMv8 CPUs, so data abort happened. Signed-off-by: Sam Protsenko --- Changes in v2: - None arch/arm/cpu/armv8/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/cpu/armv8/cpu.c b/arch/arm/cpu/armv8/cpu.c index d568efa427ab..82ecf02f4b03 100644 --- a/arch/arm/cpu/armv8/cpu.c +++ b/arch/arm/cpu/armv8/cpu.c @@ -94,3 +94,8 @@ void armv8_setup_psci(void) secure_ram_addr(psci_arch_init)(); } #endif + +void allow_unaligned(void) +{ + set_sctlr(get_sctlr() & ~CR_A); +}