ACPI: erinevus redaktsioonide vahel

Allikas: Imre kasutab arvutit
Mine navigeerimisribaleMine otsikasti
 
(ei näidata sama kasutaja 39 vahepealset redaktsiooni)
11. rida: 11. rida:
 
* GPIO - General Purpose I/O
 
* GPIO - General Purpose I/O
 
* KCS - Keyboard Controller Style
 
* KCS - Keyboard Controller Style
  +
* DSDT - Differentiated System Description Table
  +
* SSDT - Secondary System Description Tables
   
 
===Tööpõhimõte===
 
===Tööpõhimõte===
  +
  +
Kui nö tavaline arvuti on ettevalmistatud nt Ubuntu operatsioonisüsteemiga kasutamiseks ja töökorras, siis arvuti käivitumisel toimub muu hulgas selline sündmuste järgnevus
  +
  +
* toide lülitatakse sisse
  +
* arvuti teeb POST (power on self test) laadse kontrolli oma seadmete koosseisu kohta
  +
* cpu peal hakkab tööle uefi lahendus
  +
* uefi lõpetamisel ja enne linux kernelile arvuti riistvara üle kontrolli üleandmist, viimase tegevusena uefi moodustab arvuti mällu acpi tabelid
  +
* acpi tabelid sisaldavad 1. inventory nimekirja, 2. teatud seadmetega suhtlemiseks vajalikku koodi (nn acpi-drivers)
  +
* linux kernel laaditakse mällu ja acpi tabelite abil saab linux kernel teada, millises riistvaralises keskkonnas ta töötab (ta oskab buildin mooduleid aktiveerida, kinnitada nad mälus sobivatele aadressidele, laadida mällu eraldiseisvaid .ko mooduleid jms)
  +
* jätkub operatsioonisüsteemi käivitumine, systemd jne
  +
  +
Väited
  +
  +
* acpi mõju kirjeldatakse nö maakaartide komplektina, mille abil linux kernel leiab üles tee riistvara erinevate komponentide juurde
  +
* acpi tabelites on kirjas standardsel viisil esitatud riivara mudelite jms nimetused
  +
* acpi tegeleb peamiselt non-pcie ja non-usb seadmetega
  +
* acpi tegeleb nt protsessoriga, mäluga, igasuguste embedder controllerite, i2c chip'ide, rtc (real time clock), taimerite, PS/2 klaviatuuri ja hiirega, temperatuuri, chassis, laptop kaane jms anduritega
  +
* pcie ja usb osakonna eest hoolitsevad pcie ja usb siinid ise (nad on nö enumeration võimelised, erinevalt plug-and-play jms legacy seadmetest)
   
 
TODO
 
TODO
18. rida: 38. rida:
 
* ACPI - supervisor
 
* ACPI - supervisor
 
* EC/SMBus/KCS - worker
 
* EC/SMBus/KCS - worker
  +
  +
====ACPI override====
  +
  +
Sarnaselt cpu microcode rakendamisele, mis tekitab nö protective-layer'i kerneli ja füüsilise protsessori vahele on olemas ka acpi puhul võimalus korrigeerida linux kerneli jaoks füüsilise acpi osakonna probleeme. Seda saab teha paketi acpi-override-initramfs abil
  +
  +
# apt-get install acpi-override-initramfs
  +
  +
Tulemusena lisatakse initrd koosseisu dsdt, ssdt vms tabel ja seda kasutatakse uefi juurest tuleva vastava tabeli asemel.
  +
  +
Väited
  +
  +
* põhimõtteliselt on acpi oveeride kasutamine vastuolus secure boot kasutamisega
   
 
===Misc===
 
===Misc===
118. rida: 150. rida:
 
10. PXSX S4 *disabled
 
10. PXSX S4 *disabled
 
11. XHCI S3 *enabled pci:0000:00:14.0
 
11. XHCI S3 *enabled pci:0000:00:14.0
  +
</pre>
   
  +
kus
  +
  +
* Sysfs node - esitatakse väärtused samamoodi programmiga systool
  +
  +
<pre>
 
root@ubu2110:~# lspci | grep 00:1f.6
 
root@ubu2110:~# lspci | grep 00:1f.6
 
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
 
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
131. rida: 169. rida:
 
TODO
 
TODO
   
===Arvuti käivitumine===
+
===Misc===
  +
  +
nt laptop kaane nupp
  +
  +
<pre>
  +
root@ubu2110:~# find /sys/devices/ -name PNP0C0D:00 -ls
  +
8108 0 drwxr-xr-x 3 root root 0 okt 5 01:10 /sys/devices/platform/PNP0C0D:00
  +
6170 0 drwxr-xr-x 5 root root 0 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00
  +
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00 | grep -A 5 "looking at"
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00':
  +
KERNEL=="PNP0C0D:00"
  +
SUBSYSTEM=="acpi"
  +
DRIVER=="button"
  +
ATTR{hid}=="PNP0C0D"
  +
ATTR{path}=="\_SB_.LID_"
  +
--
  +
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
  +
KERNELS=="LNXSYBUS:00"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
--
  +
looking at parent device '/devices/LNXSYSTM:00':
  +
KERNELS=="LNXSYSTM:00"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
  +
root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00/modalias
  +
acpi:PNP0C0D:
  +
  +
root@ubu2110:~# grep button /lib/modules/5.15.0-140-generic/modules.builtin
  +
kernel/drivers/acpi/button.ko
  +
  +
root@ubu2110:~# dmesg | grep PWR
  +
[ 0.323534] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
  +
[ 0.323553] ACPI: button: Power Button [PWRF]
  +
</pre>
  +
  +
===PnP - klassikaline===
  +
  +
Nö klassikalised PnP seadmed asuvad pnp nimelisel siinil
  +
  +
<pre>
  +
root@pve-02:~# systool -b pnp
  +
Bus = "pnp"
  +
  +
Device = "00:00"
  +
Device = "00:01"
  +
Device = "00:02"
  +
Device = "00:03"
  +
Device = "00:04"
  +
Device = "00:05"
  +
</pre>
  +
  +
====RTC CMOS====
  +
  +
Klassikaline RTC CMOS seade
  +
  +
<pre>
  +
root@pve-02:~# systool -b pnp -v -d 00:01
  +
Bus = "pnp"
  +
  +
Device = "00:01"
  +
Device path = "/sys/devices/pnp0/00:01"
  +
id = "PNP0b00"
  +
options =
  +
resources = "state = active
  +
io 0x70-0x71"
  +
uevent = "DRIVER=rtc_cmos"
  +
</pre>
  +
  +
kus x86 arhitektuuril on praktilisel alati kasutusel sellised väärtused
  +
  +
* id - PNP0b00
  +
* io - 0x70 - 0x71
  +
* driver - rtc_cmos
  +
  +
udevadmin abil info küsimine
  +
  +
<pre>
  +
root@pve-02:~# udevadm info -a -p /sys/devices/pnp0/00:01
  +
  +
Udevadm info starts with the device specified by the devpath and then
  +
walks up the chain of parent devices. It prints for every device
  +
found, all possible attributes in the udev rules key format.
  +
A rule to match, can be composed by the attributes of the device
  +
and the attributes from one single parent device.
  +
  +
looking at device '/devices/pnp0/00:01':
  +
KERNEL=="00:01"
  +
SUBSYSTEM=="pnp"
  +
DRIVER=="rtc_cmos"
  +
ATTR{id}=="PNP0b00"
  +
ATTR{options}==""
  +
ATTR{power/async}=="disabled"
  +
...
  +
</pre>
  +
  +
Samale rtc seadmele kaks perspektiivi
  +
  +
<pre>
  +
root@pve-svc-01:~# systool -b acpi -v -d PNP0B00:00
  +
Bus = "acpi"
  +
  +
Device = "PNP0B00:00"
  +
Device path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0B00:00"
  +
hid = "PNP0B00"
  +
modalias = "acpi:PNP0B00:"
  +
path = "\_SB_.PCI0.SBRG.RTC0"
  +
uevent = "MODALIAS=acpi:PNP0B00:"
  +
  +
root@pve-svc-01:~# systool -b pnp -v -d 00:03
  +
Bus = "pnp"
  +
  +
Device = "00:03"
  +
Device path = "/sys/devices/pnp0/00:03"
  +
id = "PNP0b00"
  +
options =
  +
resources = "state = active
  +
io 0x70-0x71"
  +
uevent = "DRIVER=rtc_cmos"
  +
</pre>
  +
  +
====Klassikaline serial port - COM1====
  +
  +
<pre>
  +
root@pm60-trt:~# systool -b pnp -v -d 00:03
  +
Bus = "pnp"
  +
  +
Device = "00:03"
  +
Device path = "/sys/devices/pnp0/00:03"
  +
id = "PNP0501"
  +
options = "Dependent: 00 - Priority preferred
  +
port 0x3f8-0x3f8, align 0x0, size 0x8, 16-bit address decoding
  +
irq 4 High-Edge
  +
dma <none> 8-bit compatible
  +
Dependent: 01 - Priority acceptable
  +
port 0x3f8-0x3f8, align 0x0, size 0x8, 16-bit address decoding
  +
irq 4 High-Edge
  +
dma <none> 8-bit compatible
  +
Dependent: 02 - Priority acceptable
  +
port 0x2f8-0x2f8, align 0x0, size 0x8, 16-bit address decoding
  +
irq 3 High-Edge
  +
dma <none> 8-bit compatible
  +
Dependent: 03 - Priority acceptable
  +
port 0x3e8-0x3e8, align 0x0, size 0x8, 16-bit address decoding
  +
irq 4 High-Edge
  +
dma <none> 8-bit compatible
  +
Dependent: 04 - Priority acceptable
  +
port 0x2e8-0x2e8, align 0x0, size 0x8, 16-bit address decoding
  +
irq 3 High-Edge
  +
dma <none> 8-bit compatible"
  +
resources = "state = active
  +
io 0x3f8-0x3ff
  +
irq 4
  +
dma disabled"
  +
uevent = "DRIVER=serial"
  +
</pre>
  +
  +
kus x86 arhitektuuril on praktilisel alati kasutusel sellised väärtused
  +
  +
* id - PNP0501
  +
* io - 0x3f8 - 0x3ff
  +
* driver - serial
  +
* option - pikk nimekiri nö võimalikest alternatiivsetest lähenemistest
  +
  +
udevadm abil info küsimine
  +
  +
<pre>
  +
root@pve-02:~# udevadm info -a -p /sys/devices/pnp0/00:03
  +
  +
Udevadm info starts with the device specified by the devpath and then
  +
walks up the chain of parent devices. It prints for every device
  +
found, all possible attributes in the udev rules key format.
  +
A rule to match, can be composed by the attributes of the device
  +
and the attributes from one single parent device.
  +
  +
looking at device '/devices/pnp0/00:03':
  +
KERNEL=="00:03"
  +
SUBSYSTEM=="pnp"
  +
DRIVER=="serial"
  +
ATTR{id}=="PNP0501"
  +
ATTR{power/async}=="disabled"
  +
...
  +
</pre>
  +
  +
===PnP - mitte-klassikaline===
  +
  +
chatgpt ülevaade
  +
  +
<pre>
  +
ACPI ID Meaning Notes
  +
PNP0C0C Power Button ACPI power event device
  +
PNP0C0D Lid Button Laptop lid open/close
  +
PNP0C0E Sleep Button Optional ACPI control
  +
PNP0800 System Speaker Legacy beeper
  +
PNP0103 System Timer Legacy PIT timer
  +
PNP0C09 Embedded Controller Handles thermal/fan/power
  +
PNP0C14 Windows Management Instrumentation device ACPI-WMI interface
  +
</pre>
  +
  +
====Toitenupp====
  +
  +
Tundub, et toitenupp on x86 desktop tüüpi arvutitel standardses kohas
  +
  +
* id - PNP0C0C:00
  +
  +
<pre>
  +
root@pve-svc-01:~# systool -b platform
  +
Bus = "platform"
  +
  +
Device = "AMDI0030:00"
  +
Device = "Fixed MDIO bus.0"
  +
Device = "MSFT0101:00"
  +
Device = "PNP0103:00"
  +
Device = "PNP0800:00"
  +
Device = "PNP0C0C:00"
  +
Device = "PNP0C14:00"
  +
Device = "PNP0C14:01"
  +
Device = "acpi-cpufreq"
  +
Device = "alarmtimer.0.auto"
  +
Device = "efivars.0"
  +
Device = "eisa.0"
  +
Device = "intel_rapl_msr.0"
  +
Device = "kgdboc"
  +
Device = "microcode"
  +
Device = "pcspkr"
  +
Device = "reg-dummy"
  +
Device = "regulatory.0"
  +
Device = "rtc-efi.0"
  +
Device = "serial8250"
  +
  +
root@pve-svc-01:~# systool -b platform -v -d PNP0C0C:00
  +
Bus = "platform"
  +
  +
Device = "PNP0C0C:00"
  +
Device path = "/sys/devices/platform/PNP0C0C:00"
  +
driver_override = "(null)"
  +
modalias = "acpi:PNP0C0C:"
  +
uevent = "MODALIAS=acpi:PNP0C0C:"
  +
waiting_for_supplier= "0"
  +
  +
root@pve-svc-01:~# find /sys/devices/ -name PNP0C0C:00
  +
/sys/devices/platform/PNP0C0C:00
  +
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00
  +
</pre>
  +
  +
kus
  +
  +
* teist kasutades udevadm argumendina saab info draiveri kohta jms, esimese abil ei saa
  +
  +
<pre>
  +
root@pve-svc-01:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00 | head -n 15
  +
  +
Udevadm info starts with the device specified by the devpath and then
  +
walks up the chain of parent devices. It prints for every device
  +
found, all possible attributes in the udev rules key format.
  +
A rule to match, can be composed by the attributes of the device
  +
and the attributes from one single parent device.
  +
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00':
  +
KERNEL=="PNP0C0C:00"
  +
SUBSYSTEM=="acpi"
  +
DRIVER=="button"
  +
ATTR{hid}=="PNP0C0C"
  +
ATTR{path}=="\_SB_.PWRB"
  +
ATTR{power/async}=="disabled"
  +
ATTR{power/control}=="auto"
  +
</pre>
  +
  +
kus
  +
  +
* näeb et tegu on nupuga
  +
* täpsemalt, pwrb st toitenupuga
  +
  +
Toitenupu mõju
  +
  +
* toitenupu vajutuse signaali korjab acpi osakond üles
  +
* signaal saadetakse operatsioonisüsteemile
  +
* signaaline reagreeritake shutdown protseduuri käivitamisega
  +
* shutdown protseduuri lõpus saadetakse signaal üle acpi kokkuvõtte toiteplokile ja toiteplokk lülitatakse välja
  +
  +
====Sleep button====
  +
  +
<pre>
  +
root@ubu2110:~# systool -b platform -d PNP0C0E:00 -v
  +
Bus = "platform"
  +
  +
Device = "PNP0C0E:00"
  +
Device path = "/sys/devices/platform/PNP0C0E:00"
  +
driver_override = "(null)"
  +
modalias = "acpi:PNP0C0E:"
  +
uevent = "MODALIAS=acpi:PNP0C0E:"
  +
waiting_for_supplier= "0"
  +
  +
root@ubu2110:~# find /sys/devices/ -name PNP0C0E:00
  +
/sys/devices/platform/PNP0C0E:00
  +
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00
  +
  +
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00
  +
  +
Udevadm info starts with the device specified by the devpath and then
  +
walks up the chain of parent devices. It prints for every device
  +
found, all possible attributes in the udev rules key format.
  +
A rule to match, can be composed by the attributes of the device
  +
and the attributes from one single parent device.
  +
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00':
  +
KERNEL=="PNP0C0E:00"
  +
SUBSYSTEM=="acpi"
  +
DRIVER=="button"
  +
ATTR{hid}=="PNP0C0E"
  +
ATTR{path}=="\_SB_.SLPB"
  +
ATTR{power/async}=="disabled"
  +
</pre>
  +
  +
kus
  +
  +
* _SB.SLPB - system bus, sleep button
  +
  +
====TPM moodul====
  +
  +
non-pci jms tüüpi seadmega seotud info leidmine, nt tpm moodul
  +
  +
<pre>
  +
root@ubu2110:~# systool -b platform
  +
Bus = "platform"
  +
  +
Device = "ACPI0003:00"
  +
Device = "Fixed MDIO bus.0"
  +
Device = "LEN0068:00"
  +
Device = "MSFT0101:00"
  +
Device = "PNP0103:00"
  +
Device = "PNP0800:00"
  +
Device = "PNP0C04:00"
  +
Device = "PNP0C09:00"
  +
Device = "PNP0C0A:00"
  +
Device = "PNP0C0D:00"
  +
Device = "PNP0C0E:00"
  +
Device = "PNP0C14:00"
  +
Device = "PNP0C14:01"
  +
Device = "PNP0C14:02"
  +
Device = "alarmtimer.0.auto"
  +
Device = "coretemp.0"
  +
Device = "efivars.0"
  +
Device = "eisa.0"
  +
Device = "i8042"
  +
Device = "intel_pmc_core.0"
  +
Device = "intel_rapl_msr.0"
  +
Device = "kgdboc"
  +
Device = "microcode"
  +
Device = "pcspkr"
  +
Device = "reg-dummy"
  +
Device = "regulatory.0"
  +
Device = "rtc-efi.0"
  +
Device = "rtsx_pci_sdmmc.0"
  +
Device = "serial8250"
  +
Device = "thinkpad_acpi"
  +
Device = "thinkpad_hwmon"
  +
Device = "vboxdrv.0"
  +
  +
root@ubu2110:~# find /sys/devices/ -name MSFT0101:00 -ls
  +
9680 0 drwxr-xr-x 3 root root 0 okt 5 01:10 /sys/devices/platform/MSFT0101:00
  +
8004 0 drwxr-xr-x 5 root root 0 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00
  +
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00 | grep -A 3 "looking a"
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00':
  +
KERNEL=="MSFT0101:00"
  +
SUBSYSTEM=="acpi"
  +
DRIVER=="tpm_crb"
  +
--
  +
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
  +
KERNELS=="LNXSYBUS:00"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
--
  +
looking at parent device '/devices/LNXSYSTM:00':
  +
KERNELS=="LNXSYSTM:00"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
</pre>
  +
  +
kus
  +
  +
* saadakse teada, et tpm seadmega tegeleb driver tpm_crb
  +
* seejuures ei kasutata praktiliselt modalias süsteemi kuna driaver on builtin
  +
  +
<pre>
  +
root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/MSFT0101\:00/modalias
  +
acpi:MSFT0101:
  +
  +
root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.alias
  +
  +
root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.builtin
  +
kernel/drivers/char/tpm/tpm_crb.ko
  +
</pre>
  +
  +
====EC - embbeded controller====
  +
  +
Embedded controller
  +
  +
<pre>
  +
root@pm60-trt:~# systool -b platform -d PNP0C09:00 -v
  +
Bus = "platform"
  +
  +
Device = "PNP0C09:00"
  +
Device path = "/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00"
  +
driver_override = "(null)"
  +
modalias = "acpi:PNP0C09:"
  +
uevent = "MODALIAS=acpi:PNP0C09:"
  +
waiting_for_supplier= "0"
  +
  +
root@pm60-trt:~# lspci | grep 00:14
  +
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 59)
  +
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
  +
  +
root@pm60-trt:~# find /sys/devices/ -name PNP0C09:00
  +
/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00
  +
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00
  +
  +
root@pm60-trt:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00 | grep -A 5 "looking a"
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00':
  +
KERNEL=="PNP0C09:00"
  +
SUBSYSTEM=="acpi"
  +
DRIVER=="ec"
  +
ATTR{hid}=="PNP0C09"
  +
ATTR{path}=="\_SB_.PCI0.SBRG.EC0_"
  +
--
  +
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f':
  +
KERNELS=="device:2f"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
ATTRS{adr}=="0x00140003"
  +
ATTRS{path}=="\_SB_.PCI0.SBRG"
  +
--
  +
...
  +
</pre>
  +
  +
===PCIE===
  +
  +
Väited
  +
  +
* TODO
  +
  +
PCI bus nimekiri, sisuliselt sama, mis lspci programmi väljund
  +
  +
<pre>
  +
root@pve-svc-01:~# systool -b pci
  +
Bus = "pci"
  +
  +
0000:00:00.0 Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
  +
0000:00:01.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
  +
0000:00:01.1 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  +
0000:00:01.2 Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
  +
0000:00:01.3 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  +
0000:00:02.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
  +
0000:00:02.2 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  +
0000:00:08.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
  +
  +
...
  +
</pre>
  +
  +
'ACPI system root node', standardne nimi
  +
  +
<pre>
  +
/sys/devices/LNXSYSTM:00
  +
</pre>
   
  +
ning
Väited, 'ACPI system root node'
 
   
 
<pre>
 
<pre>
235. rida: 737. rida:
 
-r--r--r-- 1 root root 4096 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/waiting_for_supplier
 
-r--r--r-- 1 root root 4096 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/waiting_for_supplier
 
</pre>
 
</pre>
  +
  +
kus
  +
  +
* physical_node ja firmware_node viitavad linkidega üksteisele - sama nähtuse erinevad vaated
   
 
ja konkreetne pcie seade
 
ja konkreetne pcie seade
271. rida: 777. rida:
 
* systemd juhib udevd osakonda
 
* systemd juhib udevd osakonda
   
===Misc===
+
===I2C===
   
  +
TODO
non-pci jms tüüpi seadmega seotud info leidmine, nt tpm moodul
 
  +
  +
===platform===
  +
  +
TODO
  +
  +
===serio===
  +
  +
TODO
   
 
<pre>
 
<pre>
root@ubu2110:~# systool -b platform
+
root@ubu2110:~# systool -b serio
Bus = "platform"
+
Bus = "serio"
   
Device = "ACPI0003:00"
+
Device = "serio0"
Device = "Fixed MDIO bus.0"
+
Device = "serio1"
Device = "LEN0068:00"
+
Device = "serio2"
Device = "MSFT0101:00"
 
Device = "PNP0103:00"
 
Device = "PNP0800:00"
 
Device = "PNP0C04:00"
 
Device = "PNP0C09:00"
 
Device = "PNP0C0A:00"
 
Device = "PNP0C0D:00"
 
Device = "PNP0C0E:00"
 
Device = "PNP0C14:00"
 
Device = "PNP0C14:01"
 
Device = "PNP0C14:02"
 
Device = "alarmtimer.0.auto"
 
Device = "coretemp.0"
 
Device = "efivars.0"
 
Device = "eisa.0"
 
Device = "i8042"
 
Device = "intel_pmc_core.0"
 
Device = "intel_rapl_msr.0"
 
Device = "kgdboc"
 
Device = "microcode"
 
Device = "pcspkr"
 
Device = "reg-dummy"
 
Device = "regulatory.0"
 
Device = "rtc-efi.0"
 
Device = "rtsx_pci_sdmmc.0"
 
Device = "serial8250"
 
Device = "thinkpad_acpi"
 
Device = "thinkpad_hwmon"
 
Device = "vboxdrv.0"
 
   
root@ubu2110:~# find /sys/devices/ -name MSFT0101:00 -ls
+
root@ubu2110:~# systool -b serio -v -d serio0
  +
Bus = "serio"
9680 0 drwxr-xr-x 3 root root 0 okt 5 01:10 /sys/devices/platform/MSFT0101:00
 
  +
8004 0 drwxr-xr-x 5 root root 0 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00
 
  +
Device = "serio0"
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00 | grep -A 3 "looking a"
 
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00':
+
Device path = "/sys/devices/platform/i8042/serio0"
  +
bind_mode = "auto"
KERNEL=="MSFT0101:00"
 
  +
description = "i8042 KBD port"
SUBSYSTEM=="acpi"
 
  +
drvctl = <store method only>
DRIVER=="tpm_crb"
 
  +
err_count = "0"
  +
extra = "0"
  +
firmware_id = "PNP: LEN0071 PNP0303"
  +
force_release = "369-370"
  +
modalias = "serio:ty06pr00id00ex00"
  +
scroll = "0"
  +
set = "2"
  +
softraw = "1"
  +
softrepeat = "0"
  +
uevent = "DRIVER=atkbd
  +
SERIO_TYPE=06
  +
SERIO_PROTO=00
  +
SERIO_ID=00
  +
SERIO_EXTRA=00
  +
MODALIAS=serio:ty06pr00id00ex00
  +
SERIO_FIRMWARE_ID=PNP: LEN0071 PNP0303"
  +
  +
root@ubu2110:~# udevadm info -a -p /sys/devices/platform/i8042/serio0 | grep -A 3 "looking at"
  +
looking at device '/devices/platform/i8042/serio0':
  +
KERNEL=="serio0"
  +
SUBSYSTEM=="serio"
  +
DRIVER=="atkbd"
 
--
 
