Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192109
b: refs/heads/master
c: 9ee1ace
h: refs/heads/master
i:
  192107: ed35cc1
v: v3
  • Loading branch information
Cyril Chemparathy authored and Kevin Hilman committed May 6, 2010
1 parent 97ced1c commit f69b2f3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 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: da0122ca8b7804b9cd8fa7eff466bafba27f09a3
refs/heads/master: 9ee1acefa86083c6acf4112983b88a0057eb7785
32 changes: 25 additions & 7 deletions trunk/arch/arm/mach-davinci/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
int offset)
{
offset <<= up->regshift;
return (unsigned int)__raw_readl(IO_ADDRESS(up->mapbase) + offset);

WARN_ONCE(!up->membase, "unmapped read: uart[%d]\n", offset);

return (unsigned int)__raw_readl(up->membase + offset);
}

static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
int value)
{
offset <<= p->regshift;
__raw_writel(value, IO_ADDRESS(p->mapbase) + offset);

WARN_ONCE(!p->membase, "unmapped write: uart[%d]\n", offset);

__raw_writel(value, p->membase + offset);
}

static void __init davinci_serial_reset(struct plat_serial8250_port *p)
Expand Down Expand Up @@ -83,14 +89,26 @@ int __init davinci_serial_init(struct davinci_uart_config *info)

sprintf(name, "uart%d", i);
uart_clk = clk_get(dev, name);
if (IS_ERR(uart_clk))
if (IS_ERR(uart_clk)) {
printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
__func__, __LINE__, i);
else {
clk_enable(uart_clk);
p->uartclk = clk_get_rate(uart_clk);
davinci_serial_reset(p);
continue;
}

clk_enable(uart_clk);
p->uartclk = clk_get_rate(uart_clk);

if (!p->membase && p->mapbase) {
p->membase = ioremap(p->mapbase, SZ_4K);

if (p->membase)
p->flags &= ~UPF_IOREMAP;
else
pr_err("uart regs ioremap failed\n");
}

if (p->membase)
davinci_serial_reset(p);
}

return platform_device_register(soc_info->serial_dev);
Expand Down

0 comments on commit f69b2f3

Please sign in to comment.