Commit d5bd4e8d authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Arnd Bergmann
Browse files

ARM: add lolevel debug support for asm9260



Since there is no public documentation, this patch also provide register
offsets for different UART units on this SoC.

Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent d9bfc86d
Loading
Loading
Loading
Loading
+26 −2
Original line number Diff line number Diff line
@@ -93,6 +93,27 @@ choice
	prompt "Kernel low-level debugging port"
	depends on DEBUG_LL

	config DEBUG_ASM9260_UART
		bool "Kernel low-level debugging via asm9260 UART"
		depends on MACH_ASM9260
		help
		  Say Y here if you want the debug print routines to direct
		  their output to an UART or USART port on asm9260 based
		  machines.

		    DEBUG_UART_PHYS | DEBUG_UART_VIRT

		    0x80000000      | 0xf0000000     | UART0
		    0x80004000      | 0xf0004000     | UART1
		    0x80008000      | 0xf0008000     | UART2
		    0x8000c000      | 0xf000c000     | UART3
		    0x80010000      | 0xf0010000     | UART4
		    0x80014000      | 0xf0014000     | UART5
		    0x80018000      | 0xf0018000     | UART6
		    0x8001c000      | 0xf001c000     | UART7
		    0x80020000      | 0xf0020000     | UART8
		    0x80024000      | 0xf0024000     | UART9

	config AT91_DEBUG_LL_DBGU0
		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl"
		depends on HAVE_AT91_DBGU0
@@ -1144,6 +1165,7 @@ config DEBUG_LL_INCLUDE
	string
	default "debug/sa1100.S" if DEBUG_SA1100
	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
	default "debug/asm9260.S" if DEBUG_ASM9260_UART
	default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2
	default "debug/meson.S" if DEBUG_MESON_UARTAO
	default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X
@@ -1248,6 +1270,7 @@ config DEBUG_UART_PHYS
	default 0x78000000 if DEBUG_CNS3XXX
	default 0x7c0003f8 if FOOTBRIDGE
	default 0x78000000 if DEBUG_CNS3XXX
	default 0x80010000 if DEBUG_ASM9260_UART
	default 0x80070000 if DEBUG_IMX23_UART
	default 0x80074000 if DEBUG_IMX28_UART
	default 0x80230000 if DEBUG_PICOXCELL_UART
@@ -1297,13 +1320,14 @@ config DEBUG_UART_PHYS
		DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
		DEBUG_UART_BCM63XX
		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART

config DEBUG_UART_VIRT
	hex "Virtual base address of debug UART"
	default 0xe0010fe0 if ARCH_RPC
	default 0xe1000000 if DEBUG_MSM_UART
	default 0xf0000be0 if ARCH_EBSA110
	default 0xf0010000 if DEBUG_ASM9260_UART
	default 0xf01fb000 if DEBUG_NOMADIK_UART
	default 0xf0201000 if DEBUG_BCM2835
	default 0xf1000300 if DEBUG_BCM_5301X
@@ -1374,7 +1398,7 @@ config DEBUG_UART_VIRT
	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
		DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
		DEBUG_UART_BCM63XX
		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART

config DEBUG_UART_8250_SHIFT
	int "Register offset shift for the 8250 debug UART"
+29 −0
Original line number Diff line number Diff line
/* Debugging macro include header
 *
 *  Copyright (C) 1994-1999 Russell King
 *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
 *  Modified for ASM9260 by Oleksij Remepl <linux@rempel-privat.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

		.macro	addruart, rp, rv, tmp
		ldr	\rp, = CONFIG_DEBUG_UART_PHYS
		ldr	\rv, = CONFIG_DEBUG_UART_VIRT
		.endm

		.macro	waituart,rd,rx
		.endm

		.macro	senduart,rd,rx
		str	\rd, [\rx, #0x50]	@ TXDATA
		.endm

		.macro	busyuart,rd,rx
1002:		ldr	\rd, [\rx, #0x60]	@ STAT
		tst	\rd, #1 << 27		@ TXEMPTY
		beq	1002b			@ wait until transmit done
		.endm