Skip to contentSkip to conversation

How to add the "gpio-line-names" property in a PCI gpio expander

DISCUSSION Flavio Suligoi 4 participants 17 messages Nov 5, 2020 – Nov 9, 2020 ACPI

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm working to introduce the "gpio-line-names" property in the ACPI configuration of the BIOS of our x86 boards (we can customize the BIOS of our boards).

All is ok for the gpiochips related to the Intel chipset and some I2C gpio expanders. I have inserted the _DSD as described in the Linux documentation.

In one of our boards we have an add-on PCI board, with a PCI serial device Exar XR17V352. This device also contains 16 gpios.
The exar device drivers work good, both the "8250_exar" and the "gpio_exar", and I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI gpio expanders like this.

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")
    Name (_STR, Unicode ("STR - Exar GPIOs"))  // _STR: Description String

    Name (_DSD, Package () {
	ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
	Package () {
	    Package () {
		"gpio-line-names",
		    Package () {
			"exar_0",
			"exar_1",
			"exar_2",
			"exar_3",
			...
		    }
		}
	    }
    })
}

but I have no result.
Does anyone have a suggestion?

Thanks,

Flavio

#1 lore raw

CC Mika and Andy who should be more familiar with that problem space than I am.

Quoted 47 lines · Flavio Suligoi

Hi all,

I'm working to introduce the "gpio-line-names" property in the ACPI configuration of the BIOS of our x86 boards (we can customize the BIOS of our boards).

All is ok for the gpiochips related to the Intel chipset and some I2C gpio expanders. I have inserted the _DSD as described in the Linux documentation.

In one of our boards we have an add-on PCI board, with a PCI serial device Exar XR17V352. This device also contains 16 gpios.
The exar device drivers work good, both the "8250_exar" and the "gpio_exar", and I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI gpio expanders like this.

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")
    Name (_STR, Unicode ("STR - Exar GPIOs"))  // _STR: Description String

    Name (_DSD, Package () {
        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
        Package () {
            Package () {
                "gpio-line-names",
                    Package () {
                        "exar_0",
                        "exar_1",
                        "exar_2",
                        "exar_3",
                        ...
                    }
                }
            }
    })
}

but I have no result.
Does anyone have a suggestion?

Thanks,

Flavio

#2 lore raw

Hi,

Quoted 25 lines · Rafael J. Wysocki

CC Mika and Andy who should be more familiar with that problem space than I am.

Quoted 22 lines · Flavio Suligoi

Hi all,

I'm working to introduce the "gpio-line-names" property in the ACPI configuration of the BIOS of our x86 boards (we can customize the BIOS of our boards).

All is ok for the gpiochips related to the Intel chipset and some I2C gpio expanders. I have inserted the _DSD as described in the Linux documentation.

In one of our boards we have an add-on PCI board, with a PCI serial device Exar XR17V352. This device also contains 16 gpios.
The exar device drivers work good, both the "8250_exar" and the "gpio_exar", and I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI gpio expanders like this.

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

Quoted 25 lines
Quoted 25 lines
    Name (_STR, Unicode ("STR - Exar GPIOs"))  // _STR: Description String

    Name (_DSD, Package () {
        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
        Package () {
            Package () {
                "gpio-line-names",
                    Package () {
                        "exar_0",
                        "exar_1",
                        "exar_2",
                        "exar_3",
                        ...
                    }
                }
            }
    })
}

but I have no result.
Does anyone have a suggestion?

Thanks,

Flavio

#3 lore raw

Hi Mika,

Quoted 10 lines
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI serial

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 2 lines
Quoted 2 lines

expanders like this.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

the problem is that the parent bus of this device is not declared in any ACPI table. The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

