IIO node for power-Pc architecture(T1024RDB)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

IIO node for power-Pc architecture(T1024RDB)

跳至解决方案
1,581 次查看
Kasturi_s
Contributor III

Dear Team,

I am using AD7689 power monitoring ADC on the T1024rdb processor(powerpc-based architecture), and I cannot get node iio in rootfs (/sys/bus/).

I have enabled iio related configuration in menuconfig, attached for reference.

Will iio node in /sys/bus/ be created in PowerPC architecture ?

Kasturi_s_0-1665466852111.png

 

Thanks in advance,

Kasturi.

0 项奖励
回复
1 解答
1,378 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please upgrade Linux Kernel to version 5.0 or above which includes AD7949 driver.

在原帖中查看解决方案

0 项奖励
回复
15 回复数
1,570 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to Documentation/devicetree/bindings/iio/adc/ad7949.txt for dts definition.

For example:

spi@110000 {

 

adc@3{

                                              #address-cells = <0x1>;

                                              #size-cells = <0x1>;

                                              compatible = "adi,ad7689";

                                              reg = <0x3>;

                                              spi-max-frequency = <16000000>;

                               };

};

 

In Linux Kernel configuration file, please define CONFIG_AD7949.

0 项奖励
回复
1,565 次查看
Kasturi_s
Contributor III

Thanks yipingwang for your quick response.

DTS is configured as below,

Kasturi_s_1-1665568663726.png

Kconfig is configured as below,

Kasturi_s_0-1665568537990.png

Enabled it in menuconfig as below,

Kasturi_s_2-1665580552310.png

But still not able to get iio node in rootfs(/sys/bus)

Kasturi_s_3-1665580703012.png

Please let me know if anything else has to be configured.

Thanks in advance,

Kasturi.

0 项奖励
回复
1,545 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Would you please provide your Linux Kernel booting up log and dts file?

0 项奖励
回复
1,535 次查看
Kasturi_s
Contributor III

Hello yipingwang,

Please find attached the kernel boot log and DTS file.

What I suspect is that driver is searching for the iio node, since the iio node is not there, the driver is not inserted.

Thanks.

0 项奖励
回复
1,532 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please modify the following in dts file.

ad7949@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "adi,ad7689";
reg = <0x3>;
spi-max-frequency = <16000000>;
};

Modify to:

ad7949@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "adi,ad7689";
reg = <0x1>;
spi-max-frequency = <16000000>;
};

0 项奖励
回复
1,527 次查看
Kasturi_s
Contributor III

Hello yipingwang,

I could not see any difference in the behavior after changing the reg = <0x1>; 

Attached is the log for reference.

0 项奖励
回复
1,519 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please check the following on your target board.

cat /sys/bus/spi/devices/spi32766.1/of_node/compatible

Please check your Linux Kernel source code drivers/iio/adc/ad7949.c whether "adi,ad7689" is valid.

0 项奖励
回复
1,515 次查看
Kasturi_s
Contributor III

Hello yipingwang,

In linux Kernel source code drivers/iio/adc/ad7949.c , "adi,ad7689" is valid.

Attaching the driver source code for your reference.

Kasturi_s_0-1666272023377.png

Thank you.

0 项奖励
回复
1,480 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please check the following on your target board.

cat /sys/bus/spi/devices/spi32766.1/of_node/compatible

0 项奖励
回复
1,473 次查看
Kasturi_s
Contributor III

Below is the log.

root@t1024rdb:/sys/firmware/devicetree/base/soc@ffe000000/spi@110000/ad7949@1# cat compatible
adi,ad7689

root@t1024rdb:/sys/firmware/devicetree/base/soc@ffe000000/spi@110000/ad7949@1# cat name
ad7949

 

When I build the driver as a module and try to insert it in the kernel, I get the below error.

==============================================================

root@t1024rdb:~# modprobe ad7949.ko
modprobe: module ad7949.ko not found in modules.dep
root@t1024rdb:~# insmod ad7949.ko
[ 184.015140] ad7949: Unknown symbol devm_iio_device_alloc (err 0)
[ 184.021239] ad7949: Unknown symbol iio_device_unregister (err 0)
[ 184.027274] ad7949: Unknown symbol iio_device_register (err 0)
insmod: can't insert 'ad7949.ko': unknown symbol in module, or unknown parameter
root@t1024rdb:~# 

=============================================================

0 项奖励
回复
1,471 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Would you please check whether following and let me know the result?

cat /sys/bus/spi/devices/spi32766.1/of_node/compatible

0 项奖励
回复
1,467 次查看
Kasturi_s
Contributor III
root@t1024rdb:~# cat /sys/bus/spi/devices/spi32766.1/of_node/compatible
adi,ad7689
0 项奖励
回复
1,426 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please run the following command in Linux and let me know the result.

 zcat /proc/config.gz | grep CONFIG_AD7949

In your booting up log, it seems that your Linux Kernel image is built on 2019-12-26.

0 项奖励
回复
1,381 次查看
Kasturi_s
Contributor III

Hello yipingwang,

I could get the below output,

**********************************************************
root@t1024rdb:~# zcat /proc/config.gz | grep CONFIG_AD7949
CONFIG_AD7949=m
**********************************************************

The image does not boot completely when the module is built with the image. Attached is the boot log for the same. So built it as a module and tried to modprobe it. That shows the "module ad7949.ko not found in modules. dep" error.

For Information:
The Kernel version that I am using is 4.1.
But the AD7949 driver support was found from kernel version 5.0 and above.
Will that be the reason, it is not working straightforwardly?
Do I need to include any dependencies?

 

0 项奖励
回复
1,379 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please upgrade Linux Kernel to version 5.0 or above which includes AD7949 driver.

0 项奖励
回复