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 C3791ECAAA1 for ; Sun, 11 Sep 2022 10:58:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 413FF84807; Sun, 11 Sep 2022 12:58:19 +0200 (CEST) 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="LLkCFDLc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8976784133; Sun, 11 Sep 2022 12:58:17 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 6588284133 for ; Sun, 11 Sep 2022 12:58:14 +0200 (CEST) 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=1662893894; x=1694429894; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=54CI0INWxGEMYAWjEuMiZcvyzQyIP9o3EWMkoVRagKA=; b=LLkCFDLclHZsY0r8Z02il6GwnZ1TXgYNRpkyDkwZsthMi9kSC72EzZ4x m1jvQcqFr0gP37ryJYaibry+n0m5isPzr/vEia/srXgtbA+xyS20DAQDi 4K3M8L/j1r73rezqjJAMJKw/qBDhLUX9gKFAkVSQI9O3PvDMSKAu/3gRD mYaBLyJhfY+pa90CML58K/tibmiq7K+1jtzHeNjOrmUPQ76YmrpBuq6nB Kw5aHe9yOeYBggMu9OeHCOqdWgxfPW8oXUUb1prqzWfqVJONi2h9zawc3 OCTY/AVj1IlVy7DtzeK3CYFab13o3VLH6lxYcZb5Ku7V7R/xRmKYb+6Ne Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10466"; a="277447881" X-IronPort-AV: E=Sophos;i="5.93,307,1654585200"; d="scan'208";a="277447881" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2022 03:58:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,307,1654585200"; d="scan'208";a="684136766" Received: from pglmail07.png.intel.com ([10.221.193.207]) by fmsmga004.fm.intel.com with ESMTP; 11 Sep 2022 03:58:08 -0700 Received: from localhost (pgli0028.png.intel.com [10.221.84.177]) by pglmail07.png.intel.com (Postfix) with ESMTP id EB74D32ED; Sun, 11 Sep 2022 18:58:07 +0800 (+08) Received: by localhost (Postfix, from userid 12048045) id E652EE00414; Sun, 11 Sep 2022 18:58:07 +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 , Thor Thayer Subject: [PATCH] arch: arm: mach-socfpga: HSD #1707102234: Agilex: Disable MPFE HMC Adapter Firewall Date: Sun, 11 Sep 2022 18:58:06 +0800 Message-Id: <20220911105806.26468-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: Thor Thayer Disable the MPFE HMC Adapter Firewall for the MPU because the Linux SDRAM ECC needs to access that register. Also cleanup the HMC Firewall added for SMMU. Signed-off-by: Thor Thayer Signed-off-by: Jit Loon Lim --- arch/arm/mach-socfpga/firewall.c | 10 ++++++++++ arch/arm/mach-socfpga/include/mach/firewall.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm/mach-socfpga/firewall.c b/arch/arm/mach-socfpga/firewall.c index 69229dc651..c6c41b2134 100644 --- a/arch/arm/mach-socfpga/firewall.c +++ b/arch/arm/mach-socfpga/firewall.c @@ -104,4 +104,14 @@ void firewall_setup(void) socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA); writel(SYSMGR_DMAPERIPH_ALL_NS, socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA_PERIPH); + +#ifdef CONFIG_TARGET_SOCFPGA_AGILEX + /* Disable the MPFE Firewall for SMMU */ + writel(FIREWALL_MPFE_SCR_DISABLE_ALL, SOCFPGA_FW_MPFE_SCR_ADDRESS + + FW_MPFE_SCR_HMC); + /* Disable MPFE Firewall for HMC adapter (ECC) */ + writel(FIREWALL_MPFE_SCR_DISABLE_MPU, SOCFPGA_FW_MPFE_SCR_ADDRESS + + FW_MPFE_SCR_HMC_ADAPTOR); +#endif + } diff --git a/arch/arm/mach-socfpga/include/mach/firewall.h b/arch/arm/mach-socfpga/include/mach/firewall.h index 5cb7f23f8f..e45acb6501 100644 --- a/arch/arm/mach-socfpga/include/mach/firewall.h +++ b/arch/arm/mach-socfpga/include/mach/firewall.h @@ -75,6 +75,7 @@ struct socfpga_firwall_l4_sys { }; #define FIREWALL_L4_DISABLE_ALL (BIT(0) | BIT(24) | BIT(16)) +#define FIREWALL_MPFE_SCR_DISABLE_MPU BIT(0) #define FIREWALL_BRIDGE_DISABLE_ALL (~0) /* Cache coherency unit (CCU) registers */ @@ -126,6 +127,10 @@ struct socfpga_firwall_l4_sys { #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT 0x9c #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT_FIELD 0xff +/* Firewall MPFE SCR Registers */ +#define FW_MPFE_SCR_HMC 0x00 +#define FW_MPFE_SCR_HMC_ADAPTOR 0x04 + #define MPUREGION0_ENABLE BIT(0) #define NONMPUREGION0_ENABLE BIT(8) -- 2.26.2