From patchwork Tue Jan 10 10:52:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 6140 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EEFDD23E16 for ; Tue, 10 Jan 2012 10:43:07 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id D73C5A1820F for ; Tue, 10 Jan 2012 10:43:07 +0000 (UTC) Received: by bkbzu5 with SMTP id zu5so424071bkb.11 for ; Tue, 10 Jan 2012 02:43:07 -0800 (PST) Received: by 10.204.152.20 with SMTP id e20mr8240196bkw.117.1326192187569; Tue, 10 Jan 2012 02:43:07 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs78651bkc; Tue, 10 Jan 2012 02:43:06 -0800 (PST) Received: by 10.180.88.229 with SMTP id bj5mr11115502wib.5.1326192185508; Tue, 10 Jan 2012 02:43:05 -0800 (PST) Received: from AM1EHSOBE002.bigfish.com (am1ehsobe002.messaging.microsoft.com. [213.199.154.205]) by mx.google.com with ESMTPS id bs15si499329wib.18.2012.01.10.02.43.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Jan 2012 02:43:05 -0800 (PST) Received-SPF: neutral (google.com: 213.199.154.205 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=213.199.154.205; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.205 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail87-am1-R.bigfish.com (10.3.201.254) by AM1EHSOBE002.bigfish.com (10.3.204.22) with Microsoft SMTP Server id 14.1.225.23; Tue, 10 Jan 2012 10:43:05 +0000 Received: from mail87-am1 (localhost [127.0.0.1]) by mail87-am1-R.bigfish.com (Postfix) with ESMTP id 08EEAE0154; Tue, 10 Jan 2012 10:43:05 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zcb8kzzz1202hzz8275dhz2dhc1ahc1bh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail87-am1 (localhost.localdomain [127.0.0.1]) by mail87-am1 (MessageSwitch) id 1326192184816751_32722; Tue, 10 Jan 2012 10:43:04 +0000 (UTC) Received: from AM1EHSMHS015.bigfish.com (unknown [10.3.201.254]) by mail87-am1.bigfish.com (Postfix) with ESMTP id B9B7120043; Tue, 10 Jan 2012 10:43:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS015.bigfish.com (10.3.207.153) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 10 Jan 2012 10:43:04 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Tue, 10 Jan 2012 04:43:02 -0600 Received: from r64343-desktop.ap.freescale.net (r64343-desktop.ap.freescale.net [10.192.242.36]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q0AAh0rM025058; Tue, 10 Jan 2012 04:43:01 -0600 (CST) From: Jason Liu To: CC: Subject: [PATCH] imx: mx6q: add aipstz init for off platform periph Date: Tue, 10 Jan 2012 18:52:59 +0800 Message-ID: <1326192779-9077-1-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Init peripheral access control register of AIPSTZ OPACRx: Buffer Writes(BW): 0 -> not bufferable, Supervisor Protect(SP): 0 -> not require supervisor privilege level for accesses. Write Protect(WP): 0 -> allows write accesses. Trusted Protect(TP): 0 -> allows unstrusted master Signed-off-by: Jason Liu Cc: Stefano Babic --- arch/arm/cpu/armv7/mx6/soc.c | 29 +++++++++++++++++++++++------ arch/arm/include/asm/arch-mx6/imx-regs.h | 11 +++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index bd59cf5..bec53cd 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -40,18 +40,35 @@ u32 get_cpu_rev(void) #ifdef CONFIG_ARCH_CPU_INIT void init_aips(void) { - u32 reg = AIPS1_BASE_ADDR; + struct aipstz_regs *aips1, *aips2; + + aips1 = (struct aipstz_regs *)AIPS1_BASE_ADDR; + aips2 = (struct aipstz_regs *)AIPS2_BASE_ADDR; /* * Set all MPROTx to be non-bufferable, trusted for R/W, * not forced to user-mode. */ - writel(0x77777777, reg + 0x00); - writel(0x77777777, reg + 0x04); + writel(0x77777777, &aips1->mprot0); + writel(0x77777777, &aips1->mprot1); + writel(0x77777777, &aips2->mprot0); + writel(0x77777777, &aips2->mprot1); - reg = AIPS2_BASE_ADDR; - writel(0x77777777, reg + 0x00); - writel(0x77777777, reg + 0x04); + /* + * Set all OPACRx to be non-bufferable, not require + * supervisor privilege level for access,allow for + * write access and untrusted master access. + */ + writel(0x00000000, &aips1->opacr0); + writel(0x00000000, &aips1->opacr1); + writel(0x00000000, &aips1->opacr2); + writel(0x00000000, &aips1->opacr3); + writel(0x00000000, &aips1->opacr4); + writel(0x00000000, &aips2->opacr0); + writel(0x00000000, &aips2->opacr1); + writel(0x00000000, &aips2->opacr2); + writel(0x00000000, &aips2->opacr3); + writel(0x00000000, &aips2->opacr4); } int arch_cpu_init(void) diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 5fe9748..7650cb9 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -232,5 +232,16 @@ struct fuse_bank4_regs { u32 rsvd3[0x13]; }; +struct aipstz_regs { + u32 mprot0; + u32 mprot1; + u32 rsvd[0xe]; + u32 opacr0; + u32 opacr1; + u32 opacr2; + u32 opacr3; + u32 opacr4; +}; + #endif /* __ASSEMBLER__*/ #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */