diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/amba-pl011.c | 78 | ||||
-rw-r--r-- | drivers/serial/arm_dcc.c | 3 | ||||
-rw-r--r-- | drivers/serial/atmel.c | 3 | ||||
-rw-r--r-- | drivers/serial/linux_console.c | 3 | ||||
-rw-r--r-- | drivers/serial/serial_altera.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_altera_jtag.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_blackfin.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_imx.c | 20 | ||||
-rw-r--r-- | drivers/serial/serial_mpc5xxx.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_netx.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_ns16550.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_pl010.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_pl010.h | 4 | ||||
-rw-r--r-- | drivers/serial/serial_s3c.c | 3 | ||||
-rw-r--r-- | drivers/serial/stm-serial.c | 3 |
15 files changed, 77 insertions, 68 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index f8c55c4b54..58c69e5c2d 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -19,10 +19,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ /* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */ @@ -35,6 +31,7 @@ #include <linux/amba/serial.h> #include <linux/clk.h> #include <linux/err.h> +#include <linux/amba/bus.h> /* * We wrap our port structure around the generic console_device. @@ -44,6 +41,23 @@ struct amba_uart_port { struct console_device uart; /* uart */ struct clk *clk; /* uart clock */ u32 uartclk; + struct vendor_data *vendor; +}; + +/* There is by now at least one vendor with differing details, so handle it */ +struct vendor_data { + unsigned int lcrh_tx; + unsigned int lcrh_rx; +}; + +static struct vendor_data vendor_arm = { + .lcrh_tx = UART011_LCRH, + .lcrh_rx = UART011_LCRH, +}; + +static struct vendor_data vendor_st = { + .lcrh_tx = ST_UART011_LCRH_TX, + .lcrh_rx = ST_UART011_LCRH_RX, }; static inline struct amba_uart_port * @@ -116,13 +130,27 @@ static int pl011_tstc(struct console_device *cdev) return !(readl(uart->base + UART01x_FR) & UART01x_FR_RXFE); } +static void pl011_rlcr(struct amba_uart_port *uart, u32 lcr) +{ + struct vendor_data *vendor = uart->vendor; + + writew(lcr, uart->base + vendor->lcrh_rx); + if (vendor->lcrh_tx != vendor->lcrh_rx) { + int i; + /* + * Wait 10 PCLKs before writing LCRH_TX register, + * to get this delay write read only register 10 times + */ + for (i = 0; i < 10; ++i) + writew(0xff, uart->base + UART011_MIS); + writew(lcr, uart->base + vendor->lcrh_tx); + } +} + int pl011_init_port (struct console_device *cdev) { - struct device_d *dev = cdev->dev; struct amba_uart_port *uart = to_amba_uart_port(cdev); - uart->base = dev_request_mem_region(dev, 0); - /* ** First, disable everything. */ @@ -142,8 +170,7 @@ int pl011_init_port (struct console_device *cdev) /* ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled. */ - writel((UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN), - uart->base + UART011_LCRH); + pl011_rlcr(uart, UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN); /* ** Finally, enable the UART @@ -154,19 +181,21 @@ int pl011_init_port (struct console_device *cdev) return 0; } -static int pl011_probe(struct device_d *dev) +static int pl011_probe(struct amba_device *dev, const struct amba_id *id) { struct amba_uart_port *uart; struct console_device *cdev; uart = xzalloc(sizeof(struct amba_uart_port)); - uart->clk = clk_get(dev, NULL); + uart->clk = clk_get(&dev->dev, NULL); + uart->base = amba_get_mem_region(dev); + uart->vendor = (void*)id->data; if (IS_ERR(uart->clk)) return PTR_ERR(uart->clk); cdev = &uart->uart; - cdev->dev = dev; + cdev->dev = &dev->dev; cdev->f_caps = CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR; cdev->tstc = pl011_tstc; cdev->putc = pl011_putc; @@ -182,14 +211,31 @@ static int pl011_probe(struct device_d *dev) return 0; } -static struct driver_d pl011_driver = { - .name = "uart-pl011", - .probe = pl011_probe, +static struct amba_id pl011_ids[] = { + { + .id = 0x00041011, + .mask = 0x000fffff, + .data = &vendor_arm, + }, + { + .id = 0x00380802, + .mask = 0x00ffffff, + .data = &vendor_st, + }, + { 0, 0 }, +}; + +struct amba_driver pl011_driver = { + .drv = { + .name = "uart-pl011", + }, + .probe = pl011_probe, + .id_table = pl011_ids, }; static int pl011_init(void) { - register_driver(&pl011_driver); + amba_driver_register(&pl011_driver); return 0; } diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c index 3f87d3f015..8c2253b8b5 100644 --- a/drivers/serial/arm_dcc.c +++ b/drivers/serial/arm_dcc.c @@ -11,9 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * As a special exception, if other files instantiate templates or use macros * or inline functions from this file, or you compile this file and link it diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c index 32e6a8de24..45225294ef 100644 --- a/drivers/serial/atmel.c +++ b/drivers/serial/atmel.c @@ -11,9 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ diff --git a/drivers/serial/linux_console.c b/drivers/serial/linux_console.c index a9081a7fad..597c390c0b 100644 --- a/drivers/serial/linux_console.c +++ b/drivers/serial/linux_console.c @@ -15,9 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_altera.c b/drivers/serial/serial_altera.c index ee1b6bc62c..c8dc3a512c 100644 --- a/drivers/serial/serial_altera.c +++ b/drivers/serial/serial_altera.c @@ -14,10 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_altera_jtag.c b/drivers/serial/serial_altera_jtag.c index 7edb5bd0c0..e808183e33 100644 --- a/drivers/serial/serial_altera_jtag.c +++ b/drivers/serial/serial_altera_jtag.c @@ -17,10 +17,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_blackfin.c b/drivers/serial/serial_blackfin.c index 7830a61d17..c134fcf770 100644 --- a/drivers/serial/serial_blackfin.c +++ b/drivers/serial/serial_blackfin.c @@ -15,10 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 1e1e8e3157..012ab028a1 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -11,9 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ @@ -357,10 +354,23 @@ static void imx_serial_remove(struct device_d *dev) free(priv); } +static __maybe_unused struct of_device_id imx_serial_dt_ids[] = { + { + .compatible = "fsl,imx1-uart", + .data = 0, + }, { + .compatible = "fsl,imx21-uart", + .data = 1, + }, { + /* sentinel */ + } +}; + static struct driver_d imx_serial_driver = { - .name = "imx_serial", - .probe = imx_serial_probe, + .name = "imx_serial", + .probe = imx_serial_probe, .remove = imx_serial_remove, + .of_compatible = DRV_OF_COMPAT(imx_serial_dt_ids), }; static int imx_serial_init(void) diff --git a/drivers/serial/serial_mpc5xxx.c b/drivers/serial/serial_mpc5xxx.c index cf9ce622fd..d19eda9d21 100644 --- a/drivers/serial/serial_mpc5xxx.c +++ b/drivers/serial/serial_mpc5xxx.c @@ -15,10 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA * * Hacked for MPC8260 by Murray.Jensen@cmst.csiro.au, 19-Oct-00, with * changes based on the file arch/ppc/mbxboot/m8260_tty.c from the diff --git a/drivers/serial/serial_netx.c b/drivers/serial/serial_netx.c index 838293fd72..b165d64726 100644 --- a/drivers/serial/serial_netx.c +++ b/drivers/serial/serial_netx.c @@ -15,10 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 1248bd6a1a..9984437e9d 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -30,10 +30,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <common.h> diff --git a/drivers/serial/serial_pl010.c b/drivers/serial/serial_pl010.c index 2c2b8c4fc2..fd17a3a6fc 100644 --- a/drivers/serial/serial_pl010.c +++ b/drivers/serial/serial_pl010.c @@ -21,10 +21,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ /* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */ diff --git a/drivers/serial/serial_pl010.h b/drivers/serial/serial_pl010.h index 6124e0e0f7..ff3d2f9974 100644 --- a/drivers/serial/serial_pl010.h +++ b/drivers/serial/serial_pl010.h @@ -18,10 +18,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ struct hldc_struct { diff --git a/drivers/serial/serial_s3c.c b/drivers/serial/serial_s3c.c index f8192813dd..08212c73ec 100644 --- a/drivers/serial/serial_s3c.c +++ b/drivers/serial/serial_s3c.c @@ -14,9 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c index f6dcb8447c..958cc76a0b 100644 --- a/drivers/serial/stm-serial.c +++ b/drivers/serial/stm-serial.c @@ -15,9 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ |