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 63826C433EF for ; Mon, 11 Apr 2022 16:27:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E09B583E48; Mon, 11 Apr 2022 18:27:20 +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="c40tYe6q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 99A1983E45; Mon, 11 Apr 2022 18:26:55 +0200 (CEST) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 9604583B38 for ; Mon, 11 Apr 2022 18:26:52 +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-x62e.google.com with SMTP id k23so31986607ejd.3 for ; Mon, 11 Apr 2022 09:26:52 -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=pJLGoUBICi9QwKLxg9i8lfKTC/fQlGYOFHVihgOrhWc=; b=c40tYe6qggjBa8szscqN7p9TWtcroDVyFIz/gGRY7z35mPKYZL607nqcKQ2iBabJIn 8gxhiRrpSQnlzT4BhKU3Ei2Vw+0VwLRsdWmuAfAxhZPM4Kg69Lz3dTW5c/YNzaneBZVc HkT+S+uEMLvWrPd0BE2jzVsYN5MbEwcg132RrIOjBWw9YiKIpfv29/H6VyqXfEDXAv7Y 4zYNoQro35nMY0FLBRrwykD4163LWrWmfCHEFmnnJ5ouDb8r/poC1UCxMt4apeGuPftx dTiR85uVkFZkP9efpvfkqnFyOwmKI9Kjt8S9ROJ/VVEPsRPflxzEST+A4cJkRY7zZHqf MX+A== 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=pJLGoUBICi9QwKLxg9i8lfKTC/fQlGYOFHVihgOrhWc=; b=eGCC+33L/z9hIsjcLNgySQHrKP1TUt1ySywRzf7zpx6Li9QYyZ7qiXv/KHfHZktRyG 1cGZxM7uMhWe+glSrW9L2553fPV8Y89k3sOx7CTjRZYgAwzbkBVd3LWHGvlU5XgsYvoi kfl/QCTPvzodYqRkqc81KXAGmJRhuPgKrdOy65QswC/Y2oKpVe6IPsChRhEcPgGXYAyP mpMq68ffdmANNMzwjAMDha1+r2OM0mwbWtnOt6cv2uqMHPuAObQc+eR+wauVyCAsM8qt +URG6vNrMjCH4X4RwKNyQIaOmOYsk8TjaT89QM8eKBGLvaesH+dAX6CK/76FCiM6+tIk lJjQ== X-Gm-Message-State: AOAM530R1u8VMLUO86k57uJT/LU7/MNTwYvX/vmvcDq6nm4GgmRxy+2z 1deUR29dizbfSIr4q4Gn9CtrqaRLIxf1jw== X-Google-Smtp-Source: ABdhPJzFTZDRKNOmXdS85FalbPPfieJAszoHeBsVosqVsvox9/tTpyU82sUziDYeUQbDbJIpwgVmNQ== X-Received: by 2002:a17:906:4e48:b0:6e8:a246:9645 with SMTP id g8-20020a1709064e4800b006e8a2469645mr2082936ejw.642.1649694412283; Mon, 11 Apr 2022 09:26:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 09:26:52 -0700 (PDT) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Michal Simek , Michal Simek Subject: [PATCH 04/10] microblaze: cache: improve icache Kconfig options Date: Mon, 11 Apr 2022 19:26:28 +0300 Message-Id: <20220411162634.69647-4-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 Replace CONFIG_ICACHE with a Kconfig option more limited in scope - XILINX_MICROBLAZE0_USE_WIC. It should be enabled if the processor supports the "wic" (Write to Instruction Cache) instruction. It will be used to guard "wic" invocations in microblaze cache code. Signed-off-by: Ovidiu Panait --- arch/microblaze/Kconfig | 4 ---- arch/microblaze/cpu/cache.c | 6 +++--- board/xilinx/microblaze-generic/Kconfig | 7 +++++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 5a2e91104f..a25a95a013 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -25,10 +25,6 @@ config TARGET_MICROBLAZE_GENERIC endchoice -config ICACHE - bool "Enable icache support" - default y - source "board/xilinx/Kconfig" source "board/xilinx/microblaze-generic/Kconfig" diff --git a/arch/microblaze/cpu/cache.c b/arch/microblaze/cpu/cache.c index 4e8e228a22..b6bbc215b3 100644 --- a/arch/microblaze/cpu/cache.c +++ b/arch/microblaze/cpu/cache.c @@ -58,14 +58,14 @@ void flush_cache(ulong addr, ulong size) { int i; for (i = 0; i < size; i += 4) { - asm volatile ( -#ifdef CONFIG_ICACHE + if (CONFIG_IS_ENABLED(XILINX_MICROBLAZE0_USE_WIC)) { + asm volatile ( "wic %0, r0;" -#endif "nop;" : : "r" (addr + i) : "memory"); + } if (CONFIG_IS_ENABLED(XILINX_MICROBLAZE0_USE_WDC)) { asm volatile ( diff --git a/board/xilinx/microblaze-generic/Kconfig b/board/xilinx/microblaze-generic/Kconfig index 0d756ac7ba..89af8d714f 100644 --- a/board/xilinx/microblaze-generic/Kconfig +++ b/board/xilinx/microblaze-generic/Kconfig @@ -70,4 +70,11 @@ config XILINX_MICROBLAZE0_USE_WDC Enable this option if the MicroBlaze processor is configured with support for the "wdc" (Write to Data Cache) instruction. +config XILINX_MICROBLAZE0_USE_WIC + bool "MicroBlaze wic instruction support" + default y + help + Enable this option if the MicroBlaze processor is configured with + support for the "wic" (Write to Instruction Cache) instruction. + endif -- 2.25.1