How to deal with platform fragmentation, is the device tree the answer?

My task is to implement a user level with fixed names for things like Ethernet and LEDs.

It should be the same on x86 and ARM devices. Therefore, the power and eth1 LEDs are always the same for applications, but are not connected to the same hardware pins. From my point of view, I can do this on ARM with Tree Tree assignments. But can I use the device tree on x86-based boards for this? Is this a good practice?

Background: Objectives: a wide range of Linux embedded cards, Buildsystem: Buildroot, custom Linux kernel versions, no Linux distribution, Busybox runs on top

+4
source share
2 answers

TL DR - The device tree is not the answer you are looking for. There are many ways to do this, depending on your final needs.


PowerPC. . , , CPU/SOC. , TI OMAP . , CPU ( Ethernet MII/RMII ..) , , .. TI OMAP SOC, . - SOC . SOC ( ).

- , .


, . ...

  • .
  • NetLink
  • ( )
  • PROCFS
  • sysfs
  • debugfs
  • Udev/mdev
  • GPIO
  • select (/)

3-6 . , . , PIN-, , . , , , ( ), /. , - RS-232 ? ( inotify .. ). netlink - . , ( ).

mdev udev netlink, / PCI, USB .. GPIO. /sys/class/output/led 1 /dev/my_company/power_led mdev/udev script.

, . eth1, ? , Ethernet? - , . , , eth1 eth0?

+2

sysfs.

, /sys/class/net/eth0/. , .

x86/ARM . , , wpa_supplicant .

+2

Source: https://habr.com/ru/post/1624994/


All Articles