From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 469BAC433F5 for ; Tue, 31 May 2022 18:16:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD423842B1; Tue, 31 May 2022 20:15:45 +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="irqTg+tV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F3FB8421F; Tue, 31 May 2022 20:15:27 +0200 (CEST) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 6B12884287 for ; Tue, 31 May 2022 20:15:01 +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=ovpanait@gmail.com Received: by mail-wm1-x32c.google.com with SMTP id o29-20020a05600c511d00b00397697f172dso1547219wms.0 for ; Tue, 31 May 2022 11:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tet/mQxCqv/B3QfK5xgUqM5QvE80F4cJLQrBLkzhnl8=; b=irqTg+tVP9Fkg2RHRiulpTmsn8k8yVZXn4TPabEDIlRIIbNcqCu3ojw7939Jtc3z4z oI0rGWBL/oMo/mSF/Fd+ACPVzSLMo+2MxDEQVK3q7b4zydqNJDAOlK4bVwp730AG41R5 LRhoozTvLKsM/BS41iQp1es2b5GflsUL8Bg/AFYTGjHodX9bFeo9ao9U81VqA9mVH2Fe 2o/lLDfi2hUdR7z7LnxqYyDiNC4Al2TE4mvstfZASvKwHoSIqvvSbgvME1aYrp9/FZgC OvsNzhvWL2kJ56PypwVgLc7T9IatJWX1tbD1O98zpMLJL6kvF0U6qJOnZwcjnFbWogfS UfPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tet/mQxCqv/B3QfK5xgUqM5QvE80F4cJLQrBLkzhnl8=; b=3hb5taxoqKsr/rL5cE+BBXSwVoYC0hCxS1RQEO1xx0EfUcpHt/ByJnWQdJTmb7y7qS +UvHYFrpC7KkkASs2k5fvJkWu2b8YmyXg4+kZczTwwqics+W9Xy7qR+Ad2bHIKxpSP8f AyFxfK3Sb6svR55P9mA734gBEauTa6nrHRs3WkxE++qR2RoothpLWWekAaE06m5WkPMp a+RDtugW3Qvwn7UZDgeR8DSTORD0B/of2zu7tmPMWrbrQN3Zi9fY6lVyEunbE6/JwJNa R0UX9GvLqv8wcx87H67AbJPruzkjnSvRExUVrocQHJD6VT9LburpPV9HlaZH1Le7Z3zd WKdA== X-Gm-Message-State: AOAM5310DK9G3H+7siEyDnto6I0SwWvRnBmUotzSpAhnXl+cQdzobAyV XTZ4TgZZWZPZM5+VQfvYuSe1CGMt2l4= X-Google-Smtp-Source: ABdhPJzFcAwDI8Gh2HeVLjVm0JYgR565w+kZ8W7koK8ztQK8QheYLlAGEQ7JU22M9MnEMQO73HltEg== X-Received: by 2002:a1c:7912:0:b0:397:41e9:872d with SMTP id l18-20020a1c7912000000b0039741e9872dmr24808844wme.184.1654020900917; Tue, 31 May 2022 11:15:00 -0700 (PDT) Received: from localhost.localdomain ([2a02:2f0e:c003:7c00:45d1:29c0:7802:f752]) by smtp.gmail.com with ESMTPSA id l3-20020a1c7903000000b003974027722csm2682980wme.47.2022.05.31.11.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 11:15:00 -0700 (PDT) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: monstr@monstr.eu, Ovidiu Panait , Michal Simek , Simon Glass Subject: [PATCH v2 11/14] microblaze: cache: introduce flush_dcache_range() Date: Tue, 31 May 2022 21:14:32 +0300 Message-Id: <20220531181435.3473549-11-ovpanait@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531181435.3473549-1-ovpanait@gmail.com> References: <20220531181435.3473549-1-ovpanait@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 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.5 at phobos.denx.de X-Virus-Status: Clean Align microblaze with the other architectures and provide an implementation for flush_dcache_range(). Also, remove the microblaze exception in drivers/core/device.c. Signed-off-by: Ovidiu Panait --- Changes in v2: - Added debug message for invalid range. arch/microblaze/cpu/cache.c | 11 +++++++++++ drivers/core/device.c | 5 ----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/microblaze/cpu/cache.c b/arch/microblaze/cpu/cache.c index cd8507901d..829e6c7ae6 100644 --- a/arch/microblaze/cpu/cache.c +++ b/arch/microblaze/cpu/cache.c @@ -49,6 +49,17 @@ static void __flush_dcache(ulong addr, ulong size) } } +void flush_dcache_range(unsigned long start, unsigned long end) +{ + if (start >= end) { + debug("Invalid dcache range - start: 0x%08lx end: 0x%08lx\n", + start, end); + return; + } + + __flush_dcache(start, end - start); +} + void flush_dcache_all(void) { __flush_dcache(0, gd_cpuinfo()->dcache_size); diff --git a/drivers/core/device.c b/drivers/core/device.c index 3ab2583df3..03155e9867 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -328,13 +328,8 @@ static void *alloc_priv(int size, uint flags) * within this range at the start. The driver can then * use normal flush-after-write, invalidate-before-read * procedures. - * - * TODO(sjg@chromium.org): Drop this microblaze - * exception. */ -#ifndef CONFIG_MICROBLAZE flush_dcache_range((ulong)priv, (ulong)priv + size); -#endif } } else { priv = calloc(1, size); -- 2.25.1