Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: linux-serial@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Robert Schwebel <r.schwebel@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Olof Johansson <olof@lixom.net>,
	github@hilscher.com,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: Hilscher NetX mach-netx refactorings
Date: Sun, 13 Jan 2019 23:39:42 +0100
Message-ID: <CACRpkdbHTi9=x7-_uEYWggfxt4jNUm3JhXy=AqarW3B11d=XKg@mail.gmail.com> (raw)
In-Reply-To: <20190113155047.GA12829@lenoch>

On Sun, Jan 13, 2019 at 4:50 PM Ladislav Michl <ladis@linux-mips.org> wrote:
> On Sun, Jan 13, 2019 at 01:14:36PM +0100, Linus Walleij wrote:

> > > On a related note, there does appear to be active work on
> > > newer netx machines that were never upstreamed, see
> > > https://github.com/Hilscher/netx4000-linux/commits/v4.9-netx4000-stable
> >
> > That RS485 addition to PL011 using GPIOs is a bit hacky but
> > looks like very useful for industrial applications.
> > Ladislav, have you been in contact with Hilscher?
>
> I guess I appeared on Cc list because of commit 797537a45450 ("amba-pl011:
> Add RS485 support (ioctl and devicetree)") from above github repo which
> is based on my hack originaly done for rPi3 as I got tired of all those
> experts implementing 'drive enable' in userspace. That's broken by design
> and works only by accident.

I suppose it is one of those GPIO hacks in userspace. Yeah that makes
the GPIO maintainer very unhappy I can tell you that :/

> But as I'm also considering every single
> device running from SD card broken by design - it was perfect match ;-)

Ha ha ;)

> But seriously, it is indeed needed for industrial applications and
> should be done a bit better - I mean regarding those delays in interrupt
> context.

I suppose this thing is a bit of an oddity since the PL011
does have an RTS signal, but in this case (for reasons such
as hardware doesn't do the right thing, or the hardware engineer
didn't care do make it possible to get the RTS line out of the
chip, or the board engineer didn't think of it) a GPIO is used
for RTS instead. So what the patch does is add that as an
option.

There are DT bindings for RTS (etc):
Documentation/devicetree/bindings/serial/serial.txt

I think that GPIO support code could be implemented using
the library in:
drivers/tty/serial/serial_mctrl_gpio.c

This makes it possible to handle any extra "modem control"
pins using GPIO. I think it is fine to just look for RTS if that is all
that's needed. Possibly those extra delay settings could be
added in mctrl and added as generic DT bindings as well.
(I'm not smart enough to tell if that is possible.)

Sorry for the sidetrack.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-12  8:35 Linus Walleij
2019-01-12 12:03 ` Arnd Bergmann
2019-01-13 12:14   ` Linus Walleij
2019-01-13 15:50     ` Ladislav Michl
2019-01-13 22:39       ` Linus Walleij [this message]
2019-01-14 11:26     ` Michael Trensch
2019-01-14 14:22       ` Linus Walleij
2019-01-15  7:05         ` Michael Trensch
2019-01-15 10:11           ` Arnd Bergmann
2019-01-15 10:14         ` Arnd Bergmann
2019-01-14 10:35 ` Sascha Hauer

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACRpkdbHTi9=x7-_uEYWggfxt4jNUm3JhXy=AqarW3B11d=XKg@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=arnd@arndb.de \
    --cc=github@hilscher.com \
    --cc=kernel@pengutronix.de \
    --cc=ladis@linux-mips.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=r.schwebel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox