ARM: debug: fix big endian operation for 8250 word mode
[deliverable/linux.git] / arch / arm / include / debug / imx.S
CommitLineData
a09e64fb 1/* arch/arm/mach-imx/include/mach/debug-macro.S
4bc25650
SH
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
49c9e60e 13
f8c95fe6 14#include "imx-uart.h"
d9c92783 15
6dde5ac5
SG
16/*
17 * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
18 * stay sync with that. It's hard to maintain, and should be fixed
19 * globally for multi-platform build to use a fixed virtual address
20 * for low-level debug uart port across platforms.
21 */
22#define IMX_IO_P2V(x) ( \
23 (((x) & 0x80000000) >> 7) | \
24 (0xf4000000 + \
25 (((x) & 0x50000000) >> 6) + \
26 (((x) & 0x0b000000) >> 4) + \
27 (((x) & 0x000fffff))))
28
29#define UART_VADDR IMX_IO_P2V(UART_PADDR)
ac401427 30
639da5ee 31 .macro addruart, rp, rv, tmp
0ea12930
JK
32 ldr \rp, =UART_PADDR @ physical
33 ldr \rv, =UART_VADDR @ virtual
4bc25650
SH
34 .endm
35
36 .macro senduart,rd,rx
37 str \rd, [\rx, #0x40] @ TXDATA
38 .endm
39
40 .macro waituart,rd,rx
41 .endm
42
43 .macro busyuart,rd,rx
441002: ldr \rd, [\rx, #0x98] @ SR2
45 tst \rd, #1 << 3 @ TXDC
46 beq 1002b @ wait until transmit done
47 .endm
This page took 0.428885 seconds and 5 git commands to generate.