Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261906
b: refs/heads/master
c: 514820e
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Jun 8, 2011
1 parent da5ae67 commit f880cd4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: debf9507166eede1e676d27d3298cdfb27399cb4
refs/heads/master: 514820eb982eb85677ed2ecef9710e90e24fbdab
1 change: 1 addition & 0 deletions trunk/arch/sh/kernel/cpu/sh3/setup-sh770x.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static struct platform_device rtc_device = {

static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xfffffe80,
.port_reg = 0xa4000136,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sh/kernel/cpu/sh4/setup-sh7750.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static struct platform_device rtc_device = {

static struct plat_sci_port sci_platform_data = {
.mapbase = 0xffe00000,
.port_reg = 0xffe0001C
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,19 @@ static int sci_rxfill(struct uart_port *port)
return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0;
}

/*
* SCI helper for checking the state of the muxed port/RXD pins.
*/
static inline int sci_rxd_in(struct uart_port *port)
{
struct sci_port *s = to_sci_port(port);

if (s->cfg->port_reg <= 0)
return 1;

return !!__raw_readb(s->cfg->port_reg);
}

/* ********************************************************************** *
* the interrupt related routines *
* ********************************************************************** */
Expand Down
29 changes: 0 additions & 29 deletions trunk/drivers/tty/serial/sh-sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,32 +287,3 @@ SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
#endif
#define sci_in(port, reg) sci_##reg##_in(port)
#define sci_out(port, reg, value) sci_##reg##_out(port, value)

#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
defined(CONFIG_CPU_SUBTYPE_SH7707) || \
defined(CONFIG_CPU_SUBTYPE_SH7708) || \
defined(CONFIG_CPU_SUBTYPE_SH7709)
static inline int sci_rxd_in(struct uart_port *port)
{
if (port->mapbase == 0xfffffe80)
return __raw_readb(SCPDR)&0x01 ? 1 : 0; /* SCI */
return 1;
}
#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
defined(CONFIG_CPU_SUBTYPE_SH7751) || \
defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
defined(CONFIG_CPU_SUBTYPE_SH7091)
static inline int sci_rxd_in(struct uart_port *port)
{
if (port->mapbase == 0xffe00000)
return __raw_readb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */
return 1;
}
#else /* default case for non-SCI processors */
static inline int sci_rxd_in(struct uart_port *port)
{
return 1;
}
#endif
2 changes: 2 additions & 0 deletions trunk/include/linux/serial_sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ struct plat_sci_port {
int overrun_bit;
unsigned int error_mask;

int port_reg;

struct device *dma_dev;

unsigned int dma_slave_tx;
Expand Down

0 comments on commit f880cd4

Please sign in to comment.