--
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
+
looking at parent device '/devices/platform/i8042':
KERNELS=="LNXSYBUS:00"
+
KERNELS=="i8042"
SUBSYSTEMS=="acpi"
+
SUBSYSTEMS=="platform"
DRIVERS==""
+
DRIVERS=="i8042"
 
--
 
--
looking at parent device '/devices/LNXSYSTM:00':
+
looking at parent device '/devices/platform':
KERNELS=="LNXSYSTM:00"
+
KERNELS=="platform"
SUBSYSTEMS=="acpi"
+
SUBSYSTEMS==""
 
DRIVERS==""
 
DRIVERS==""
  +
  +
root@ubu2110:~# modinfo atkbd
  +
name: atkbd
  +
filename: (builtin)
  +
license: GPL
  +
file: drivers/input/keyboard/atkbd
  +
description: AT and PS/2 keyboard driver
  +
author: Vojtech Pavlik <vojtech@suse.cz>
  +
parm: set:Select keyboard code set (2 = default, 3 = PS/2 native) (int)
  +
parm: reset:Reset keyboard during initialization (bool)
  +
parm: softrepeat:Use software keyboard repeat (bool)
  +
parm: softraw:Use software generated rawmode (bool)
  +
parm: scroll:Enable scroll-wheel on MS Office and similar keyboards (bool)
  +
parm: extra:Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards (bool)
  +
parm: terminal:Enable break codes on an IBM Terminal keyboard connected via AT/PS2 (bool)
 
</pre>
 
</pre>
   
  +
===usb===
kus
 
   
  +
====ethernet over usb====
* saadakse teada, et tpm seadmega tegeleb driver tpm_crb
 
* seejuures ei kasutata praktiliselt modalias süsteemi kuna driaver on builtin
 
   
 
<pre>
 
<pre>
  +
root@ubu2110:~# lsusb
root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/MSFT0101\:00/modalias
 
  +
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
acpi:MSFT0101:
 
  +
Bus 001 Device 006: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
  +
Bus 001 Device 005: ID 04f2:b541 Chicony Electronics Co., Ltd Integrated Camera
  +
Bus 001 Device 004: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
  +
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. VFS7500 Touch Fingerprint Sensor
  +
Bus 001 Device 002: ID 046d:c30e Logitech, Inc. UltraX Keyboard (Y-BL49)
  +
Bus 001 Device 018: ID 0bda:8152 Realtek Semiconductor Corp. RTL8152 Fast Ethernet Adapter
   
root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.alias
+
root@ubu2110:~# systool -b usb
  +
Bus = "usb"
  +
  +
Device = "1-0:1.0"
  +
Device = "1-2:1.0"
  +
Device = "1-2"
  +
Device = "1-4:1.0"
  +
Device = "1-4:1.1"
  +
Device = "1-4"
  +
Device = "1-6:1.0"
  +
Device = "1-6"
  +
Device = "1-7"
  +
Device = "1-7:1.0"
  +
Device = "1-7:1.1"
  +
Device = "1-8:1.0"
  +
Device = "1-8:1.1"
  +
Device = "1-8"
  +
Device = "1-9:1.0"
  +
Device = "1-9"
  +
Device = "2-0:1.0"
  +
Device = "usb1"
  +
Device = "usb2"
   
root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.builtin
+
root@ubu2110:~# systool -b usb -v -d "1-2:1.0"
  +
Bus = "usb"
kernel/drivers/char/tpm/tpm_crb.ko
 
  +
  +
Device = "1-2:1.0"
  +
Device path = "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0"
  +
authorized = "1"
  +
bAlternateSetting = " 0"
  +
bInterfaceClass = "ff"
  +
bInterfaceNumber = "00"
  +
bInterfaceProtocol = "00"
  +
bInterfaceSubClass = "ff"
  +
bNumEndpoints = "03"
  +
modalias = "usb:v0BDAp8152d2000dc00dsc00dp00icFFiscFFip00in00"
  +
supports_autosuspend= "1"
  +
uevent = "DEVTYPE=usb_interface
  +
DRIVER=r8152
  +
PRODUCT=bda/8152/2000
  +
TYPE=0/0/0
  +
INTERFACE=255/255/0
  +
MODALIAS=usb:v0BDAp8152d2000dc00dsc00dp00icFFiscFFip00in00"
 
</pre>
 
</pre>
   
  +
kus
nt toitenupp
 
  +
  +
* product 'bda' klapib lsusb realtek seadme rea infoga
   
 
<pre>
 
<pre>
root@ubu2110:~# find /sys/devices/ -name PNP0C0D:00 -ls
+
root@ubu2110:~# udevadm info -a -p "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0" | grep -A 3 "looking at"
  +
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0':
8108 0 drwxr-xr-x 3 root root 0 okt 5 01:10 /sys/devices/platform/PNP0C0D:00
 
  +
KERNEL=="1-2:1.0"
6170 0 drwxr-xr-x 5 root root 0 okt 5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00
 
  +
SUBSYSTEM=="usb"
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00 | grep -A 3 "looking at"
 
  +
DRIVER=="r8152"
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00':
 
KERNEL=="PNP0C0D:00"
 
SUBSYSTEM=="acpi"
 
DRIVER=="button"
 
 
--
 
--
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
+
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-2':
KERNELS=="LNXSYBUS:00"
+
KERNELS=="1-2"
SUBSYSTEMS=="acpi"
+
SUBSYSTEMS=="usb"
DRIVERS==""
+
DRIVERS=="r8152-cfgselector"
  +
--
  +
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1':
  +
KERNELS=="usb1"
  +
SUBSYSTEMS=="usb"
  +
DRIVERS=="usb"
  +
--
  +
looking at parent device '/devices/pci0000:00/0000:00:14.0':
  +
KERNELS=="0000:00:14.0"
  +
SUBSYSTEMS=="pci"
  +
DRIVERS=="xhci_hcd"
 
--
 
--
looking at parent device '/devices/LNXSYSTM:00':
+
looking at parent device '/devices/pci0000:00':
KERNELS=="LNXSYSTM:00"
+
KERNELS=="pci0000:00"
SUBSYSTEMS=="acpi"
+
SUBSYSTEMS==""
 
DRIVERS==""
 
DRIVERS==""
   
root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00/modalias
+
root@ubu2110:~# modinfo r8152
  +
filename: /lib/modules/5.15.0-140-generic/kernel/drivers/net/usb/r8152.ko
acpi:PNP0C0D:
 
  +
version: v1.12.13
 
  +
license: GPL
root@ubu2110:~# grep button /lib/modules/5.15.0-140-generic/modules.builtin
 
  +
description: Realtek RTL8152/RTL8153 Based USB Ethernet Adapters
kernel/drivers/acpi/button.ko
 
  +
author: Realtek linux nic maintainers <nic_swsd@realtek.com>
 
  +
firmware: rtl_nic/rtl8156b-2.fw
root@ubu2110:~# dmesg | grep PWR
 
  +
firmware: rtl_nic/rtl8156a-2.fw
[ 0.323534] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
 
  +
firmware: rtl_nic/rtl8153c-1.fw
[ 0.323553] ACPI: button: Power Button [PWRF]
 
  +
firmware: rtl_nic/rtl8153b-2.fw
  +
firmware: rtl_nic/rtl8153a-4.fw
  +
firmware: rtl_nic/rtl8153a-3.fw
  +
firmware: rtl_nic/rtl8153a-2.fw
  +
srcversion: 45F2FB1C5EDA0E06263CD86
 
</pre>
 
</pre>
   
===PnP - klassikaline===
+
===Olematu seadme ACPI sissekanne===
   
  +
Selline olukord vastab olematule seadmele kuigi iseenesest ACPI tabelites on sissekanne olemas
Nö klassikalised PnP seadmed asuvad pnp nimelisel siinil
 
   
 
<pre>
 
<pre>
root@pve-02:~# systool -b pnp
+
root@ubu2110:~# systool -b acpi | grep PNP0200
Bus = "pnp"
+
Device = "PNP0200:00"
   
  +
root@ubu2110:~# systool -b acpi -v -d PNP0200:00
Device = "00:00"
 
Device = "00:01"
+
Bus = "acpi"
Device = "00:02"
 
Device = "00:03"
 
Device = "00:04"
 
Device = "00:05"
 
</pre>
 
   
  +
Device = "PNP0200:00"
====RTC CMOS====
 
  +
Device path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00"
  +
hid = "PNP0200"
  +
modalias = "acpi:PNP0200:"
  +
path = "\_SB_.PCI0.LPC_.DMAC"
  +
