serial: Drivers for Altera UARTs
Tobias Klauser
maintainerPATCH v3 1/2 serial: Add driver for the Altera JTAG UART
In reply to Tobias KlauserAdd an UART driver for the JTAG UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.
--- drivers/serial/Kconfig | 21 ++ drivers/serial/Makefile | 1 + drivers/serial/altera_jtaguart.c | 504 ++++++++++++++++++++++++++++++++++++++ include/linux/altera_jtaguart.h | 16 ++ include/linux/serial_core.h | 3 + 5 files changed, 545 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/altera_jtaguart.c create mode 100644 include/linux/altera_jtaguart.h
drivers/serial/Kconfig +21 -0
@@ -1490,4 +1490,25 @@ config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE help Support for running a console on the GRLIB APBUART +config SERIAL_ALTERA_JTAGUART + bool "Altera JTAG UART support" + select SERIAL_CORE + help + This driver supports the Altera JTAG UART port. + +config SERIAL_ALTERA_JTAGUART_CONSOLE + bool "Altera JTAG UART console support" + depends on SERIAL_ALTERA_JTAGUART + select SERIAL_CORE_CONSOLE + help + Enable a Altera JTAG UART port to be the system console. + +config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS + bool "Bypass output when no connection" + depends on SERIAL_ALTERA_JTAGUART_CONSOLE + select SERIAL_CORE_CONSOLE + help + Bypass console output and keep going even if there is no + JTAG terminal connection with the host. + endmenu
drivers/serial/Makefile +1 -0
@@ -82,3 +82,4 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o +obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
drivers/serial/altera_jtaguart.c new file +504 -0
504 lines not on this page · raw message
include/linux/altera_jtaguart.h new file +16 -0
@@ -0,0 +1,16 @@ +/* +* altera_jtaguart.h -- Altera JTAG UART driver defines. +*/ + +#ifndef __ALTJUART_H +#define __ALTJUART_H + +#define ALTERA_JTAGUART_MAJOR 204 +#define ALTERA_JTAGUART_MINOR 186 + +struct altera_jtaguart_platform_uart { +unsigned long mapbase;/* Physical address base */ +unsigned int irq;/* Interrupt vector */ +}; + +#endif /* __ALTJUART_H */
include/linux/serial_core.h +3 -0
@@ -182,6 +182,9 @@/* Aeroflex Gaisler GRLIB APBUART */ #define PORT_APBUART 90 +/* Altera UARTs */ +#define PORT_ALTERA_JTAGUART 91 +#ifdef __KERNEL__#include <linux/compiler.h>
Signature · 1 line
1.6.3.3
Tobias Klauser
maintainerv3 cover serial: Drivers for Altera UARTs
This is the third version of the patchset to add the serial drivers for the Altera UARTs. I made the corrections suggested by Alan Cox on top of the second version submitted on 01 Mar 2010.
Changes from v2 to v3:
- altera_uart: Copy old termios settings back and set baud rate
- altera_uart: Remove board specific DTR/DCD macros
Changes from v1 to v2:
- altera_jtaguart: Implement altera_jtaguart_set_termios
- altera_jtaguart: Protect port.tty in altera_jtaguart_rx_chars
- altera_uart, altera_jtaguart: Don't depend on EMBEDDED
- altera_jtaguart: Correct check for co->index
- altera_uart: Correct check for co->index
Thanks,
Tobias
Tobias Klauser
maintainerPATCH v3 2/2 serial: Add driver for the Altera UART
In reply to Tobias KlauserAdd an UART driver for the UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.
--- drivers/serial/Kconfig | 31 +++ drivers/serial/Makefile | 1 + drivers/serial/altera_uart.c | 573 ++++++++++++++++++++++++++++++++++++++++++ include/linux/altera_uart.h | 14 + include/linux/serial_core.h | 1 + 5 files changed, 620 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/altera_uart.c create mode 100644 include/linux/altera_uart.h
drivers/serial/Kconfig +31 -0
@@ -1511,4 +1511,35 @@ config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS Bypass console output and keep going even if there is no JTAG terminal connection with the host. +config SERIAL_ALTERA_UART + bool "Altera UART support" + select SERIAL_CORE + help + This driver supports the Altera softcore UART port. + +config SERIAL_ALTERA_UART_MAXPORTS + int "Maximum number of Altera UART ports" + depends on SERIAL_ALTERA_UART + default 4 + help + This setting lets you define the maximum number of the Altera + UART ports. The usual default varies from board to board, and + this setting is a way of catering for that. + +config SERIAL_ALTERA_UART_BAUDRATE + int "Default baudrate for Altera UART ports" + depends on SERIAL_ALTERA_UART + default 115200 + help + This setting lets you define what the default baudrate is for the + Altera UART ports. The usual default varies from board to board, + and this setting is a way of catering for that. + +config SERIAL_ALTERA_UART_CONSOLE + bool "Altera UART console support" + depends on SERIAL_ALTERA_UART + select SERIAL_CORE_CONSOLE + help + Enable a Altera UART port to be the system console. + endmenu
drivers/serial/Makefile +1 -0
@@ -83,3 +83,4 @@ obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o +obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
drivers/serial/altera_uart.c new file +573 -0
573 lines not on this page · raw message
include/linux/altera_uart.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* altera_uart.h -- Altera UART driver defines. +*/ + +#ifndef __ALTUART_H +#define __ALTUART_H + +struct altera_uart_platform_uart { +unsigned long mapbase;/* Physical address base */ +unsigned int irq;/* Interrupt vector */ +unsigned int uartclk;/* UART clock rate */ +}; + +#endif /* __ALTUART_H */
include/linux/serial_core.h +1 -0
@@ -184,6 +184,7 @@/* Altera UARTs */ #define PORT_ALTERA_JTAGUART 91 +#define PORT_ALTERA_UART 92#ifdef __KERNEL__
Signature · 1 line
1.6.3.3
Re: [PATCHv3 1/2] serial: Add driver for the Altera JTAG UART
In reply to Tobias KlauserQuoted 21 lines · On Fri, 5 Mar 2010 17:52:22 +0100 Tobias Klauser <[email protected]> wrote:
Add an UART driver for the JTAG UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.
...
drivers/serial/Kconfig +10
-0@@ -1490,4 +1490,25 @@ config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE help Support for running a console on the GRLIB APBUART +config SERIAL_ALTERA_JTAGUART + bool "Altera JTAG UART support" + select SERIAL_CORE + help + This driver supports the Altera JTAG UART port. + +config SERIAL_ALTERA_JTAGUART_CONSOLE + bool "Altera JTAG UART console support" + depends on SERIAL_ALTERA_JTAGUART + select SERIAL_CORE_CONSOLE
drivers/serial/Kconfig config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE · line 1512
Quoted 10 lines
drivers/serial/Kconfig +10
-0+ help + Enable a Altera JTAG UART port to be the system console. + +config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS + bool "Bypass output when no connection" + depends on SERIAL_ALTERA_JTAGUART_CONSOLE + select SERIAL_CORE_CONSOLE + help + Bypass console output and keep going even if there is no + JTAG terminal connection with the host.
So this driver will be available on all CPU architectures.
I'm guessing that the hardware _isn't_ available on all CPU architectures? Maybe that's wrong.
If this hardware is only available on certain CPUs then we face tradeoffs. By making it universally available, the code gets better compile tesst coverage and that can detect problems (usually minor ones). otoh, it can increase your maintenance load a bit, and adds a risk that people will ship unusable kernel modules and will see increased build times. I have no particular opinion either way.
Quoted 33 lines
drivers/serial/Kconfig +0
-0endmenudrivers/serial/Makefile +1
-0@@ -82,3 +82,4 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o +obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.odrivers/serial/altera_jtaguart.c new file +17
-0@@ -0,0 +1,504 @@ +/* +* altera_jtaguart.c -- Altera JTAG UART driver +* +* Based on mcf.c -- Freescale ColdFire UART driver +* +* (C) Copyright 2003-2007, Greg Ungerer <[email protected]> +* (C) Copyright 2008, Thomas Chou <[email protected]> +* (C) Copyright 2010, Tobias Klauser <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/init.h>
drivers/serial/altera_jtaguart.c line 27
Quoted 10 lines
drivers/serial/altera_jtaguart.c new file +10
-0+#include <linux/interrupt.h> +#include <linux/module.h> +#include <linux/console.h> +#include <linux/tty.h> +#include <linux/tty_flip.h> +#include <linux/serial.h> +#include <linux/serial_core.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/altera_jtaguart.h>
Does it make sense to put altera_jtaguart.h into include/linux? Could we put it in drivers/serial/?
Quoted 3 lines
...
Tobias Klauser
maintainerRe: [PATCHv3 1/2] serial: Add driver for the Altera JTAG UART
Quoted 37 lines · Andrew Morton
Quoted 21 lines · On Fri, 5 Mar 2010 17:52:22 +0100 Tobias Klauser <[email protected]> wrote:
Add an UART driver for the JTAG UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.
...
drivers/serial/Kconfig +10
-0@@ -1490,4 +1490,25 @@ config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE help Support for running a console on the GRLIB APBUART +config SERIAL_ALTERA_JTAGUART + bool "Altera JTAG UART support" + select SERIAL_CORE + help + This driver supports the Altera JTAG UART port. + +config SERIAL_ALTERA_JTAGUART_CONSOLE + bool "Altera JTAG UART console support" + depends on SERIAL_ALTERA_JTAGUART + select SERIAL_CORE_CONSOLEdrivers/serial/Kconfig config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE · line 1512
Quoted 10 lines
drivers/serial/Kconfig +10
-0+ help + Enable a Altera JTAG UART port to be the system console. + +config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS + bool "Bypass output when no connection" + depends on SERIAL_ALTERA_JTAGUART_CONSOLE + select SERIAL_CORE_CONSOLE + help + Bypass console output and keep going even if there is no + JTAG terminal connection with the host.So this driver will be available on all CPU architectures.
Quoted 2 lines
I'm guessing that the hardware _isn't_ available on all CPU architectures? Maybe that's wrong.
In principle it is available on all CPU. I can think of a hardware component with an Altera FPGA containing this UART. But at the moment no such implementation is known to me and the UART is only usable on the nios2 CPU architecture (which is not in mainline yet - we're planning to change that, submitting the arch-sepcific drivers is the first step towards this).
Quoted 6 lines
If this hardware is only available on certain CPUs then we face tradeoffs. By making it universally available, the code gets better compile tesst coverage and that can detect problems (usually minor ones). otoh, it can increase your maintenance load a bit, and adds a risk that people will ship unusable kernel modules and will see increased build times. I have no particular opinion either way.
I'd like to have this universally available if no one objects. It'd be nice to get better test coverage and I don't really mind the additional maintanance load. AFAICS other UART driver are only available on one single architecture too, so I hoped it would be fine to go the same way with the altera_{jtag,}uart drivers.
Quoted 38 lines
Quoted 38 lines
drivers/serial/Kconfig +0
-0endmenudrivers/serial/Makefile +1
-0@@ -82,3 +82,4 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o +obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.odrivers/serial/altera_jtaguart.c new file +22
-0@@ -0,0 +1,504 @@ +/* +* altera_jtaguart.c -- Altera JTAG UART driver +* +* Based on mcf.c -- Freescale ColdFire UART driver +* +* (C) Copyright 2003-2007, Greg Ungerer <[email protected]> +* (C) Copyright 2008, Thomas Chou <[email protected]> +* (C) Copyright 2010, Tobias Klauser <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/module.h> +#include <linux/console.h> +#include <linux/tty.h> +#include <linux/tty_flip.h>
Quoted 8 lines
drivers/serial/altera_jtaguart.c line 27
Quoted 5 lines
drivers/serial/altera_jtaguart.c new file +5
-0+#include <linux/serial.h> +#include <linux/serial_core.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/altera_jtaguart.h> Does it make sense to put
altera_jtaguart.hintoinclude/linux? Could we put it indrivers/serial/?
It is stored in include/linux and not in drivers/serial because we need to include it from arch/nios2 for the platform device setup. Including <linux/altera_jtaguart.h> looks nicer than including "../drivers/serial/altera_jtaguart.h". The same holds true for the altera_uart driver.
Thanks a lot,
Tobias
Re: [Nios2-dev] [PATCHv3 1/2] serial: Add driver for the Altera JTAG UART
----- Origineel bericht -----
Van: Tobias Klauser <[email protected]>
Datum: maandag, maart 15, 2010 10:21
Onderwerp: Re: [Nios2-dev] [PATCHv3 1/2] serial: Add driver for the Altera JTAG UART
Aan: Andrew Morton <[email protected]>
Cc: [email protected], [email protected], [email protected], [email protected]
Quoted 42 lines
Quoted 37 lines · Andrew Morton
Quoted 21 lines · On Fri, 5 Mar 2010 17:52:22 +0100 Tobias Klauser <[email protected]> wrote:
Add an UART driver for the JTAG UART component available as a SOPC (System on Programmable Chip) component for Altera FPGAs.
...
drivers/serial/Kconfig +10
-0@@ -1490,4 +1490,25 @@ config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE help Support for running a console on the GRLIB APBUART +config SERIAL_ALTERA_JTAGUART + bool "Altera JTAG UART support" + select SERIAL_CORE + help + This driver supports the Altera JTAG UART port. + +config SERIAL_ALTERA_JTAGUART_CONSOLE + bool "Altera JTAG UART console support" + depends on SERIAL_ALTERA_JTAGUART + select SERIAL_CORE_CONSOLEdrivers/serial/Kconfig config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE · line 1512
Quoted 10 lines
drivers/serial/Kconfig +10
-0+ help + Enable a Altera JTAG UART port to be the system console. + +config SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS + bool "Bypass output when no connection" + depends on SERIAL_ALTERA_JTAGUART_CONSOLE + select SERIAL_CORE_CONSOLE + help + Bypass console output and keep going even if there is no + JTAG terminal connection with the host.So this driver will be available on all CPU architectures.
Quoted 2 lines
I'm guessing that the hardware _isn't_ available on all CPU architectures? Maybe that's wrong.
Quoted 8 lines
In principle it is available on all CPU. I can think of a hardware component with an Altera FPGA containing this UART. But at the moment no
such implementation is known to me and the UART is only usable on the nios2 CPU architecture (which is not in mainline yet - we're planning to change that, submitting the arch-sepcific drivers is the first step towards this).
We are actually working on a project without a Nios2 where a PCIe core connected to a powerPC is the avalon-master. So I'm in favor of not getting everything too nios2 specific.
Quoted 76 lines
Quoted 4 lines
If this hardware is only available on certain CPUs then we face tradeoffs. By making it universally available, the code gets better compile tesst coverage and that can detect problems (usually minor ones). otoh, it can increase your maintenance load a bit, and adds
a
Quoted 2 lines
risk that people will ship unusable kernel modules and will see increased build times. I have no particular opinion either way.
I'd like to have this universally available if no one objects. It'd be nice to get better test coverage and I don't really mind the additional maintanance load. AFAICS other UART driver are only available on one single architecture too, so I hoped it would be fine to go the same way with the altera_{jtag,}uart drivers.
Quoted 18 lines
Quoted 18 lines
drivers/serial/Kconfig +0
-0endmenudrivers/serial/Makefile +1
-0@@ -82,3 +82,4 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o +obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.odrivers/serial/altera_jtaguart.c new file +2
-0@@ -0,0 +1,504 @@ +/* +* altera_jtaguart.c -- Altera JTAG UART driver Quoted 8 lines
drivers/serial/altera_jtaguart.c
Quoted 8 lines
drivers/serial/altera_jtaguart.c new file +8
-0+* +* Based on mcf.c -- Freescale ColdFire UART driver +* +* (C) Copyright 2003-2007, Greg Ungerer <[email protected]> +* (C) Copyright 2008, Thomas Chou <[email protected]> +* (C) Copyright 2010, Tobias Klauser <[email protected]> +* +* This program is free software; you can redistribute it and/or modify
Quoted 1 line
drivers/serial/altera_jtaguart.c line 11
Quoted 1 line
drivers/serial/altera_jtaguart.c new file +1
-0+* it under the terms of the GNU General Public License as published by
Quoted 1 line
drivers/serial/altera_jtaguart.c line 12
Quoted 1 line
drivers/serial/altera_jtaguart.c new file +1
-0+* the Free Software Foundation; either version 2 of the License, or
Quoted 10 lines
Quoted 10 lines
drivers/serial/altera_jtaguart.c new file +10
-0+* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/module.h> +#include <linux/console.h> +#include <linux/tty.h> +#include <linux/tty_flip.h> Quoted 8 lines
drivers/serial/altera_jtaguart.c line 27
Quoted 5 lines
drivers/serial/altera_jtaguart.c new file +5
-0+#include <linux/serial.h> +#include <linux/serial_core.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/altera_jtaguart.h> Does it make sense to put
altera_jtaguart.hintoinclude/linux? Could we put it indrivers/serial/?It is stored in
include/linuxand not indrivers/serialbecause we need to include it fromarch/nios2for the platform device setup. Including <linux/altera_jtaguart.h> looks nicer than including "../drivers/serial/altera_jtaguart.h". The same holds true for thealtera_uartdriver.Thanks a lot,
Tobias
_______________________________________________
Nios2-dev mailing list
[email protected]
http://sopc.et.ntust.edu.tw/cgi-bin/mailman/listinfo/nios2-dev
Re: [Nios2-dev] [PATCHv3 1/2] serial: Add driver for the Altera JTAG UART
In reply to Andrew MortonQuoted 8 lines · Andrew Morton
drivers/serial/Kconfig config SERIAL_GRLIB_GAISLER_APBUART_CONSOLE · line 1498
Quoted 6 lines
drivers/serial/Kconfig +6
-0+config SERIAL_ALTERA_JTAGUART + bool "Altera JTAG UART support" + select SERIAL_CORE + help + This driver supports the Altera JTAG UART port. +So this driver will be available on all CPU architectures.
Quoted 4 lines
I'm guessing that the hardware _isn't_ available on all CPU architectures? Maybe that's wrong.
It is true that this driver is used mostly with nios2, soft-core coldfire and arm. But peripherals on FPGA can be made available to almost any CPU architecture. So I think it might make sense to let it available to all. Or should we put a "default n" ?
Quoted 10 lines
Review
Quoted 4 lines
(quoted diff) +3
-0+#include<linux/platform_device.h> +#include<linux/io.h> +#include<linux/altera_jtaguart.h>Does it make sense to put
altera_jtaguart.hintoinclude/linux? Could we put it indrivers/serial/?
There is only a platform data structure declaration in the header, which should be passed through platform device data to the driver. If we put it in drivers/serial/, then we will need to include "../../../drivers/serial/altera_jtaguart.h" .
I have written this driver in parallel with the altera_uart driver. We could have passed the data ( base, irq, freq ) using platform resources. But I don't know if there is a way to pass ( freq )? Please let me know if you have any suggestions.
- Thomas
Re: [PATCHv3 2/2] serial: Add driver for the Altera UART
In reply to Tobias Klauserdrivers/serial/altera_uart.c line 101
Quoted 2 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser <[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );
We seem to be missing a few things here.
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd' drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr' drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'
Tobias Klauser
maintainerRe: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 8 lines · Andrew Morton
drivers/serial/altera_uart.c line 101
Quoted 2 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser <[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );We seem to be missing a few things here.
Quoted 5 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'
These should usually be declared in a board specific header. There were compatibility macros in altera_uart.c which defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).
Should we add them again (maybe to altera_uart.h)? Or would it be better to define a config symbol which is set in the board specific Kconfig and altera_uart depends on it?
Thanks
Tobias
Re: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 15 lines · On Wed, 24 Mar 2010 07:47:47 +0100 Tobias Klauser <[email protected]> wrote:
Quoted 8 lines · Andrew Morton
drivers/serial/altera_uart.c line 101
Quoted 2 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser <[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );We seem to be missing a few things here.
Quoted 5 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'
Quoted 8 lines
These should usually be declared in a board specific header. There were compatibility macros in
altera_uart.cwhich defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).Should we add them again (maybe to
altera_uart.h)? Or would it be better to define a config symbol which is set in the board specificKconfigandaltera_uartdepends on it?
I guess the latter.
There should have been a real implementation of these in the patchset - otherwise the code can't be used or tested. Confused.
Tobias Klauser
maintainerRe: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 21 lines · Andrew Morton
Quoted 20 lines · On Wed, 24 Mar 2010 07:47:47 +0100 Tobias Klauser <[email protected]> wrote:
Quoted 8 lines · Andrew Morton
drivers/serial/altera_uart.c line 101
Quoted 2 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser <[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );We seem to be missing a few things here.
Quoted 5 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'These should usually be declared in a board specific header. There were compatibility macros in
altera_uart.cwhich defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).
Quoted 8 lines
Quoted 3 lines
Should we add them again (maybe to
altera_uart.h)? Or would it be better to define a config symbol which is set in the board specificKconfigandaltera_uartdepends on it?I guess the latter.
There should have been a real implementation of these in the patchset - otherwise the code can't be used or tested. Confused.
Sorry for the confusion.
The last patchset I submitted (with the functions removed from altera_uart.c) was tested on a local branch, where I added the macros to a global board specific header. I didn't include that one in the patch.
After looking at the code and it's history a bit closer (and also on the nios2 specific part) I realised that this macro was probably added because the driver was originally based on drivers/serial/mcf.c (the macros are present there too).
Also there are currently no board configurations known to me that define these macros. So I'd suggest to remove the usage of these macros alltogether. We could still add them again (to the board specific part and with the config option then) in case there will be a board configuration implementing DTR/DCD lines on GPIOs.
Could anyone on nios2-dev verify that there are currently no such board configurations?
I'd remove the usage of the macros then and post an updated patch.
Tobias
Re: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 52 lines · Tobias Klauser
Quoted 24 lines · Andrew Morton
Quoted 22 lines · On Wed, 24 Mar 2010 07:47:47 +0100 Tobias Klauser<[email protected]> wrote:
Quoted 9 lines · Andrew Morton
drivers/serial/altera_uart.c line 101
Quoted 3 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser<[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );We seem to be missing a few things here.
Quoted 6 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'These should usually be declared in a board specific header. There were compatibility macros in
altera_uart.cwhich defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).Quoted 9 lines
Quoted 4 lines
Should we add them again (maybe to
altera_uart.h)? Or would it be better to define a config symbol which is set in the board specificKconfigandaltera_uartdepends on it?I guess the latter.
There should have been a real implementation of these in the patchset - otherwise the code can't be used or tested. Confused.
Sorry for the confusion.
The last patchset I submitted (with the functions removed from
altera_uart.c) was tested on a local branch, where I added the macros to a global board specific header. I didn't include that one in the patch.After looking at the code and it's history a bit closer (and also on the nios2 specific part) I realised that this macro was probably added because the driver was originally based on
drivers/serial/mcf.c(the macros are present there too).Also there are currently no board configurations known to me that define these macros. So I'd suggest to remove the usage of these macros alltogether. We could still add them again (to the board specific part and with the config option then) in case there will be a board configuration implementing DTR/DCD lines on GPIOs.
Quoted 5 lines
Could anyone on nios2-dev verify that there are currently no such board configurations?
I'd remove the usage of the macros then and post an updated patch.
Maybe we can add pointers to functions for the DCD/DTR in the struct altera_uart_platform_uart. Then board config file can define them if they implement these pins, NULL/0 otherwise.
struct altera_uart_platform_uart {
...
int (*getppdcd)(...); /* get DCD status */
...
};
static unsigned int altera_uart_get_mctrl(struct uart_port *port) {
...
if (port->getppdcd)
sigs |= (port->getppdcd(...)) ? TIOCM_CD : 0);- Thomas
Tobias Klauser
maintainerRe: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 53 lines · Thomas Chou
Quoted 52 lines · Tobias Klauser
Quoted 24 lines · Andrew Morton
Quoted 22 lines · On Wed, 24 Mar 2010 07:47:47 +0100 Tobias Klauser<[email protected]> wrote:
Quoted 9 lines · Andrew Morton
drivers/serial/altera_uart.c line 101
Quoted 3 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser<[email protected]> wrote:
drivers/serial/altera_uart.c new file +2
-0+ sigs |= (altera_uart_getppdcd (port->line) ?TIOCM_CD :0 ); + sigs |= (altera_uart_getppdtr (port->line) ?TIOCM_DTR :0 );We seem to be missing a few things here.
Quoted 6 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'These should usually be declared in a board specific header. There were compatibility macros in
altera_uart.cwhich defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).Quoted 9 lines
Quoted 4 lines
Should we add them again (maybe to
altera_uart.h)? Or would it be better to define a config symbol which is set in the board specificKconfigandaltera_uartdepends on it?I guess the latter.
There should have been a real implementation of these in the patchset - otherwise the code can't be used or tested. Confused.
Sorry for the confusion.
The last patchset I submitted (with the functions removed from
altera_uart.c) was tested on a local branch, where I added the macros to a global board specific header. I didn't include that one in the patch.After looking at the code and it's history a bit closer (and also on the nios2 specific part) I realised that this macro was probably added because the driver was originally based on
drivers/serial/mcf.c(the macros are present there too).Also there are currently no board configurations known to me that define these macros. So I'd suggest to remove the usage of these macros alltogether. We could still add them again (to the board specific part and with the config option then) in case there will be a board configuration implementing DTR/DCD lines on GPIOs.
Quoted 8 lines
Quoted 5 lines
Could anyone on nios2-dev verify that there are currently no such board configurations?
I'd remove the usage of the macros then and post an updated patch.
Maybe we can add pointers to functions for the DCD/DTR in the struct
altera_uart_platform_uart. Then board config file can define them if they implement these pins, NULL/0 otherwise.
Unfortunately we then need to define them in struct altera_uart too and set them in the probe function using the platform data.
For me that seems like a bit too much overhead just to support the possibility of someone defining these functions in the future. I'd prefer to get rid of the macros now for the mainline submission and then add it later if someone would actually use these DCD/DTR get/set functions. Hope that's OK for you too, Thomas.
-- Tobias
Re: [PATCHv3 2/2] serial: Add driver for the Altera UART
Quoted 74 lines · Tobias Klauser
Quoted 65 lines · Thomas Chou
Quoted 63 lines · Tobias Klauser
Quoted 34 lines · Andrew Morton
Quoted 21 lines · On Wed, 24 Mar 2010 07:47:47 +0100 Tobias Klauser<[email protected]> wrote:
Quoted 11 lines · Andrew Morton
Review
Quoted 4 lines · On Fri, 5 Mar 2010 17:52:23 +0100 Tobias Klauser<[email protected]> wrote:
(quoted diff) +2
-0+ sigs |= (altera_uart_getppdcd(port->line) ? TIOCM_CD : 0); + sigs |= (altera_uart_getppdtr(port->line) ? TIOCM_DTR : 0);We seem to be missing a few things here.
Quoted 7 lines
drivers/serial/altera_uart.c: In function 'altera_uart_get_mctrl':drivers/serial/altera_uart.c:100: error: implicit declaration of function 'altera_uart_getppdcd'drivers/serial/altera_uart.c:101: error: implicit declaration of function 'altera_uart_getppdtr'drivers/serial/altera_uart.c: In function 'altera_uart_set_mctrl':drivers/serial/altera_uart.c:114: error: implicit declaration of function 'altera_uart_setppdtr'Quoted 10 lines
These should usually be declared in a board specific header. There were compatibility macros in
altera_uart.cwhich defined them to NOPs in case the board header did not properly define them. But I remove them as per request by Alan Cox (Message-ID: [email protected]).Should we add them again (maybe to
altera_uart.h)? Or would it be better to define a config symbol which is set in the board specificKconfigandaltera_uartdepends on it?Quoted 6 lines
I guess the latter.
There should have been a real implementation of these in the patchset - otherwise the code can't be used or tested. Confused.
Sorry for the confusion.
The last patchset I submitted (with the functions removed from
altera_uart.c) was tested on a local branch, where I added the macros to a global board specific header. I didn't include that one in the patch.After looking at the code and it's history a bit closer (and also on the nios2 specific part) I realised that this macro was probably added because the driver was originally based on
drivers/serial/mcf.c(the macros are present there too).Also there are currently no board configurations known to me that define these macros. So I'd suggest to remove the usage of these macros alltogether. We could still add them again (to the board specific part and with the config option then) in case there will be a board configuration implementing DTR/DCD lines on GPIOs.
Could anyone on nios2-dev verify that there are currently no such board configurations?
Quoted 7 lines
Quoted 3 lines
I'd remove the usage of the macros then and post an updated patch.
Maybe we can add pointers to functions for the DCD/DTR in the struct
altera_uart_platform_uart. Then board config file can define them if they implement these pins, NULL/0 otherwise.
Quoted 9 lines
Unfortunately we then need to define them in struct
altera_uarttoo and set them in the probe function using the platform data.For me that seems like a bit too much overhead just to support the possibility of someone defining these functions in the future. I'd prefer to get rid of the macros now for the mainline submission and then add it later if someone would actually use these DCD/DTR get/set functions. Hope that's OK for you too, Thomas.
Hi Tobias,
OK. Please drop them. That would be easier.
Best regards,
Thomas