It's been nearly one year since I requested, both in their forum and here but still no solution. Other vendor like CompuLab here have a solution to change their dts to support spidev, but not SolidRun.
Checking from their dts even in the latest sr-imx8-debian-bullseye-20191201-cli-imx8mq-sdh.. image, it seems like all ecspi0,1,2 are still disabled. The HBPulse has a mikroBus interface that uses ecspi2, so this is the bus that I would like to enable. I tried changing to status to 'okay', but apparently I need to also add another node to the dts with the following entry. I'm not sure what to fill in the pinctrl-0, cs-gpios, and reg fields? Perhaps someone can look at the HbPulse schematic that I attached and provide me the info?
&ecspi2 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
status = "okay";spidev0: spi@0 {
reg = <0>;
compatible = "epson,s1d13c00";
spi-max-frequency = <500000>;
};
};
After some readings about dtb in general this is the modified:
ecspi@30830000 {
#address-cells = <0x01>;
#size-cells = <0x00>;
compatible = "spidev,fsl,imx8mq-ecspi\0fsl,imx51-ecspi";
reg = <0x00 0x30830000 0x00 0x10000>;
interrupts = <0x00 0x20 0x04>;
clocks = <0x04 0xc2 0x04 0xc2>;
clock-names = "ipg\0per";
status = "okay";
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;spidev0: spi@0 {
reg = <0>;
compatible = "spidev";
spi-max-frequency = <500000>;
status = "okay";
};
The pinctrl that handles io muxing is very complex and I'm still yet to know what to define, there is no pinctrl_ecspi2 defined anywhere in the dts.
Useful reference regarding imx8 to help modify the dts:
pinfunc - linux/imx8mq-pinfunc.h at master · torvalds/linux · GitHub
linux/arch/arm64/boot/dts/freescale at master · torvalds/linux · GitHub
https://www.nxp.com/docs/en/user-guide/i.MX_BSP_Porting_Guide_Linux.pdf (pg.31-32)
Serial Peripheral Interface (SPI)
Really wish these could be enabled by default.
Hi Gary
one can look at attached ecspi2 example for boundary devices nitrogen8m
board, and make appropriate pinmuxing changes for used board:
GitHub - boundarydevices/linux-imx6 at boundary-imx_4.14.x_2.0.0_ga
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------