Support for RTL9607C / RTL8198D Realtek SoC

About the gpio, have you seen the gpio application note for rtl9607c? From my understanding, it is a clear indicatation that ports are reversed so GPIO_PORTS_REVERSED should be set. There is also GPIO_ITERRUPTS_PER_CPU which I believe?? is what IER registers are for, but somehow need to be unset for bank 1 and bank 2. Another thing worth mentioning is IO_GPIO_EN register. You can see the it being used in the dal_rtl9607c_state_set function. I am not that knowledged with pinctrl and pinmux, but is what its for? Since you mentioned led, there is IO_LED_EN register for that too.

Also, have you seen this gpio driver from GPL archive? It utilizes a lot of gpio functions from the aforementioned realtek SDK but maybe that could still help you.

Have done GPIO support - there is registers in switch configuration address space for enabling GPIO pins (just like in reference driver). Feel free to pull patches

After that PCI driver started to work... some way. It starts enumerating devices and than falls into recursion between pci_scan_child_bus_extend and pci_scan_bridge_extend - still not getting what problem is, so I hardcoded recursion limit and it completed probing devices. But there is no drivers for chips (RTL8832BR and RTL8192XB[1]), so I can't check is it working or not. Current version here

Here is:

Successfull bootlog fragment (recursion limit hardcoded):
[    4.338720] platform b8b00000.pci: Retrying from deferred list
[    4.345998] platform b8b00000.pci: bus: 'platform': __driver_probe_device: matched device with driver pci-rtl960x
[    4.358563] platform b8b00000.pci: bus: 'platform': really_probe: probing driver pci-rtl960x with device
[    4.370114] pci-rtl960x b8b00000.pci: no pinctrl handle
[    4.603471] Port1 Link@2.5GHz
[    4.607123] device: 'pci0000:00': device_add
[    4.612358] device: '0000:00': device_add
[    4.617344] PCI host bridge to bus 0000:00
[    4.622366] pci_bus 0000:00: root bus resource [mem 0xb9000000-0xb9ffffff]
[    4.630776] pci_bus 0000:00: root bus resource [io  0xb8c00000-0xb8dfffff]
[    4.639107] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    4.648714] pci_bus 0000:00: scanning bus
[    4.653639] pci 0000:00:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.662521] pci 0000:00:00.0: PCI bridge to [bus 00]
[    4.668558] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    4.675966] pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.684192] pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.693016] pci 0000:00:00.0: supports D1
[    4.697896] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    4.704861] pci 0000:00:00.0: PME# disabled
[    4.709962] device: '0000:00:00.0': device_add
[    4.715400] bus: 'pci': add device 0000:00:00.0
[    4.721227] pci 0000:00:01.0: [10ec:0192] type 00 class 0x028000 PCIe Endpoint
[    4.730064] pci 0000:00:01.0: BAR 0 [io  0x0000-0x00ff]
[    4.736426] pci 0000:00:01.0: BAR 2 [mem 0x00000000-0x000fffff 64bit]
[    4.744417] pci 0000:00:01.0: supports D1 D2
[    4.749595] pci 0000:00:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.757627] pci 0000:00:01.0: PME# disabled
[    4.762770] device: '0000:00:01.0': device_add
[    4.768196] bus: 'pci': add device 0000:00:01.0
[    4.774316] pci_bus 0000:00: fixups for bus
[    4.779401] pci_scan_bridge_extend:1306 starting with max: 0
[    4.786298] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[    4.794461] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.804170] pci_scan_bridge_extend:1306 starting with max: 0
[    4.811042] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[    4.819229] device: '0000:01': device_add
[    4.824299] pci_bus 0000:01: scanning bus
[    4.829245] pci 0000:01:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.838146] pci 0000:01:00.0: PCI bridge to [bus 01-ff]
[    4.844485] pci 0000:01:00.0:   bridge window [io  0x0000-0x0fff]
[    4.851896] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.860155] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.868965] pci 0000:01:00.0: supports D1
[    4.873840] pci 0000:01:00.0: PME# supported from D0 D1 D3hot
[    4.880814] pci 0000:01:00.0: PME# disabled
[    4.885907] device: '0000:01:00.0': device_add
[    4.891339] bus: 'pci': add device 0000:01:00.0
[    4.897032] pci_bus 0000:01: fixups for bus
[    4.902113] pci_scan_bridge_extend:1306 starting with max: 1
[    4.909008] pci 0000:01:00.0: scanning [bus 01-ff] behind bridge, pass 0
[    4.917151] pci 0000:01:00.0: Primary bus is hard wired to 0
[    4.924006] pci 0000:01:00.0: bridge configuration invalid ([bus 01-ff]), reconfiguring
[    4.933719] pci_scan_bridge_extend:1306 starting with max: 1
[    4.940592] pci 0000:01:00.0: scanning [bus 00-00] behind bridge, pass 1
[    4.948841] device: '0000:02': device_add
[    4.953863] pci_bus 0000:02: scanning bus
[    4.958829] pci 0000:02:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.967754] pci 0000:02:00.0: PCI bridge to [bus 02-ff]
[    4.974095] pci 0000:02:00.0:   bridge window [io  0x0000-0x0fff]
[    4.981499] pci 0000:02:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.989755] pci 0000:02:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.998565] pci 0000:02:00.0: supports D1
[    5.003440] pci 0000:02:00.0: PME# supported from D0 D1 D3hot
[    5.010403] pci 0000:02:00.0: PME# disabled
[    5.015514] device: '0000:02:00.0': device_add
[    5.021018] bus: 'pci': add device 0000:02:00.0
[    5.026718] pci_bus 0000:02: fixups for bus
[    5.031798] pci_scan_bridge_extend:1306 starting with max: 2
[    5.038690] pci 0000:02:00.0: scanning [bus 02-ff] behind bridge, pass 0
[    5.046836] pci 0000:02:00.0: bridge configuration invalid ([bus 02-ff]), reconfiguring
[    5.056556] pci_scan_bridge_extend:1306 starting with max: 2
[    5.063411] pci 0000:02:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.071597] device: '0000:03': device_add
[    5.076633] pci_bus 0000:03: scanning bus
[    5.081542] pci 0000:03:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.090460] pci 0000:03:00.0: PCI bridge to [bus 03-ff]
[    5.096816] pci 0000:03:00.0:   bridge window [io  0x0000-0x0fff]
[    5.104214] pci 0000:03:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.112468] pci 0000:03:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.121305] pci 0000:03:00.0: supports D1
[    5.126167] pci 0000:03:00.0: PME# supported from D0 D1 D3hot
[    5.133154] pci 0000:03:00.0: PME# disabled
[    5.138250] device: '0000:03:00.0': device_add
[    5.143759] bus: 'pci': add device 0000:03:00.0
[    5.149432] pci_bus 0000:03: fixups for bus
[    5.154556] pci_scan_bridge_extend:1306 starting with max: 3
[    5.161430] pci 0000:03:00.0: scanning [bus 03-ff] behind bridge, pass 0
[    5.169564] pci 0000:03:00.0: bridge configuration invalid ([bus 03-ff]), reconfiguring
[    5.179287] pci_scan_bridge_extend:1306 starting with max: 3
[    5.186166] pci 0000:03:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.194343] device: '0000:04': device_add
[    5.199379] pci_bus 0000:04: scanning bus
[    5.204292] pci 0000:04:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.213211] pci 0000:04:00.0: PCI bridge to [bus 04-ff]
[    5.219590] pci 0000:04:00.0:   bridge window [io  0x0000-0x0fff]
[    5.226977] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.235219] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.244053] pci 0000:04:00.0: supports D1
[    5.248908] pci 0000:04:00.0: PME# supported from D0 D1 D3hot
[    5.255889] pci 0000:04:00.0: PME# disabled
[    5.260981] device: '0000:04:00.0': device_add
[    5.266491] bus: 'pci': add device 0000:04:00.0
[    5.272304] pci_bus 0000:04: fixups for bus
[    5.277396] pci_scan_bridge_extend:1306 starting with max: 4
[    5.284280] pci 0000:04:00.0: scanning [bus 04-ff] behind bridge, pass 0
[    5.292401] pci 0000:04:00.0: bridge configuration invalid ([bus 04-ff]), reconfiguring
[    5.302117] pci_scan_bridge_extend:1306 starting with max: 4
[    5.308988] pci 0000:04:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.317179] device: '0000:05': device_add
[    5.322234] pci_bus 0000:05: scanning bus
[    5.327204] pci 0000:05:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.336093] pci 0000:05:00.0: PCI bridge to [bus 05-ff]
[    5.342450] pci 0000:05:00.0:   bridge window [io  0x0000-0x0fff]
[    5.349855] pci 0000:05:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.358090] pci 0000:05:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.366926] pci 0000:05:00.0: supports D1
[    5.371806] pci 0000:05:00.0: PME# supported from D0 D1 D3hot
[    5.378769] pci 0000:05:00.0: PME# disabled
[    5.383870] device: '0000:05:00.0': device_add
[    5.389365] bus: 'pci': add device 0000:05:00.0
[    5.395061] pci_bus 0000:05: fixups for bus
[    5.400135] pci_scan_bridge_extend:1306 starting with max: 5
[    5.407032] pci 0000:05:00.0: scanning [bus 05-ff] behind bridge, pass 0
[    5.415202] pci 0000:05:00.0: bridge configuration invalid ([bus 05-ff]), reconfiguring
[    5.424930] pci_scan_bridge_extend:1306 starting with max: 5
[    5.431787] pci 0000:05:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.439971] device: '0000:06': device_add
[    5.444981] pci_bus 0000:06: scanning bus
[    5.449965] pci 0000:06:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.458880] pci 0000:06:00.0: PCI bridge to [bus 06-ff]
[    5.465221] pci 0000:06:00.0:   bridge window [io  0x0000-0x0fff]
[    5.472626] pci 0000:06:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.480882] pci 0000:06:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.489717] pci 0000:06:00.0: supports D1
[    5.494581] pci 0000:06:00.0: PME# supported from D0 D1 D3hot
[    5.501559] pci 0000:06:00.0: PME# disabled
[    5.506657] device: '0000:06:00.0': device_add
[    5.512165] bus: 'pci': add device 0000:06:00.0
[    5.517845] pci_bus 0000:06: fixups for bus
[    5.522956] pci_scan_bridge_extend:1306 starting with max: 6
[    5.529827] pci_scan_bridge_extend:1308 RETURN MAX 6
[    5.535860] pci_scan_bridge_extend:1306 starting with max: 6
[    5.542711] pci_scan_bridge_extend:1308 RETURN MAX 6
[    5.548746] pci_bus 0000:06: bus scan returning with max=06
[    5.555514] pci_bus 0000:06: busn_res: [bus 06-ff] end is updated to 06
[    5.563545] pci_bus 0000:05: bus scan returning with max=06
[    5.570312] pci_bus 0000:05: busn_res: [bus 05-ff] end is updated to 06
[    5.578349] pci_bus 0000:04: bus scan returning with max=06
[    5.585097] pci_bus 0000:04: busn_res: [bus 04-ff] end is updated to 06
[    5.593133] pci_bus 0000:03: bus scan returning with max=06
[    5.599906] pci_bus 0000:03: busn_res: [bus 03-ff] end is updated to 06
[    5.607924] pci_bus 0000:02: bus scan returning with max=06
[    5.614676] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 06
[    5.622713] pci_bus 0000:01: bus scan returning with max=06
[    5.629461] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 06
[    5.637490] pci_bus 0000:00: bus scan returning with max=06
[    5.644264] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 06
[    5.652330] pci 0000:00:01.0: BAR 2 [mem 0xb9000000-0xb90fffff 64bit]: assigned
[    5.661221] pci 0000:00:01.0: BAR 0 [io  0xb8c00000-0xb8c000ff]: assigned
[    5.669491] pci 0000:05:00.0: PCI bridge to [bus 06]
[    5.675542] pci 0000:04:00.0: PCI bridge to [bus 05-06]
[    5.681870] pci 0000:03:00.0: PCI bridge to [bus 04-06]
[    5.688218] pci 0000:02:00.0: PCI bridge to [bus 03-06]
[    5.694554] pci 0000:01:00.0: PCI bridge to [bus 02-06]
[    5.700907] pci 0000:00:00.0: PCI bridge to [bus 01-06]
[    5.707358] pci 0000:00:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    5.718462] pci 0000:00:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    5.728617] pcieport 0000:00:00.0: no default pinctrl state
[    5.735421] pcieport 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    5.743455] pcieport 0000:00:00.0: assign IRQ: got 0
[    5.749538] pcieport 0000:00:00.0: probe with driver pcieport rejects match -19
[    5.758451] pcieport 0000:00:00.0: devm_attr_group_remove: removing group (ptrval)
[    5.767755] pci 0000:01:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    5.778859] pci 0000:01:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    5.789015] pcieport 0000:01:00.0: no default pinctrl state
[    5.795829] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    5.803318] pcieport 0000:01:00.0: assign IRQ: got 0
[    5.809377] pci 0000:00:00.0: enabling bus mastering
[    5.815516] pcieport 0000:01:00.0: probe with driver pcieport rejects match -19
[    5.824406] pcieport 0000:01:00.0: devm_attr_group_remove: removing group (ptrval)
[    5.833686] pci 0000:02:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    5.844790] pci 0000:02:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    5.854944] pcieport 0000:02:00.0: no default pinctrl state
[    5.861772] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    5.869270] pcieport 0000:02:00.0: assign IRQ: got 0
[    5.875314] pci 0000:01:00.0: enabling bus mastering
[    5.881420] pcieport 0000:02:00.0: probe with driver pcieport rejects match -19
[    5.890304] pcieport 0000:02:00.0: devm_attr_group_remove: removing group (ptrval)
[    5.899560] pci 0000:03:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    5.910656] pci 0000:03:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    5.920816] pcieport 0000:03:00.0: no default pinctrl state
[    5.927641] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    5.935165] pcieport 0000:03:00.0: assign IRQ: got 0
[    5.941195] pci 0000:02:00.0: enabling bus mastering
[    5.947285] pcieport 0000:03:00.0: probe with driver pcieport rejects match -19
[    5.956171] pcieport 0000:03:00.0: devm_attr_group_remove: removing group (ptrval)
[    5.965439] pci 0000:04:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    5.976549] pci 0000:04:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    5.986706] pcieport 0000:04:00.0: no default pinctrl state
[    5.993586] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    6.001114] pcieport 0000:04:00.0: assign IRQ: got 0
[    6.007138] pci 0000:03:00.0: enabling bus mastering
[    6.013221] pcieport 0000:04:00.0: probe with driver pcieport rejects match -19
[    6.022134] pcieport 0000:04:00.0: devm_attr_group_remove: removing group (ptrval)
[    6.031377] pci 0000:05:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    6.042473] pci 0000:05:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    6.052628] pcieport 0000:05:00.0: no default pinctrl state
[    6.059450] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    6.066976] pcieport 0000:05:00.0: assign IRQ: got 0
[    6.073005] pci 0000:04:00.0: enabling bus mastering
[    6.079096] pcieport 0000:05:00.0: probe with driver pcieport rejects match -19
[    6.088008] pcieport 0000:05:00.0: devm_attr_group_remove: removing group (ptrval)
[    6.097241] pci 0000:06:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    6.108341] pci 0000:06:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    6.118494] pcieport 0000:06:00.0: no default pinctrl state
[    6.125315] pci 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    6.132834] pcieport 0000:06:00.0: assign IRQ: got 0
[    6.138861] pci 0000:05:00.0: enabling bus mastering
[    6.144951] pcieport 0000:06:00.0: probe with driver pcieport rejects match -19
[    6.153867] pcieport 0000:06:00.0: devm_attr_group_remove: removing group (ptrval)
[    6.163069] pci-rtl960x b8b00000.pci: driver: 'pci-rtl960x': driver_bound: bound to device
[    6.173120] pci-rtl960x b8b00000.pci: Dropping the link to 1800331c.gpio-controller
[    6.182415] device: 'platform:1800331c.gpio-controller--platform:b8b00000.pci': device_unregister
[    6.193389] pci-rtl960x b8b00000.pci: bus: 'platform': really_probe: bound device to driver pci-rtl960x
[    6.204869] devices_kset: Moving b8b20000.pci to end of list
[    6.211782] platform b8b20000.pci: Retrying from deferred list
[    6.218884] platform b8b20000.pci: bus: 'platform': __driver_probe_device: matched device with driver pci-rtl960x
[    6.231341] platform b8b20000.pci: bus: 'platform': really_probe: probing driver pci-rtl960x with device
[    6.242872] pci-rtl960x b8b20000.pci: no pinctrl handle
[    6.494621] Port0 Link@5.0Ghz
[    6.498272] device: 'pci0000:07': device_add
[    6.503515] device: '0000:07': device_add
[    6.508505] PCI host bridge to bus 0000:07
[    6.513519] pci_bus 0000:07: root bus resource [mem 0xba000000-0xbaffffff]
[    6.521866] pci_bus 0000:07: root bus resource [io  0xb8e00000-0xb8ffffff]
[    6.530204] pci_bus 0000:07: No busn resource found for root bus, will use [bus 07-ff]
[    6.539814] pci_bus 0000:07: scanning bus
[    6.544739] pci 0000:07:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.553622] pci 0000:07:00.0: PCI bridge to [bus 00]
[    6.559666] pci 0000:07:00.0:   bridge window [io  0x0000-0x0fff]
[    6.567075] pci 0000:07:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.575303] pci 0000:07:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.584130] pci 0000:07:00.0: supports D1
[    6.589007] pci 0000:07:00.0: PME# supported from D0 D1 D3hot
[    6.595971] pci 0000:07:00.0: PME# disabled
[    6.601071] device: '0000:07:00.0': device_add
[    6.606507] bus: 'pci': add device 0000:07:00.0
[    6.612374] pci 0000:07:01.0: [10ec:b832] type 00 class 0x028000 PCIe Endpoint
[    6.621214] pci 0000:07:01.0: BAR 0 [io  0x0000-0x00ff]
[    6.627577] pci 0000:07:01.0: BAR 2 [mem 0x00000000-0x000fffff 64bit]
[    6.635527] pci 0000:07:01.0: supports D1 D2
[    6.640704] pci 0000:07:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[    6.648736] pci 0000:07:01.0: PME# disabled
[    6.653866] device: '0000:07:01.0': device_add
[    6.659303] bus: 'pci': add device 0000:07:01.0
[    6.665416] pci_bus 0000:07: fixups for bus
[    6.670492] pci_scan_bridge_extend:1306 starting with max: 7
[    6.677365] pci_scan_bridge_extend:1308 RETURN MAX 7
[    6.683374] pci_scan_bridge_extend:1306 starting with max: 7
[    6.690239] pci_scan_bridge_extend:1308 RETURN MAX 7
[    6.696269] pci_bus 0000:07: bus scan returning with max=07
[    6.703024] pci_bus 0000:07: busn_res: [bus 07-ff] end is updated to 07
[    6.711071] pci 0000:07:01.0: BAR 2 [mem 0xba000000-0xba0fffff 64bit]: assigned
[    6.719980] pci 0000:07:01.0: BAR 0 [io  0xb8e00000-0xb8e000ff]: assigned
[    6.728329] pci 0000:07:00.0: bus: 'pci': __driver_probe_device: matched device with driver pcieport
[    6.739437] pci 0000:07:00.0: bus: 'pci': really_probe: probing driver pcieport with device
[    6.749607] pcieport 0000:07:00.0: no default pinctrl state
[    6.756484] pcieport 0000:07:00.0: of_irq_parse_pci: failed with rc=-22
[    6.764534] pcieport 0000:07:00.0: assign IRQ: got 0
[    6.770618] pcieport 0000:07:00.0: probe with driver pcieport rejects match -19
[    6.779538] pcieport 0000:07:00.0: devm_attr_group_remove: removing group (ptrval)
[    6.788837] pci-rtl960x b8b20000.pci: driver: 'pci-rtl960x': driver_bound: bound to device
[    6.798893] pci-rtl960x b8b20000.pci: Dropping the link to 1800331c.gpio-controller
[    6.808184] device: 'platform:1800331c.gpio-controller--platform:b8b20000.pci': device_unregister
[    6.819159] pci-rtl960x b8b20000.pci: bus: 'platform': really_probe: bound device to driver pci-rtl960x
[    6.831480] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    6.868252] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.877498] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    6.886364] clk: Disabling unused clocks
[    6.945112] Freeing unused kernel image (initmem) memory: 10796K
[    6.952664] This architecture does not have kernel memory protection.
[    6.960534] Run /init as init process
[    6.964974]   with arguments:
[    6.968601]     /init
[    6.971353]   with environment:
[    6.975142]     HOME=/
[    6.977991]     TERM=linux
[    6.981793] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    6.992481] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    7.002053] device: 'regulatory.db': device_add
[    7.357600] init: Console is alive
[    7.362265] init: - watchdog -
[    7.378001] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.389012] gpio_button_hotplug: loading out-of-tree module taints kernel.
[    7.397935] bus: 'platform': add driver gpio-keys
[    7.403909] Extended deferred probe timeout by 10 secs
[    7.410159] bus: 'platform': add driver gpio-keys-polled
[    7.416803] Extended deferred probe timeout by 10 secs
[    7.423932] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.444931] init: - preinit -
root@OpenWrt:~# lspci
07:00.0 Class 0604: 10ec:8196
00:00.0 Class 0604: 10ec:8196
06:00.0 Class 0604: 10ec:8196
05:00.0 Class 0604: 10ec:8196
04:00.0 Class 0604: 10ec:8196
03:00.0 Class 0604: 10ec:8196
07:01.0 Class 0280: 10ec:b832 <- RTL8832BR
00:01.0 Class 0280: 10ec:0192 <- RTL8192XB(R?)
02:00.0 Class 0604: 10ec:8196
01:00.0 Class 0604: 10ec:8196

  1. both supported by g6 wifi driver (see reference soft) â†Šī¸Ž

