[PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug

Arnd Bergmann arnd at arndb.de
Thu Jan 17 11:25:42 EST 2013


On Thursday 17 January 2013, Shawn Guo wrote:
> However, there is a problem with above approach.  DEBUG_LL routines
> will check MMU enable bit to decide whether physical or virtual address
> should be used to access debug port.  In case virtual address needs
> to be used, the address returned by addruart will not work for
> decompressor who uses a different mapping from what kernel uses.
> Fortunately, decompressor uses a flat mapping (same physical and virtual
> addresses).  So we can easily work it around by asking platform addruart
> return physical address as virtual address when it runs in decompressor.
> The macro UNCOMPRESS_DEBUG is defined for this use.

Can't you just create a new copy of kernel/debug.S in boot/compressed/
that provides only a putc() function and uses the physical address
unconditionally?

For all I can tell, that should be little more than just

#include CONFIG_DEBUG_LL_INCLUDE
ENTRY(putc)
	addruart r1, r2, r3
	waituart r3, r1
	senduart r0, r1
	busyuart r3, r1
	mov pc,lr
ENDPROC(putc)

(I'm not sure about the actual semantics of the above, take that
as an approximation)

	Arnd



More information about the linux-arm-kernel mailing list