From patchwork Mon Dec 8 06:09:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bo Shen X-Patchwork-Id: 418575 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 4DB311400A0 for ; Mon, 8 Dec 2014 17:10:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 266954B65B; Mon, 8 Dec 2014 07:10:32 +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 mpbp-TsCR8pv; Mon, 8 Dec 2014 07:10:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B20284B661; Mon, 8 Dec 2014 07:09:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 168FA4B666 for ; Mon, 8 Dec 2014 07:09:51 +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 HhZb3JX7giKa for ; Mon, 8 Dec 2014 07:09:50 +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 DVREDG01.corp.atmel.com (nasmtp01.atmel.com [192.199.1.245]) by theia.denx.de (Postfix) with ESMTPS id 059C14B667 for ; Mon, 8 Dec 2014 07:09:40 +0100 (CET) Received: from sjogate2.atmel.com (10.42.103.223) by DVREDG01.corp.atmel.com (10.42.103.30) with Microsoft SMTP Server id 14.2.347.0; Sun, 7 Dec 2014 23:09:35 -0700 Received: from localhost.localdomain ([10.217.12.46]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id sB867x6O013897; Sun, 7 Dec 2014 22:08:11 -0800 (PST) From: Bo Shen To: Date: Mon, 8 Dec 2014 14:09:14 +0800 Message-ID: <1418018958-23342-10-git-send-email-voice.shen@atmel.com> X-Mailer: git-send-email 2.1.0.24.g4109c28 In-Reply-To: <1418018958-23342-1-git-send-email-voice.shen@atmel.com> References: <1418018958-23342-1-git-send-email-voice.shen@atmel.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 09/13] ARM: atmel: sama5d4: add interrupt redirec function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Bo Shen --- arch/arm/cpu/armv7/at91/sama5d4_devices.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/cpu/armv7/at91/sama5d4_devices.c b/arch/arm/cpu/armv7/at91/sama5d4_devices.c index 9c63e99..ef39cb7 100644 --- a/arch/arm/cpu/armv7/at91/sama5d4_devices.c +++ b/arch/arm/cpu/armv7/at91/sama5d4_devices.c @@ -11,6 +11,7 @@ #include #include #include +#include #include char *get_cpu_name() @@ -78,4 +79,15 @@ void matrix_init(void) writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h64mx->wpmr); writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h32mx->wpmr); } + +void redirect_int_from_saic_to_aic(void) +{ + struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR; + u32 key32; + + if (!(readl(&sfr->aicredir) & ATMEL_SFR_AICREDIR_NSAIC)) { + key32 = readl(&sfr->sn1) ^ ATMEL_SFR_AICREDIR_KEY; + writel((key32 | ATMEL_SFR_AICREDIR_NSAIC), &sfr->aicredir); + } +} #endif