Bootlog fragment with stack overflow:
[    4.321087] platform b8b00000.pci: Retrying from deferred list
[    4.328246] platform b8b00000.pci: bus: 'platform': __driver_probe_device: matched device with driver pci-rtl960x
[    4.340739] platform b8b00000.pci: bus: 'platform': really_probe: probing driver pci-rtl960x with device
[    4.352291] pci-rtl960x b8b00000.pci: no pinctrl handle
[    4.585950] Port1 Link@2.5GHz
[    4.589624] device: 'pci0000:00': device_add
[    4.594857] device: '0000:00': device_add
[    4.599904] PCI host bridge to bus 0000:00
[    4.604879] pci_bus 0000:00: root bus resource [mem 0xb9000000-0xb9ffffff]
[    4.613235] pci_bus 0000:00: root bus resource [io  0xb8c00000-0xb8dfffff]
[    4.621620] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    4.631257] pci_bus 0000:00: scanning bus
[    4.636162] pci 0000:00:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.645074] pci 0000:00:00.0: PCI bridge to [bus 00]
[    4.651105] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    4.658511] pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.666787] pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.675641] pci 0000:00:00.0: supports D1
[    4.680505] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    4.687504] pci 0000:00:00.0: PME# disabled
[    4.692602] device: '0000:00:00.0': device_add
[    4.698060] bus: 'pci': add device 0000:00:00.0
[    4.703857] pci 0000:00:01.0: [10ec:0192] type 00 class 0x028000 PCIe Endpoint
[    4.712691] pci 0000:00:01.0: BAR 0 [io  0x0000-0x00ff]
[    4.719105] pci 0000:00:01.0: BAR 2 [mem 0x00000000-0x000fffff 64bit]
[    4.727096] pci 0000:00:01.0: supports D1 D2
[    4.732307] pci 0000:00:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.740362] pci 0000:00:01.0: PME# disabled
[    4.745492] device: '0000:00:01.0': device_add
[    4.750953] bus: 'pci': add device 0000:00:01.0
[    4.757119] pci_bus 0000:00: fixups for bus
[    4.762246] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[    4.770370] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.780100] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[    4.788306] device: '0000:01': device_add
[    4.793301] pci_bus 0000:01: scanning bus
[    4.798287] pci 0000:01:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.807213] pci 0000:01:00.0: PCI bridge to [bus 01-ff]
[    4.813552] pci 0000:01:00.0:   bridge window [io  0x0000-0x0fff]
[    4.820975] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.829244] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.838093] pci 0000:01:00.0: supports D1
[    4.842960] pci 0000:01:00.0: PME# supported from D0 D1 D3hot
[    4.849949] pci 0000:01:00.0: PME# disabled
[    4.855052] device: '0000:01:00.0': device_add
[    4.860525] bus: 'pci': add device 0000:01:00.0
[    4.866257] pci_bus 0000:01: fixups for bus
[    4.871407] pci 0000:01:00.0: scanning [bus 01-ff] behind bridge, pass 0
[    4.879548] pci 0000:01:00.0: Primary bus is hard wired to 0
[    4.886434] pci 0000:01:00.0: bridge configuration invalid ([bus 01-ff]), reconfiguring
[    4.896177] pci 0000:01:00.0: scanning [bus 00-00] behind bridge, pass 1
[    4.904394] device: '0000:02': device_add
[    4.909405] pci_bus 0000:02: scanning bus
[    4.914399] pci 0000:02:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    4.923297] pci 0000:02:00.0: PCI bridge to [bus 02-ff]
[    4.929670] pci 0000:02:00.0:   bridge window [io  0x0000-0x0fff]
[    4.937089] pci 0000:02:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    4.945322] pci 0000:02:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    4.954174] pci 0000:02:00.0: supports D1
[    4.959076] pci 0000:02:00.0: PME# supported from D0 D1 D3hot
[    4.966040] pci 0000:02:00.0: PME# disabled
[    4.971161] device: '0000:02:00.0': device_add
[    4.976616] bus: 'pci': add device 0000:02:00.0
[    4.982376] pci_bus 0000:02: fixups for bus
[    4.987466] pci 0000:02:00.0: scanning [bus 02-ff] behind bridge, pass 0
[    4.995630] pci 0000:02:00.0: bridge configuration invalid ([bus 02-ff]), reconfiguring
[    5.005368] pci 0000:02:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.013587] device: '0000:03': device_add
[    5.018596] pci_bus 0000:03: scanning bus
[    5.023578] pci 0000:03:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.032475] pci 0000:03:00.0: PCI bridge to [bus 03-ff]
[    5.038848] pci 0000:03:00.0:   bridge window [io  0x0000-0x0fff]
[    5.046266] pci 0000:03:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.054499] pci 0000:03:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.063351] pci 0000:03:00.0: supports D1
[    5.068254] pci 0000:03:00.0: PME# supported from D0 D1 D3hot
[    5.075217] pci 0000:03:00.0: PME# disabled
[    5.080338] device: '0000:03:00.0': device_add
[    5.085792] bus: 'pci': add device 0000:03:00.0
[    5.091550] pci_bus 0000:03: fixups for bus
[    5.096634] pci 0000:03:00.0: scanning [bus 03-ff] behind bridge, pass 0
[    5.104795] pci 0000:03:00.0: bridge configuration invalid ([bus 03-ff]), reconfiguring
[    5.114527] pci 0000:03:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.122745] device: '0000:04': device_add
[    5.127756] pci_bus 0000:04: scanning bus
[    5.132723] pci 0000:04:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.141663] pci 0000:04:00.0: PCI bridge to [bus 04-ff]
[    5.148026] pci 0000:04:00.0:   bridge window [io  0x0000-0x0fff]
[    5.155456] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.163730] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.172551] pci 0000:04:00.0: supports D1
[    5.177433] pci 0000:04:00.0: PME# supported from D0 D1 D3hot
[    5.184404] pci 0000:04:00.0: PME# disabled
[    5.189525] device: '0000:04:00.0': device_add
[    5.194979] bus: 'pci': add device 0000:04:00.0
[    5.200733] pci_bus 0000:04: fixups for bus
[    5.205821] pci 0000:04:00.0: scanning [bus 04-ff] behind bridge, pass 0
[    5.213984] pci 0000:04:00.0: bridge configuration invalid ([bus 04-ff]), reconfiguring
[    5.223723] pci 0000:04:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.231999] device: '0000:05': device_add
[    5.237009] pci_bus 0000:05: scanning bus
[    5.242035] pci 0000:05:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.250970] pci 0000:05:00.0: PCI bridge to [bus 05-ff]
[    5.257322] pci 0000:05:00.0:   bridge window [io  0x0000-0x0fff]
[    5.264726] pci 0000:05:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.273003] pci 0000:05:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.281824] pci 0000:05:00.0: supports D1
[    5.286713] pci 0000:05:00.0: PME# supported from D0 D1 D3hot
[    5.293678] pci 0000:05:00.0: PME# disabled
[    5.298801] device: '0000:05:00.0': device_add
[    5.304254] bus: 'pci': add device 0000:05:00.0
[    5.310018] pci_bus 0000:05: fixups for bus
[    5.315104] pci 0000:05:00.0: scanning [bus 05-ff] behind bridge, pass 0
[    5.323266] pci 0000:05:00.0: bridge configuration invalid ([bus 05-ff]), reconfiguring
[    5.333005] pci 0000:05:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.341225] device: '0000:06': device_add
[    5.346234] pci_bus 0000:06: scanning bus
[    5.351200] pci 0000:06:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.360137] pci 0000:06:00.0: PCI bridge to [bus 06-ff]
[    5.366488] pci 0000:06:00.0:   bridge window [io  0x0000-0x0fff]
[    5.373893] pci 0000:06:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.382171] pci 0000:06:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.390994] pci 0000:06:00.0: supports D1
[    5.395874] pci 0000:06:00.0: PME# supported from D0 D1 D3hot
[    5.402880] pci 0000:06:00.0: PME# disabled
[    5.407996] device: '0000:06:00.0': device_add
[    5.413462] bus: 'pci': add device 0000:06:00.0
[    5.419135] pci_bus 0000:06: fixups for bus
[    5.424280] pci 0000:06:00.0: scanning [bus 06-ff] behind bridge, pass 0
[    5.432422] pci 0000:06:00.0: bridge configuration invalid ([bus 06-ff]), reconfiguring
[    5.442158] pci 0000:06:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.450376] device: '0000:07': device_add
[    5.455451] pci_bus 0000:07: scanning bus
[    5.460403] pci 0000:07:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.469319] pci 0000:07:00.0: PCI bridge to [bus 07-ff]
[    5.475666] pci 0000:07:00.0:   bridge window [io  0x0000-0x0fff]
[    5.483073] pci 0000:07:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.491348] pci 0000:07:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.500171] pci 0000:07:00.0: supports D1
[    5.505050] pci 0000:07:00.0: PME# supported from D0 D1 D3hot
[    5.512063] pci 0000:07:00.0: PME# disabled
[    5.517173] device: '0000:07:00.0': device_add
[    5.522633] bus: 'pci': add device 0000:07:00.0
[    5.528304] pci_bus 0000:07: fixups for bus
[    5.533512] pci 0000:07:00.0: scanning [bus 07-ff] behind bridge, pass 0
[    5.541661] pci 0000:07:00.0: bridge configuration invalid ([bus 07-ff]), reconfiguring
[    5.551389] pci 0000:07:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.559613] device: '0000:08': device_add
[    5.564703] pci_bus 0000:08: scanning bus
[    5.569699] pci 0000:08:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.578638] pci 0000:08:00.0: PCI bridge to [bus 08-ff]
[    5.584988] pci 0000:08:00.0:   bridge window [io  0x0000-0x0fff]
[    5.592394] pci 0000:08:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.600665] pci 0000:08:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.609518] pci 0000:08:00.0: supports D1
[    5.614375] pci 0000:08:00.0: PME# supported from D0 D1 D3hot
[    5.621380] pci 0000:08:00.0: PME# disabled
[    5.626494] device: '0000:08:00.0': device_add
[    5.631956] bus: 'pci': add device 0000:08:00.0
[    5.637624] pci_bus 0000:08: fixups for bus
[    5.642769] pci 0000:08:00.0: scanning [bus 08-ff] behind bridge, pass 0
[    5.650906] pci 0000:08:00.0: bridge configuration invalid ([bus 08-ff]), reconfiguring
[    5.660624] pci 0000:08:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.668836] device: '0000:09': device_add
[    5.673922] pci_bus 0000:09: scanning bus
[    5.678931] pci 0000:09:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.687871] pci 0000:09:00.0: PCI bridge to [bus 09-ff]
[    5.694223] pci 0000:09:00.0:   bridge window [io  0x0000-0x0fff]
[    5.701628] pci 0000:09:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.709904] pci 0000:09:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.718752] pci 0000:09:00.0: supports D1
[    5.723610] pci 0000:09:00.0: PME# supported from D0 D1 D3hot
[    5.730608] pci 0000:09:00.0: PME# disabled
[    5.735721] device: '0000:09:00.0': device_add
[    5.741179] bus: 'pci': add device 0000:09:00.0
[    5.746849] pci_bus 0000:09: fixups for bus
[    5.751963] pci 0000:09:00.0: scanning [bus 09-ff] behind bridge, pass 0
[    5.760092] pci 0000:09:00.0: bridge configuration invalid ([bus 09-ff]), reconfiguring
[    5.769824] pci 0000:09:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.778039] device: '0000:0a': device_add
[    5.783168] pci_bus 0000:0a: scanning bus
[    5.788092] pci 0000:0a:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.797023] pci 0000:0a:00.0: PCI bridge to [bus 0a-ff]
[    5.803381] pci 0000:0a:00.0:   bridge window [io  0x0000-0x0fff]
[    5.810795] pci 0000:0a:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.819072] pci 0000:0a:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.827921] pci 0000:0a:00.0: supports D1
[    5.832778] pci 0000:0a:00.0: PME# supported from D0 D1 D3hot
[    5.839780] pci 0000:0a:00.0: PME# disabled
[    5.844899] device: '0000:0a:00.0': device_add
[    5.850367] bus: 'pci': add device 0000:0a:00.0
[    5.856049] pci_bus 0000:0a: fixups for bus
[    5.861170] pci 0000:0a:00.0: scanning [bus 0a-ff] behind bridge, pass 0
[    5.869299] pci 0000:0a:00.0: bridge configuration invalid ([bus 0a-ff]), reconfiguring
[    5.879017] pci 0000:0a:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.887236] device: '0000:0b': device_add
[    5.892371] pci_bus 0000:0b: scanning bus
[    5.897296] pci 0000:0b:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    5.906213] pci 0000:0b:00.0: PCI bridge to [bus 0b-ff]
[    5.912568] pci 0000:0b:00.0:   bridge window [io  0x0000-0x0fff]
[    5.919973] pci 0000:0b:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    5.928249] pci 0000:0b:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    5.937103] pci 0000:0b:00.0: supports D1
[    5.941965] pci 0000:0b:00.0: PME# supported from D0 D1 D3hot
[    5.948967] pci 0000:0b:00.0: PME# disabled
[    5.954085] device: '0000:0b:00.0': device_add
[    5.959542] bus: 'pci': add device 0000:0b:00.0
[    5.965211] pci_bus 0000:0b: fixups for bus
[    5.970321] pci 0000:0b:00.0: scanning [bus 0b-ff] behind bridge, pass 0
[    5.978448] pci 0000:0b:00.0: bridge configuration invalid ([bus 0b-ff]), reconfiguring
[    5.988165] pci 0000:0b:00.0: scanning [bus 00-00] behind bridge, pass 1
[    5.996383] device: '0000:0c': device_add
[    6.001502] pci_bus 0000:0c: scanning bus
[    6.006427] pci 0000:0c:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.015371] pci 0000:0c:00.0: PCI bridge to [bus 0c-ff]
[    6.021726] pci 0000:0c:00.0:   bridge window [io  0x0000-0x0fff]
[    6.029131] pci 0000:0c:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.037402] pci 0000:0c:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.046256] pci 0000:0c:00.0: supports D1
[    6.051114] pci 0000:0c:00.0: PME# supported from D0 D1 D3hot
[    6.058116] pci 0000:0c:00.0: PME# disabled
[    6.063236] device: '0000:0c:00.0': device_add
[    6.068698] bus: 'pci': add device 0000:0c:00.0
[    6.074366] pci_bus 0000:0c: fixups for bus
[    6.079485] pci 0000:0c:00.0: scanning [bus 0c-ff] behind bridge, pass 0
[    6.087637] pci 0000:0c:00.0: bridge configuration invalid ([bus 0c-ff]), reconfiguring
[    6.097340] pci 0000:0c:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.105548] device: '0000:0d': device_add
[    6.110660] pci_bus 0000:0d: scanning bus
[    6.115584] pci 0000:0d:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.124507] pci 0000:0d:00.0: PCI bridge to [bus 0d-ff]
[    6.130881] pci 0000:0d:00.0:   bridge window [io  0x0000-0x0fff]
[    6.138265] pci 0000:0d:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.146530] pci 0000:0d:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.155382] pci 0000:0d:00.0: supports D1
[    6.160243] pci 0000:0d:00.0: PME# supported from D0 D1 D3hot
[    6.167239] pci 0000:0d:00.0: PME# disabled
[    6.172354] device: '0000:0d:00.0': device_add
[    6.177809] bus: 'pci': add device 0000:0d:00.0
[    6.183470] pci_bus 0000:0d: fixups for bus
[    6.188587] pci 0000:0d:00.0: scanning [bus 0d-ff] behind bridge, pass 0
[    6.196745] pci 0000:0d:00.0: bridge configuration invalid ([bus 0d-ff]), reconfiguring
[    6.206451] pci 0000:0d:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.214664] device: '0000:0e': device_add
[    6.219784] pci_bus 0000:0e: scanning bus
[    6.224704] pci 0000:0e:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.233637] pci 0000:0e:00.0: PCI bridge to [bus 0e-ff]
[    6.240020] pci 0000:0e:00.0:   bridge window [io  0x0000-0x0fff]
[    6.247404] pci 0000:0e:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.255666] pci 0000:0e:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.264517] pci 0000:0e:00.0: supports D1
[    6.269374] pci 0000:0e:00.0: PME# supported from D0 D1 D3hot
[    6.276376] pci 0000:0e:00.0: PME# disabled
[    6.281550] device: '0000:0e:00.0': device_add
[    6.287021] bus: 'pci': add device 0000:0e:00.0
[    6.292698] pci_bus 0000:0e: fixups for bus
[    6.297810] pci 0000:0e:00.0: scanning [bus 0e-ff] behind bridge, pass 0
[    6.305964] pci 0000:0e:00.0: bridge configuration invalid ([bus 0e-ff]), reconfiguring
[    6.315707] pci 0000:0e:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.323892] device: '0000:0f': device_add
[    6.329007] pci_bus 0000:0f: scanning bus
[    6.333930] pci 0000:0f:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.342846] pci 0000:0f:00.0: PCI bridge to [bus 0f-ff]
[    6.349227] pci 0000:0f:00.0:   bridge window [io  0x0000-0x0fff]
[    6.356610] pci 0000:0f:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.364874] pci 0000:0f:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.373727] pci 0000:0f:00.0: supports D1
[    6.378589] pci 0000:0f:00.0: PME# supported from D0 D1 D3hot
[    6.385592] pci 0000:0f:00.0: PME# disabled
[    6.390711] device: '0000:0f:00.0': device_add
[    6.396163] bus: 'pci': add device 0000:0f:00.0
[    6.401832] pci_bus 0000:0f: fixups for bus
[    6.406944] pci 0000:0f:00.0: scanning [bus 0f-ff] behind bridge, pass 0
[    6.415092] pci 0000:0f:00.0: bridge configuration invalid ([bus 0f-ff]), reconfiguring
[    6.424836] pci 0000:0f:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.433023] device: '0000:10': device_add
[    6.438060] pci_bus 0000:10: scanning bus
[    6.442983] pci 0000:10:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.451938] pci 0000:10:00.0: PCI bridge to [bus 10-ff]
[    6.458326] pci 0000:10:00.0:   bridge window [io  0x0000-0x0fff]
[    6.465710] pci 0000:10:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.473969] pci 0000:10:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.482823] pci 0000:10:00.0: supports D1
[    6.487681] pci 0000:10:00.0: PME# supported from D0 D1 D3hot
[    6.494684] pci 0000:10:00.0: PME# disabled
[    6.499804] device: '0000:10:00.0': device_add
[    6.505317] bus: 'pci': add device 0000:10:00.0
[    6.511005] pci_bus 0000:10: fixups for bus
[    6.516129] pci 0000:10:00.0: scanning [bus 10-ff] behind bridge, pass 0
[    6.524278] pci 0000:10:00.0: bridge configuration invalid ([bus 10-ff]), reconfiguring
[    6.534017] pci 0000:10:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.542200] device: '0000:11': device_add
[    6.547235] pci_bus 0000:11: scanning bus
[    6.552147] pci 0000:11:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.561063] pci 0000:11:00.0: PCI bridge to [bus 11-ff]
[    6.567438] pci 0000:11:00.0:   bridge window [io  0x0000-0x0fff]
[    6.574831] pci 0000:11:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.583093] pci 0000:11:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.591946] pci 0000:11:00.0: supports D1
[    6.596811] pci 0000:11:00.0: PME# supported from D0 D1 D3hot
[    6.603805] pci 0000:11:00.0: PME# disabled
[    6.608924] device: '0000:11:00.0': device_add
[    6.614434] bus: 'pci': add device 0000:11:00.0
[    6.620255] pci_bus 0000:11: fixups for bus
[    6.625348] pci 0000:11:00.0: scanning [bus 11-ff] behind bridge, pass 0
[    6.633538] pci 0000:11:00.0: bridge configuration invalid ([bus 11-ff]), reconfiguring
[    6.643307] pci 0000:11:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.651495] device: '0000:12': device_add
[    6.656540] pci_bus 0000:12: scanning bus
[    6.661451] pci 0000:12:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.670370] pci 0000:12:00.0: PCI bridge to [bus 12-ff]
[    6.676750] pci 0000:12:00.0:   bridge window [io  0x0000-0x0fff]
[    6.684132] pci 0000:12:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.692396] pci 0000:12:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.701242] pci 0000:12:00.0: supports D1
[    6.706101] pci 0000:12:00.0: PME# supported from D0 D1 D3hot
[    6.713105] pci 0000:12:00.0: PME# disabled
[    6.718256] device: '0000:12:00.0': device_add
[    6.723761] bus: 'pci': add device 0000:12:00.0
[    6.729486] pci_bus 0000:12: fixups for bus
[    6.734572] pci 0000:12:00.0: scanning [bus 12-ff] behind bridge, pass 0
[    6.742764] pci 0000:12:00.0: bridge configuration invalid ([bus 12-ff]), reconfiguring
[    6.752534] pci 0000:12:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.760721] device: '0000:13': device_add
[    6.765765] pci_bus 0000:13: scanning bus
[    6.770677] pci 0000:13:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.779600] pci 0000:13:00.0: PCI bridge to [bus 13-ff]
[    6.785976] pci 0000:13:00.0:   bridge window [io  0x0000-0x0fff]
[    6.793367] pci 0000:13:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.801624] pci 0000:13:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.810476] pci 0000:13:00.0: supports D1
[    6.815337] pci 0000:13:00.0: PME# supported from D0 D1 D3hot
[    6.822340] pci 0000:13:00.0: PME# disabled
[    6.827484] device: '0000:13:00.0': device_add
[    6.832984] bus: 'pci': add device 0000:13:00.0
[    6.838711] pci_bus 0000:13: fixups for bus
[    6.843797] pci 0000:13:00.0: scanning [bus 13-ff] behind bridge, pass 0
[    6.851952] pci 0000:13:00.0: bridge configuration invalid ([bus 13-ff]), reconfiguring
[    6.861692] pci 0000:13:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.869923] device: '0000:14': device_add
[    6.875013] pci_bus 0000:14: scanning bus
[    6.879930] pci 0000:14:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.888885] pci 0000:14:00.0: PCI bridge to [bus 14-ff]
[    6.895287] pci 0000:14:00.0:   bridge window [io  0x0000-0x0fff]
[    6.902731] pci 0000:14:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    6.910974] pci 0000:14:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    6.919807] pci 0000:14:00.0: supports D1
[    6.924703] pci 0000:14:00.0: PME# supported from D0 D1 D3hot
[    6.931684] pci 0000:14:00.0: PME# disabled
[    6.936823] device: '0000:14:00.0': device_add
[    6.942326] bus: 'pci': add device 0000:14:00.0
[    6.948053] pci_bus 0000:14: fixups for bus
[    6.953137] pci 0000:14:00.0: scanning [bus 14-ff] behind bridge, pass 0
[    6.961284] pci 0000:14:00.0: bridge configuration invalid ([bus 14-ff]), reconfiguring
[    6.971031] pci 0000:14:00.0: scanning [bus 00-00] behind bridge, pass 1
[    6.979306] device: '0000:15': device_add
[    6.984334] pci_bus 0000:15: scanning bus
[    6.989287] pci 0000:15:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    6.998207] pci 0000:15:00.0: PCI bridge to [bus 15-ff]
[    7.004589] pci 0000:15:00.0:   bridge window [io  0x0000-0x0fff]
[    7.012023] pci 0000:15:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    7.020267] pci 0000:15:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    7.029096] pci 0000:15:00.0: supports D1
[    7.034001] pci 0000:15:00.0: PME# supported from D0 D1 D3hot
[    7.040976] pci 0000:15:00.0: PME# disabled
[    7.046106] device: '0000:15:00.0': device_add
[    7.051605] bus: 'pci': add device 0000:15:00.0
[    7.057327] pci_bus 0000:15: fixups for bus
[    7.062410] pci 0000:15:00.0: scanning [bus 15-ff] behind bridge, pass 0
[    7.070600] pci 0000:15:00.0: bridge configuration invalid ([bus 15-ff]), reconfiguring
[    7.080362] pci 0000:15:00.0: scanning [bus 00-00] behind bridge, pass 1
[    7.088576] device: '0000:16': device_add
[    7.093597] pci_bus 0000:16: scanning bus
[    7.098634] pci 0000:16:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    7.107534] pci 0000:16:00.0: PCI bridge to [bus 16-ff]
[    7.113901] pci 0000:16:00.0:   bridge window [io  0x0000-0x0fff]
[    7.121328] pci 0000:16:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    7.129569] pci 0000:16:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    7.138401] pci 0000:16:00.0: supports D1
[    7.143303] pci 0000:16:00.0: PME# supported from D0 D1 D3hot
[    7.150277] pci 0000:16:00.0: PME# disabled
/* too many chars - cut off a bit of logs */
[    7.816376] bus: 'pci': add device 0000:1c:00.0
[    7.822129] pci_bus 0000:1c: fixups for bus
[    7.827255] pci 0000:1c:00.0: scanning [bus 1c-ff] behind bridge, pass 0
[    7.835391] pci 0000:1c:00.0: bridge configuration invalid ([bus 1c-ff]), reconfiguring
[    7.845128] pci 0000:1c:00.0: scanning [bus 00-00] behind bridge, pass 1
[    7.853345] device: '0000:1d': device_add
[    7.858381] pci_bus 0000:1d: scanning bus
[    7.863342] pci 0000:1d:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    7.872252] pci 0000:1d:00.0: PCI bridge to [bus 1d-ff]
[    7.878595] pci 0000:1d:00.0:   bridge window [io  0x0000-0x0fff]
[    7.886010] pci 0000:1d:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    7.894283] pci 0000:1d:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    7.903138] pci 0000:1d:00.0: supports D1
[    7.908010] pci 0000:1d:00.0: PME# supported from D0 D1 D3hot
[    7.914999] pci 0000:1d:00.0: PME# disabled
[    7.920122] device: '0000:1d:00.0': device_add
[    7.925590] bus: 'pci': add device 0000:1d:00.0
[    7.931347] pci_bus 0000:1d: fixups for bus
[    7.936465] pci 0000:1d:00.0: scanning [bus 1d-ff] behind bridge, pass 0
[    7.944588] pci 0000:1d:00.0: bridge configuration invalid ([bus 1d-ff]), reconfiguring
[    7.954317] pci 0000:1d:00.0: scanning [bus 00-00] behind bridge, pass 1
[    7.962532] device: '0000:1e': device_add
[    7.967563] pci_bus 0000:1e: scanning bus
[    7.972554] pci 0000:1e:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    7.981477] pci 0000:1e:00.0: PCI bridge to [bus 1e-ff]
[    7.987821] pci 0000:1e:00.0:   bridge window [io  0x0000-0x0fff]
[    7.995243] pci 0000:1e:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    8.003511] pci 0000:1e:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    8.012360] pci 0000:1e:00.0: supports D1
[    8.017225] pci 0000:1e:00.0: PME# supported from D0 D1 D3hot
[    8.024240] pci 0000:1e:00.0: PME# disabled
[    8.029425] device: '0000:1e:00.0': device_add
[    8.034903] bus: 'pci': add device 0000:1e:00.0
[    8.040654] pci_bus 0000:1e: fixups for bus
[    8.045807] pci 0000:1e:00.0: scanning [bus 1e-ff] behind bridge, pass 0
[    8.053947] pci 0000:1e:00.0: bridge configuration invalid ([bus 1e-ff]), reconfiguring
[    8.063684] pci 0000:1e:00.0: scanning [bus 00-00] behind bridge, pass 1
[    8.071901] device: '0000:1f': device_add
[    8.076976] pci_bus 0000:1f: scanning bus
[    8.081894] pci 0000:1f:00.0: [10ec:8196] type 01 class 0x060400 PCIe Root Port
[    8.090841] pci 0000:1f:00.0: PCI bridge to [bus 1f-ff]
[    8.097200] pci 0000:1f:00.0:   bridge window [io  0x0000-0x0fff]
[    8.104622] pci 0000:1f:00.0:   bridge window [mem 0x00000000-0x000fffff]
[    8.112890] pci 0000:1f:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
[    8.121753] pci 0000:1f:00.0: supports D1
[    8.126623] pci 0000:1f:00.0: PME# supported from D0 D1 D3hot
[    8.133614] pci 0000:1f:00.0: PME# disabled
[    8.138737] device: '0000:1f:00.0': device_add
[    8.144199] bus: 'pci': add device 0000:1f:00.0

