Hi all,
In my project I have connected both ENC28J60 PHY and TPM2.0 SLB9670 to SPI1 bus. First one uses CS0 (mode 3), and second one CS1 (mode 2) connected to P9_42 pin. Here is my overlay:
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "BB-SPI1-ENC28J60";
version = "00A0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinmux_spi1_pins: pinmux_spi1_pins {
pinctrl-single,pins = <
0x190 0x33 /* spi1_sclk,MODE3 */
0x194 0x33 /* spi1_d0, MODE3 */
0x198 0x33 /* spi1_d1, MODE3 */
>;
};
pinmux_eth_pins: pinmux_eth_pins {
pinctrl-single,pins = <
0x19C 0x33 /* spi1_cs0, MODE3 */
0x1AC 0x37 /* INT, MODE7 */
0x028 0x37 /* RST, MODE7 */
>;
};
pinmux_tpm_pins: pinmux_tpm_pins {
pinctrl-single,pins = <
0x164 0x32 /* spi1_cs1, MODE2 */
0x024 0x37 /* IRQ, MODE7 */
0x09C 0x37 /* RST, MODE7 */
>;
};
};
};
fragment@1 {
target = <&spi1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&pinmux_spi1_pins>;
pinctrl-names = "default";
enc28j60: enc28j60@0 {
compatible = "microchip,enc28j60";
reg = <0>; /* Chip select 0 */
symlink = "bone/spi/1.0";
pinctrl-names = "default";
pinctrl-0 = <&pinmux_eth_pins>;
interrupt-parent = <&gpio3>;
interrupts = <21 0x02>; /* P9_25, falling edge */
spi-max-frequency = <16000000>;
};
slb9670: slb9670@1 {
compatible = "infineon,slb9670";
reg = <1>;
symlink = "bone/spi/1.1";
pinctrl-names = "default";
pinctrl-0 = <&pinmux_tpm_pins>;
interrupt-parent = <&gpio0>;
interrupts = <23 0x2>; /* IRQ */
spi-max-frequency = <24000000>;
};
};
};
};
Here are some logs indicating that ENC28J60 is working but TPM not:
iotlab@iotlab:~ $ dmesg | grep -i spi1.0
[ 2.247896] enc28j60 spi1.0: Ethernet driver 1.02 loaded
[ 6.512152] enc28j60 spi1.0 eth1: link down
[ 6.516651] enc28j60 spi1.0 eth1: multicast mode
[ 6.521499] enc28j60 spi1.0 eth1: multicast mode
[ 8.809323] enc28j60 spi1.0 eth1: link up - Half duplex
[ 8.850178] enc28j60 spi1.0 eth1: multicast mode
[ 8.980516] enc28j60 spi1.0 eth1: link down
[ 11.226493] enc28j60 spi1.0 eth1: link up - Half duplex
iotlab@iotlab:~ $ dmesg | grep -i spi1.1
iotlab@iotlab:~ $ dmesg | grep -i tpm
Driver for ENC28J60 is binded to SPI1.0:
iotlab@iotlab:/sys/bus/spi/drivers/enc28j60 $ ls
bind spi1.0 uevent unbind
Driver for SLB9670 is not binded to SPI1.1:
iotlab@iotlab:/sys/bus/spi/drivers/tpm_tis_spi $ ls
bind uevent unbind
Both SPI1 devices are present:
iotlab@iotlab:/sys/bus/spi/devices $ ls
spi1.0 spi1.1
Can someone point me what I am missing to have my TPM working ?
Kernel version: 6.1.33
Thanks a lot!