diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-02-12 03:52:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:29 -0500 |
commit | 544fc7283cd6902831d660bd8e1181602bd2b4d2 (patch) | |
tree | 4047a09e91eb833807caa2e9de07e05f38df3609 | |
parent | 3991d3bd1506391d8feec209b1d22ccb1c03a0bf (diff) |
[PATCH] atmel_serial: Use __raw I/O register access
Access to chip-internal registers should always be native-endian. This is
especially important for AVR32 since it's a big-endian architecture and the
non-raw readl() and writel() macros are defined to do little-endian
accesses.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/serial/atmel_serial.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 881f886b91c6..df45a7ac773f 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -73,35 +73,35 @@ | |||
73 | 73 | ||
74 | #define ATMEL_ISR_PASS_LIMIT 256 | 74 | #define ATMEL_ISR_PASS_LIMIT 256 |
75 | 75 | ||
76 | #define UART_PUT_CR(port,v) writel(v, (port)->membase + ATMEL_US_CR) | 76 | #define UART_PUT_CR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_CR) |
77 | #define UART_GET_MR(port) readl((port)->membase + ATMEL_US_MR) | 77 | #define UART_GET_MR(port) __raw_readl((port)->membase + ATMEL_US_MR) |
78 | #define UART_PUT_MR(port,v) writel(v, (port)->membase + ATMEL_US_MR) | 78 | #define UART_PUT_MR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_MR) |
79 | #define UART_PUT_IER(port,v) writel(v, (port)->membase + ATMEL_US_IER) | 79 | #define UART_PUT_IER(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IER) |
80 | #define UART_PUT_IDR(port,v) writel(v, (port)->membase + ATMEL_US_IDR) | 80 | #define UART_PUT_IDR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IDR) |
81 | #define UART_GET_IMR(port) readl((port)->membase + ATMEL_US_IMR) | 81 | #define UART_GET_IMR(port) __raw_readl((port)->membase + ATMEL_US_IMR) |
82 | #define UART_GET_CSR(port) readl((port)->membase + ATMEL_US_CSR) | 82 | #define UART_GET_CSR(port) __raw_readl((port)->membase + ATMEL_US_CSR) |
83 | #define UART_GET_CHAR(port) readl((port)->membase + ATMEL_US_RHR) | 83 | #define UART_GET_CHAR(port) __raw_readl((port)->membase + ATMEL_US_RHR) |
84 | #define UART_PUT_CHAR(port,v) writel(v, (port)->membase + ATMEL_US_THR) | 84 | #define UART_PUT_CHAR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_THR) |
85 | #define UART_GET_BRGR(port) readl((port)->membase + ATMEL_US_BRGR) | 85 | #define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR) |
86 | #define UART_PUT_BRGR(port,v) writel(v, (port)->membase + ATMEL_US_BRGR) | 86 | #define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) |
87 | #define UART_PUT_RTOR(port,v) writel(v, (port)->membase + ATMEL_US_RTOR) | 87 | #define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) |
88 | 88 | ||
89 | // #define UART_GET_CR(port) readl((port)->membase + ATMEL_US_CR) // is write-only | 89 | // #define UART_GET_CR(port) __raw_readl((port)->membase + ATMEL_US_CR) // is write-only |
90 | 90 | ||
91 | /* PDC registers */ | 91 | /* PDC registers */ |
92 | #define UART_PUT_PTCR(port,v) writel(v, (port)->membase + ATMEL_PDC_PTCR) | 92 | #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) |
93 | #define UART_GET_PTSR(port) readl((port)->membase + ATMEL_PDC_PTSR) | 93 | #define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR) |
94 | 94 | ||
95 | #define UART_PUT_RPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RPR) | 95 | #define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR) |
96 | #define UART_GET_RPR(port) readl((port)->membase + ATMEL_PDC_RPR) | 96 | #define UART_GET_RPR(port) __raw_readl((port)->membase + ATMEL_PDC_RPR) |
97 | #define UART_PUT_RCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RCR) | 97 | #define UART_PUT_RCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RCR) |
98 | #define UART_PUT_RNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNPR) | 98 | #define UART_PUT_RNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNPR) |
99 | #define UART_PUT_RNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNCR) | 99 | #define UART_PUT_RNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNCR) |
100 | 100 | ||
101 | #define UART_PUT_TPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TPR) | 101 | #define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) |
102 | #define UART_PUT_TCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TCR) | 102 | #define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) |
103 | //#define UART_PUT_TNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNPR) | 103 | //#define UART_PUT_TNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNPR) |
104 | //#define UART_PUT_TNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNCR) | 104 | //#define UART_PUT_TNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNCR) |
105 | 105 | ||
106 | static int (*atmel_open_hook)(struct uart_port *); | 106 | static int (*atmel_open_hook)(struct uart_port *); |
107 | static void (*atmel_close_hook)(struct uart_port *); | 107 | static void (*atmel_close_hook)(struct uart_port *); |