David Daney | 7 Oct 02:36
Favicon

[PATCH] serial: Add Cavium OCTEON UART definitions.

cavium: 8250 serial driver changes

As mentioned in '[PATCH 1/2] serial: Allow for replaceable I/O
functions in 8250 driver.', we are in the process of preparing kernel
support for the Cavium Networks OCTEON processor for inclusion in the
main-line kernel sources.

The OCTEON's UART differs from the existing uart_configs, so we add a
new uart_config and check for it in several places.

This patch depends on the aforementioned 'Allow for replaceable I/O
functions in 8250 driver' patch.

Since this patch is part of the Cavium OCTEON processor port, we don't
expect that it would be committed until the rest of the port is
accepted.  However we would like feedback so that it might be
adjusted if necessary.

Signed-off-by: Tomaso Paoletti <tpaoletti <at> caviumnetworks.com>
Signed-off-by: David Daney <ddaney <at> caviumnetworks.com>
---
 drivers/serial/8250.c       |   30 +++++++++++++++++++++++++++---
 include/linux/serial_core.h |    3 ++-
 include/linux/serial_reg.h  |    6 ++++++
 3 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 02771d6..2ef79e9 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
(Continue reading)

Arnd Bergmann | 7 Oct 11:34
X-Face
Gravatar

Re: [PATCH] serial: Add Cavium OCTEON UART definitions.

On Tuesday 07 October 2008, David Daney wrote:
> 
> -       up->port.type = PORT_16550A;
> +#ifdef CONFIG_CPU_CAVIUM_OCTEON
> +       /* UPF_FIXED_PORT indicates an internal UART.  */
> +       if (up->port.flags & UPF_FIXED_PORT)
> +               up->port.type = PORT_OCTEON;
> +       else
> +#endif
> +               up->port.type = PORT_16550A;
> +

This looks somewhat wrong, IMHO a device driver should not assume that
a CONFIG_CPU_* symbol is exclusive. You could have (maybe not now, but
in the future) a kernel that supports running on an Octeon as well
as some other Mips64 processor, and have UPF_FIXED_PORT uart on some
other machine, which will make the kernel think it is a PORT_OCTEON.

	Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Alan Cox | 7 Oct 12:29

Re: [PATCH] serial: Add Cavium OCTEON UART definitions.

> +#ifdef CONFIG_CPU_CAVIUM_OCTEON
> +	/* UPF_FIXED_PORT indicates an internal UART.  */
> +	if (up->port.flags & UPF_FIXED_PORT)
> +		up->port.type = PORT_OCTEON;
> +	else
> +#endif

Not nice. Please keep CPU specific ifdefs out of the 8250 core code. Can
you not set a port flag for UPF_BROKEN_OCTEON or similar to clean that up
and also make the other tests that need things doing (eg the always
calling IRQ code use port flags of a more generic nature ?)
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane