summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-vexpress/include/mach/uncompress.h
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2012-03-30 12:10:03 +0200
committerMichal Simek <monstr@monstr.eu>2012-03-30 12:10:03 +0200
commit6a4770e335bd4df0a4577146f76e116ab6e23f40 (patch)
tree305056c20b6ccf3a4fed00e9e32f3a1dd039cd70 /arch/arm/mach-vexpress/include/mach/uncompress.h
parentmicroblaze: Fix stack usage in PAGE_SIZE copy_tofrom_user (diff)
parentMerge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh (diff)
downloadlinux-6a4770e335bd4df0a4577146f76e116ab6e23f40.tar.xz
linux-6a4770e335bd4df0a4577146f76e116ab6e23f40.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into next
Diffstat (limited to 'arch/arm/mach-vexpress/include/mach/uncompress.h')
-rw-r--r--arch/arm/mach-vexpress/include/mach/uncompress.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index 7972c5748d0e..7dab5596b868 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -22,7 +22,27 @@
#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
-#define get_uart_base() (0x10000000 + 0x00009000)
+#define UART_BASE 0x10009000
+#define UART_BASE_RS1 0x1c090000
+
+static unsigned long get_uart_base(void)
+{
+ unsigned long mpcore_periph;
+
+ /*
+ * Make an educated guess regarding the memory map:
+ * - the original A9 core tile, which has MPCore peripherals
+ * located at 0x1e000000, should use UART at 0x10009000
+ * - all other (RS1 complaint) tiles use UART mapped
+ * at 0x1c090000
+ */
+ asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (mpcore_periph));
+
+ if (mpcore_periph == 0x1e000000)
+ return UART_BASE;
+ else
+ return UART_BASE_RS1;
+}
/*
* This does not append a newline