The SPI driver fails to obtain the GPIO pin. In the original code, the SPI driver fails to be registered. As a result, the TPM driver fails to be loaded. The error message indicates that the dependent GPIO resource is not prepared.
Self-verification:
root@localhost:/# uname -a
Linux (none) 6.6.0+ #4 SMP Fri May 10 14:36:14 CST 2024 aarch64 GNU/Linux
root@localhost:/#
root@localhost:/#
root@localhost:/# zcat /proc/config.gz | grep -i CONFIG_GPIO_DWAPB
CONFIG_GPIO_DWAPB=y
root@localhost:/#
root@localhost:/# zcat /proc/config.gz | grep -i CONFIG_SPI_DESIGNWARE
CONFIG_SPI_DESIGNWARE=y
root@localhost:/#
root@localhost:/# zcat /proc/config.gz | grep -i CONFIG_SPI_DW_MMIO
CONFIG_SPI_DW_MMIO=y
root@localhost:/#
root@localhost:/# zcat /proc/config.gz | grep -i CONFIG_TCG_TIS_CORE
CONFIG_TCG_TIS_CORE=y
root@localhost:/#
root@localhost:/# zcat /proc/config.gz | grep -i CONFIG_TCG_TIS_SPI
CONFIG_TCG_TIS_SPI=y
root@localhost:/#
root@localhost:/# ls /dev/spi*
ls: /dev/spi*: No such file or directory
root@localhost:/#
root@localhost:/#
root@localhost:/# ls
bin hclgevf.ko init root sys var
data hnae3.ko io_test run sysroot vendor
dev hns3.cfg lib sbin tmp
etc hns3.ko lib64 spidev.ko unic
hclge.ko home proc spidev_test usr
root@localhost:/#
root@localhost:/# insmod spidev.ko
[ 355.731206][ T897] spidev spi-SPT0001:00: do not use this driver in production systems!
root@localhost:/#
root@localhost:/# ls /dev/spidev0.1
/dev/spidev0.1
root@localhost:/# spidev_test -D /dev/spidev0.1 -b 8 -p "hellospi" -v
-l
spi mode: 0x20
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | 68 65 6C 6C 6F 73 70 69 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |hellospi|
RX | 68 65 6C 6C 6F 73 70 69 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |hellospi|
root@localhost:/# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 512-543, parent: platform/HISI0181:00, HISI0181:00:
gpiochip1: GPIOs 544-575, parent: platform/HISI0181:01, HISI0181:01:
gpiochip2: GPIOs 576-607, parent: platform/HISI0181:02, HISI0181:02:
gpio-583 ( |spi0 CS0 ) out hi
gpiochip3: GPIOs 608-639, parent: platform/HISI0181:03, HISI0181:03:
gpiochip4: GPIOs 640-671, parent: platform/HISI0181:04, HISI0181:04:
gpiochip5: GPIOs 672-703, parent: platform/HISI0181:05, HISI0181:05:
root@localhost:/#
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论