uevent = "MODALIAS=acpi:PNP0200:"
   
  +
root@ubu2110:~# find /sys/devices/ -name PNP0200:00
Klassikaline RTC CMOS seade
 
  +
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00
   
  +
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00
<pre>
 
  +
root@pve-02:~# systool -b pnp -v -d 00:01
 
  +
Udevadm info starts with the device specified by the devpath and then
Bus = "pnp"
 
  +
walks up the chain of parent devices. It prints for every device
  +
found, all possible attributes in the udev rules key format.
  +
A rule to match, can be composed by the attributes of the device
  +
and the attributes from one single parent device.
   
  +
looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00':
Device = "00:01"
 
  +
KERNEL=="PNP0200:00"
Device path = "/sys/devices/pnp0/00:01"
 
  +
SUBSYSTEM=="acpi"
id = "PNP0b00"
 
  +
DRIVER==""
options =
 
  +
ATTR{hid}=="PNP0200"
resources = "state = active
 
  +
ATTR{path}=="\_SB_.PCI0.LPC_.DMAC"
io 0x70-0x71"
 
  +
ATTR{power/async}=="disabled"
uevent = "DRIVER=rtc_cmos"
 
  +
ATTR{power/control}=="auto"
  +
ATTR{power/runtime_active_kids}=="0"
  +
ATTR{power/runtime_active_time}=="0"
  +
ATTR{power/runtime_enabled}=="disabled"
  +
ATTR{power/runtime_status}=="unsupported"
  +
ATTR{power/runtime_suspended_time}=="0"
  +
ATTR{power/runtime_usage}=="0"
  +
  +
looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00':
  +
KERNELS=="device:00"
  +
SUBSYSTEMS=="acpi"
  +
DRIVERS==""
  +
ATTRS{adr}=="0x001f0000"
  +
ATTRS{path}=="\_SB_.PCI0.LPC_"
  +
ATTRS{power/async}=="disabled"
  +
..
 
</pre>
 
</pre>
   
  +
* KERNEL=="PNP0200:00", SUBSYSTEM=="acpi", DRIVER=="" - linux ei ole draiverit kinnitanud seadme külge
kus x86 arhitektuuril on praktilisel alati kasutusel sellised väärtused
 
 
* id - PNP0b00
 
* io - 0x70 - 0x71
 
* driver - rtc_cmos
 
   
 
===Kasulikud lisamaterjalid===
 
===Kasulikud lisamaterjalid===

Viimane redaktsioon: 13. oktoober 2025, kell 15:58

Sissejuhatus

TODO

Mõisted

  • ACPI - advanced configuration and power interface
  • AML - acpi machine language
  • EC - embedder controller
  • SMBus - system management bus
  • GPIO - General Purpose I/O
  • KCS - Keyboard Controller Style
  • DSDT - Differentiated System Description Table
  • SSDT - Secondary System Description Tables

Tööpõhimõte

Kui nö tavaline arvuti on ettevalmistatud nt Ubuntu operatsioonisüsteemiga kasutamiseks ja töökorras, siis arvuti käivitumisel toimub muu hulgas selline sündmuste järgnevus

  • toide lülitatakse sisse
  • arvuti teeb POST (power on self test) laadse kontrolli oma seadmete koosseisu kohta
  • cpu peal hakkab tööle uefi lahendus
  • uefi lõpetamisel ja enne linux kernelile arvuti riistvara üle kontrolli üleandmist, viimase tegevusena uefi moodustab arvuti mällu acpi tabelid
  • acpi tabelid sisaldavad 1. inventory nimekirja, 2. teatud seadmetega suhtlemiseks vajalikku koodi (nn acpi-drivers)
  • linux kernel laaditakse mällu ja acpi tabelite abil saab linux kernel teada, millises riistvaralises keskkonnas ta töötab (ta oskab buildin mooduleid aktiveerida, kinnitada nad mälus sobivatele aadressidele, laadida mällu eraldiseisvaid .ko mooduleid jms)
  • jätkub operatsioonisüsteemi käivitumine, systemd jne

Väited

  • acpi mõju kirjeldatakse nö maakaartide komplektina, mille abil linux kernel leiab üles tee riistvara erinevate komponentide juurde
  • acpi tabelites on kirjas standardsel viisil esitatud riivara mudelite jms nimetused
  • acpi tegeleb peamiselt non-pcie ja non-usb seadmetega
  • acpi tegeleb nt protsessoriga, mäluga, igasuguste embedder controllerite, i2c chip'ide, rtc (real time clock), taimerite, PS/2 klaviatuuri ja hiirega, temperatuuri, chassis, laptop kaane jms anduritega
  • pcie ja usb osakonna eest hoolitsevad pcie ja usb siinid ise (nad on nö enumeration võimelised, erinevalt plug-and-play jms legacy seadmetest)

TODO

  • ACPI - supervisor
  • EC/SMBus/KCS - worker

ACPI override

Sarnaselt cpu microcode rakendamisele, mis tekitab nö protective-layer'i kerneli ja füüsilise protsessori vahele on olemas ka acpi puhul võimalus korrigeerida linux kerneli jaoks füüsilise acpi osakonna probleeme. Seda saab teha paketi acpi-override-initramfs abil

# apt-get install acpi-override-initramfs

Tulemusena lisatakse initrd koosseisu dsdt, ssdt vms tabel ja seda kasutatakse uefi juurest tuleva vastava tabeli asemel.

Väited

  • põhimõtteliselt on acpi oveeride kasutamine vastuolus secure boot kasutamisega

Misc

Lenovo T460p - Ubuntu

OSI

root@ubu2110:~# dmesg -T | grep Added
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Module Device)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Processor Device)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(3.0 _SCP Extensions)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Processor Aggregator Device)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Linux-Dell-Video)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[P sept  21 10:38:30 2025] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)

acpi aml tabelite (koodi) laadimine (ehk nn acpi-driverid)

[P sept  21 10:38:30 2025] ACPI: 11 ACPI AML tables successfully acquired and loaded

bus tüübid

root@ubu2110:~# dmesg -T | grep "ACPI: " | grep regist
[P sept  21 10:38:30 2025] ACPI: bus type PCI registered
[P sept  21 10:38:30 2025] ACPI: bus type USB registered

üsna tüüpiline viga

root@ubu2110:~# dmesg -T | grep "ACPI: " | grep Bug
[P sept  21 10:38:30 2025] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored

millega saaks tegeleda nt linux kernel ütleb, et ta on windows, iseasi kas see on praktiliselt vajalik

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi='Windows 2015'"

acpitool abil suhtlemine acpi osakonnaga

root@ubu2110:~# acpitool -c
  CPU type               : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Min/Max frequency      : 800/3500 MHz
  Current frequency      : 799 MHz
  Frequency governor     : powersave
  Freq. scaling driver   : intel_pstate
  Cache size             : 2600.000 KB
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Bogomips               : 5199.98
  Function Show_CPU_Info : could not read directory /proc/acpi/processor/
  Make sure your kernel has ACPI processor support enabled.

aku

root@ubu2110:~# acpitool -B
  Battery #1     : present
    Remaining capacity : 15680 mWh, 100.0%
    Design capacity    : 71280 mWh
    Last full capacity : 15680 mWh, 22.00% of design capacity
    Capacity loss      : 78.00%
    Present rate       : 0 mW
    Charging state     : Full
    Battery type       : Li-ion
    Model number       : 45N1777
    Serial number      : 2616

wake up seadmed

root@ubu2110:~# acpitool -w
   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. LID	  S4	*enabled   platform:PNP0C0D:00
  2. SLPB	  S3	*enabled   platform:PNP0C0E:00
  3. IGBE	  S4	*enabled   pci:0000:00:1f.6
  4. PXSX	  S4	*disabled  pci:0000:03:00.0
  5. PXSX	  S4	*disabled
  6. PXSX	  S4	*disabled
  7. PXSX	  S4	*disabled
  8. PXSX	  S4	*disabled  pci:0000:04:00.0
  9. 		*disabled  platform:rtsx_pci_sdmmc.0
  10. PXSX	  S4	*disabled
  11. XHCI	  S3	*enabled   pci:0000:00:14.0

kus

  • Sysfs node - esitatakse väärtused samamoodi programmiga systool
root@ubu2110:~# lspci | grep 00:1f.6
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)

root@ubu2110:~# dmesg | egrep "PNP0C0D|PNP0C0E"
[    0.323518] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input0
[    0.323573] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input1

