TI中文支持网
TI专业的中文技术问题搜集分享网站

AM4377 spi2连接w5100s网络芯片内核和设备树配置问题

各位好,

我需要在AM4377 evm板卡上增加一个网络芯片w5100s,w5100s连接到AM4377的spi2引脚,使用spi模式控制w5100s网络芯片,目前使用的SDK版本是TI官网提供的V5.2版本,内核版本是RT-Linux 4.14.79,该内核版本下提供了w5100的spi驱动,我按照如下方式修改配置内核和设备树文件后,但是在系统启动后没有去加载w5100的驱动ko文件,我不知道是不是我这边配置的哪里有问题,或是缺少了什么步骤,完整的启动串口打印的log和设备树配置文件等见附件,麻烦帮助看下可能是什么问题,非常感谢!

1、打开内核中关于wiznet下w5100的相关配置

2、打开CONFIG_SPI_SPIDEV配置

3、修改/drivers/spi/spidev.c 文件,在spidev_dt_ids[ ]中增加.compatible= "w5100"匹配项

4、重新编译配置文件tisdk_am437x-evm-rt_deconfig,内核zImage 和 驱动模块modules,将编译生成新的内核zImage、 驱动w5100.ko 和w5100-spi.ko(如下图片就是编译生成的w5100.ko 和w5100-spi.ko驱动),将新的内核烧写到nand flash,将驱动w5100.ko 和w5100-spi.ko放到nand flash文件系统/lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet中

同时我在w5100.c和w5100-spi.c中的probe函数中增加了两句pr_err打印函数,如果执行会在串口终端打印出来

5、在设备树文件中增加spi2相关配置,并重新编译设备树文件烧写到nand flash中

6、以上完成之后重新启动后lsmod列举加载的驱动发现没有w5100.ko 和w5100-spi.ko,但是出现设备节点/dev/spidev2.0,串口打印的log也没有发现相关驱动的错误,应该是这两个驱动没有去加载,我手动加载不报错,也没有打印出我在probe函数中增加的pr_err打印函数。

root@am437x-evm:~# lsmod
Module                  Size  Used by
xhci_plat_hcd          16384  0
xhci_hcd              118784  1 xhci_plat_hcd
usbcore               204800  2 xhci_plat_hcd,xhci_hcd
dwc3                   69632  0
udc_core               28672  1 dwc3
usb_common             16384  3 udc_core,usbcore,dwc3
ti_am335x_adc          16384  0
ti_prueth              73728  1
pru_rproc              20480  1 ti_prueth
pruss                  16384  2 pru_rproc,ti_prueth
pruss_intc             16384  1 pru_rproc
pm33xx                 16384  0
omap_des               20480  0
omap_aes_driver        24576  0
des_generic            28672  1 omap_des
omap_sham              28672  0
crypto_engine          16384  2 omap_des,omap_aes_driver
omap_crypto            16384  2 omap_des,omap_aes_driver
pruss_soc_bus          16384  0
ti_emif_sram           16384  1 pm33xx
dwc3_omap              16384  0
am437x_vpfe            36864  0
c_can_platform         16384  0
c_can                  20480  1 c_can_platform
can_dev                24576  1 c_can
pixcir_i2c_ts          16384  0
snd_soc_tlv320aic3x    57344  0
ov2659                 16384  0
wkup_m3_ipc            16384  1 pm33xx
v4l2_fwnode            16384  2 am437x_vpfe,ov2659
phy_omap_usb2          16384  2
wkup_m3_rproc          16384  1
ti_am335x_tscadc       16384  1 ti_am335x_adc
remoteproc             40960  4 pru_rproc,wkup_m3_rproc,wkup_m3_ipc,ti_prueth
omap_wdt               16384  0
sch_fq_codel           20480  2
cryptodev              45056  0
root@am437x-evm:~#

