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 4C9D0C433F5 for ; Tue, 31 May 2022 18:16:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CAF484293; Tue, 31 May 2022 20:15:39 +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="UfNebUYC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 988F483F72; Tue, 31 May 2022 20:15:23 +0200 (CEST) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 A348C84250 for ; Tue, 31 May 2022 20:14:55 +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-wr1-x435.google.com with SMTP id e2so19795053wrc.1 for ; Tue, 31 May 2022 11:14:55 -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=bgOMnxjTeFSN6G9oV7RhY4Ok+ht/J8lzR/QGsLErP0o=; b=UfNebUYCKndoxOigf4HUZERlG2yf6NhR+hxentvaeNCmDwonw5bK+q3TGBfFXsBvlh UspCUye3JkD9/qm0WRXt5I1NHrSTdaSep8PE/wrG1Ezb14OVK117VQbk8TmwVUiWtTH/ DHsg++41uWMC8HUfpEHSe3HEYl2j8qFuSe9JCBML0561x877LLtMPg37CESdHfhkbusn rl4tLnd8AVGdsEFv5GWaS/9rH+9pylpiI9BDJQRMVVqpUaxTBdSDies73SYOsrQTb3xf CilpDc3bllQx/6kOSiwhXxCQz/djNCJzLkNCIYbAqE98pNfmD8IN110Jdd1VTePKsrlB KIGA== 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=bgOMnxjTeFSN6G9oV7RhY4Ok+ht/J8lzR/QGsLErP0o=; b=j3lZoaWhLyeInfVc5fzUQeCvpKVXEGSmKoYqv7XhhO2yx/Frs14Y1NUwcKeL8a1roE 9TLmBhoa5HdIt0RDTrOgOV4PYfsfjkxYk020NMVCXB1A46x6YkcdvGBjFiniHdVIQ0Hk NNWLUBHremHe28DE4KGI2oxlsJu/A4R9lakWPMulQLWBoIR98JozJzi0k1a9ifZYF5g7 kq+9m/7dpthqIYdzMAmIjmYn+/acm+MUqBUA1qRK/veLuTcNIxITaGBpdlmh4TrdkjGy fEKzWOriZ3GLma8OrbqgMeo/i6ku8/v7YgufIaOcD+ReT0V7tG7NRFXc2xh89scBsGUp jB9Q== X-Gm-Message-State: AOAM533SY/lSSxqx151c5ty66WDgAB5TYMEQ+jlxKcD0cqFxLgUVBLBs cTIDGKafR3f/ZqE/dXSyEhcLdrT9f5w= X-Google-Smtp-Source: ABdhPJyjxQQ/WMyktyekQCLH5bnj8yStiFOeF4KA8EuxPoUzF4nqaRgw8uwG5IGO9/eZXGkm3XJnEg== X-Received: by 2002:a05:6000:1887:b0:20f:e155:9db4 with SMTP id a7-20020a056000188700b0020fe1559db4mr35883380wri.243.1654020895200; Tue, 31 May 2022 11:14:55 -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.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 11:14:54 -0700 (PDT) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: monstr@monstr.eu, Ovidiu Panait , Michal Simek Subject: [PATCH v2 06/14] microblaze: cache: improve icache Kconfig options Date: Tue, 31 May 2022 21:14:27 +0300 Message-Id: <20220531181435.3473549-6-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 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 --- Changes in v2: - added CONFIG_SPL_XILINX_MICROBLAZE0_USE_WIC symbol arch/microblaze/Kconfig | 4 ---- arch/microblaze/cpu/cache.c | 6 +++--- board/xilinx/microblaze-generic/Kconfig | 11 +++++++++++ 3 files changed, 14 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 b00ce6f59a..98b4814b95 100644 --- a/board/xilinx/microblaze-generic/Kconfig +++ b/board/xilinx/microblaze-generic/Kconfig @@ -74,4 +74,15 @@ config SPL_XILINX_MICROBLAZE0_USE_WDC bool default XILINX_MICROBLAZE0_USE_WDC +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. + +config SPL_XILINX_MICROBLAZE0_USE_WIC + bool + default XILINX_MICROBLAZE0_USE_WIC + endif -- 2.25.1