Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a43cd3b authored by Haojian Zhuang's avatar Haojian Zhuang
Browse files

ARM: pxa: move debug uart code



Move debug uart code from mach-pxa/mach-mmp to debug directory.
Since they are similar, merge them together.

Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@linaro.org>
Acked-by: default avatarEric Mico <eric.y.miao@gmail.com>
parent 8cdde338
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -312,6 +312,13 @@ choice
		  Say Y here if you want kernel low-level debugging support
		  Say Y here if you want kernel low-level debugging support
		  on PicoXcell based platforms.
		  on PicoXcell based platforms.


	config DEBUG_PXA_UART1
		depends on ARCH_PXA
		bool "Use PXA UART1 for low-level debug"
		help
		  Say Y here if you want kernel low-level debugging support
		  on PXA UART1.

	config DEBUG_REALVIEW_STD_PORT
	config DEBUG_REALVIEW_STD_PORT
		bool "RealView Default UART"
		bool "RealView Default UART"
		depends on ARCH_REALVIEW
		depends on ARCH_REALVIEW
@@ -593,6 +600,8 @@ config DEBUG_LL_INCLUDE
	default "debug/mvebu.S" if DEBUG_MVEBU_UART
	default "debug/mvebu.S" if DEBUG_MVEBU_UART
	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
	default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
	default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
	default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
				 DEBUG_MMP_UART3
	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
+33 −0
Original line number Original line Diff line number Diff line
/* arch/arm/mach-mmp/include/mach/debug-macro.S
/*
 * Early serial output macro for Marvell PXA/MMP SoC
 *
 *
 * Debugging macro include header
 * Copyright (C) 1994-1999 Russell King
 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
 *
 *
 *  Copied from arch/arm/mach-pxa/include/mach/debug.S
 * Copyright (C) 2013 Haojian Zhuang
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
*/
*/


#if defined(CONFIG_DEBUG_MMP_UART2)
#if defined(CONFIG_DEBUG_PXA_UART1)
#define MMP_UART_OFFSET	0x00017000
#define PXA_UART_REG_PHYS_BASE	0x40100000
#define PXA_UART_REG_VIRT_BASE	0xf2100000
#elif defined(CONFIG_DEBUG_MMP_UART2)
#define PXA_UART_REG_PHYS_BASE	0xd4017000
#define PXA_UART_REG_VIRT_BASE	0xfe017000
#elif defined(CONFIG_DEBUG_MMP_UART3)
#elif defined(CONFIG_DEBUG_MMP_UART3)
#define MMP_UART_OFFSET	0x00018000
#define PXA_UART_REG_PHYS_BASE	0xd4018000
#define PXA_UART_REG_VIRT_BASE	0xfe018000
#else
#else
#error "Select uart for DEBUG_LL"
#error "Select uart for DEBUG_LL"
#endif
#endif


#include <mach/addr-map.h>

	.macro	addruart, rp, rv, tmp
	.macro	addruart, rp, rv, tmp
		ldr	\rp, =APB_PHYS_BASE		@ physical
	ldr	\rp, =PXA_UART_REG_PHYS_BASE
		ldr	\rv, =APB_VIRT_BASE		@ virtual
	ldr	\rv, =PXA_UART_REG_VIRT_BASE
		orr	\rp, \rp, #MMP_UART_OFFSET
		orr	\rv, \rv, #MMP_UART_OFFSET
	.endm
	.endm


#define UART_SHIFT	2
#define UART_SHIFT	2
+0 −23
Original line number Original line Diff line number Diff line
/* arch/arm/mach-pxa/include/mach/debug-macro.S
 *
 * Debugging macro include header
 *
 *  Copyright (C) 1994-1999 Russell King
 *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
 *
 * 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.
 *
*/

#include "hardware.h"

		.macro	addruart, rp, rv, tmp
		mov	\rp, #0x00100000
		orr	\rv, \rp, #io_p2v(0x40000000)	@ virtual
		orr	\rp, \rp, #0x40000000		@ physical
		.endm

#define UART_SHIFT	2
#include <asm/hardware/debug-8250.S>