Gpiochip412 enable usb power / power over ethernet?

Hi,

I'm Using and Aruba 303h and works, but I have a question on the USB.

It has an USB port and installing some usb packages , and chips are found see log below.
Adding and usb devices, nothing happens, and I think I have to enable usb power?

I found this on GPIO, but I don't know if this is for enabling usb power? Or maybe it's for POE out, but how can I figure it out?

root@AP-303H:/sys/class/gpio# ls -al
drwxr-xr-x    2 root     root             0 Jan  1  1970 .
drwxr-xr-x   38 root     root             0 Jan  1  1970 ..
--w-------    1 root     root          4096 Jan  1  1970 export
lrwxrwxrwx    1 root     root             0 Jan  1  1970 gpiochip412 -> ../../devices/platform/soc/1000000.pinctrl/gpio/gpiochip412
--w-------    1 root     root          4096 Jan  1  1970 unexport

Bus 002 Device 001: ID 1d6b:0003 Linux 5.15.85 xhci-hcd xHCI Host Controller
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            9
  bDeviceSubClass         0
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b
  idProduct          0x0003
  bcdDevice            5.15
  iManufacturer           3 Linux 5.15.85 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 xhci-hcd.0.auto
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0
Hub Descriptor:
  bLength              12
  bDescriptorType      42
  nNbrPorts             0
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  bHubDecLat          0.0 micro seconds
  wHubDelay             0 nano seconds
  DeviceRemovable    0x00
 Hub Port Status:
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000f
  bNumDeviceCaps          1
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x0008
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat           0 micro seconds
    bU2DevExitLat           0 micro seconds
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.85 xhci-hcd xHCI Host Controller
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9
  bDeviceSubClass         0
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x1d6b
  idProduct          0x0002
  bcdDevice            5.15
  iManufacturer           3 Linux 5.15.85 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 xhci-hcd.0.auto
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0103 power enable connect
Device Status:     0x0001
  Self Powered

No access to a device atm, but there's a package called USB ctrl/control or similar, see if you can use it to control the port.

I found now this in tthe bootlog

[ 0.026087] gpio-435 (USB-power): hogged as output/high

So it should be active?

Should I do something in de /sys/class/gpio , because I don't see gpio435???

this is in the dts file


+
+	usb-power {
+		line-name = "USB-power";
+		gpios = <23 GPIO_ACTIVE_HIGH>;
+		gpio-hog;
+		output-high;
+	};
+};

412+23=435
yes, it should be active already

OK , than it is still strange I can't see any usb devices. Tried usb stick en cp2102 uart.

Also to enable POE on my port 3 , looking at the dts file is 34, so do I need to create a gpio 412+34=446?
And how should I create it and enable it, set it in active low?

+&tlmm {
+	/*
+	 * In addition to the Pins listed below,
+	 * the following GPIOs have "features":
+	 * 39 - out - active low to force HW reset
+	 * 32 - out - active low to reset TPM
+	 * 43 - out - active low to reset BLE radio
+	 * 41 - out - pulse to set warm reset status
+	 * 34 - out - active low to enable PSE port
+	 * 22 - in  - active low when 802.3at powered
+	 * 29 - in  - active high when DC powered
+	 * 40 - in  - active low when reset due to cold HW reset
+	 * 30 - in  - active low when USB overcurrent detected
+	 * 35 - in  - interrupt line for power monitor chip
+	 * 31 - in  - active low when PSE port active

Please see https://openwrt.org/docs/techref/hardware/port.gpio#software

Thx, the POE now works, only USB is still not working . Any idea how I can fix this?

Do you have power present on USB connector?
Do you see your device(s) in cat /sys/kernel/debug/usb/devices output ?

If I use and usb tester, it gives 5v.

I only see the the internal usb host controller???

root@AP-303H:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux 5.15.85 xhci-hcd xHCI Host Controller
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.85 xhci-hcd xHCI Host Controller
root@AP-303H:~#  cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.85 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.0.auto
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.15
S:  Manufacturer=Linux 5.15.85 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.0.auto
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

you're probably missing USB2 support
check/load kmod-usb2 kmod-usb-ehci