diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2014-11-12 15:53:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-25 20:06:40 -0500 |
commit | 3ffb1a8193bead7bf4ef0fec2dae050c70e4c1c1 (patch) | |
tree | 18b8c192f0d6b3e6c21f4a93316c06763576a5d7 | |
parent | 57850a50c1f91c6136fe0b4b27301ebbe848b2ce (diff) |
serial: core: Add big-endian iotype
Since most drivers interpret UPIO_MEM32 to mean "little-endian" and use
readl/writel to access the registers, add a parallel UPIO_MEM32BE to
request the use of big-endian MMIO accessors (ioread32be/iowrite32be).
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/serial_core.c | 2 | ||||
-rw-r--r-- | include/linux/serial_core.h | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 5c8b8f50f787..57ca61b14670 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -2153,6 +2153,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) | |||
2153 | break; | 2153 | break; |
2154 | case UPIO_MEM: | 2154 | case UPIO_MEM: |
2155 | case UPIO_MEM32: | 2155 | case UPIO_MEM32: |
2156 | case UPIO_MEM32BE: | ||
2156 | case UPIO_AU: | 2157 | case UPIO_AU: |
2157 | case UPIO_TSI: | 2158 | case UPIO_TSI: |
2158 | snprintf(address, sizeof(address), | 2159 | snprintf(address, sizeof(address), |
@@ -2796,6 +2797,7 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2) | |||
2796 | (port1->hub6 == port2->hub6); | 2797 | (port1->hub6 == port2->hub6); |
2797 | case UPIO_MEM: | 2798 | case UPIO_MEM: |
2798 | case UPIO_MEM32: | 2799 | case UPIO_MEM32: |
2800 | case UPIO_MEM32BE: | ||
2799 | case UPIO_AU: | 2801 | case UPIO_AU: |
2800 | case UPIO_TSI: | 2802 | case UPIO_TSI: |
2801 | return (port1->mapbase == port2->mapbase); | 2803 | return (port1->mapbase == port2->mapbase); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 3231a43f6acf..057038cf2788 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -142,12 +142,13 @@ struct uart_port { | |||
142 | unsigned char iotype; /* io access style */ | 142 | unsigned char iotype; /* io access style */ |
143 | unsigned char unused1; | 143 | unsigned char unused1; |
144 | 144 | ||
145 | #define UPIO_PORT (0) | 145 | #define UPIO_PORT (0) /* 8b I/O port access */ |
146 | #define UPIO_HUB6 (1) | 146 | #define UPIO_HUB6 (1) /* Hub6 ISA card */ |
147 | #define UPIO_MEM (2) | 147 | #define UPIO_MEM (2) /* 8b MMIO access */ |
148 | #define UPIO_MEM32 (3) | 148 | #define UPIO_MEM32 (3) /* 32b little endian */ |
149 | #define UPIO_AU (4) /* Au1x00 and RT288x type IO */ | 149 | #define UPIO_MEM32BE (4) /* 32b big endian */ |
150 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | 150 | #define UPIO_AU (5) /* Au1x00 and RT288x type IO */ |
151 | #define UPIO_TSI (6) /* Tsi108/109 type IO */ | ||
151 | 152 | ||
152 | unsigned int read_status_mask; /* driver specific */ | 153 | unsigned int read_status_mask; /* driver specific */ |
153 | unsigned int ignore_status_mask; /* driver specific */ | 154 | unsigned int ignore_status_mask; /* driver specific */ |