xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/arm: UART addresses are not always aligned to a page.
@ 2013-10-24 18:35 Jon Fraser
  2013-10-25 11:28 ` Julien Grall
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Fraser @ 2013-10-24 18:35 UTC (permalink / raw)
  To: xen-devel; +Cc: Jon Fraser

Add the page offset of the UART to the mapped address.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 xen/arch/arm/arm32/debug.S | 5 +++--
 xen/arch/arm/arm32/head.S  | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
index ec774cd..e095911 100644
--- a/xen/arch/arm/arm32/debug.S
+++ b/xen/arch/arm/arm32/debug.S
@@ -22,18 +22,19 @@
 #ifdef EARLY_PRINTK_INC
 #include EARLY_PRINTK_INC
 #endif
+#define UART_OFFSET (EARLY_UART_BASE_ADDRESS & ~PAGE_MASK)
 
 /* Print a character on the UART - this function is called by C
  * r0: character to print */
 GLOBAL(early_putch)
-        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE) + UART_OFFSET  /* r1 := VA UART base address */
         early_uart_ready r1, r2
         early_uart_transmit r1, r0
         mov   pc, lr
 
 /* Flush the UART - this function is called by C */
 GLOBAL(early_flush)
-        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE) + UART_OFFSET  /* r1 := VA UART base address */
         early_uart_ready r1, r2
         mov   pc, lr
 
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index ce1d21a..aa8daec 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -355,8 +355,9 @@ paging:
         mov   r4, r4, lsr #18        /* r4 := Slot for FIXMAP(0) */
         strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
 
+#define UART_OFFSET (EARLY_UART_BASE_ADDRESS & ~PAGE_MASK)
         /* Use a virtual address to access the UART. */
-        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        ldr   r11, =(FIXMAP_ADDR(FIXMAP_CONSOLE) + UART_OFFSET)
 #endif
         /* Map the DTB in the boot misc slot */
         teq   r12, #0                /* Only on boot CPU */
-- 
1.7.11.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-31 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-24 18:35 [PATCH] xen/arm: UART addresses are not always aligned to a page Jon Fraser
2013-10-25 11:28 ` Julien Grall
2013-10-25 22:43   ` Jon Fraser
2013-10-29  1:28   ` Jon Fraser
2013-10-30 18:57     ` Julien Grall
2013-10-31 16:15       ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).