From patchwork Wed Mar 4 05:48:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bo Shen X-Patchwork-Id: 446110 X-Patchwork-Delegate: andreas.biessmann@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2A3D41400B6 for ; Wed, 4 Mar 2015 16:49:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC8854B5D2; Wed, 4 Mar 2015 06:49:00 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kYI2iSRtK8S9; Wed, 4 Mar 2015 06:49:00 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A1894B5B9; Wed, 4 Mar 2015 06:49:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9FE404B5B9 for ; Wed, 4 Mar 2015 06:48:56 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gNOGA3pD1cjF for ; Wed, 4 Mar 2015 06:48:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from DVREDG02.corp.atmel.com (nasmtp01.atmel.com [192.199.1.246]) by theia.denx.de (Postfix) with ESMTPS id 120664B5A8 for ; Wed, 4 Mar 2015 06:48:52 +0100 (CET) Received: from sjogate2.atmel.com (10.42.103.223) by DVREDG02.corp.atmel.com (10.42.103.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 3 Mar 2015 22:48:46 -0700 Received: from localhost.localdomain ([10.217.12.46]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id t245k94R013979; Tue, 3 Mar 2015 21:46:10 -0800 (PST) From: Bo Shen To: Date: Wed, 4 Mar 2015 13:48:47 +0800 Message-ID: <1425448127-25716-1-git-send-email-voice.shen@atmel.com> X-Mailer: git-send-email 2.3.0 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] ARM: atmel: sama5d4: set non-secured for peripherals X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" When access the programmable secure peripherals address space, it needs set them to non-secured. Signed-off-by: Bo Shen --- arch/arm/mach-at91/armv7/sama5d4_devices.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mach-at91/armv7/sama5d4_devices.c b/arch/arm/mach-at91/armv7/sama5d4_devices.c index ef39cb7..76301d6 100644 --- a/arch/arm/mach-at91/armv7/sama5d4_devices.c +++ b/arch/arm/mach-at91/armv7/sama5d4_devices.c @@ -75,6 +75,15 @@ void matrix_init(void) writel(0x00000001, &h32mx->sassr[4]); writel(0x00000001, &h32mx->srtsr[4]); + /* Configure Programmable Security peripherals on matrix 64 */ + writel(readl(&h64mx->spselr[0]) | 0x00080000, &h64mx->spselr[0]); + writel(readl(&h64mx->spselr[1]) | 0x00180000, &h64mx->spselr[1]); + writel(readl(&h64mx->spselr[2]) | 0x00000008, &h64mx->spselr[2]); + + /* Configure Programmable Security peripherals on matrix 32 */ + writel(readl(&h32mx->spselr[0]) | 0xFFC00000, &h32mx->spselr[0]); + writel(readl(&h32mx->spselr[1]) | 0x60E3FFFF, &h32mx->spselr[1]); + /* Enable the write protect */ writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h64mx->wpmr); writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h32mx->wpmr);