From patchwork Mon Nov 13 16:26:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 837470 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ybGHd6Gglz9ryv for ; Tue, 14 Nov 2017 03:26:52 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1ED87C21E73; Mon, 13 Nov 2017 16:26:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 13B2CC21D78; Mon, 13 Nov 2017 16:26:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 68E6AC21DA3; Mon, 13 Nov 2017 16:26:34 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 04226C21D78 for ; Mon, 13 Nov 2017 16:26:33 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vADGO9wQ016282; Mon, 13 Nov 2017 17:26:31 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2e5yw1anem-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 13 Nov 2017 17:26:31 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DCC2D38; Mon, 13 Nov 2017 16:26:30 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BDD5B5155; Mon, 13 Nov 2017 16:26:30 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 13 Nov 2017 17:26:30 +0100 From: To: , , , Date: Mon, 13 Nov 2017 17:26:18 +0100 Message-ID: <1510590378-6510-1-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-13_09:, , signatures=0 Subject: [U-Boot] [PATCH] mach-stm32: Fix mpu region's attribute for STM32H7 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Patrice Chotard The SDRAM region was setup with the wrong attributes. It must be set to : _ XN_EN (Execution of an instruction fetched from this region permitted) _ O_I_WB_RD_WR_ALLOC (Outer and inner write-back, write and read allocate) This fixes hard fault when trying to load and execute kernel linux in this area. Signed-off-by: Patrice Chotard Reviewed-by: Vikas Manocha --- arch/arm/mach-stm32/stm32h7/soc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-stm32/stm32h7/soc.c b/arch/arm/mach-stm32/stm32h7/soc.c index 692dbcc..e0d3f11 100644 --- a/arch/arm/mach-stm32/stm32h7/soc.c +++ b/arch/arm/mach-stm32/stm32h7/soc.c @@ -30,9 +30,12 @@ int arch_cpu_init(void) { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW, O_I_WB_RD_WR_ALLOC, REGION_4GB }, - /* Code area, executable & strongly ordered */ - { 0xD0000000, REGION_1, XN_EN, PRIV_RW_USR_RW, - STRONG_ORDER, REGION_8MB }, + /* + * Code area, executable, Outer and inner write-back, + * no write allocate + */ + { 0xD0000000, REGION_1, XN_DIS, PRIV_RW_USR_RW, + O_I_WB_RD_WR_ALLOC, REGION_32MB }, /* Device area in all H7 : Not executable */ { 0x40000000, REGION_2, XN_EN, PRIV_RW_USR_RW,