root@am437x-evm:~# ls  /dev                                        autofs              ptye5               ptyx2               ttyS6               ttys9
block               ptye6               ptyx3               ttyS7               ttysa
btrfs-control       ptye7               ptyx4               ttyS8               ttysb
bus                 ptye8               ptyx5               ttyS9               ttysc
char                ptye9               ptyx6               ttya0               ttysd
console             ptyea               ptyx7               ttya1               ttyse
cpu_dma_latency     ptyeb               ptyx8               ttya2               ttysf
crypto              ptyec               ptyx9               ttya3               ttyt0
fd                  ptyed               ptyxa               ttya4               ttyt1
full                ptyee               ptyxb               ttya5               ttyt2
gpiochip0           ptyef               ptyxc               ttya6               ttyt3
gpiochip1           ptyp0               ptyxd               ttya7               ttyt4
gpiochip2           ptyp1               ptyxe               ttya8               ttyt5
gpiochip3           ptyp2               ptyxf               ttya9               ttyt6
gpiochip4           ptyp3               ptyy0               ttyaa               ttyt7
gpiochip5           ptyp4               ptyy1               ttyab               ttyt8
hwrng               ptyp5               ptyy2               ttyac               ttyt9
i2c-0               ptyp6               ptyy3               ttyad               ttyta
i2c-1               ptyp7               ptyy4               ttyae               ttytb
iio:device0         ptyp8               ptyy5               ttyaf               ttytc
initctl             ptyp9               ptyy6               ttyb0               ttytd
kmsg                ptypa               ptyy7               ttyb1               ttyte
log                 ptypb               ptyy8               ttyb2               ttytf
loop-control        ptypc               ptyy9               ttyb3               ttyu0
loop0               ptypd               ptyya               ttyb4               ttyu1
loop1               ptype               ptyyb               ttyb5               ttyu2
loop2               ptypf               ptyyc               ttyb6               ttyu3
loop3               ptyq0               ptyyd               ttyb7               ttyu4
loop4               ptyq1               ptyye               ttyb8               ttyu5
loop5               ptyq2               ptyyf               ttyb9               ttyu6
loop6               ptyq3               ptyz0               ttyba               ttyu7
loop7               ptyq4               ptyz1               ttybb               ttyu8
mem                 ptyq5               ptyz2               ttybc               ttyu9
memory_bandwidth    ptyq6               ptyz3               ttybd               ttyua
mqueue              ptyq7               ptyz4               ttybe               ttyub
mtd0                ptyq8               ptyz5               ttybf               ttyuc
mtd0ro              ptyq9               ptyz6               ttyc0               ttyud
mtd1                ptyqa               ptyz7               ttyc1               ttyue
mtd1ro              ptyqb               ptyz8               ttyc2               ttyuf
mtd2                ptyqc               ptyz9               ttyc3               ttyv0
mtd2ro              ptyqd               ptyza               ttyc4               ttyv1
mtd3                ptyqe               ptyzb               ttyc5               ttyv2
mtd3ro              ptyqf               ptyzc               ttyc6               ttyv3
mtd4                ptyr0               ptyzd               ttyc7               ttyv4
mtd4ro              ptyr1               ptyze               ttyc8               ttyv5
mtd5                ptyr2               ptyzf               ttyc9               ttyv6
mtd5ro              ptyr3               ram0                ttyca               ttyv7
mtd6                ptyr4               ram1                ttycb               ttyv8
mtd6ro              ptyr5               ram10               ttycc               ttyv9
mtd7                ptyr6               ram11               ttycd               ttyva
mtd7ro              ptyr7               ram12               ttyce               ttyvb
mtd8                ptyr8               ram13               ttycf               ttyvc
mtd8ro              ptyr9               ram14               ttyd0               ttyvd
mtd9                ptyra               ram15               ttyd1               ttyve
mtd9ro              ptyrb               ram2                ttyd2               ttyvf
mtdblock0           ptyrc               ram3                ttyd3               ttyw0
mtdblock1           ptyrd               ram4                ttyd4               ttyw1
mtdblock2           ptyre               ram5                ttyd5               ttyw2
mtdblock3           ptyrf               ram6                ttyd6               ttyw3
mtdblock4           ptys0               ram7                ttyd7               ttyw4
mtdblock5           ptys1               ram8                ttyd8               ttyw5
mtdblock6           ptys2               ram9                ttyd9               ttyw6
mtdblock7           ptys3               random              ttyda               ttyw7
mtdblock8           ptys4               rfkill              ttydb               ttyw8
mtdblock9           ptys5               shm                 ttydc               ttyw9
network_latency     ptys6               snd                 ttydd               ttywa
network_throughput  ptys7               spidev2.0           ttyde               ttywb
null                ptys8               stderr              ttydf               ttywc
port                ptys9               stdin               ttye0               ttywd
ptmx                ptysa               stdout              ttye1               ttywe
ptp0                ptysb               tty                 ttye2               ttywf
pts                 ptysc               tty0                ttye3               ttyx0
ptya0               ptysd               tty1                ttye4               ttyx1
ptya1               ptyse               tty10               ttye5               ttyx2
ptya2               ptysf               tty11               ttye6               ttyx3
ptya3               ptyt0               tty12               ttye7               ttyx4
ptya4               ptyt1               tty13               ttye8               ttyx5
ptya5               ptyt2               tty14               ttye9               ttyx6
ptya6               ptyt3               tty15               ttyea               ttyx7
ptya7               ptyt4               tty16               ttyeb               ttyx8
ptya8               ptyt5               tty17               ttyec               ttyx9
ptya9               ptyt6               tty18               ttyed               ttyxa
ptyaa               ptyt7               tty19               ttyee               ttyxb
ptyab               ptyt8               tty2                ttyef               ttyxc
ptyac               ptyt9               tty20               ttyp0               ttyxd
ptyad               ptyta               tty21               ttyp1               ttyxe
ptyae               ptytb               tty22               ttyp2               ttyxf
ptyaf               ptytc               tty23               ttyp3               ttyy0
ptyb0               ptytd               tty24               ttyp4               ttyy1
ptyb1               ptyte               tty25               ttyp5               ttyy2
ptyb2               ptytf               tty26               ttyp6               ttyy3
ptyb3               ptyu0               tty27               ttyp7               ttyy4
ptyb4               ptyu1               tty28               ttyp8               ttyy5
ptyb5               ptyu2               tty29               ttyp9               ttyy6
ptyb6               ptyu3               tty3                ttypa               ttyy7
ptyb7               ptyu4               tty30               ttypb               ttyy8
ptyb8               ptyu5               tty31               ttypc               ttyy9
ptyb9               ptyu6               tty32               ttypd               ttyya
ptyba               ptyu7               tty33               ttype               ttyyb
ptybb               ptyu8               tty34               ttypf               ttyyc
ptybc               ptyu9               tty35               ttyq0               ttyyd
ptybd               ptyua               tty36               ttyq1               ttyye
ptybe               ptyub               tty37               ttyq2               ttyyf
ptybf               ptyuc               tty38               ttyq3               ttyz0
ptyc0               ptyud               tty39               ttyq4               ttyz1
ptyc1               ptyue               tty4                ttyq5               ttyz2
ptyc2               ptyuf               tty40               ttyq6               ttyz3
ptyc3               ptyv0               tty41               ttyq7               ttyz4
ptyc4               ptyv1               tty42               ttyq8               ttyz5
ptyc5               ptyv2               tty43               ttyq9               ttyz6
ptyc6               ptyv3               tty44               ttyqa               ttyz7
ptyc7               ptyv4               tty45               ttyqb               ttyz8
ptyc8               ptyv5               tty46               ttyqc               ttyz9
ptyc9               ptyv6               tty47               ttyqd               ttyza
ptyca               ptyv7               tty48               ttyqe               ttyzb
ptycb               ptyv8               tty49               ttyqf               ttyzc
ptycc               ptyv9               tty5                ttyr0               ttyzd
ptycd               ptyva               tty50               ttyr1               ttyze
ptyce               ptyvb               tty51               ttyr2               ttyzf
ptycf               ptyvc               tty52               ttyr3               ubi0
ptyd0               ptyvd               tty53               ttyr4               ubi0_0
ptyd1               ptyve               tty54               ttyr5               ubi_ctrl
ptyd2               ptyvf               tty55               ttyr6               udev_network_queue
ptyd3               ptyw0               tty56               ttyr7               urandom
ptyd4               ptyw1               tty57               ttyr8               vcs
ptyd5               ptyw2               tty58               ttyr9               vcs1
ptyd6               ptyw3               tty59               ttyra               vcs2
ptyd7               ptyw4               tty6                ttyrb               vcs3
ptyd8               ptyw5               tty60               ttyrc               vcs4
ptyd9               ptyw6               tty61               ttyrd               vcs5
ptyda               ptyw7               tty62               ttyre               vcs6
ptydb               ptyw8               tty63               ttyrf               vcsa
ptydc               ptyw9               tty7                ttys0               vcsa1
ptydd               ptywa               tty8                ttys1               vcsa2
ptyde               ptywb               tty9                ttys2               vcsa3
ptydf               ptywc               ttyS0               ttys3               vcsa4
ptye0               ptywd               ttyS1               ttys4               vcsa5
ptye1               ptywe               ttyS2               ttys5               vcsa6
ptye2               ptywf               ttyS3               ttys6               watchdog
ptye3               ptyx0               ttyS4               ttys7               watchdog0
ptye4               ptyx1               ttyS5               ttys8               zero

