mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Vicente Bergas <vicencb@gmail.com>
To: barebox@lists.infradead.org
Cc: Vicente Bergas <vicencb@gmail.com>
Subject: [PATCH 3/6] ARM: ensure irqs are disabled at barebox exit
Date: Mon, 15 Oct 2012 02:22:37 +0200	[thread overview]
Message-ID: <1350260560-15528-4-git-send-email-vicencb@gmail.com> (raw)
In-Reply-To: <1350260560-15528-1-git-send-email-vicencb@gmail.com>


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/cpu/cpu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c
index 51da3b5..4cf4efa 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -31,6 +31,7 @@
 #include <asm/system_info.h>
 #include <asm/cputype.h>
 #include <asm/cache.h>
+#include <asm/ptrace.h>
 
 /**
  * Enable processor's instruction cache
@@ -74,10 +75,20 @@ int icache_status(void)
  */
 void arch_shutdown(void)
 {
+	uint32_t r;
+
 #ifdef CONFIG_MMU
 	mmu_disable();
 #endif
 	flush_icache();
+	/*
+	 * barebox normally does not use interrupts, but some functionalities
+	 * (eg. OMAP4_USBBOOT) require them enabled. So be sure interrupts are
+	 * disabled before exiting.
+	 */
+	__asm__ __volatile__("mrs %0, cpsr" : "=r"(r));
+	r |= PSR_I_BIT;
+	__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
 }
 
 #ifdef CONFIG_THUMB2_BAREBOX
-- 
1.7.12.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-10-15  0:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15  0:22 [PATCH 0/6] archosg9: improve support for tablet Vicente Bergas
2012-10-15  0:22 ` [PATCH 1/6] ArchosG9: changed serial port and env Vicente Bergas
2012-10-15  0:22 ` [PATCH 2/6] ARM: add rename PSR bits to match linux names Vicente Bergas
2012-10-15  0:22 ` Vicente Bergas [this message]
2012-10-15  0:22 ` [PATCH 4/6] UIMAGE: improve transfer speed Vicente Bergas
2012-10-15  0:22 ` [PATCH 5/6] ARM: use arm setup stack function on archosg9 Vicente Bergas
2012-10-15  0:22 ` [PATCH 6/6] OMAP4: clean voltage switch Vicente Bergas
2012-10-15  7:17   ` Sascha Hauer
2012-10-15  7:27 ` [PATCH 0/6] archosg9: improve support for tablet Sascha Hauer
2012-10-18 22:22   ` vj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350260560-15528-4-git-send-email-vicencb@gmail.com \
    --to=vicencb@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox