From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1f::613]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BB9A681E44 for ; Wed, 18 Jan 2017 12:24:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=k0x5/IIkUOLgeknI8WBEn3VYJKT9dUoF5N3QLM94dXQ=; b=klM6c19WtozUaof+vNYxeSP5lqKJZ+0L8608CZGc0jNjxmjyyNv9JodRRG6aE518oltSXdPV70QzFN2av66k4RmUw05ryE2MNr4NZZ4IeZ5QUDd1M8EUWI1iMALh+WFMLnz6oyvwtr6TM+6xMN832gQouoxyBjKuvMT6nhz8c+Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; Received: from e104320-lin.cambridge.arm.com (217.140.96.140) by VI1PR08MB1200.eurprd08.prod.outlook.com (10.166.45.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 18 Jan 2017 20:24:06 +0000 From: To: CC: , , , Achin Gupta Date: Wed, 18 Jan 2017 20:24:06 +0000 Message-ID: <1484771046-21296-1-git-send-email-achin.gupta@arm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM5PR0201CA0020.eurprd02.prod.outlook.com (10.169.248.30) To VI1PR08MB1200.eurprd08.prod.outlook.com (10.166.45.153) X-MS-Office365-Filtering-Correlation-Id: 5b577b55-d315-4df3-0aad-08d43fdff404 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR08MB1200; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1200; 3:3LgZ1glpTiyf260JbAeEQcQJThPnHp7NO7+SfUZqcU69CMy6fY9iLXhfBsOF6sEf7moPr8qu3GoTZwDrFKHTRBYl3m2EzGJqotYRSz0jhV5OpE885l01ivzyHDPuk+3zI1K5IFJL3TqfdypEfy7VygnDGT6Zz5q0g4PYlMcR+kftrllsHsWNqAQ3c+JD3Qy36a4bNcoEoqUEWPGnzh6JqfrszDMDElknvXu4/0dF+ZCdkRDaa5RqUxmKfe9k1L63YR84l+K+Dvvwr+SgBj12TQ==; 25:fBNN47fmcAy6WByERgv48k1PcsUIRHpiWu2XZC47gmqu29inMSt6fsmDE/lapgB+ip66NZvaieLDUp92UgFoQ4sAZzNinvtwoP0eFRtQj/eKb8sHuJIeEXbvycs+18opoW1RcLjbBQbztkoqLKZFp9wrytna5DdSRwyKLViM5qwc5FoubQaN+tUHotvlNm6IXBhuNB8vTAcbc5MwCTbJcn1ObHg11S/mIRqODWdYHK/PpgAMhStrwTwTn2rTFQKbRmucZ8hfcve3rTM/faRjsjb9MGLy6UdxKdB6JMFSR2UXwoepZgyU9ySpjgcgDGicEDPTC8JDuvMNgtdiYcf/78n9P1eYaXJ4yFDmgROVau8v+yyq/VGM05czahDYk+aqkUkAMOfGsIgE+wvUY01kBjPqtxscW5+nS++D+DwlRCweIAfOEW9AzFXHYnudLXY1CqkDuzigfjjmIA0ihHm4ag== X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1200; 31:hFWgWgvq257v15DvVdIivjdmPH88auFd5w8HoPAy6h1YNxIPIdH3qqd8V6QmG0lGpWbbY9FKZ5pE0vUb94AuqrqOLz5I6dk1nd//y0cEGbP9iinf8PwJI31GAHlmIr4zu01KsaxniNNdzpDqngAcSwqIagd+MombPczgtzJX3GbMUwSwXD89nX+j1zBor4igdcxFtknvTIL7lCjlnTU3ptvKYlFvYwhPmWzuK/Dv7hHmYi2i3EzBGiknJxLdEWUZeihn6dszvqntSoq52qF7Iw==; 20:H08kOYvddKQOFVld8ymQhnZXYqxbCp8JmhR+HKeoyctppoarySUkVeOQFIAZXjKc9ZPBLVu/7+MpxTrDcJldF6s0Y3oan0XptP7xem4VZKw8OSJa4OzeP6rBE4DUsk4xKbF+mKgyPJYk2S/OKqH34quq/+718Lv7j+x0GCBLlRo= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:VI1PR08MB1200; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB1200; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1200; 4:TShDcFCc1tAyj52Ot5Zqri9FHL/6lQB5nbBKv1BipmMYQRsXbXssRhegQ2QXz017s6CmUquKJS7KUtzJ9NE+jeMoBvZ7seaS4aODLsAbvX7leoK3L3Ndfpkok1HDwL9IZyYHWF68bAqjGzflhMjbUCN1UgUJ2VloTgtFgB25oSC0F3rd1zxqsK1K34kUo889rQ6SRmRmf2pyGRiZE1is82VdKALIlwAlE4b4ibS85PgCqBxFkyJKymKdGpiV7RgKxXyoKjzORkPiE3j6NN090RQJZpf8UcpIB7jUoyqwYVgvu8KMM5zXBwiH7g3ibVvhfqWW6CHl/2sZbBNYNjO+y619ocY160TndlqGKOQX7dub4JmqWkPQ0hDrcjHEpWaGv1AIwYq/g5gGurZ8u8F6SfDxGZXerDqw9ShugWk9oYEBd4ipXw++c5Upoyjeq46HcCRyV2oKLB9NOJJSHz55usX0iOruUFkyPl87UOZ0Lbj6SwPVk1AFzFmrgT3o27exlFBj+j+3FVQXrMzmi2bLwxxqvHkOMeuVFIjp3KdE4SFebw6MBNDeXEeXTOyaDVaj3FcvOcr+tALTKeM0+L+bSxqsDwq96ogQNpzsR+F84awyGrrJ+6udOcwzr6gFSsLg0KklD/YejD6l17Jztdq39w== X-Forefront-PRVS: 01917B1794 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39860400002)(39840400002)(39850400002)(199003)(189002)(5660300001)(50986999)(81166006)(6916009)(110136003)(2876002)(5003940100001)(48376002)(86152003)(81156014)(68736007)(8676002)(25786008)(50226002)(101416001)(54906002)(2351001)(50466002)(189998001)(42186005)(4326007)(105586002)(6486002)(47776003)(66066001)(53936002)(86362001)(2906002)(3846002)(305945005)(7736002)(6116002)(33646002)(36756003)(106356001)(38730400001)(92566002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB1200; H:e104320-lin.cambridge.arm.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR08MB1200; 23:JcirR3tmMDhxVdadoHJaM701ovyjmNq03xqPrb/sq?= =?us-ascii?Q?q0eMRReF7yjSCaR29AubNTT/X9iv2b5lNHAYglldtcUNzXfp3Q4TGGLTAbDn?= =?us-ascii?Q?D/wXmmOTYvGq/fz1wCz9qxju1Cy4wVR3Oc8Ahj9vZB+7zbDjnl9VYvSbHrjA?= =?us-ascii?Q?yNOmbKVb3VHQYYecsM6/wmdwLbGogL96EDh17GR7PnmT8928kBkYpmiv6jaG?= =?us-ascii?Q?brOzz9OIaueDu9E5Lrjg46UJuXHv6jvXL7IioUmljv7kGC78x2tPdugwKw6z?= =?us-ascii?Q?pfAlFa4hZP/0Q7gqhUcnO6IDnZQbyoEiEi2aaiVl+rroLUKv8MF1qzJePxSt?= =?us-ascii?Q?ez508VBXZncWfadjx8dn2/WdRhQKePeU2jA69ZH/b+yDZuR7nQI4ONq9+GAg?= =?us-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eINdm2V0jdqRoOHTF0fxcrqdgkepK50abcx6eCIkZBHvMaTEdMav07/hRTK0ludeJ3sCu9iDUbI4Zo4RTmUgMlMfpvdeznCIjbF71nR0Fh55wbcZ3ISVwyZdWqVbNTNDTmZ2ablBQZDuXHcC8eS14s36gOP6Mm5hddltMvq6voRVuALQVnG7cPjssrOmkX1zQrHx40QO5x/mTrEipvG+FEpK3lSy4ltFbbU535R1oRCk7pfr87wi3R/AjCpc4hI5lWFQFLzuk/E9K8v3+z82Slz4SceoOoH7rVuNPESFtnNWZXczZZ590Vd2lzqxc7xTYidyX2VOWZYWeifOhy4QcSPCXKDLoaAFJBbIrcXFs/ipepxSPD/dVHhqIsqkJtmJ/QRK5GUAdVnNcT7ldNsnA2GvVFAmZuWXkuAlu/8lw==; 5:KEfnEWQIfLi5azWgx/zSKcE0w2A9o06abXnEI2gXuAhzfqWlVhrNK5+azXIqVN1TC/Dx7q+yP3HXqYWW8s6cPVeRobqd0RImtepChKUvv82zjoT2e3a3m60f8FltfyOAc6sPZNih4aGVUIwbuGpHiM+whRrVUGKdLEvE6rfT/18=; 24:JqOjp19JSXz8av53FBx05c06NYy750be/nkxOvY6hDLhrsc3a+U4PjVI9Ra40bZCmIXA6sDhU6zPJBlvmTc1dTLwlrOfT5VRVLCg587YtPw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1200; 7:+Vo/5YjfcSrmpXftkC4tH/r2VumbjHHjdv7q/hr7V7Lqy9Lpyl4GPMQFko2dV3fWiWZvggol5lVqVXpOLy6dG4OuOed0cwRtKb4zPROAUdLXEr4yg2/1hJQFhRezzF8DCAmSgtV8dLa/jzSYSOFvXU10STM1WzPKAZaonNgYFbkoik77dIdpYc6w8GfCPZ9pZrl9OCFTvD1tEhIR2P/VPksAUyh630WqCnKHq3Ma63jifSst9xQuwdMTFODWkabiXjQsrgltLWhs+8FRqm5P/vhX5MY9v0KyhISy3zPX+xfR9ejo6bjLEQEHHHVO1Po1lJpGazIeihB74cB6rExeA+Fuk0+NYoAHC//UshvteB4nhvVbT7PY0AKm7rXq9A8iGn0l/niaKrqZwXybK6U+xMttdKIjQukrXwIxFitqhlaxgUniu6UeTKyQylOi9HaRoOyY9gMwvPkyPUJ6Y2f63w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2017 20:24:06.7432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB1200 Subject: [PATCH] ArmPlatformPkg/ArmVExpressPkg: Fix memory attributes for NOR Flash X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 20:24:11 -0000 Content-Type: text/plain From: Achin Gupta The NOR flash banks were being mapped in the translation tables with the same memory attributes as RAM in the system. These attributes mark the region as Normal Memory and could additionally be cacheable or non-cacheable. Either type of attributes are unsuitable for NOR Flash since write operations could be performed on it. Normal Memory does not guarantee ordering of transactions that Device memory does. So the commands sent to the Flash device may not arrive in the right order unless barriers are used. Commands might not get past the CPU caches in case the region has been mapped with cacheable attributes. This patch fixes the problem by mapping the NOR Flash memory region with Device memory attributes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Achin Gupta --- ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c index 14c7e8e..2685114 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c @@ -116,7 +116,7 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_NOR0_BASE; VirtualMemoryTable[Index].VirtualBase = ARM_VE_SMB_NOR0_BASE; VirtualMemoryTable[Index].Length = ARM_VE_SMB_NOR0_SZ + ARM_VE_SMB_NOR1_SZ; - VirtualMemoryTable[Index].Attributes = CacheAttributes; + VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; // SMB CS2 - SRAM VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_SRAM_BASE; -- 1.9.1