Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149169
b: refs/heads/master
c: 5926a29
h: refs/heads/master
i:
  149167: 00f4f62
v: v3
  • Loading branch information
Alessandro Rubini authored and Russell King committed Jun 4, 2009
1 parent 2cd4550 commit 170a959
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 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: c7f7ff179cb9f2f1e0244ef2c80afbb93c74ce2a
refs/heads/master: 5926a295bb78272b3f648f62febecd19a1b6a6ca
30 changes: 27 additions & 3 deletions trunk/drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ struct uart_amba_port {
struct clk *clk;
unsigned int im; /* interrupt mask */
unsigned int old_status;
unsigned int ifls; /* vendor-specific */
};

/* There is by now at least one vendor with differing details, so handle it */
struct vendor_data {
unsigned int ifls;
unsigned int fifosize;
};

static struct vendor_data vendor_arm = {
.ifls = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8,
.fifosize = 16,
};

static struct vendor_data vendor_st = {
.ifls = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF,
.fifosize = 64,
};

static void pl011_stop_tx(struct uart_port *port)
Expand Down Expand Up @@ -360,8 +377,7 @@ static int pl011_startup(struct uart_port *port)
if (retval)
goto clk_dis;

writew(UART011_IFLS_RX4_8|UART011_IFLS_TX4_8,
uap->port.membase + UART011_IFLS);
writew(uap->ifls, uap->port.membase + UART011_IFLS);

/*
* Provoke TX FIFO interrupt into asserting.
Expand Down Expand Up @@ -732,6 +748,7 @@ static struct uart_driver amba_reg = {
static int pl011_probe(struct amba_device *dev, struct amba_id *id)
{
struct uart_amba_port *uap;
struct vendor_data *vendor = id->data;
void __iomem *base;
int i, ret;

Expand Down Expand Up @@ -762,12 +779,13 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id)
goto unmap;
}

uap->ifls = vendor->ifls;
uap->port.dev = &dev->dev;
uap->port.mapbase = dev->res.start;
uap->port.membase = base;
uap->port.iotype = UPIO_MEM;
uap->port.irq = dev->irq[0];
uap->port.fifosize = 16;
uap->port.fifosize = vendor->fifosize;
uap->port.ops = &amba_pl011_pops;
uap->port.flags = UPF_BOOT_AUTOCONF;
uap->port.line = i;
Expand Down Expand Up @@ -812,6 +830,12 @@ static struct amba_id pl011_ids[] __initdata = {
{
.id = 0x00041011,
.mask = 0x000fffff,
.data = &vendor_arm,
},
{
.id = 0x00380802,
.mask = 0x00ffffff,
.data = &vendor_st,
},
{ 0, 0 },
};
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/amba/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
#define UART011_IFLS_TX4_8 (2 << 0)
#define UART011_IFLS_TX6_8 (3 << 0)
#define UART011_IFLS_TX7_8 (4 << 0)
/* special values for ST vendor with deeper fifo */
#define UART011_IFLS_RX_HALF (5 << 3)
#define UART011_IFLS_TX_HALF (5 << 0)

#define UART011_OEIM (1 << 10) /* overrun error interrupt mask */
#define UART011_BEIM (1 << 9) /* break error interrupt mask */
Expand Down

0 comments on commit 170a959

Please sign in to comment.