diff mbox

[U-Boot,v2,09/13] ARM: atmel: sama5d4: add interrupt redirec function

Message ID 1418621079-29668-10-git-send-email-voice.shen@atmel.com
State Accepted, archived
Delegated to: Andreas Bießmann
Headers show

Commit Message

Bo Shen Dec. 15, 2014, 5:24 a.m. UTC
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---

Changes in v2: None

 arch/arm/cpu/armv7/at91/sama5d4_devices.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Andreas Bießmann Feb. 7, 2015, 10:45 p.m. UTC | #1
Dear Bo Shen,

Bo Shen <voice.shen@atmel.com> writes:
>Signed-off-by: Bo Shen <voice.shen@atmel.com>
>[fix subject]
>Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
>---
>
>Changes in v2: None
>
> arch/arm/cpu/armv7/at91/sama5d4_devices.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
diff mbox

Patch

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 <asm/arch/at91_pmc.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5_matrix.h>
+#include <asm/arch/sama5_sfr.h>
 #include <asm/arch/sama5d4.h>
 
 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