root@debian:/etc# lspci
00:00.0 Host bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Host Bridge (rev 0d)
00:02.0 VGA compatible controller: Intel Corporation Device 5a85 (rev 0d)
00:0e.0 Audio device: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Audio Cluster (rev 0d)
00:0f.0 Communication controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Trusted Execution Engine (rev 0d)
00:12.0 SATA controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SATA AHCI Controller (rev 0d)
00:13.0 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #1 (rev fd)
00:13.1 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #2 (rev fd)
00:13.2 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #3 (rev fd)
00:14.0 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #1 (rev fd)
00:14.1 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #2 (rev fd)
00:15.0 USB controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series USB xHCI (rev 0d)
00:16.0 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #1 (rev 0d)
00:16.1 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #2 (rev 0d)
00:19.0 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #1 (rev 0d)
00:19.1 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #2 (rev 0d)
00:19.2 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #3 (rev 0d)
00:1f.0 ISA bridge: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Low Pin Count Interface (rev 0d)
00:1f.1 SMBus: Intel Corporation Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SMBus Controller (rev 0d)
01:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
04:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
05:00.0 PCI bridge: Pericom Semiconductor Device 2404 (rev 05)
06:01.0 PCI bridge: Pericom Semiconductor Device 2404 (rev 05)
06:02.0 PCI bridge: Pericom Semiconductor Device 2404 (rev 05)
06:03.0 PCI bridge: Pericom Semiconductor Device 2404 (rev 05)
07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)  --- Exar serial port
08:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
root@debian:/etc#
Thanks,
Flavio
#4 lore raw
Quoted 20 lines · Flavio Suligoi

Hi Mika,

Quoted 10 lines
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI serial

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 2 lines
Quoted 2 lines

expanders like this.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

Quoted 8 lines

the problem is that the parent bus of this device is not declared in any ACPI table. The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

The parent is the root port the device is connected to and I'm pretty sure it exists in the namespace as this seems to be Intel hardware. If you run 'lspci -t' it shows you the root port.

The _ADR should be 0 for this one.

#5 lore raw

Hi Mika,

Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI

serial

Quoted 11 lines
Quoted 11 lines

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 4 lines
Quoted 4 lines

expanders like this.

I tried adding a new device in my ACPI configuration, as:

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

the problem is that the parent bus of this device is not declared in any

ACPI table.

Quoted 7 lines

The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

Quoted 5 lines

The parent is the root port the device is connected to and I'm pretty sure it exists in the namespace as this seems to be Intel hardware. If you run 'lspci -t' it shows you the root port.

The _ADR should be 0 for this one.

Unfortunately there is bridge in the middle:

root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <-- Exar (bus 7, dev 0, funct 0)
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1
root@debian:~#

My changes in the ACPI:

Scope (_SB.PCI0) {
    Device (EXAR)
		{
			Name (_ADR, 0x0000)

....

but it doesn't work, because of the bridge.

Regards,

Flavio

#6 lore raw
Quoted 60 lines · Flavio Suligoi
Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI

serial

Quoted 11 lines
Quoted 11 lines

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 4 lines
Quoted 4 lines

expanders like this.

I tried adding a new device in my ACPI configuration, as:

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

the problem is that the parent bus of this device is not declared in any

ACPI table.

Quoted 7 lines

The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

Quoted 5 lines

The parent is the root port the device is connected to and I'm pretty sure it exists in the namespace as this seems to be Intel hardware. If you run 'lspci -t' it shows you the root port.

The _ADR should be 0 for this one.

Unfortunately there is bridge in the middle:

root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <-- Exar (bus 7, dev 0, funct 0)
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1
root@debian:~#
Quoted 6 lines

My changes in the ACPI:

Scope (_SB.PCI0) {
    Device (EXAR)
		{
			Name (_ADR, 0x0000)

_ADR should represent BDF (Bus:Device.Function)

Something like 0x07000000

Quoted 3 lines

....

but it doesn't work, because of the bridge.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 63 lines · Andy Shevchenko
Quoted 62 lines · Flavio Suligoi
Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI

serial

Quoted 11 lines
Quoted 11 lines

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 4 lines
Quoted 4 lines

expanders like this.

I tried adding a new device in my ACPI configuration, as:

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

the problem is that the parent bus of this device is not declared in any

ACPI table.

Quoted 7 lines

The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

Quoted 5 lines

The parent is the root port the device is connected to and I'm pretty sure it exists in the namespace as this seems to be Intel hardware. If you run 'lspci -t' it shows you the root port.

The _ADR should be 0 for this one.

Unfortunately there is bridge in the middle:

root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <-- Exar (bus 7, dev 0, funct 0)
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1
root@debian:~#

My changes in the ACPI:

Quoted 8 lines
Quoted 4 lines
Scope (_SB.PCI0) {
    Device (EXAR)
		{
			Name (_ADR, 0x0000)

_ADR should represent BDF (Bus:Device.Function)

Something like 0x07000000

Per documentation:
"High word–Device #, Low word–Function #. (for example, device 3, function 2 is 0x00030002). To refer to all the functions on a device #, use a function number of FFFF)."

It seems it doesn't describe where bus is going.

Maybe Mika can help here.

Quoted 3 lines
Quoted 3 lines

....

but it doesn't work, because of the bridge.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw

Hi Andy,

Quoted 36 lines
Quoted 14 lines
Quoted 14 lines

Unfortunately there is bridge in the middle:

root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <--

Exar (bus 7, dev 0, funct 0)

Quoted 21 lines
Quoted 10 lines
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1
Quoted 8 lines

root@debian:~#

My changes in the ACPI:

Scope (_SB.PCI0) {
    Device (EXAR)
		{
			Name (_ADR, 0x0000)

_ADR should represent BDF (Bus:Device.Function)

Quoted 8 lines
Quoted 1 line

Something like 0x07000000

Per documentation:
"High word–Device #, Low word–Function #. (for example, device 3, function 2 is
0x00030002). To refer to all the functions on a device #, use a function number of FFFF)."

exactly, with the _ADR object we can specify only device and function. The bus is implicit, that's way I used the:

Scope (_SB.PCI0) { ...

But it is the wrong bus, because of a bridge in the middle.

Best regards,

Flavio

#9 lore raw
In reply to Flavio Suligoi
Quoted 64 lines · Flavio Suligoi

Hi Mika,

Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In one of our boards we have an add-on PCI board, with a PCI

serial

Quoted 11 lines
Quoted 11 lines

device

Quoted 2 lines
Quoted 2 lines

Exar XR17V352. This device also contains 16 gpios. The exar device drivers work good, both the "8250_exar" and the

"gpio_exar", and

Quoted 2 lines
Quoted 2 lines

I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI

gpio

Quoted 4 lines
Quoted 4 lines

expanders like this.

I tried adding a new device in my ACPI configuration, as:

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Device (EXAR)

{
    Name (_HID, "13A80352")

If this is PCI device then you need to have _ADR here instead of _HID.

the problem is that the parent bus of this device is not declared in any

ACPI table.

Quoted 7 lines

The exar chip is on the bus 7 :

07:00.0 Serial controller: Exar Corp. XR17V3521 Dual PCIe UART (rev 03)

and in the _ADR object you can specify device and function only. How can I specify the parent bus? It is not simple … The lspci output is the following:

Quoted 5 lines

The parent is the root port the device is connected to and I'm pretty sure it exists in the namespace as this seems to be Intel hardware. If you run 'lspci -t' it shows you the root port.

The _ADR should be 0 for this one.

Unfortunately there is bridge in the middle:

root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <-- Exar (bus 7, dev 0, funct 0)
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1
root@debian:~#

My changes in the ACPI:

Quoted 7 lines
Scope (_SB.PCI0) {
    Device (EXAR)
		{
			Name (_ADR, 0x0000)

....

but it doesn't work, because of the bridge.

OK, then add the bridge first:

Scope (_SB.PCI0.RPX) {
    Device (BRG) { // Bridge
       Name (_ADR, 0)

       Device (EXAR) { // Expander
           Name (_ADR, 0)
       }
    }

Or something like that. RPX is the root port 14.1 and if I read the above right both the bridge and the EXAR device have device and function 0.

#10 lore raw

Hi Mika and Andy,

Quoted 34 lines
Quoted 12 lines
root@debian:~# lspci -t
-[0000:00]-+-00.0
           +-02.0
           +-0e.0
           +-0f.0
           +-12.0
           +-13.0-[01]----00.0
           +-13.1-[02]----00.0
           +-13.2-[03]--
           +-14.0-[04]----00.0
           +-14.1-[05-09]----00.0-[06-09]--+-01.0-[07]----00.0 <-- Exar

(bus 7, dev 0, funct 0)

Quoted 10 lines
           |                               +-02.0-[08]----00.0
           |                               \-03.0-[09]--
           +-15.0
           +-16.0
           +-16.1
           +-19.0
           +-19.1
           +-19.2
           +-1f.0
           \-1f.1

OK, then add the bridge first:

Scope (_SB.PCI0.RPX) {
    Device (BRG) { // Bridge
       Name (_ADR, 0)

       Device (EXAR) { // Expander
           Name (_ADR, 0)
       }
    }
Quoted 3 lines

Or something like that. RPX is the root port 14.1 and if I read the above right both the bridge and the EXAR device have device and function 0.

All ok now, I've added the bridge (I had to use the BIOS sources) and not it works:

Scope (_SB.PCI0.RP02) {

		Device (BRG1) //Bridge
		{
			Name (_ADR, 0x0000)
		
			Device (BRG2) //Bridge
			{
				Name (_ADR, 0x00010000)

				Device (EXAR)
				{
					Name (_ADR, 0x0000)

					Name (_DSD, Package ()
					{
						ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
						Package ()
						{
							Package ()
							{
								"gpio-line-names",
								Package ()
								{
									"exar_0",
									"exar_1",
									"exar_2",
									"exar_3",
									"exar_4",
									"exar_5",
									"exar_6",
									"exar_7"
								} ....
root@debian:~# gpioinfo gpiochip4
gpiochip4 - 16 lines:
	line   0:     "exar_0"       unused   input  active-high 
	line   1:     "exar_1"       unused   input  active-high 
	line   2:     "exar_2"       unused   input  active-high 
	line   3:     "exar_3"       unused   input  active-high 
	line   4:     "exar_4"       unused   input  active-high 
	line   5:     "exar_5"       unused   input  active-high 
	line   6:     "exar_6"       unused   input  active-high 
	line   7:     "exar_7"       unused   input  active-high 
	line   8:      unnamed       unused   input  active-high 
	line   9:      unnamed       unused   input  active-high 
	line  10:      unnamed       unused   input  active-high 
	line  11:      unnamed       unused   input  active-high 
	line  12:      unnamed       unused   input  active-high 
	line  13:      unnamed       unused   input  active-high 
	line  14:      unnamed       unused   input  active-high 
	line  15:      unnamed       unused   input  active-high 
root@debian:~# 

Thanks for your precious help and ideas !!!

Best regards,

Flavio

#11 lore raw
Quoted 6 lines · Flavio Suligoi
Quoted 3 lines

Or something like that. RPX is the root port 14.1 and if I read the above right both the bridge and the EXAR device have device and function 0.

All ok now, I've added the bridge (I had to use the BIOS sources) and not it works:

I suppose not -> now ;)

Glad to hear this! So, maybe you can add some bits to the documentation [1] based on your experience?

Note, I have sent a series [2] to amend it a bit, and your input welcome!

[1]: Documentation/firmware-guide/acpi/gpio-properties.rst
[2]: https://lore.kernel.org/linux-acpi/[email protected]/T/#u

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#12 lore raw

Hi Andy,

Quoted 5 lines
Quoted 3 lines

All ok now, I've added the bridge (I had to use the BIOS sources) and not it works:

I suppose not -> now ;)

right! --> now it works !!! 😊

Quoted 5 lines

Glad to hear this! So, maybe you can add some bits to the documentation
[1]
based on your experience?

Yes, I can! Thanks you for asking me!

Quoted 5 lines

Note, I have sent a series [2] to amend it a bit, and your input welcome!

[1]: Documentation/firmware-guide/acpi/gpio-properties.rst [2]: https://lore.kernel.org/linux-acpi/20201029193243.61546-1-
[email protected]/T/#u

Ok, I'll see how to integrate my PCI "investigation" about the identification of the correct path from the CPU to the final PCI device, through the various bridges of the board.
I think that a general discourse about it can be useful to other people, too.

Quoted 6 lines

--
With Best Regards,
Andy Shevchenko

Best regards,

Flavio

#13 lore raw
Quoted 12 lines · Flavio Suligoi
Quoted 3 lines

Glad to hear this! So, maybe you can add some bits to the documentation
[1]
based on your experience?

Yes, I can! Thanks you for asking me!

Quoted 5 lines

Note, I have sent a series [2] to amend it a bit, and your input welcome!

[1]: Documentation/firmware-guide/acpi/gpio-properties.rst [2]: https://lore.kernel.org/linux-acpi/20201029193243.61546-1-
[email protected]/T/#u

Quoted 5 lines

Ok, I'll see how to integrate my PCI "investigation" about the identification of the correct path from the CPU to the final PCI device, through the various bridges of the board.
I think that a general discourse about it can be useful to other people, too.

I realized that here we have two items to document:
1) the gpio-line-names property in [1];
2) PCI hierarchy in ACPI tables, which can be added into [3] under the "PCI hierarchy representation" title or so.

[3]: Documentation/firmware-guide/acpi/enumeration.rst

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#14 lore raw

Hi Andy,

Quoted 6 lines
Quoted 5 lines

Ok, I'll see how to integrate my PCI "investigation" about the identification of the correct path from the CPU to the final PCI device, through the various bridges of the board.
I think that a general discourse about it can be useful to other people, too.

Quoted 6 lines

I realized that here we have two items to document:
1) the gpio-line-names property in [1];
2) PCI hierarchy in ACPI tables, which can be added into [3] under the "PCI hierarchy representation" title or so.

[3]: Documentation/firmware-guide/acpi/enumeration.rst

OK, thanks for your guidelines!

Quoted 5 lines

--
With Best Regards,
Andy Shevchenko

Regards,

Flavio

#15 lore raw
In reply to Andy Shevchenko
Quoted 14 lines · Andy Shevchenko
Quoted 12 lines · Flavio Suligoi
Quoted 3 lines

Glad to hear this! So, maybe you can add some bits to the documentation
[1]
based on your experience?

Yes, I can! Thanks you for asking me!

Quoted 5 lines

Note, I have sent a series [2] to amend it a bit, and your input welcome!

[1]: Documentation/firmware-guide/acpi/gpio-properties.rst [2]: https://lore.kernel.org/linux-acpi/20201029193243.61546-1-
[email protected]/T/#u

Quoted 8 lines
Quoted 5 lines

Ok, I'll see how to integrate my PCI "investigation" about the identification of the correct path from the CPU to the final PCI device, through the various bridges of the board.
I think that a general discourse about it can be useful to other people, too.

I realized that here we have two items to document:
1) the gpio-line-names property in [1];

More precise here is to extend the existing documentation with the examples and explanation how GPIO subsystem in Linux is expecting those names to be (as I explained in one thread to you that the property covers only line names from the beginning to the first hole, when no name is provided, i.o.w. holes are not accepted).

Quoted 4 lines

2) PCI hierarchy in ACPI tables, which can be added into [3] under the "PCI hierarchy representation" title or so.

[3]: Documentation/firmware-guide/acpi/enumeration.rst

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#16 lore raw
In reply to Rafael J. Wysocki
Quoted 1 line · Rafael J. Wysocki

CC Mika and Andy who should be more familiar with that problem space than I am.

I believe I have explained this in the [1]. Perhaps it's about how to find proper device node / ACPI path of the devices in question?

[1]: https://lore.kernel.org/linux-gpio/[email protected]/

Quoted 48 lines · Flavio Suligoi
Quoted 47 lines

Hi all,

I'm working to introduce the "gpio-line-names" property in the ACPI configuration of the BIOS of our x86 boards (we can customize the BIOS of our boards).

All is ok for the gpiochips related to the Intel chipset and some I2C gpio expanders. I have inserted the _DSD as described in the Linux documentation.

In one of our boards we have an add-on PCI board, with a PCI serial device Exar XR17V352. This device also contains 16 gpios.
The exar device drivers work good, both the "8250_exar" and the "gpio_exar", and I can manage the exar's gpios correctly.
The problem is how to assign the gpio-line-names property to a PCI gpio expanders like this.

I tried adding a new device in my ACPI configuration, as:

Device (EXAR)

{
    Name (_HID, "13A80352")
    Name (_STR, Unicode ("STR - Exar GPIOs"))  // _STR: Description String

    Name (_DSD, Package () {
        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
        Package () {
            Package () {
                "gpio-line-names",
                    Package () {
                        "exar_0",
                        "exar_1",
                        "exar_2",
                        "exar_3",
                        ...
                    }
                }
            }
    })
}

but I have no result.
Does anyone have a suggestion?

Thanks,

Flavio

Signature · 2 lines
With Best Regards,
Andy Shevchenko