Awesome work on the GPIO support!

I can now see why my previous attempt with gpio patching was not successful..
I have a few comments how the patch could be improved, for example you could add to a flag to realtek_gpio_flags for enable_reg read out, similar way to how other flags are done
though.
But there is gonna be a problem with GPIO_INTERRUPTS_PER_CPU because for it should be set for bank 0 but not the bank 1 and 2. Will have to think about the solution for it in some other time maybe.

Will include gpio patch to the ongoing pull request tomorrow.

I thought about using flags, but encountered with number of problems
First of all, yes, different banks has to use different flags, what leads to different compatible values, which will grow exponentially that way (rtl9607-bank0, rtl9607-other-banks, etc)
Second, we still need to pass enable registers for each bank. And with property present, no need to check flags. So adding new property to dts looks like win-win solution

Generally speaking, I would leave single realtek-gpio compatible and list different features as dts properties (little-endian-registers, for example, which makes more sense than GPIO_PORTS_REVERSED), but it is more work, than needed

Anyway, I would like to invite @svanheule to this discussion

About the wifi part, there is rtw89 driver already present in the upstream linux and while it doesn't support RTL8832BR and RTL8192XB, they share a lot of similarities with supported wifi chips so i don't think we would have relatively hard add porting our wifi chips to this linux driver. Maybe in the future though.

