Linux下Chelsio T5调试方法

版权声明: https://blog.csdn.net/masterbee/article/details/87378017

T5是Chelsio的网络芯片,具体的硬件参数可以参考《Chelsio T5 HW Debug Guide V1.02.pdf》文档,如有需要请留言留下你的邮箱,我发给你。

现在我们着重讲述它在Linux下的的相关调试方法。

T5的调试分为2步:

  1. T5芯片firmware的烧录。
  2. T5芯片在Linux下的驱动调试。

 

我的调试环境为:

CPU:Intel Xeon E5-2648L

内存:64GB

硬盘:512G

系统:ubuntu 15.10 64 bit destop版本

 

一、T5 firmware的烧录

注意:

  1. 如果T5芯片是第一次烧录,即T5为空,则在烧录之前,硬件上需要把T5芯片的debug0_data0引脚下拉,烧录完成后,再复原。当正确烧录一次之后,再次烧录时,此引脚不用再下拉。
  2. 烧写所需要的所有文件,均为芯片供应商提供。t5seeprom为源码形式,如果提供的t5seeprom不能运行,则需要重新编译生成t5seeprom。

T5的firmware烧录方法如下(使用su权限):

  1. 使用 lspci | grep -i chelsio查看chelsio的前缀,比如我的为03:00.0

root@jojo-desktop:/home/jojo# lspci | grep -i chelsio

03:00.0 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.1 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.2 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.3 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.4 Ethernet controller: Chelsio Communications Inc Device 54a9

03:00.5 SCSI storage controller: Chelsio Communications Inc Device 55a9

03:00.6 Fibre Channel: Chelsio Communications Inc Device 56a9

 

2、用t5seeprom烧写eeprom文件,使用以下命令(命令中为03:00.0为第1步获取到的chelsio前缀):

./t5seeprom -b 03:00.0 write -f:./ok/eeprom.bin -K NA:000743112200

root@jojo-desktop:/home/jojo/t5# ./t5seeprom -b 03:00.0 write -f:./ok/eeprom.bin -K NA:000743112200

Using Part number(from Board) :����������������

Using Serial number(from Board) :������������������������

Using MAC address(from Board) :������������

Read 0x8000 bytes from file ./ok/eeprom.bin

0xb30 bytes of 0x8000 written

0x1808 bytes of 0x8000 written

0x25c0 bytes of 0x8000 written

0x3294 bytes of 0x8000 written

0x3f68 bytes of 0x8000 written

0x4c40 bytes of 0x8000 written

0x5914 bytes of 0x8000 written

0x65ec bytes of 0x8000 written

0x72c0 bytes of 0x8000 written

0x7f94 bytes of 0x8000 written

Wrote those bytes to serial eeprom starting at 0x0

 

3、用cxgbtool烧写bootstrap文件和firmware文件,烧写过程不会有LOG提示,持续10秒钟左右。

cxgbtool enp3s0f0 loadfw ./ok/t5fwbootstrap-1.2.0.0.bin

cxgbtool enp3s0f0 loadfw ./ok/t5fw-1.13.32.0.bin

至此,烧写firmware完成。

 

二、T5在linux下的驱动调试:

 

1. 从chelsio官网下载驱动,网址为:https://service.chelsio.com/

我的下载配置如下:

 

2. 下载后,解压,make即可。顺利的话,会在build/src/network/cxgb4/下生成cxgb4.ko文件,insmod此ko文件。完成后可使用lsmod查看cxgb4是否存在。

3. 使用dmesg | grep cxgb4 查看驱动的log,确认Firmware version和Bootstrap version能正常打印出来,则表示驱动加载OK。

 

root@jojo-desktop:/home/jojo/t5# dmesg | grep cxgb4

[   12.650763] cxgb4: module verification failed: signature and/or required key missing - tainting kernel

[   14.282757] cxgb4 0000:03:00.4: firmware on card (1.13.32.0) is older than the version bundled with this driver, installing firmware 1.16.63.0 on card.

[   39.856587] cxgb4 0000:03:00.4: Coming up as MASTER: Initializing adapter

[   40.430381] cxgb4 0000:03:00.4: Successfully configured using Firmware Configuration File "/lib/firmware/cxgb4/t5-config.txt", version 0x100002a, computed checksum 0x36228c7d

[   40.454405] cxgb4 0000:03:00.4: max_ordird_qp 255 max_ird_adapter 4096

[   40.459109] cxgb4 0000:03:00.4: Registering cxgb4 panic handler.., Buffer start address = ffff880c42c00000

[   40.469888] cxgb4 0000:03:00.4: 128 MSI-X vectors allocated, nic 32 ofld 28 rdma cpl 2 rdma ciq 28 iscsi 12 iscsit 24

[   40.484350] cxgb4 0000:03:00.4: PCIe link speed is 8.0GT/s, device supports 8.0GT/s

[   40.484353] cxgb4 0000:03:00.4: PCIe link width is x8, device supports x8

[   40.486116] cxgb4 0000:03:00.4: Chelsio T580-KR rev 1

[   40.486118] cxgb4 0000:03:00.4: S/N: \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff, P/N: \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff

[   40.486120] cxgb4 0000:03:00.4: Firmware version: 1.16.63.0

[   40.486121] cxgb4 0000:03:00.4: Bootstrap version: 1.2.0.0

[   40.486122] cxgb4 0000:03:00.4: TP Microcode version: 0.1.4.9

[   40.486123] cxgb4 0000:03:00.4: No Expansion ROM loaded

[   40.486124] cxgb4 0000:03:00.4: Serial Configuration version: 0x0

[   40.486125] cxgb4 0000:03:00.4: VPD version: 0x0

[   40.486127] cxgb4 0000:03:00.4: Configuration: RNIC MSI-X, Offload capable

[   40.494763] cxgb4 0000:03:00.4 enp3s0f4d1: renamed from eth1

[   40.508616] cxgb4 0000:03:00.4 enp3s0f4: renamed from eth0

4. 使用ifconfig -a查看网卡是否被正常识别:

root@jojo-desktop:/home/jojo/t5#ifconfig -a

 

enp3s0f4  Link encap:Ethernet  HWaddr 48:48:48:48:48:48  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:27

 

enp3s0f4d1 Link encap:Ethernet  HWaddr 48:48:48:48:48:50  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:27

注意看errors后面带的数字,为0表示没有error,为其它数值,则可能硬件有问题,需要排查。

至此,驱动加载OK。剩下的,就是测试了,把它当成网口测试即OK,这里不再详述。

猜你喜欢

转载自blog.csdn.net/masterbee/article/details/87378017
今日推荐