From patchwork Tue Sep 3 16:44:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russ Dill X-Patchwork-Id: 2853347 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42F43C0AB5 for ; Tue, 3 Sep 2013 16:44:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 953C8204EA for ; Tue, 3 Sep 2013 16:44:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74EB920511 for ; Tue, 3 Sep 2013 16:44:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759529Ab3ICQof (ORCPT ); Tue, 3 Sep 2013 12:44:35 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:59547 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757068Ab3ICQof (ORCPT ); Tue, 3 Sep 2013 12:44:35 -0400 Received: by mail-pd0-f169.google.com with SMTP id r10so6301203pdi.28 for ; Tue, 03 Sep 2013 09:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=LYQyETEmlEqn0tcxswDxBNil44InlxsZwmHvT3uSgrM=; b=MtRpe8XUG+wJSTawXrl6Ko5hi67fgYAm2N3HvgLXtPmx66ceExIcC0t9pIssboMC59 bwcfeIQEx4pFlRXijhM6uS1Quby4LlAMS8FYWrPnt46cW+PzZFugw5x5icU98mKcTTGM KgZmxkWmQC4LSxaZMtvt0KrMbZcZQCbTEHsShPwaS6Pq3O/9jENCC4XB4/XsQjNI4bDT fdPlVIR+P2zUjN7vdzVdrmYgLqLOL1YsaC5lQKfX1f5f8eH2z/x+PaBxzufInzlYEB/A SxI5A72ii3dy1C2bxEhRdRBA4KXAiKPwqnlIJjQnipWRQHX0IrnhZt1w9N0edtN9nDIY J2Lg== X-Received: by 10.66.191.5 with SMTP id gu5mr9926948pac.126.1378226674563; Tue, 03 Sep 2013 09:44:34 -0700 (PDT) Received: from localhost (pool-108-13-119-108.lsanca.fios.verizon.net. [108.13.119.108]) by mx.google.com with ESMTPSA id ye1sm25122200pab.19.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 09:44:34 -0700 (PDT) From: Russ Dill To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org, Philipp Zabel , Shawn Guo , Grant Likely , mans@mansr.com Subject: [RFC 3/4] Misc: SRAM: Hack for allowing executable code in SRAM. Date: Tue, 3 Sep 2013 09:44:24 -0700 Message-Id: <1378226665-27090-4-git-send-email-Russ.Dill@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1378226665-27090-1-git-send-email-Russ.Dill@ti.com> References: <1378226665-27090-1-git-send-email-Russ.Dill@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The generic SRAM mechanism does not ioremap memory in a manner that allows code to be executed from SRAM. There is currently no generic way to request ioremap to return a memory area with execution allowed. Insert a temporary hack for proof of concept on ARM. Signed-off-by: Russ Dill --- drivers/misc/sram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 08baaab..e059a23 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -31,6 +31,7 @@ #include #include #include +#include #define SRAM_GRANULARITY 32 @@ -138,7 +139,7 @@ static int sram_probe(struct platform_device *pdev) int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - virt_base = devm_ioremap_resource(&pdev->dev, res); + virt_base = __arm_ioremap_exec(res->start, resource_size(res), false); if (IS_ERR(virt_base)) return PTR_ERR(virt_base);