Lenovo T460p - OpenBSD

TODO

Misc

nt laptop kaane nupp

root@ubu2110:~# find /sys/devices/ -name PNP0C0D:00 -ls
     8108      0 drwxr-xr-x   3 root     root            0 okt    5 01:10 /sys/devices/platform/PNP0C0D:00
     6170      0 drwxr-xr-x   5 root     root            0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00
root@ubu2110:~# udevadm info -a -p  /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00 | grep -A 5 "looking at"
  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00':
    KERNEL=="PNP0C0D:00"
    SUBSYSTEM=="acpi"
    DRIVER=="button"
    ATTR{hid}=="PNP0C0D"
    ATTR{path}=="\_SB_.LID_"
--
  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
    KERNELS=="LNXSYBUS:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
--
  looking at parent device '/devices/LNXSYSTM:00':
    KERNELS=="LNXSYSTM:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""

root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0D\:00/modalias
acpi:PNP0C0D:

root@ubu2110:~# grep button /lib/modules/5.15.0-140-generic/modules.builtin
kernel/drivers/acpi/button.ko

root@ubu2110:~# dmesg | grep PWR
[    0.323534] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
[    0.323553] ACPI: button: Power Button [PWRF]

PnP - klassikaline

Nö klassikalised PnP seadmed asuvad pnp nimelisel siinil

root@pve-02:~# systool -b pnp
Bus = "pnp"

  Device = "00:00"
  Device = "00:01"
  Device = "00:02"
  Device = "00:03"
  Device = "00:04"
  Device = "00:05"

RTC CMOS

Klassikaline RTC CMOS seade

root@pve-02:~# systool -b pnp -v -d 00:01
Bus = "pnp"

  Device = "00:01"
  Device path = "/sys/devices/pnp0/00:01"
    id                  = "PNP0b00"
    options             =
    resources           = "state = active
io 0x70-0x71"
    uevent              = "DRIVER=rtc_cmos"

kus x86 arhitektuuril on praktilisel alati kasutusel sellised väärtused

  • id - PNP0b00
  • io - 0x70 - 0x71
  • driver - rtc_cmos

udevadmin abil info küsimine

root@pve-02:~# udevadm info -a -p /sys/devices/pnp0/00:01

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pnp0/00:01':
    KERNEL=="00:01"
    SUBSYSTEM=="pnp"
    DRIVER=="rtc_cmos"
    ATTR{id}=="PNP0b00"
    ATTR{options}==""
    ATTR{power/async}=="disabled"
...

Samale rtc seadmele kaks perspektiivi

root@pve-svc-01:~# systool -b acpi -v -d PNP0B00:00
Bus = "acpi"

  Device = "PNP0B00:00"
  Device path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0B00:00"
    hid                 = "PNP0B00"
    modalias            = "acpi:PNP0B00:"
    path                = "\_SB_.PCI0.SBRG.RTC0"
    uevent              = "MODALIAS=acpi:PNP0B00:"

root@pve-svc-01:~# systool -b pnp -v -d 00:03
Bus = "pnp"

  Device = "00:03"
  Device path = "/sys/devices/pnp0/00:03"
    id                  = "PNP0b00"
    options             =
    resources           = "state = active
io 0x70-0x71"
    uevent              = "DRIVER=rtc_cmos"

Klassikaline serial port - COM1

root@pm60-trt:~# systool -b pnp -v -d 00:03
Bus = "pnp"

  Device = "00:03"
  Device path = "/sys/devices/pnp0/00:03"
    id                  = "PNP0501"
    options             = "Dependent: 00 - Priority preferred
  port 0x3f8-0x3f8, align 0x0, size 0x8, 16-bit address decoding
  irq 4 High-Edge
  dma <none> 8-bit compatible
Dependent: 01 - Priority acceptable
  port 0x3f8-0x3f8, align 0x0, size 0x8, 16-bit address decoding
  irq 4 High-Edge
  dma <none> 8-bit compatible
Dependent: 02 - Priority acceptable
  port 0x2f8-0x2f8, align 0x0, size 0x8, 16-bit address decoding
  irq 3 High-Edge
  dma <none> 8-bit compatible
Dependent: 03 - Priority acceptable
  port 0x3e8-0x3e8, align 0x0, size 0x8, 16-bit address decoding
  irq 4 High-Edge
  dma <none> 8-bit compatible
Dependent: 04 - Priority acceptable
  port 0x2e8-0x2e8, align 0x0, size 0x8, 16-bit address decoding
  irq 3 High-Edge
  dma <none> 8-bit compatible"
    resources           = "state = active
io 0x3f8-0x3ff
irq 4
dma disabled"
    uevent              = "DRIVER=serial"

kus x86 arhitektuuril on praktilisel alati kasutusel sellised väärtused

  • id - PNP0501
  • io - 0x3f8 - 0x3ff
  • driver - serial
  • option - pikk nimekiri nö võimalikest alternatiivsetest lähenemistest

udevadm abil info küsimine

root@pve-02:~# udevadm info -a -p /sys/devices/pnp0/00:03

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pnp0/00:03':
    KERNEL=="00:03"
    SUBSYSTEM=="pnp"
    DRIVER=="serial"
    ATTR{id}=="PNP0501"
    ATTR{power/async}=="disabled"
...

PnP - mitte-klassikaline

chatgpt ülevaade

ACPI ID	     Meaning             Notes
PNP0C0C	     Power Button	     ACPI power event device
PNP0C0D	     Lid Button	         Laptop lid open/close
PNP0C0E	     Sleep Button	     Optional ACPI control
PNP0800	     System Speaker	     Legacy beeper
PNP0103	     System Timer	     Legacy PIT timer
PNP0C09      Embedded Controller Handles thermal/fan/power
PNP0C14	     Windows Management Instrumentation device	ACPI-WMI interface

Toitenupp

Tundub, et toitenupp on x86 desktop tüüpi arvutitel standardses kohas

  • id - PNP0C0C:00
root@pve-svc-01:~# systool -b platform
Bus = "platform"

  Device = "AMDI0030:00"
  Device = "Fixed MDIO bus.0"
  Device = "MSFT0101:00"
  Device = "PNP0103:00"
  Device = "PNP0800:00"
  Device = "PNP0C0C:00"
  Device = "PNP0C14:00"
  Device = "PNP0C14:01"
  Device = "acpi-cpufreq"
  Device = "alarmtimer.0.auto"
  Device = "efivars.0"
  Device = "eisa.0"
  Device = "intel_rapl_msr.0"
  Device = "kgdboc"
  Device = "microcode"
  Device = "pcspkr"
  Device = "reg-dummy"
  Device = "regulatory.0"
  Device = "rtc-efi.0"
  Device = "serial8250"

root@pve-svc-01:~# systool -b platform -v -d PNP0C0C:00
Bus = "platform"

  Device = "PNP0C0C:00"
  Device path = "/sys/devices/platform/PNP0C0C:00"
    driver_override     = "(null)"
    modalias            = "acpi:PNP0C0C:"
    uevent              = "MODALIAS=acpi:PNP0C0C:"
    waiting_for_supplier= "0"

root@pve-svc-01:~# find /sys/devices/ -name PNP0C0C:00
/sys/devices/platform/PNP0C0C:00
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00

kus

  • teist kasutades udevadm argumendina saab info draiveri kohta jms, esimese abil ei saa
root@pve-svc-01:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00 | head -n 15

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00':
    KERNEL=="PNP0C0C:00"
    SUBSYSTEM=="acpi"
    DRIVER=="button"
    ATTR{hid}=="PNP0C0C"
    ATTR{path}=="\_SB_.PWRB"
    ATTR{power/async}=="disabled"
    ATTR{power/control}=="auto"

kus

  • näeb et tegu on nupuga
  • täpsemalt, pwrb st toitenupuga

Toitenupu mõju

  • toitenupu vajutuse signaali korjab acpi osakond üles
  • signaal saadetakse operatsioonisüsteemile
  • signaaline reagreeritake shutdown protseduuri käivitamisega
  • shutdown protseduuri lõpus saadetakse signaal üle acpi kokkuvõtte toiteplokile ja toiteplokk lülitatakse välja

Sleep button

root@ubu2110:~# systool -b platform -d PNP0C0E:00 -v
Bus = "platform"

  Device = "PNP0C0E:00"
  Device path = "/sys/devices/platform/PNP0C0E:00"
    driver_override     = "(null)"
    modalias            = "acpi:PNP0C0E:"
    uevent              = "MODALIAS=acpi:PNP0C0E:"
    waiting_for_supplier= "0"

