On Tue, Dec 8, 2015 at 12:20 PM, David Mandala firstname.lastname@example.org wrote:
On 12/8/15 12:10 PM, Kevin Hilman wrote:
Rob Herring email@example.com writes:
On Thu, Dec 3, 2015 at 10:35 PM, David Mandala firstname.lastname@example.org wrote:
It's the reason why we have UDEV rules now making the two UARTs on the LS connector /dev/tty96B0 and /dev/tty96B1 get rid of the confusion and make it MUCH easier to document things.
Anything in userspace that is 96boards specific is a flawed solution. These problems have nothing to do with 96boards, but are shortcomings in the kernel interfaces. Lets fix those and not be working around them.
Much better said than the rant I had written up but deleted.
I agree that the kernel space is the proper place to fix this but it will likely take years for that to happen, feel free to shock me and have a fix in the next kernel cycle. ;-P
It's simply a matter of adding label properties to UARTs in dts files and defining the strings to use. I feel confident the DT maintainers would be okay with that. Then you have to get that information, and there are a couple of ways we could do that. The first is already supported. You just have to mine sysfs for it:
for f in $(ls -d /sys/class/tty/tty*); do label=$(cat $f/device/of_node/label) if [ "$label" = "LS-UART1" ]; then # you've found UART1, so do something with it. # $f/dev is the major:minor for the /dev node fi done
We could also expose it in a path that is not DT specific (in case there's ever any other firmware inferface we care about). That could either be generically done for any device with a label property or for tty devices in particular.
What concerns me more is not this specific case, but what are other problems like this in general. These are all problems easy enough to work-around in userspace for a handful of boards. But let's stop doing that and push these problems back to engineering teams. Sure, sometimes the answer may be it will take years, but don't assume that or not ask for it.