Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45B29C432BE for ; Wed, 1 Sep 2021 07:02:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 89A816101A for ; Wed, 1 Sep 2021 07:02:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 89A816101A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2474983239; Wed, 1 Sep 2021 09:02:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.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=sifive.com header.i=@sifive.com header.b="gyH4K3Ra"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27DA983116; Wed, 1 Sep 2021 09:02:00 +0200 (CEST) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 4AF2582DB6 for ; Wed, 1 Sep 2021 09:01:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zong.li@sifive.com Received: by mail-pj1-x102f.google.com with SMTP id 28-20020a17090a031cb0290178dcd8a4d1so3542861pje.0 for ; Wed, 01 Sep 2021 00:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JOyfKlxSymfusuOjs4+7vs4daB5QzQL2QxyLGDYFZI4=; b=gyH4K3RaWeGnNAJNrMTze1WnWyJX4jVFmwngHZW9wumCLNbXp+1vX0eyMM35jfQ1K9 BxjPqczR8yA0jzez50mv5s2ZlwFFAysXtyByqGtJ65zZgryfWh8NzCwW333vZv/8cLZe BQcnNifsahN7cwkmygjEH1z9wblmAaN8+FkS9oNVikInRYyr69ynYHgTTXYvPkJWT+ll IXJkJTrAyYBQpcXnlHQu7zqgF7omvNkSSFl5E3EMUpTWOZ5gDbcymI9pL2Hb4YqNMLyy hu6ovQ0YIfMqN6CSyr/u0OQ12+P+vSpzTmCzrSPBkcoUrhTigOWFzXVvwXQ/BgvQ99Lm msUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JOyfKlxSymfusuOjs4+7vs4daB5QzQL2QxyLGDYFZI4=; b=LbXSGMxEEV4fct9R6ZeJ1uzi7fLbb5zagH/My0u/BiZ7BluGuqNuhtiuvPhxnn/fJF TIokGP6I4p85Lf5z2XurPczn9T01JrydWeNDI3vV6l5kH7IjaUcNaOExi294YDsraI7y OcAQdEpJbERR8KiFwm2dSJsDiQIPUd03ltQrpgAyf7DR5Yi96xvuxOy3b3Tys/NKYZ2m VdRJpDTx/uIVLQraNhBDQcHLvbYFQ1Twi2GOJEgs9+srJ2Aus4phwO327D5M3/EFQ3DP 3IDCUmF9ZNAIf8Y6xI3c21H8/yya9F5O6L1Ff5vnL+hvIJ/GvlQwSqguLQIk0W9PZYYI W3+Q== X-Gm-Message-State: AOAM532YK9dR3fN55S5L2FXuDM3L5J5aJ92iVk2x84bCAiSHfcN37yuR Vo0B1nTfvTqyHSvdmr6xPJthaA== X-Google-Smtp-Source: ABdhPJwFIvDhe36fXdL7OaRF6bq/EwK2kCga+XVpeKjWkqTntYcsyoNss1kCMVJl0gKqESR3grkpcA== X-Received: by 2002:a17:90a:53:: with SMTP id 19mr10220591pjb.159.1630479713546; Wed, 01 Sep 2021 00:01:53 -0700 (PDT) Received: from hsinchu15.internal.sifive.com (59-124-168-89.HINET-IP.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id j23sm4833497pjn.12.2021.09.01.00.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 00:01:53 -0700 (PDT) From: Zong Li To: rick@andestech.com, ycliang@andestech.com, bmeng.cn@gmail.com, seanga2@gmail.com, green.wan@sifive.com, paul.walmsley@sifive.com, sjg@chromium.org, u-boot@lists.denx.de Cc: Zong Li Subject: [PATCH v5 2/5] common: board_r: support enable_caches for RISC-V Date: Wed, 1 Sep 2021 15:01:40 +0800 Message-Id: <20210901070143.15102-3-zong.li@sifive.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210901070143.15102-1-zong.li@sifive.com> References: <20210901070143.15102-1-zong.li@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean The enable_caches is a generic hook for architecture-implemented, we leverage this function to enable caches for RISC-V Signed-off-by: Zong Li --- arch/riscv/lib/cache.c | 4 ++++ common/board_r.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/riscv/lib/cache.c b/arch/riscv/lib/cache.c index b1d42bcc2b..686e699efb 100644 --- a/arch/riscv/lib/cache.c +++ b/arch/riscv/lib/cache.c @@ -70,3 +70,7 @@ __weak int dcache_status(void) { return 0; } + +__weak void enable_caches(void) +{ +} diff --git a/common/board_r.c b/common/board_r.c index e3e6248a1f..630c2451a2 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -114,7 +114,7 @@ static int initr_reloc(void) return 0; } -#ifdef CONFIG_ARM +#if defined(CONFIG_ARM) || defined(CONFIG_RISCV) /* * Some of these functions are needed purely because the functions they * call return void. If we change them to return 0, these stubs can go away. @@ -607,7 +607,7 @@ static init_fnc_t init_sequence_r[] = { initr_trace, initr_reloc, /* TODO: could x86/PPC have this also perhaps? */ -#ifdef CONFIG_ARM +#if defined(CONFIG_ARM) || defined(CONFIG_RISCV) initr_caches, /* Note: For Freescale LS2 SoCs, new MMU table is created in DDR. * A temporary mapping of IFC high region is since removed, -- 2.32.0