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 F0874C4332F for ; Tue, 22 Nov 2022 14:30:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35B5B85407; Tue, 22 Nov 2022 15:30:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.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=intel.com header.i=@intel.com header.b="UrdIQagx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CAA4B85417; Tue, 22 Nov 2022 15:30:44 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 59922853E7 for ; Tue, 22 Nov 2022 15:30:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=jitloonl@ecsmtp.png.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669127442; x=1700663442; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pQGdhNP/UfWpR4SZ5KSmUQcFd+bi3wpddQ5iU9lAwWE=; b=UrdIQagxmG2eMa+3jR55XdL/EXDtiyu4sfUdLzM3t80/xXh/fMW5xfdQ zazCMnGGQMQN6nq0+aEyqBCSFk59NrWrQ5uHG8S+fCMlyALDRj+MD4wAE VFsJ0NGOBEyuxTFjHjNJYkdEfExk6pj4bgwjkByHmSzhU3npsq5Meo0SV 4UV9uMJVS8QMr7MLsrifHebaW3/IWRj8jbk0HdMOBkLk20VhN45K62mGe DLWHfXEJVd8w0VDcH5MkBZE5gLtHYVvo+N92vA1QrNufBeq1r/lFAYudr vxI6/NHNzUkkMeR/HZjNtEwIFz6G4jnF8QnhU9YM2x8CuuplAD/NpynDD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="301375613" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="301375613" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 06:30:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="619232180" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="619232180" Received: from pglmail07.png.intel.com ([10.221.193.207]) by orsmga006.jf.intel.com with ESMTP; 22 Nov 2022 06:30:35 -0800 Received: from localhost (pgli0028.png.intel.com [10.221.84.177]) by pglmail07.png.intel.com (Postfix) with ESMTP id 00489482A; Tue, 22 Nov 2022 22:30:35 +0800 (+08) Received: by localhost (Postfix, from userid 12048045) id F08C3E00214; Tue, 22 Nov 2022 22:30:34 +0800 (+08) From: Jit Loon Lim To: u-boot@lists.denx.de Cc: Jagan Teki , Vignesh R , Marek , Simon , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Jit Loon Lim , Sieu Mun Tang , Yau Wai Gan Subject: [PATCH] drivers: fpga: intel_sdm_mb: Flush cache before FPGA configuration Date: Tue, 22 Nov 2022 22:30:33 +0800 Message-Id: <20221122143033.7864-1-jit.loon.lim@intel.com> X-Mailer: git-send-email 2.26.2 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.6 at phobos.denx.de X-Virus-Status: Clean From: Yau Wai Gan FPGA configuration encounter failure when the cache is not flushed. Add cache flushing to the memory region that holds the FPGA configuration bitstream. Signed-off-by: Yau Wai Gan Signed-off-by: Jit Loon Lim --- drivers/fpga/intel_sdm_mb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/fpga/intel_sdm_mb.c b/drivers/fpga/intel_sdm_mb.c index f5fd9a14c2..72958aac86 100644 --- a/drivers/fpga/intel_sdm_mb.c +++ b/drivers/fpga/intel_sdm_mb.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include @@ -121,6 +123,8 @@ int intel_sdm_mb_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size) debug("Invoking FPGA_CONFIG_START...\n"); + flush_dcache_range((unsigned long)rbf_data, (unsigned long)(rbf_data + rbf_size)); + ret = invoke_smc(INTEL_SIP_SMC_FPGA_CONFIG_START, &arg, 1, NULL, 0); if (ret) { @@ -394,6 +398,8 @@ int intel_sdm_mb_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size) u32 resp_len = 2; u32 resp_buf[2]; + flush_dcache_range((unsigned long)rbf_data, (unsigned long)(rbf_data + rbf_size)); + debug("Sending MBOX_RECONFIG...\n"); ret = mbox_send_cmd(MBOX_ID_UBOOT, MBOX_RECONFIG, MBOX_CMD_DIRECT, 0, NULL, 0, &resp_len, resp_buf); -- 2.26.2