Post Go back to editing

MAX3421E SPI TO USB Linux driver Not working as expected

Category: Software
Product Number: MAX3421E

Hi Team,

We are planning to use MAX3421 chip as a bridge chip between the processor and a Wi-Fi/BT module for one of our requirement. For that we are performing the PoC.

Please find below the details of the kernel version and operating system:

OS: Yocto Linux

Kernel: 5.15

In our case, we want to use the MAX3421 chip in host mode. 

We have validated the Wi-Fi/BT module on Linux host machine and it is working fine. However, when the same module is connected to processor through MAX3421 IC, the chip is not working as expected.

can you share latest Linux driver of MAX3421 chip which support 5.15 kernel ? 

Thanks,

Parents
  • Hi,

    MAX3421 chip driver is already upstream and th elatest version is in the 5.15 mainline kernel.

    You can find here the devicetree bindings and sources here.

    If that's the driver you're using maybe you can explain the problem you're having and give us some details like do you see the USB host in linux with lsusb?
    Which speed you're running the SPI between host processor and MAX3421?

    Bogdan

  • hi bogdan,

    we are able to detect bt module on usb line.

    we are using same device tree and linux driver as mention by you.

    problem is the communication between the bt module and max3421 chip.

    check attched logs of spi driver.

    when SPI driver is probe:
    [ 10.648796][ T425] max3421_probe 1935 called
    [ 10.653415][ T425] max3421-hcd spi0.0: property 'maxim,vbus-en-pin' value is <8 1>
    [ 10.653466][ T425] max3421-hcd spi0.0: The value of irq is = 317 from max3421_probe
    [ 10.661642][ T425] max3421-hcd spi0.0: MAX3421 USB Host-Controller Driver
    [ 10.661645][ T425] max3421-hcd spi0.0: new USB bus registered, assigned bus number 1
    [ 10.661790][ T425] usb usb1: Manufacturer: Linux 5.15.104-qki-consolidate-android13-8-gf0d819d80775-dirty max3421
    [ 10.663287][ T817] max3421-hcd spi0.0: rev 0x13, SPI clk 26000000Hz, bpw 8, irq 317
    [ 10.663455][ T817] *** DEBUG_SPI *** max3421_reset_hcd :1330
    [ 10.668908][ T817] *** DEBUG_SPI *** max3421_detect_conn :1138
    [ 10.670704][ T817] *** DEBUG_SPI *** max3421_spi_thread :1492
    [ 10.671126][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 11.186565][ T58] usb 1-1: new full-speed USB device number 2 using max3421-hcd
    [ 11.221350][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.221513][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.221716][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.580537][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.580690][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.581000][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.586587][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.586744][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.586992][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.591786][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.591993][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.592286][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.593284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.593471][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.593764][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.594672][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.594841][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.595135][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.596462][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.596693][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.596925][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 15.690864][ T817] max3421_handle_irqs: hrsl_stats 19 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0
    [ 20.692049][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 25.695551][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 30.700048][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 35.703598][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 40.708045][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 45.711543][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 50.716039][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 55.719499][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 60.724038][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 65.727534][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 70.732035][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 75.735560][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 80.740027][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


    when bt module start communicating with MAX3421 chip:


    [ 80.869970][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.870099][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.870284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 80.873204][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.873332][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.873507][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.352673][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.352804][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.352991][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.356236][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.356367][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.356544][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.673820][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.673950][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.674125][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 85.743758][ T817] max3421_handle_irqs: hrsl_stats 2405 0 0 0 1951 0 0 0 0 0 0 0 0 0 0 0
    [ 90.747355][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4931 0 0 0 0 0 0 0 0 0 0 0
    [ 95.751415][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4925 0 0 0 0 0 0 0 0 0 0 0
    [ 100.756028][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4928 0 0 0 0 0 0 0 0 0 0 0
    [ 105.759628][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4921 0 0 0 0 0 0 0 0 0 0 0
    [ 110.764312][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4927 0 0 0 0 0 0 0 0 0 0 0
    [ 115.767802][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4934 0 0 0 0 0 0 0 0 0 0 0
    [ 120.772170][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 2153 0 0 0 0 0 0 0 0 0 0 0
    [ 125.776073][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1769 0 0 0 0 0 0 0 0 0 0 0
    [ 130.781209][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1808 0 0 0 0 0 0 0 0 0 0 0
    [ 135.785536][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1679 0 0 0 0 0 0 0 0 0 0 0

Reply
  • hi bogdan,

    we are able to detect bt module on usb line.

    we are using same device tree and linux driver as mention by you.

    problem is the communication between the bt module and max3421 chip.

    check attched logs of spi driver.

    when SPI driver is probe:
    [ 10.648796][ T425] max3421_probe 1935 called
    [ 10.653415][ T425] max3421-hcd spi0.0: property 'maxim,vbus-en-pin' value is <8 1>
    [ 10.653466][ T425] max3421-hcd spi0.0: The value of irq is = 317 from max3421_probe
    [ 10.661642][ T425] max3421-hcd spi0.0: MAX3421 USB Host-Controller Driver
    [ 10.661645][ T425] max3421-hcd spi0.0: new USB bus registered, assigned bus number 1
    [ 10.661790][ T425] usb usb1: Manufacturer: Linux 5.15.104-qki-consolidate-android13-8-gf0d819d80775-dirty max3421
    [ 10.663287][ T817] max3421-hcd spi0.0: rev 0x13, SPI clk 26000000Hz, bpw 8, irq 317
    [ 10.663455][ T817] *** DEBUG_SPI *** max3421_reset_hcd :1330
    [ 10.668908][ T817] *** DEBUG_SPI *** max3421_detect_conn :1138
    [ 10.670704][ T817] *** DEBUG_SPI *** max3421_spi_thread :1492
    [ 10.671126][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 11.186565][ T58] usb 1-1: new full-speed USB device number 2 using max3421-hcd
    [ 11.221350][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.221513][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.221716][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.580537][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.580690][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.581000][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.586587][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.586744][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.586992][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.591786][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.591993][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.592286][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.593284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.593471][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.593764][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.594672][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.594841][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.595135][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.596462][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.596693][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.596925][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 15.690864][ T817] max3421_handle_irqs: hrsl_stats 19 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0
    [ 20.692049][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 25.695551][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 30.700048][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 35.703598][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 40.708045][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 45.711543][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 50.716039][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 55.719499][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 60.724038][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 65.727534][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 70.732035][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 75.735560][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 80.740027][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


    when bt module start communicating with MAX3421 chip:


    [ 80.869970][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.870099][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.870284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 80.873204][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.873332][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.873507][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.352673][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.352804][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.352991][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.356236][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.356367][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.356544][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.673820][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.673950][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.674125][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 85.743758][ T817] max3421_handle_irqs: hrsl_stats 2405 0 0 0 1951 0 0 0 0 0 0 0 0 0 0 0
    [ 90.747355][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4931 0 0 0 0 0 0 0 0 0 0 0
    [ 95.751415][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4925 0 0 0 0 0 0 0 0 0 0 0
    [ 100.756028][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4928 0 0 0 0 0 0 0 0 0 0 0
    [ 105.759628][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4921 0 0 0 0 0 0 0 0 0 0 0
    [ 110.764312][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4927 0 0 0 0 0 0 0 0 0 0 0
    [ 115.767802][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4934 0 0 0 0 0 0 0 0 0 0 0
    [ 120.772170][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 2153 0 0 0 0 0 0 0 0 0 0 0
    [ 125.776073][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1769 0 0 0 0 0 0 0 0 0 0 0
    [ 130.781209][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1808 0 0 0 0 0 0 0 0 0 0 0
    [ 135.785536][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1679 0 0 0 0 0 0 0 0 0 0 0

Children