From patchwork Tue Oct 13 05:54:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 7381471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A55F19F1D5 for ; Tue, 13 Oct 2015 05:56:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1D7320980 for ; Tue, 13 Oct 2015 05:56:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00F3520844 for ; Tue, 13 Oct 2015 05:56:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZlsY2-0001Gb-Od; Tue, 13 Oct 2015 05:54:54 +0000 Received: from mail-out.m-online.net ([212.18.0.10]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZlsXz-0001Bp-Is for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2015 05:54:52 +0000 Received: from frontend02.mail.m-online.net (unknown [192.168.8.183]) by mail-out.m-online.net (Postfix) with ESMTP id 3nZmKb5QpKz3hl9G; Tue, 13 Oct 2015 07:54:26 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.6.69]) by mail.m-online.net (Postfix) with ESMTP id 3nZmKZ5XtYzvdWF; Tue, 13 Oct 2015 07:54:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.184]) by localhost (dynscan2.mail.m-online.net [192.168.6.69]) (amavisd-new, port 10024) with ESMTP id I8cxb8DFTJ_N; Tue, 13 Oct 2015 07:54:25 +0200 (CEST) X-Auth-Info: mS3efj6hQaPmVpXc/KlUCQbESbJPduZo3iSlg1V5r6M= Received: from mail-internal.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Tue, 13 Oct 2015 07:54:25 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTP id 9470534332A; Tue, 13 Oct 2015 07:54:25 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 4A634F1FA; Tue, 13 Oct 2015 07:54:25 +0200 (CEST) From: Heiko Schocher To: linux-kernel@vger.kernel.org Subject: [PATCH] arm, omap2, sram: On HS/EMU devices, only 64K internal SRAM is available. Date: Tue, 13 Oct 2015 07:54:15 +0200 Message-Id: <1444715655-30077-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151012_225451_807641_1FA6657D X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Schocher , Russell King , Tony Lindgren , Georg.Soffel@bosch-si.com, Ayoub Zaki , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Of this, secure content (including PPA) uses initial portion of the SRAM. This chunk is not (and shouldn't be) accessible from the public code. The minimum size of this chunk (0x350) is used in this patch. Available size is rounded off to 63K. Both values would require a change if size of secure content grows beyond 0x350. Signed-off-by: Heiko Schocher Signed-off-by: Ayoub Zaki --- arch/arm/mach-omap2/sram.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/mach-omap2/sram.c b/arch/arm/mach-omap2/sram.c index cd488b8..2e7c00f 100644 --- a/arch/arm/mach-omap2/sram.c +++ b/arch/arm/mach-omap2/sram.c @@ -47,6 +47,28 @@ #define GP_DEVICE 0x300 +/** + * Size of chunk used by secure content in the HS/EMU devices. + * + * This size is not fixed. It depends upon the implementation of PPA. + * May need to be modified if the size grows. + */ +#define AM33XX_HS_HEADER_SIZE 0x0350 + +/** + * Start of public SRAM on HS/EMU devices. + */ +#define AM33XX_SRAM_PA 0x40300000 +#define AM33XX_SRAM_PUB_PA (AM33XX_SRAM_PA + AM33XX_HS_HEADER_SIZE) + +/** + * Size of public SRAM available on HS/EMU devices. + * + * This size also depends upon AM33XX_HS_HEADER_SIZE. + * Current value is derived from nearest round-off. + */ +#define AM33XX_SRAM_PUB_SIZE 0xfc00 /* 63K */ + #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) static unsigned long omap_sram_start; @@ -99,6 +121,9 @@ static void __init omap_detect_sram(void) } else { omap_sram_size = 0x8000; /* 32K */ } + } else if (soc_is_am33xx()) { + omap_sram_start = AM33XX_SRAM_PUB_PA; + omap_sram_size = AM33XX_SRAM_PUB_SIZE; } else { omap_sram_start = OMAP2_SRAM_PUB_PA; omap_sram_size = 0x800; /* 2K */