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: 7381461 Return-Path: X-Original-To: patchwork-linux-omap@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 AF6689F1D5 for ; Tue, 13 Oct 2015 05:54:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE4B720982 for ; Tue, 13 Oct 2015 05:54:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05A6E20844 for ; Tue, 13 Oct 2015 05:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409AbbJMFyc (ORCPT ); Tue, 13 Oct 2015 01:54:32 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:51646 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbbJMFy3 (ORCPT ); Tue, 13 Oct 2015 01:54:29 -0400 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 Cc: Heiko Schocher , Ayoub Zaki , Russell King , linux-omap@vger.kernel.org, Georg.Soffel@bosch-si.com, linux-arm-kernel@lists.infradead.org, Tony Lindgren 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 */