root@am437x-evm:~# cd /lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet/
root@am437x-evm:/lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet# ls -al
total 36
drwxrwxr-x    2 1000     1000           304 Feb 28  2019 .
drwxrwxrwx    7 root     root           488 Feb 28  2019 ..
-rwxrw-rw-    1 1000     1000          9708 Feb 28  2019 w5100-spi.ko
-rwxrw-rw-    1 1000     1000         20552 Feb 28  2019 w5100.ko

root@am437x-evm:/lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet# insmod w5100.koroot@am437x-evm:/lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet# insmod w5100-spi.ko

root@am437x-evm:/lib/modules/4.14.79-rt47-g28d73230da/kernel/drivers/net/ethernet/wiznet#

log-20190228.rar

Denny%20Yang99373:

你好,可能是DTS还需要添加W5100的网卡设备。这块我不太确定,可以咨询一下W5100厂家,看看DTS文件还需要如何修改?

nanfeng zhang:

回复 Denny%20Yang99373:

您好:

      请问您这边有厂商联系方式之类的吗,我这边不知道怎么联系他们,谢谢!

Shine:

回复 nanfeng zhang:

w5100是wiznet公司的
www.wiznet.io/…/

赞(0)
未经允许不得转载:TI中文支持网 » AM4377 spi2连接w5100s网络芯片内核和设备树配置问题
分享到: 更多 (0)