Same Hardware, new Kernel
We are trying to update to the new Kernel 5.15.32 (old Kernel 4.19.72) but the USB-PD Chip (PTN5110) just does not work:
When we start the module tcpci with our Device Tree (see below) we get the following messages:
devel@europa:/usr/lib/modules/5.15.32+g4122737b2fca$ sudo modprobe tcpci
[ 139.282440] OF: graph: no port node found in /soc/bus@2100000/i2c@21f8000/ptn5110@50
[ 139.332044] OF: graph: no port node found in /soc/bus@2100000/i2c@21f8000/ptn5110@50/connector
[ 139.341524] OF: graph: no port node found in /soc/bus@2100000/i2c@21f8000/ptn5110@50/connector
We did try to specify the port but were unlucky so far (nothing seams to work and we are trying for a few weeks now). The DT below worked wonderful in the old kernel but not the new one.
After loading the module we see some communication over the I2C port and everything seams to work fine. As soon as we plug in a USB connection the Kernel gets flooded with IRQ requests (or so it seams). The I2C bus is filled with data exchange and none of the consoles are reacting to any keystroke. After unplugging the USB connection the system reacts normal again. (the system seams to be blocked completely)
Our device tree:
/ {
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
reg_usb_otg1_vbus: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "usb_otg1_vbus";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg1_vbus>;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "okay";
};
};
};
&usbotg1 {
/*pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usbotg1>;*/
dr_mode = "otg";
status = "okay";
disable-over-current;
vbus-supply = <®_usb_otg1_vbus>;
};
&i2c4 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c4>;
status = "okay";
usb_pd: ptn5110@50 {
compatible = "nxp,ptn5110";
reg = <0x50>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_pd>;
interrupt-parent = <&gpio2>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
source-pdos = <PDO_FIXED(VSAFE5V, 2000, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)>;
sink-pdos = <PDO_FIXED(VSAFE5V, 2000, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
//PDO_FIXED(VSAFE5V, 3000, 0)
//PDO_FIXED(9000, 3000, 0)
PDO_FIXED(12000, 3000, 0)
PDO_FIXED(20000, 3000, 0)>;
//PDO_FIXED(20000, 5000, 0)>;
op-sink-microwatt = <10000000>;
};
};
};
&iomuxc {
pinctrl_i2c4: i2c4grp {
fsl,pins = <
MX6UL_PAD_UART2_TX_DATA__I2C4_SCL 0x4001b8b0
MX6UL_PAD_UART2_RX_DATA__I2C4_SDA 0x4001b8b0
>;
};
pinctrl_usb_pd: usbpdgrp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x0001b020 /* Alert Interrupt */
MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14 0x0001b020 /* Fault Interrupt */
>;
};
pinctrl_usb_otg1_vbus: usbotg1 {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x000000b9
MX6UL_PAD_ENET2_RX_DATA1__USB_OTG1_OC 0x000010b0
>;
};
};
So I did find out that the Chip goes into Fault every time I plug in a USB Connection. (It comes out of the Fault as soon as I unplug the USB)
On the I2C Bus I see that the Kernel Module keeps trying to reset the Fault flag without success.
I see a repeating pattern of:
As I wrote, the chip was working fine with the old Kernel 4.19.72 but not with the new Kernel 5.15.68.
If someone could tell me what is going wrong I would be very thankful.
The PTN5110 bindings for IMX6UL are the same that the IMX8MM, you can try this:
ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_typec1>; reg = <0x50>; interrupt-parent = <&gpio2>; interrupts = <11 8>; status = "okay"; port { typec1_dr_sw: endpoint { remote-endpoint = <&usb1_drd_sw>; }; }; typec1_con: connector { compatible = "usb-c-connector"; label = "USB-C"; power-role = "dual"; data-role = "dual"; try-power-role = "sink"; source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM) PDO_VAR(5000, 20000, 3000)>; op-sink-microwatt = <15000000>; self-powered; }; };
This reduces the messages from the module by 1 but the overall behaviour stays the same:
devel@ganymed:~$ sudo modprobe tcpci
[ 297.071214] OF: graph: no port node found in /soc/bus@2100000/i2c@21f8000/ptn5110@50/connector
[ 297.080634] OF: graph: no port node found in /soc/bus@2100000/i2c@21f8000/ptn5110@50/connector
After loading the module and connecting the USB cable the system gets blocked by IRQ Requests from the chip and only response again after disconnecting the USB Connection.
Ok, I see, could you please try with this?:
ptn5110@50 { compatible = "nxp,ptn5110"; reg = <0x50>; interrupt-parent = <&gpio3>; interrupts =IRQ_TYPE_LEVEL_LOW>; usb_con: connector { compatible = "usb-c-connector"; label = "USB-C"; data-role = "dual"; power-role = "dual"; try-power-role = "sink"; source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>; sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) PDO_VAR(5000, 12000, 2000)>; op-sink-microwatt = <10000000>; ports { #address-cells = <1>; #size-cells = <0>; port@1 { reg = <1>; usb_con_ss: endpoint { remote-endpoint = <&usb3_data_ss>; }; }; }; }; };
Using this configuration does not change the faulty behaviour. Maybe it is not even a Problem of the Ports but the interrupt configuration:
As soon as I attach a USB Cable it seams to me as if the module can not resolve the interrupt request of the device. Do you see something wrong with that part of the configuration?
In the Documentation of the Kernel (https://www.kernel.org/doc/Documentation/devicetree/bindings/connector/usb-connector.yaml), we found this:
ports:
$ref: /schemas/graph.yaml#/properties/ports
description: OF graph bindings modeling any data bus to the connector
unless the bus is between parent node and the connector. Since a single
connector can have multiple data buses every bus has an assigned OF graph
port number as described below.
properties:
port@0:
$ref: /schemas/graph.yaml#/properties/port
description: High Speed (HS), present in all connectors.
port@1:
$ref: /schemas/graph.yaml#/properties/port
description: Super Speed (SS), present in SS capable connectors.
port@2:
$ref: /schemas/graph.yaml#/properties/port
description: Sideband Use (SBU), present in USB-C. This describes the
alternate mode connection of which SBU is a part.
required:
- port@0
Are you sure, we should not just use port@0?
What is referenced with usb1_drd_sw?
port {
typec1_dr_sw: endpoint {
remote-endpoint = <&usb1_drd_sw>;
};
};
and does it in return have to reference the typec1_dr_sw endpoint?
I guess you refer this:
&usbotg1 { dr_mode = "otg"; hnp-disable; srp-disable; adp-disable; usb-role-switch; disable-over-current; samsung,picophy-pre-emp-curr-control = <3>; samsung,picophy-dc-vol-level-adjust = <7>; status = "okay"; port { usb1_drd_sw: endpoint { remote-endpoint = <&typec1_dr_sw>; }; }; };
As I said, the IC2 of IMX6UL is the same that IMX8MM, so you can refer here for review that part.
I hope I have answered your question.
Best regards!