Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281586
b: refs/heads/master
c: 0dfb3b4
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Abraham authored and Kukjin Kim committed Dec 23, 2011
1 parent 2cafdec commit 6a7debf
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 117 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: 0cfb26e1fb9d7afe9c79a40a257808eafb2aff34
refs/heads/master: 0dfb3b41be4ca3c9d1688f6c2d00bfa178356494
18 changes: 0 additions & 18 deletions trunk/drivers/tty/serial/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@

#include "samsung.h"

static int s3c2410_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
dbg("s3c2410_serial_resetport: port=%p (%08lx), cfg=%p\n",
port, port->mapbase, cfg);

wr_regl(port, S3C2410_UCON, cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);

/* reset both fifos */

wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

return 0;
}

static struct s3c24xx_uart_info s3c2410_uart_inf = {
.name = "Samsung S3C2410 UART",
.type = PORT_S3C2410,
Expand All @@ -56,7 +39,6 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = {
.num_clks = 2,
.clksel_mask = S3C2410_UCON_CLKMASK,
.clksel_shift = S3C2410_UCON_CLKSHIFT,
.reset_port = s3c2410_serial_resetport,
};

static int s3c2410_serial_probe(struct platform_device *dev)
Expand Down
24 changes: 0 additions & 24 deletions trunk/drivers/tty/serial/s3c2412.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,6 @@

#include "samsung.h"

static int s3c2412_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
unsigned long ucon = rd_regl(port, S3C2410_UCON);

dbg("%s: port=%p (%08lx), cfg=%p\n",
__func__, port, port->mapbase, cfg);

/* ensure we don't change the clock settings... */

ucon &= S3C2412_UCON_CLKMASK;

wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);

/* reset both fifos */

wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

return 0;
}

static struct s3c24xx_uart_info s3c2412_uart_inf = {
.name = "Samsung S3C2412 UART",
.type = PORT_S3C2412,
Expand All @@ -63,7 +40,6 @@ static struct s3c24xx_uart_info s3c2412_uart_inf = {
.num_clks = 4,
.clksel_mask = S3C2412_UCON_CLKMASK,
.clksel_shift = S3C2412_UCON_CLKSHIFT,
.reset_port = s3c2412_serial_resetport,
};

/* device management */
Expand Down
24 changes: 0 additions & 24 deletions trunk/drivers/tty/serial/s3c2440.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,6 @@

#include "samsung.h"

static int s3c2440_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
unsigned long ucon = rd_regl(port, S3C2410_UCON);

dbg("s3c2440_serial_resetport: port=%p (%08lx), cfg=%p\n",
port, port->mapbase, cfg);

/* ensure we don't change the clock settings... */

ucon &= (S3C2440_UCON0_DIVMASK | (3<<10));

wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);

/* reset both fifos */

wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

return 0;
}

static struct s3c24xx_uart_info s3c2440_uart_inf = {
.name = "Samsung S3C2440 UART",
.type = PORT_S3C2440,
Expand All @@ -62,7 +39,6 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = {
.num_clks = 4,
.clksel_mask = S3C2440_UCON_CLKMASK,
.clksel_shift = S3C2440_UCON_CLKSHIFT,
.reset_port = s3c2440_serial_resetport,
};

/* device management */
Expand Down
24 changes: 0 additions & 24 deletions trunk/drivers/tty/serial/s3c6400.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,6 @@

#include "samsung.h"

static int s3c6400_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
unsigned long ucon = rd_regl(port, S3C2410_UCON);

dbg("s3c6400_serial_resetport: port=%p (%08lx), cfg=%p\n",
port, port->mapbase, cfg);

/* ensure we don't change the clock settings... */

ucon &= S3C6400_UCON_CLKMASK;

wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);

/* reset both fifos */

wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

return 0;
}

static struct s3c24xx_uart_info s3c6400_uart_inf = {
.name = "Samsung S3C6400 UART",
.type = PORT_S3C6400,
Expand All @@ -64,7 +41,6 @@ static struct s3c24xx_uart_info s3c6400_uart_inf = {
.num_clks = 4,
.clksel_mask = S3C6400_UCON_CLKMASK,
.clksel_shift = S3C6400_UCON_CLKSHIFT,
.reset_port = s3c6400_serial_resetport,
};

/* device management */
Expand Down
22 changes: 1 addition & 21 deletions trunk/drivers/tty/serial/s5pv210.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,6 @@
#include <plat/regs-serial.h>
#include "samsung.h"

static int s5pv210_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
unsigned long ucon = rd_regl(port, S3C2410_UCON);

ucon &= S5PV210_UCON_CLKMASK;
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);

/* reset both fifos */
wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

/* It is need to delay When reset FIFO register */
udelay(1);

return 0;
}

#define S5PV210_UART_DEFAULT_INFO(fifo_size) \
.name = "Samsung S5PV210 UART0", \
.type = PORT_S3C6400, \
Expand All @@ -58,8 +39,7 @@ static int s5pv210_serial_resetport(struct uart_port *port,
.def_clk_sel = S3C2410_UCON_CLKSEL0, \
.num_clks = 2, \
.clksel_mask = S5PV210_UCON_CLKMASK, \
.clksel_shift = S5PV210_UCON_CLKSHIFT, \
.reset_port = s5pv210_serial_resetport
.clksel_shift = S5PV210_UCON_CLKSHIFT

static struct s3c24xx_uart_info s5p_port_fifo256 = {
S5PV210_UART_DEFAULT_INFO(256),
Expand Down
23 changes: 18 additions & 5 deletions trunk/drivers/tty/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,16 +965,29 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS

/* s3c24xx_serial_resetport
*
* wrapper to call the specific reset for this port (reset the fifos
* and the settings)
* reset the fifos and other the settings.
*/

static inline int s3c24xx_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
static void s3c24xx_serial_resetport(struct uart_port *port,
struct s3c2410_uartcfg *cfg)
{
struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
unsigned long ucon = rd_regl(port, S3C2410_UCON);
unsigned int ucon_mask;

return (info->reset_port)(port, cfg);
ucon_mask = info->clksel_mask;
if (info->type == PORT_S3C2440)
ucon_mask |= S3C2440_UCON0_DIVMASK;

ucon &= ucon_mask;
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);

/* reset both fifos */
wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
wr_regl(port, S3C2410_UFCON, cfg->ufcon);

/* some delay is required after fifo reset */
udelay(1);
}


Expand Down

0 comments on commit 6a7debf

Please sign in to comment.