Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313197
b: refs/heads/master
c: 1b820ea
h: refs/heads/master
i:
  313195: 28d05ff
v: v3
  • Loading branch information
Pawel Moll committed Jul 13, 2012
1 parent 3fa2dd4 commit 247f973
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 375faa93cbd8062317d17ddfa6d8fea75f3bbf9b
refs/heads/master: 1b820eaf42cde1df11d718909273611ee8e86ad0
26 changes: 26 additions & 0 deletions trunk/arch/arm/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,32 @@ choice
The uncompressor code port configuration is now handled
by CONFIG_S3C_LOWLEVEL_UART_PORT.

config DEBUG_VEXPRESS_UART0_DETECT
bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
depends on ARCH_VEXPRESS && CPU_CP15_MMU
help
This option enables a simple heuristic which tries to determine
the motherboard's memory map variant (original or RS1) and then
choose the relevant UART0 base address.

Note that this will only work with standard A-class core tiles,
and may fail with non-standard SMM or custom software models.

config DEBUG_VEXPRESS_UART0_CA9
bool "Use PL011 UART0 at 0x10009000 (V2P-CA9 core tile)"
depends on ARCH_VEXPRESS
help
This option selects UART0 at 0x10009000. Except for custom models,
this applies only to the V2P-CA9 tile.

config DEBUG_VEXPRESS_UART0_RS1
bool "Use PL011 UART0 at 0x1c090000 (RS1 complaint tiles)"
depends on ARCH_VEXPRESS
help
This option selects UART0 at 0x1c090000. This applies to most
of the tiles using the RS1 memory map, including all new A-class
core tiles, FPGA-based SMMs and software models.

config DEBUG_LL_UART_NONE
bool "No low-level debugging UART"
help
Expand Down
41 changes: 41 additions & 0 deletions trunk/arch/arm/mach-vexpress/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#define DEBUG_LL_VIRT_BASE 0xf8000000

#if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT)

.macro addruart,rp,rv,tmp

@ Make an educated guess regarding the memory map:
Expand All @@ -41,3 +43,42 @@
.endm

#include <asm/hardware/debug-pl01x.S>

#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9)

.macro addruart,rp,rv,tmp
mov \rp, #DEBUG_LL_UART_OFFSET
orr \rv, \rp, #DEBUG_LL_VIRT_BASE
orr \rp, \rp, #DEBUG_LL_PHYS_BASE
.endm

#include <asm/hardware/debug-pl01x.S>

#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1)

.macro addruart,rp,rv,tmp
mov \rp, #DEBUG_LL_UART_OFFSET_RS1
orr \rv, \rp, #DEBUG_LL_VIRT_BASE
orr \rp, \rp, #DEBUG_LL_PHYS_BASE_RS1
.endm

#include <asm/hardware/debug-pl01x.S>

#else /* CONFIG_DEBUG_LL_UART_NONE */

.macro addruart, rp, rv, tmp
/* Safe dummy values */
mov \rp, #0
mov \rv, #DEBUG_LL_VIRT_BASE
.endm

.macro senduart,rd,rx
.endm

.macro waituart,rd,rx
.endm

.macro busyuart,rd,rx
.endm

#endif
14 changes: 14 additions & 0 deletions trunk/arch/arm/mach-vexpress/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

static unsigned long get_uart_base(void)
{
#if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT)
unsigned long mpcore_periph;

/*
Expand All @@ -42,6 +43,13 @@ static unsigned long get_uart_base(void)
return UART_BASE;
else
return UART_BASE_RS1;
#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9)
return UART_BASE;
#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1)
return UART_BASE_RS1;
#else
return 0;
#endif
}

/*
Expand All @@ -51,6 +59,9 @@ static inline void putc(int c)
{
unsigned long base = get_uart_base();

if (!base)
return;

while (AMBA_UART_FR(base) & (1 << 5))
barrier();

Expand All @@ -61,6 +72,9 @@ static inline void flush(void)
{
unsigned long base = get_uart_base();

if (!base)
return;

while (AMBA_UART_FR(base) & (1 << 3))
barrier();
}
Expand Down

0 comments on commit 247f973

Please sign in to comment.