Anyways, I have gone and added your gpio patches to the pull request.

Yes, but I think, that network device have to have network support. In other words, after fixing PCI probing issues, I want to support ethernet ports

Does anyone have experience with several CPU ports? I'm not sure how to correctly utilize it in terms of kernel abstractions

Yeah, i think that should be the next goal too. Although, there is USB to add support for as well which shouldn't be bad.

Well, from my understanding nic driver itself only seem to utilize the cpu port 9?

My guess is repeating what nic driver is doing with rtk_gmac_register_root_netdev function but for cpu port 10 and 7 as well.

Going from rtl960x.dtsi, I understand there a three banks in the same controller. Are you saying the ports in registers 3300-331B are reversed in layout, but the ones in 331C-3337 aren't? The per-cpu interrupt control registers are at 3338-333F, so these seem to be part of the same hardware block. The 3rd bank in the controller at the next address 3340-335B might be different, but again I would find this rather odd.

Note that without the interrupts, it doesn't actually matter which port order is used. Have you confirmed the pin interrupts to be working on the all banks?

Going from the SDK DTS and GPIO driver, it actually looks like all these banks should have the same register layout (with reversed ports like RTL9300). From a cursory glance, there seem to be three identical banks ("realtek-otto" controllers), without the per-cpu interrupt support (like RTL9310, which also has a GIC).

