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 40CD9C433EF for ; Mon, 11 Apr 2022 16:28:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AEF7883E66; Mon, 11 Apr 2022 18:27:28 +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="kqGN5aAW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44D7E83DE6; Mon, 11 Apr 2022 18:27:03 +0200 (CEST) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 73AF983E4C for ; Mon, 11 Apr 2022 18:26:57 +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-ej1-x635.google.com with SMTP id l7so26569390ejn.2 for ; Mon, 11 Apr 2022 09:26:57 -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=deWRxLh+Vsz0anDbwAitzrEEIDSWWeiy7DckWv+6DlI=; b=kqGN5aAWPks9XxkwavAdfUa+lP/VETz8FHahlsuzPt2Ywi+o1NLDdrjvjVQKF/7Y9V GpdSh2g1Djt1OORA1n0/ATMo/J9V/StjsrfNLTSzLeF3rGfZA+CqUkLKzz3k0aABQ2Hi UleKDlVUxMag8As/QbETaV9a5iMRec4TpyF+Y3Slwd3qbIxD7r30Fbn97GLt3e0UnOgu ZyacNW5cKwcoa4AGPwyq/8OjyvdPUBD2IFlNhH8eSgQW/xGZkrmK0niK60LdqkLi07Zx pdxEJFEkm2146g9aELyuMxBCE0WwCh2soSRzg6KLumrL55VYjxPmhhrl53pjHwrTJT+v sszg== 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=deWRxLh+Vsz0anDbwAitzrEEIDSWWeiy7DckWv+6DlI=; b=BZ+OWAt2ztT086errHrG0c2eNEQqdhbEjdjlixS9TmKj9xluaF+rj718ORPxYZKXea Ktf4BgZJv74QHa+o2uwJOLj+MKN+uXbKGdY3bdqtzfzcuYxIp4cI/Hlpcoym8ce88f2f aQce3HwYVMXNe7JjkF6VPPw9B6shduCrj9UOIvmbk8LXIimYxACmVWc2DV1N9m5Eb56m UTk1ByrUAeimowAkJLEcgObHw+4R3n3L/Ii3i0CxXMVqDTsMadkBe35c3UIV2kN+Gds7 2whO9qXPXPgxF54o3UVXLMCRvn2VP7cjnWDdcww1aqMu7SsBPnOomDEXh3Sh93SXJi6Y 8EBQ== X-Gm-Message-State: AOAM53175HGFV0lAMTSKyxt+nFmondVwnzN3EL8BTFGqbJ9CLgxuYsRP DwRpZ4abPlwMvjrZ+bCZBSiWubFGb/0HjQ== X-Google-Smtp-Source: ABdhPJxK0wnUvBSfD4j/FgiKGGIJSjCs+15zvoSLPynPe2hS7rpqmQ+2DIM4BEzi6WoDmWMSotRQrA== X-Received: by 2002:a17:907:c284:b0:6e8:45d7:d124 with SMTP id tk4-20020a170907c28400b006e845d7d124mr16582554ejc.569.1649694417001; Mon, 11 Apr 2022 09:26:57 -0700 (PDT) Received: from wsdell.corp.ad.wrs.com ([2a02:2f0e:c41b:f600:4ab1:7aea:1e9:311a]) by smtp.gmail.com with ESMTPSA id y26-20020a1709063a9a00b006e0c272e263sm12111417ejd.71.2022.04.11.09.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 09:26:56 -0700 (PDT) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Michal Simek , Michal Simek , Simon Glass Subject: [PATCH 08/10] microblaze: cache: introduce flush_dcache_range() Date: Mon, 11 Apr 2022 19:26:32 +0300 Message-Id: <20220411162634.69647-8-ovpanait@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220411162634.69647-1-ovpanait@gmail.com> References: <20220411162634.69647-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 --- arch/microblaze/cpu/cache.c | 8 ++++++++ drivers/core/device.c | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/microblaze/cpu/cache.c b/arch/microblaze/cpu/cache.c index 60b6d549d7..cce33a6eb5 100644 --- a/arch/microblaze/cpu/cache.c +++ b/arch/microblaze/cpu/cache.c @@ -43,6 +43,14 @@ static void __flush_dcache(ulong addr, ulong size) } } +void flush_dcache_range(unsigned long start, unsigned long end) +{ + if (start >= end) + return; + + __flush_dcache(start, end - start); +} + void flush_dcache_all(void) { __flush_dcache(0, CONFIG_XILINX_MICROBLAZE0_DEFAULT_CACHE_SIZE); diff --git a/drivers/core/device.c b/drivers/core/device.c index 1b356f12dd..16f808f2be 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