Skip to content

Commit

Permalink
serial: core: Add big-endian iotype
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Cernekee authored and Greg Kroah-Hartman committed Nov 26, 2014
1 parent 57850a5 commit 3ffb1a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
break;
case UPIO_MEM:
case UPIO_MEM32:
case UPIO_MEM32BE:
case UPIO_AU:
case UPIO_TSI:
snprintf(address, sizeof(address),
Expand Down Expand Up @@ -2796,6 +2797,7 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2)
(port1->hub6 == port2->hub6);
case UPIO_MEM:
case UPIO_MEM32:
case UPIO_MEM32BE:
case UPIO_AU:
case UPIO_TSI:
return (port1->mapbase == port2->mapbase);
Expand Down
13 changes: 7 additions & 6 deletions include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ struct uart_port {
unsigned char iotype; /* io access style */
unsigned char unused1;

#define UPIO_PORT (0)
#define UPIO_HUB6 (1)
#define UPIO_MEM (2)
#define UPIO_MEM32 (3)
#define UPIO_AU (4) /* Au1x00 and RT288x type IO */
#define UPIO_TSI (5) /* Tsi108/109 type IO */
#define UPIO_PORT (0) /* 8b I/O port access */
#define UPIO_HUB6 (1) /* Hub6 ISA card */
#define UPIO_MEM (2) /* 8b MMIO access */
#define UPIO_MEM32 (3) /* 32b little endian */
#define UPIO_MEM32BE (4) /* 32b big endian */
#define UPIO_AU (5) /* Au1x00 and RT288x type IO */
#define UPIO_TSI (6) /* Tsi108/109 type IO */

unsigned int read_status_mask; /* driver specific */
unsigned int ignore_status_mask; /* driver specific */
Expand Down

0 comments on commit 3ffb1a8

Please sign in to comment.