Other Parts Discussed in Thread: AM4372
Hi Renan,
Issue: I am trying to integrate Microchip's WILC1000 wifi device with TI Sitara AM437x EVM board using SPI interface. I am using the latest SDK with kernel version 4.19.38. I am using SPI pins which is projected in the J30 connector, which is on the back side of the board. I have configured the SDK kernel for the EVM board and added WILC driver under driver/staging/wilc1000 and generated the spi module(wilc-spi.ko). I have edited the am437x-gp-evm.dts file to add the spi node and generated the dtb file and then replaced the existing zImage and dtb file in the sd card with the latest build image and dtb and board got booted up successfully.
When I try to load the spi module using "insmod wilc-spi.ko" command. I am facing spi failure.
Logs: Made a zip file and added all the below logs. Find it in the attachment
Kernel logs:Kernel_log Am437x-gp-evm.
dts file: am437x-gp-evm_dts Am4372.
dtsi : am4372_dtsi
Wilc driver load log: wilc_log
Logic Analyzer SPI probe: SPI_probe
In the SPI probe image in the attachment:
Channel 0: SCK
Channel 1: MOSI
Channel 2: MISO
Channel 3: Slave Select
Channel 4: Chip_enable
Channel 5: IRQ
Channel 6: RESET
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/All_5F00_Logs.7zBasically, as per the proper working WILC1000 device SPI probing, My CHIP_EN and RESET, IRQ should be HIGH in the beginning and IRQ should be toggle low when interrupt occur
DTS file configuration
spi1_pins_default: spi1_pins_default {
pinctrl-single,pins = < AM4372_IOPAD(0x990, PIN_INPUT | MUX_MODE3) / (N24) mcasp0_aclkx.spi1_sclk /
AM4372_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE3) / (N22) mcasp0_fsx.spi1_d0 /
AM4372_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) / (H23) mcasp0_axr0.spi1_d1 /
AM4372_IOPAD(0x99c, PIN_OUTPUT | MUX_MODE3) / (M24) mcasp0_ahclkr.spi1_cs0 /
>;
};
interrupt_pins: interrupt_pins {
pinctrl-single,pins = <
AM4372_IOPAD(0xa54, PIN_OUTPUT_PULLUP | MUX_MODE7) / (R24) spi4_d0.gpio5[5] /
AM4372_IOPAD(0xa40, PIN_OUTPUT_PULLUP | MUX_MODE7) / (G20) gpio5_10.gpio5[10] /
AM4372_IOPAD(0xa44, PIN_OUTPUT_PULLUP | MUX_MODE7) / (F23) gpio5_11.gpio5[11] /
>;
};
};
&spi1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_default>;
pinctrl-1 = <&interrupt_pins>;
wilc_spi@0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
compatible = "microchip,wilc1000";
reg = <0>;
spi-max-frequency = <16000000>;
interrupt-parent = <&gpio5>;
irq-gpios = <&gpio5 5 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
chip_en-gpios = <&gpio5 11 GPIO_ACTIVE_HIGH>;
};
};
Loading the driver is giving SPI error.
1) There is no data in the MOSI line.
2) Clock is as per the the clock frequency set in spi node
3) There is some random data in MISO
4) Slave select pins is proper(High in the beginning and then getting low)
5) Chip_en pin is staying as LOW. Not able to configure is a HIGH
6) Interrupt pin is staying HIGH
7) RESET Pin is togglling As the initial step I need to make the chip_enable pin as HIGH. Thus the WILC1000 device will get initialized. And other issue is there is no data on MOSI
can you check and let me know what I am doing wrong in my setting in dts file