root@ubu2110:~# find /sys/devices/ -name PNP0C0E:00
/sys/devices/platform/PNP0C0E:00
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00

root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00':
    KERNEL=="PNP0C0E:00"
    SUBSYSTEM=="acpi"
    DRIVER=="button"
    ATTR{hid}=="PNP0C0E"
    ATTR{path}=="\_SB_.SLPB"
    ATTR{power/async}=="disabled"

kus

  • _SB.SLPB - system bus, sleep button

TPM moodul

non-pci jms tüüpi seadmega seotud info leidmine, nt tpm moodul

root@ubu2110:~# systool -b platform
Bus = "platform"

  Device = "ACPI0003:00"
  Device = "Fixed MDIO bus.0"
  Device = "LEN0068:00"
  Device = "MSFT0101:00"
  Device = "PNP0103:00"
  Device = "PNP0800:00"
  Device = "PNP0C04:00"
  Device = "PNP0C09:00"
  Device = "PNP0C0A:00"
  Device = "PNP0C0D:00"
  Device = "PNP0C0E:00"
  Device = "PNP0C14:00"
  Device = "PNP0C14:01"
  Device = "PNP0C14:02"
  Device = "alarmtimer.0.auto"
  Device = "coretemp.0"
  Device = "efivars.0"
  Device = "eisa.0"
  Device = "i8042"
  Device = "intel_pmc_core.0"
  Device = "intel_rapl_msr.0"
  Device = "kgdboc"
  Device = "microcode"
  Device = "pcspkr"
  Device = "reg-dummy"
  Device = "regulatory.0"
  Device = "rtc-efi.0"
  Device = "rtsx_pci_sdmmc.0"
  Device = "serial8250"
  Device = "thinkpad_acpi"
  Device = "thinkpad_hwmon"
  Device = "vboxdrv.0"

root@ubu2110:~# find /sys/devices/ -name MSFT0101:00 -ls
     9680      0 drwxr-xr-x   3 root     root            0 okt    5 01:10 /sys/devices/platform/MSFT0101:00
     8004      0 drwxr-xr-x   5 root     root            0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00
root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00 | grep -A 3 "looking a"
  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00':
    KERNEL=="MSFT0101:00"
    SUBSYSTEM=="acpi"
    DRIVER=="tpm_crb"
--
  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
    KERNELS=="LNXSYBUS:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
--
  looking at parent device '/devices/LNXSYSTM:00':
    KERNELS=="LNXSYSTM:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""

kus

  • saadakse teada, et tpm seadmega tegeleb driver tpm_crb
  • seejuures ei kasutata praktiliselt modalias süsteemi kuna driaver on builtin
root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/MSFT0101\:00/modalias
acpi:MSFT0101:

root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.alias

root@ubu2110:~# grep tpm_crb /lib/modules/5.15.0-140-generic/modules.builtin
kernel/drivers/char/tpm/tpm_crb.ko

EC - embbeded controller

Embedded controller

root@pm60-trt:~# systool -b platform -d PNP0C09:00 -v
Bus = "platform"

  Device = "PNP0C09:00"
  Device path = "/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00"
    driver_override     = "(null)"
    modalias            = "acpi:PNP0C09:"
    uevent              = "MODALIAS=acpi:PNP0C09:"
    waiting_for_supplier= "0"

root@pm60-trt:~# lspci | grep 00:14
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 59)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)

root@pm60-trt:~# find /sys/devices/ -name PNP0C09:00
/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00

root@pm60-trt:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00 | grep -A 5 "looking a"
  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f/PNP0C09:00':
    KERNEL=="PNP0C09:00"
    SUBSYSTEM=="acpi"
    DRIVER=="ec"
    ATTR{hid}=="PNP0C09"
    ATTR{path}=="\_SB_.PCI0.SBRG.EC0_"
--
  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f':
    KERNELS=="device:2f"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
    ATTRS{adr}=="0x00140003"
    ATTRS{path}=="\_SB_.PCI0.SBRG"
--
...

PCIE

Väited

  • TODO

PCI bus nimekiri, sisuliselt sama, mis lspci programmi väljund

root@pve-svc-01:~# systool -b pci
Bus = "pci"

  0000:00:00.0 Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
  0000:00:01.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
  0000:00:01.1 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  0000:00:01.2 Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
  0000:00:01.3 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  0000:00:02.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
  0000:00:02.2 Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
  0000:00:08.0 Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge

...

'ACPI system root node', standardne nimi

/sys/devices/LNXSYSTM:00

ning

root@ubu2110:~# ls -ld "/sys/devices/LNXSYSTM:00/"*
-r--r--r--  1 root root 4096 okt    7 09:03 /sys/devices/LNXSYSTM:00/hid
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:00
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:01
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:02
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:03
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:04
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:05
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:06
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXCPU:07
drwxr-xr-x  5 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXPWRBN:00
drwxr-xr-x 23 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:01
-r--r--r--  1 root root 4096 okt    7 09:03 /sys/devices/LNXSYSTM:00/modalias
-r--r--r--  1 root root 4096 okt    7 09:03 /sys/devices/LNXSYSTM:00/path
drwxr-xr-x  2 root root    0 okt    6 19:53 /sys/devices/LNXSYSTM:00/power
lrwxrwxrwx  1 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/subsystem -> ../../bus/acpi
-rw-r--r--  1 root root 4096 okt    5 01:10 /sys/devices/LNXSYSTM:00/uevent

ACPI system bus

/sys/devices/LNXSYSTM:00/LNXSYBUS:00

ACPI PCI Root Bridge

root@ubu2110:~# dmesg | grep _OSC
[    0.233413] ACPI: \_PR_.CPU0: _OSC native thermal LVT Acked
[    0.258815] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
[    0.258963] acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug PCIeCapability LTR DPC]
[    0.259032] acpi PNP0A08:00: _OSC: not requesting control; platform does not support [PCIeCapability]
[    0.259037] acpi PNP0A08:00: _OSC: OS requested [PCIeHotplug SHPCHotplug PME AER PCIeCapability LTR DPC]
[    0.259041] acpi PNP0A08:00: _OSC: platform willing to grant [PCIeHotplug PME AER]
[    0.259044] acpi PNP0A08:00: _OSC: platform retains control of PCIe features (AE_SUPPORT)

root@ubu2110:~# ls -ld "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00"/*
-r--r--r--  1 root root 4096 okt    7 09:06 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/adr
drwxr-xr-x 15 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:01
drwxr-xr-x  7 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:03
drwxr-xr-x  9 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:05
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18
drwxr-xr-x  5 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:19
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1b
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1d
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1f
drwxr-xr-x  5 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:21
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:23
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:25
drwxr-xr-x 12 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:26
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2f
drwxr-xr-x  9 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:30
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:49
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4a
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b
-r--r--r--  1 root root 4096 okt    7 09:06 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/hid
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXPOWER:01
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXPOWER:02
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXPOWER:03
drwxr-xr-x 22 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:01
-r--r--r--  1 root root 4096 okt    7 09:06 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/modalias
-r--r--r--  1 root root 4096 okt    7 09:06 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/path
lrwxrwxrwx  1 root root    0 okt    7 09:06 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node -> ../../../pci0000:00
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C02:01
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C02:02
drwxr-xr-x  2 root root    0 okt    6 19:53 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/power
lrwxrwxrwx  1 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/subsystem -> ../../../../bus/acpi
-rw-r--r--  1 root root 4096 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/uevent
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/wakeup

pci root teises vaates, 'kernel-level PCI device tree'

root@ubu2110:~# ls -ld /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0A08\:00/physical_node/*
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:00.0
drwxr-xr-x  7 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:01.0
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:01.2
drwxr-xr-x 10 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:02.0
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:14.0
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:14.2
drwxr-xr-x 22 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:16.0
drwxr-xr-x  9 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:17.0
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1c.0
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1c.4
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.0
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.2
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.3
drwxr-xr-x  4 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.4
drwxr-xr-x  8 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.6
lrwxrwxrwx  1 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/firmware_node -> ../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00
drwxr-xr-x  3 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/pci_bus
drwxr-xr-x  2 root root    0 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/power
-rw-r--r--  1 root root 4096 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/uevent
-r--r--r--  1 root root 4096 okt    5 01:10 /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/waiting_for_supplier

kus

  • physical_node ja firmware_node viitavad linkidega üksteisele - sama nähtuse erinevad vaated

