lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Jan 2015 10:41:13 -0600
From:	Rob Herring <robherring2@...il.com>
To:	Chunyan Zhang <chunyan.zhang@...eadtrum.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mark Rutland <mark.rutland@....com>,
	Arnd Bergmann <arnd@...db.de>,
	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	Mark Brown <broonie@...nel.org>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Will Deacon <will.deacon@....com>,
	Catalin Marinas <catalin.marinas@....com>,
	Jiri Slaby <jslaby@...e.cz>,
	Jason Cooper <jason@...edaemon.net>,
	Heiko Stübner <heiko@...ech.de>,
	Florian Vaussard <florian.vaussard@...l.ch>,
	Andrew Lunn <andrew@...n.ch>,
	Robert Richter <rrichter@...ium.com>,
	Hayato Suzuki <hytszk@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Antony Pavlov <antonynpavlov@...il.com>,
	Joel Schopp <Joel.Schopp@....com>,
	Suravee Suthikulanit <Suravee.Suthikulpanit@....com>,
	Shawn Guo <shawn.guo@...aro.org>, lea.yan@...aro.org,
	jorge.ramirez-ortiz@...aro.org, Lee Jones <lee.jones@...aro.org>,
	Orson Zhai <orsonzhai@...il.com>, geng.ren@...eadtrum.com,
	zhizhou.zhang@...eadtrum.com, lanqing.liu@...eadtrum.com,
	Lyra Zhang <zhang.lyra@...il.com>, wei.qiao@...eadtrum.com,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	linux-api@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>
Subject: Re: [PATCH v5 5/5] tty/serial: Add Spreadtrum sc9836-uart driver support

On Fri, Jan 16, 2015 at 4:00 AM, Chunyan Zhang
<chunyan.zhang@...eadtrum.com> wrote:
> Add a full sc9836-uart driver for SC9836 SoC which is based on the
> spreadtrum sharkl64 platform.
> This driver also support earlycon.
> This patch also replaced the spaces between the macros and their
> values with the tabs in serial_core.h
>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@...eadtrum.com>
> Signed-off-by: Orson Zhai <orson.zhai@...eadtrum.com>
> Originally-by: Lanqing Liu <lanqing.liu@...eadtrum.com>
> ---
>  drivers/tty/serial/Kconfig       |   18 +
>  drivers/tty/serial/Makefile      |    1 +
>  drivers/tty/serial/sprd_serial.c |  772 ++++++++++++++++++++++++++++++++++++++
>  include/uapi/linux/serial_core.h |    3 +
>  4 files changed, 794 insertions(+)
>  create mode 100644 drivers/tty/serial/sprd_serial.c
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index c79b43c..969d3cd 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -1577,6 +1577,24 @@ config SERIAL_MEN_Z135
>           This driver can also be build as a module. If so, the module will be called
>           men_z135_uart.ko
>
> +config SERIAL_SPRD
> +       tristate "Support for SPRD serial"

Can the menu text spell out Spreadtrum. What SPRD means is not obvious.

> +       depends on ARCH_SPRD
> +       select SERIAL_CORE
> +       help
> +         This enables the driver for the Spreadtrum's serial.
> +
> +config SERIAL_SPRD_CONSOLE
> +       bool "SPRD UART console support"

Same here.

> +       depends on SERIAL_SPRD=y
> +       select SERIAL_CORE_CONSOLE
> +       select SERIAL_EARLYCON
> +       help
> +         Support for early debug console using Spreadtrum's serial. This enables
> +         the console before standard serial driver is probed. This is enabled
> +         with "earlycon" on the kernel command line. The console is
> +         enabled when early_param is processed.
> +
>  endmenu
>
>  config SERIAL_MCTRL_GPIO
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index 9a548ac..4801aca 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -93,6 +93,7 @@ obj-$(CONFIG_SERIAL_ARC)      += arc_uart.o
>  obj-$(CONFIG_SERIAL_RP2)       += rp2.o
>  obj-$(CONFIG_SERIAL_FSL_LPUART)        += fsl_lpuart.o
>  obj-$(CONFIG_SERIAL_MEN_Z135)  += men_z135_uart.o
> +obj-$(CONFIG_SERIAL_SPRD) += sprd_serial.o
>
>  # GPIOLIB helpers for modem control lines
>  obj-$(CONFIG_SERIAL_MCTRL_GPIO)        += serial_mctrl_gpio.o
> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> new file mode 100644
> index 0000000..81839e4
> --- /dev/null
> +++ b/drivers/tty/serial/sprd_serial.c
> @@ -0,0 +1,772 @@
> +/*
> + * Copyright (C) 2012 Spreadtrum Communications Inc.

This is unchanged in 3 years?

> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/console.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/ioport.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/serial_core.h>
> +#include <linux/serial.h>
> +#include <linux/slab.h>
> +#include <linux/tty.h>
> +#include <linux/tty_flip.h>
> +
> +/* device name */
> +#define UART_NR_MAX            8
> +#define SPRD_TTY_NAME          "ttySPX"

We really want to get away from per SOC serial names and use ttyS for
serial port /dev names. There's issues switching existing drivers
because this creates an ABI, so we can only have new drivers follow
this.

[...]

> +static struct platform_driver sprd_platform_driver = {
> +       .probe          = sprd_probe,
> +       .remove         = sprd_remove,
> +       .driver         = {
> +               .name   = "sprd_serial",
> +               .of_match_table = of_match_ptr(serial_ids),
> +               .pm     = &sprd_pm_ops,
> +       },
> +};
> +
> +static int __init sprd_serial_init(void)
> +{
> +       int ret = 0;
> +
> +       ret = uart_register_driver(&sprd_uart_driver);

This can be done in probe now. Then you can use module_platform_driver().

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