From: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
To: "H. Nikolaus Schaller"
<hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>,
Andrey Vostrikov
<andrey.vostrikov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
List for communicating with real GTA04 owners
<gta04-owner-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>,
tomeu-XCtybt49RKsYaV1qd6yewg@public.gmane.org,
NeilBrown <neil-+NVA1uvv1dVBDLzU/O5InQ@public.gmane.org>,
One Thousand Gnomes
<gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org>,
Marek Belisko <marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
Subject: Re: [Gta04-owner] [PATCH 0/4] UART slave device support - version 4
Date: Fri, 15 Jan 2016 09:16:09 -0800 [thread overview]
Message-ID: <56992959.2020204@hurleysoftware.com> (raw)
In-Reply-To: <CB69F6F0-B40B-47D1-B175-8401F43288C5-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
On 01/15/2016 08:08 AM, H. Nikolaus Schaller wrote:
> Hi Andrey,
> ah that is fine to learn about another project that needs some solution (however it will look like).
>
> Am 15.01.2016 um 16:43 schrieb Andrey Vostrikov <andrey.vostrikov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>:
>
>> Hi Nikolaus,
>>
>> H. Nikolaus Schaller wrote:
>>> And IMHO nobody has described that he/she needs a solution to model the*data* relationship
>>> for devices connected behind a tty port.
>>
>> I am not sure if my case fits *data* relationship or not in this case. Some time ago I asked about state of your patches.
>> In my case I have supervising microcontroller unit (MCU) that is connected to one of UARTs on SoC.
>>
>> This MCU implements several functions that will be implemented as MFD driver:
>> - watchdog and system reset
>> - NVMEM EEPROM
>> - HWMON sensors
>> - Input/power button
>> - and similar low level functions
>>
>> So in my case DTS binding looks like:
>>
>> &uart3 {
>> mcu {
>> line-speed = <baud rate>;
>> watchdog {
>> timeout = <ms>;
>> ...other params...
>> };
>> eeprom {
>> #address-cells
>> #size-cells
>> cell1 : cell@1 {
>> reg = <1 2>;
>> };
>> cell2 : cell@2 {
>> reg = <2 1>;
>> };
>> };
>> hwmon {
>> sensors-list = "voltage", "current", etc...;
>> }
>> }
>> }
>
> With my proposal it would just become
>
> / {
> themcu: mcu {
> uart = <&uart3>;
> line-speed = <baud rate>;
> watchdog {
> timeout = <ms>;
> ...other params...
> };
> eeprom {
> #address-cells
> #size-cells
> cell1 : cell@1 {
> reg = <1 2>;
> };
> cell2 : cell@2 {
> reg = <2 1>;
> };
> };
> hwmon {
> sensors-list = "voltage", "current", etc...;
> }
> }
> };
>
> Which is almost the same. Except that it allows to move your mcu node whereever you like and easily allows to change the interface to connect to a different device by
>
> &themcu {
> uart = <&uart1>;
> };
>
> With the subnode style you would need some tricks to get the driver instance for uart3 disabled, although it is possible (everything is possible - just easier or more difficult).
>
>>
>> This MCU receives commands and notifies MFD driver about events via UART protocol.
>> It looks like not really a slave though, more like a partnership from data flow point of view.
>
> Yes!. That is why I started to question the term "slave".
>
> And yes, this is the second use case I am aware of: a device that just *uses" the UART to do its works and there is no /dev/tty involved.
>
>>
>> There is no user space code involved in this case as whole interactions are between drivers (just a kick to open /dev/ttyXXX using sys_open, as there is no way to start probe on uart_slave bus and assign line discipline).
>
> Exactly this is what we want to provide as API for the drivers by our patches to serial-core.c.
>
> We want to allow such a "partner" device to take a line-speed property e.g. from its DT node (or a 9600 constant as for our GPS chip) and ask the UART driver to set the required clocks. Or to get the driver notified that someone has opened the /dev/tty* etc. So make it possible to use some UART from another driver.
>
> In the long run it should be possible to use the UART even if there is no /dev/tty client or interface in user-space but that is something not perfectly working (there is some initialization race in the tty/serial subsystem we have not yet understood).
>
> As you see, I have a driver-specific standpoint (and not coming from user space).
>
> Thanks for sharing this example.
I'd like to see the exemplar slave driver be something more complicated than
trivial on-off, before hacking in junk into the serial core.
As it stands, this gps could be supported on any uart driver that implements
mctrl gpios (which is trivial with the serial mctrl gpio helpers).
Not that I'm against uart slave device support, just that I don't think hacks
is the way to go about it.
What I'd like to see is a split of the serial core into a tty driver and a
standalone device abstraction. Anything else is just workarounds.
Regards,
Peter Hurley
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-01-15 17:16 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 1:56 [PATCH 0/4] UART slave device support - version 4 NeilBrown
2015-05-11 1:56 ` [PATCH 1/4] TTY: use class_find_device to find port in uart_suspend/resume NeilBrown
2015-05-11 1:56 ` [PATCH 3/4] TTY: add support for uart_slave devices NeilBrown
2015-05-12 8:31 ` Paul Bolle
2015-05-12 23:35 ` NeilBrown
2015-05-11 1:56 ` [PATCH 2/4] TTY: split tty_register_device_attr into 'initialize' and 'add' parts NeilBrown
2015-05-31 22:01 ` [PATCH 0/4] UART slave device support - version 4 Greg Kroah-Hartman
[not found] ` <20150511013540.5709.93626.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-05-11 1:56 ` [PATCH 4/4] tty/slaves: add a driver to power on/off UART attached devices NeilBrown
2015-08-07 13:01 ` [PATCH 0/4] UART slave device support - version 4 Linus Walleij
2015-08-11 23:20 ` NeilBrown
2015-08-28 5:52 ` [Gta04-owner] " Dr. H. Nikolaus Schaller
[not found] ` <CD86D8CD-20D8-44EF-8245-A3E49C2D3EA7-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-08-28 7:02 ` Pavel Machek
2015-08-28 9:43 ` Dr. H. Nikolaus Schaller
[not found] ` <0579762D-51C2-45F0-A362-EE31215A40E8-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-08-28 11:04 ` Pavel Machek
2015-08-28 20:04 ` Christ van Willegen
2016-01-12 13:06 ` Tomeu Vizoso
2016-01-12 13:28 ` [Gta04-owner] " H. Nikolaus Schaller
2016-01-13 19:15 ` Mark Rutland
2016-01-15 9:34 ` H. Nikolaus Schaller
2016-01-15 11:01 ` Mark Rutland
2016-01-15 15:05 ` H. Nikolaus Schaller
[not found] ` <69F8E1E5-EF49-4C8E-88E9-973F82F7102E-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-15 15:43 ` Andrey Vostrikov
2016-01-15 16:08 ` H. Nikolaus Schaller
[not found] ` <CB69F6F0-B40B-47D1-B175-8401F43288C5-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-15 17:16 ` Peter Hurley [this message]
[not found] ` <56992959.2020204-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2016-01-15 17:32 ` H. Nikolaus Schaller
2016-01-15 17:43 ` Peter Hurley
2016-01-15 17:58 ` H. Nikolaus Schaller
[not found] ` <69FAE2F5-25D1-4E5E-9FED-FC86773269D6-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-15 19:23 ` Peter Hurley
2016-01-15 21:24 ` H. Nikolaus Schaller
2016-01-15 22:40 ` Rob Herring
[not found] ` <CAL_JsqL=Wotz4FuoV7PULfZNfSV=S_q0iOzkckVA3NDDzMdfZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-16 7:34 ` Vostrikov Andrey
2016-01-16 23:31 ` Rob Herring
2016-01-17 8:53 ` H. Nikolaus Schaller
[not found] ` <3D5F35D7-31B5-4E68-875F-7DD492EF0316-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-17 14:19 ` One Thousand Gnomes
2016-01-17 17:57 ` H. Nikolaus Schaller
[not found] ` <1D5F146E-D347-453B-9158-8D269F8DA99C-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-17 19:38 ` One Thousand Gnomes
2016-01-18 8:17 ` H. Nikolaus Schaller
[not found] ` <37DCE36D-0A5E-41C5-BDA4-857DCF9F2DD1-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-18 8:56 ` Andrey Vostrikov
2016-01-18 11:52 ` H. Nikolaus Schaller
2016-01-18 11:19 ` One Thousand Gnomes
[not found] ` <20160118111926.0882b422@ lxorguk.ukuu.org.uk>
[not found] ` <20160118111926.0882b422-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2016-01-18 20:58 ` H. Nikolaus Schaller
[not found] ` <07F3B6C0-0C87-478C-B6DD-5C0EECB42D0D-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-18 22:03 ` One Thousand Gnomes
[not found] ` <20160118220319.051c9cc0-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2016-01-18 22:32 ` H. Nikolaus Schaller
[not found] ` <C1E6AFE7-1EF2-4C70-8BE2-82F5CD7DDE22-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-19 14:25 ` One Thousand Gnomes
[not found] ` <20160119142542.5bf64395-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2016-01-20 17:33 ` H. Nikolaus Schaller
2016-01-20 16:11 ` H. Nikolaus Schaller
[not found] ` <9E37C552-361C-4A54-980E-E3BFFF834302-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-20 17:46 ` One Thousand Gnomes
[not found] ` <20160120174610.1c64239a-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2016-01-20 18:03 ` H. Nikolaus Schaller
2016-01-21 10:01 ` Radek Polak
[not found] ` <39B850CE-E381-4D3B-BD0A-84AFE7DAEEDF-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-22 15:45 ` Tomeu Vizoso
2016-01-22 16:49 ` Rob Herring
[not found] ` <CAAObsKB4oFeM9Cjet5z+vz0S1M8RZ3jFt03b38KXq+sh6f5EwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-22 20:12 ` One Thousand Gnomes
[not found] ` <20160122201229.5df0bb2d-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2016-01-23 7:40 ` Andreas Kemnade
2016-01-23 12:19 ` H. Nikolaus Schaller
[not found] ` <DF404071-9FD0-4B33-B1B5-EC14192655E7-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-01-23 17:28 ` One Thousand Gnomes
2016-01-23 22:04 ` H. Nikolaus Schaller
2016-01-24 17:10 ` One Thousand Gnomes
2016-01-25 10:36 ` H. Nikolaus Schaller
2016-01-19 6:32 ` Andreas Kemnade
[not found] ` <744620565.20160116103445-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-01-20 19:38 ` Dmitry Torokhov
[not found] ` <CAKdAkRQh7xSgOXERhA8EjXEfX5m-PTTjiv757X7FYxK=bhfpww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-20 20:09 ` Vostrikov Andrey
2016-01-15 16:12 ` Mark Rutland
2016-01-15 19:16 ` H. Nikolaus Schaller
2016-01-15 19:40 ` Pavel Machek
2016-01-15 20:35 ` H. Nikolaus Schaller
[not found] ` <CAAObsKD7-02HVUosXVwqcH6HyGEGYJ9jdNepuNhLiiL+ujO5iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-12 21:28 ` NeilBrown
[not found] ` <87lh7u8p3b.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-01-13 19:00 ` Pavel Machek
Reply instructions:
You may reply publicly 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=56992959.2020204@hurleysoftware.com \
--to=peter-wagbzjegnqdsbiue7sb01tbpr1lh4cv8@public.gmane.org \
--cc=andrey.vostrikov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=gta04-owner-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
--cc=hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
--cc=jslaby-AlSwsSmVLrQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=neil-+NVA1uvv1dVBDLzU/O5InQ@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tomeu-XCtybt49RKsYaV1qd6yewg@public.gmane.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).