If you add a compatible for this SoC, and instatiate it (with one reg) at 18003300, 1800331C and 18003340, I suspect you will have all GPIOs working with interrupts:

	{
		.compatible = "realtek,rtl9607-gpio",
		.data = (void *)(GPIO_PORTS_REVERSED)
	},

Support for RTL9607C should go upstream, and they will not accept this. The different compatibles exist specifically to handle these kinds of variations in the driver.

The realtek,enable-reg property sounds like something that should be in a separate pin controller (which you can link via gpio-ranges). In fact, it doesn't even appear to be on the same bus (0x18... vs. 0x1B...), so this is very similar to RTL83xx and RTL93xx, where pincontrol is in the networking part of the SoC.

Thanks, I think I got how it should look with pinmux

No, they are all same. But per-cpu interrupt register covers only bank0, what will lead to two compatible values (with and without GPIO_INTERRUPTS_PER_CPU) for a single RTL9607 platform

While SDK GPIO driver don't use per-cpu registers, it calls network switch functions, which do that (although it just enabling/disabling interrupts for all CPUs)
Since RTL9607C have 4 CPUs (although 2 of them are virtual), and gpio-realtek-otto assumes only 2 CPUs (realtek_gpio_irq_cpu_mask()), maybe per-cpu interrupts should be excluded from flags, or mocked-up like in SDK
EDIT: driver checks CPU count, but only while probing
EDIT 2: have noticed cpu_irq_maskable, that should be enough for systems with more than 2 CPUs, right?

Haven't, only simple input-output. Could try with board reset button, but it's only one GPIO bank (don't even know which one for now)

Matching GPIO numbers with reference pretty matters, I think

It's not that I don't think you shouldn't try to match OpenWrt/Linux GPIO pins with SDK pins, but rather that either register layout will work when not using interrupts. Although the pin indices might be scrambled, so it's mostly useful for initial testing and debugging, really.

If you have input signals attached to some of the GPIOs, you can investigate a bit from u-boot or with devmem. If you leave the interrupt line to the CPU disabled, but you set the IMR to e.g. trigger on both edges, you can see if the expected ISR bit gets activated cf. the port layout.

The SDK userspace driver differs from the kernel driver with how interrupts are enabled. The register layout matches with the two registers for, but the kernel driver doesn't seem to do anything with the extra registers. If there are two per-cpu registers but four cores, I also don't really see how that would work.

To figure out where the reset button is, you should be able to set all pins to input and just see where the value changes when you press the button. You could use the libgpiod tools for this.