ja konkreetne pcie seade

root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/physical_node/0000:00:1f.6 | grep -A 3 "looking a"
  looking at device '/devices/pci0000:00/0000:00:1f.6':
    KERNEL=="0000:00:1f.6"
    SUBSYSTEM=="pci"
    DRIVER=="e1000e"
--
  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
root@ubu2110:~#

ning modalias abil seadmega seotud draiveri abil seadme kindlakstegemine

root@ubu2110:~# cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0A08\:00/physical_node/0000\:00\:1f.6/modalias
pci:v00008086d000015B7sv000017AAsd00005050bc02sc00i00

root@ubu2110:~# grep v00008086d000015B7sv /lib/modules/5.15.0-140-generic/modules.alias | grep e100
alias pci:v00008086d000015B7sv*sd*bc*sc*i* e1000e

Väited

  • kernel saab hot plug puhul aru seadme id vms väärtuse
  • kernel saadab uevent'i udevd osakonda
  • udevd juhtimisel leitakse üles modalias süsteemi abil sobiv draiver
  • udevd juhtimisel laaditakse draiver ja rakendatakse udevd rules (nt seadme nime vms omaduste kohendamiseks)
  • lisatud seade on user-space programmidele kasutatav
  • systemd juhib udevd osakonda

I2C

TODO

platform

TODO

serio

TODO

root@ubu2110:~# systool -b serio
Bus = "serio"

  Device = "serio0"
  Device = "serio1"
  Device = "serio2"

root@ubu2110:~# systool -b serio -v -d serio0
Bus = "serio"

  Device = "serio0"
  Device path = "/sys/devices/platform/i8042/serio0"
    bind_mode           = "auto"
    description         = "i8042 KBD port"
    drvctl              = <store method only>
    err_count           = "0"
    extra               = "0"
    firmware_id         = "PNP: LEN0071 PNP0303"
    force_release       = "369-370"
    modalias            = "serio:ty06pr00id00ex00"
    scroll              = "0"
    set                 = "2"
    softraw             = "1"
    softrepeat          = "0"
    uevent              = "DRIVER=atkbd
SERIO_TYPE=06
SERIO_PROTO=00
SERIO_ID=00
SERIO_EXTRA=00
MODALIAS=serio:ty06pr00id00ex00
SERIO_FIRMWARE_ID=PNP: LEN0071 PNP0303"

root@ubu2110:~# udevadm info -a -p /sys/devices/platform/i8042/serio0 | grep -A 3 "looking at"
  looking at device '/devices/platform/i8042/serio0':
    KERNEL=="serio0"
    SUBSYSTEM=="serio"
    DRIVER=="atkbd"
--
  looking at parent device '/devices/platform/i8042':
    KERNELS=="i8042"
    SUBSYSTEMS=="platform"
    DRIVERS=="i8042"
--
  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

root@ubu2110:~# modinfo atkbd
name:           atkbd
filename:       (builtin)
license:        GPL
file:           drivers/input/keyboard/atkbd
description:    AT and PS/2 keyboard driver
author:         Vojtech Pavlik <vojtech@suse.cz>
parm:           set:Select keyboard code set (2 = default, 3 = PS/2 native) (int)
parm:           reset:Reset keyboard during initialization (bool)
parm:           softrepeat:Use software keyboard repeat (bool)
parm:           softraw:Use software generated rawmode (bool)
parm:           scroll:Enable scroll-wheel on MS Office and similar keyboards (bool)
parm:           extra:Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards (bool)
parm:           terminal:Enable break codes on an IBM Terminal keyboard connected via AT/PS2 (bool)

usb

ethernet over usb

root@ubu2110:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
Bus 001 Device 005: ID 04f2:b541 Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 004: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. VFS7500 Touch Fingerprint Sensor
Bus 001 Device 002: ID 046d:c30e Logitech, Inc. UltraX Keyboard (Y-BL49)
Bus 001 Device 018: ID 0bda:8152 Realtek Semiconductor Corp. RTL8152 Fast Ethernet Adapter

root@ubu2110:~# systool -b usb
Bus = "usb"

  Device = "1-0:1.0"
  Device = "1-2:1.0"
  Device = "1-2"
  Device = "1-4:1.0"
  Device = "1-4:1.1"
  Device = "1-4"
  Device = "1-6:1.0"
  Device = "1-6"
  Device = "1-7"
  Device = "1-7:1.0"
  Device = "1-7:1.1"
  Device = "1-8:1.0"
  Device = "1-8:1.1"
  Device = "1-8"
  Device = "1-9:1.0"
  Device = "1-9"
  Device = "2-0:1.0"
  Device = "usb1"
  Device = "usb2"

root@ubu2110:~# systool -b usb  -v -d "1-2:1.0"
Bus = "usb"

  Device = "1-2:1.0"
  Device path = "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0"
    authorized          = "1"
    bAlternateSetting   = " 0"
    bInterfaceClass     = "ff"
    bInterfaceNumber    = "00"
    bInterfaceProtocol  = "00"
    bInterfaceSubClass  = "ff"
    bNumEndpoints       = "03"
    modalias            = "usb:v0BDAp8152d2000dc00dsc00dp00icFFiscFFip00in00"
    supports_autosuspend= "1"
    uevent              = "DEVTYPE=usb_interface
DRIVER=r8152
PRODUCT=bda/8152/2000
TYPE=0/0/0
INTERFACE=255/255/0
MODALIAS=usb:v0BDAp8152d2000dc00dsc00dp00icFFiscFFip00in00"

kus

  • product 'bda' klapib lsusb realtek seadme rea infoga
root@ubu2110:~# udevadm info -a -p "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0" | grep -A 3 "looking at"
  looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0':
    KERNEL=="1-2:1.0"
    SUBSYSTEM=="usb"
    DRIVER=="r8152"
--
  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-2':
    KERNELS=="1-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="r8152-cfgselector"
--
  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
--
  looking at parent device '/devices/pci0000:00/0000:00:14.0':
    KERNELS=="0000:00:14.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
--
  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

root@ubu2110:~# modinfo r8152
filename:       /lib/modules/5.15.0-140-generic/kernel/drivers/net/usb/r8152.ko
version:        v1.12.13
license:        GPL
description:    Realtek RTL8152/RTL8153 Based USB Ethernet Adapters
author:         Realtek linux nic maintainers <nic_swsd@realtek.com>
firmware:       rtl_nic/rtl8156b-2.fw
firmware:       rtl_nic/rtl8156a-2.fw
firmware:       rtl_nic/rtl8153c-1.fw
firmware:       rtl_nic/rtl8153b-2.fw
firmware:       rtl_nic/rtl8153a-4.fw
firmware:       rtl_nic/rtl8153a-3.fw
firmware:       rtl_nic/rtl8153a-2.fw
srcversion:     45F2FB1C5EDA0E06263CD86

Olematu seadme ACPI sissekanne

Selline olukord vastab olematule seadmele kuigi iseenesest ACPI tabelites on sissekanne olemas

root@ubu2110:~# systool -b acpi | grep PNP0200
  Device = "PNP0200:00"

root@ubu2110:~# systool -b acpi -v -d PNP0200:00
Bus = "acpi"

  Device = "PNP0200:00"
  Device path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00"
    hid                 = "PNP0200"
    modalias            = "acpi:PNP0200:"
    path                = "\_SB_.PCI0.LPC_.DMAC"
    uevent              = "MODALIAS=acpi:PNP0200:"

root@ubu2110:~# find /sys/devices/ -name PNP0200:00
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00

root@ubu2110:~# udevadm info -a -p /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0200:00':
    KERNEL=="PNP0200:00"
    SUBSYSTEM=="acpi"
    DRIVER==""
    ATTR{hid}=="PNP0200"
    ATTR{path}=="\_SB_.PCI0.LPC_.DMAC"
    ATTR{power/async}=="disabled"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_kids}=="0"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_enabled}=="disabled"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{power/runtime_usage}=="0"

  looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00':
    KERNELS=="device:00"
    SUBSYSTEMS=="acpi"
    DRIVERS==""
    ATTRS{adr}=="0x001f0000"
    ATTRS{path}=="\_SB_.PCI0.LPC_"
    ATTRS{power/async}=="disabled"
..
  • KERNEL=="PNP0200:00", SUBSYSTEM=="acpi", DRIVER=="" - linux ei ole draiverit kinnitanud seadme külge

Kasulikud lisamaterjalid

  • TODO