Chinaunix首页 | 论坛 | 博客
  • 博客访问: 25491
  • 博文数量: 8
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2017-06-30 15:18
文章分类
文章存档

2018年(7)

2017年(1)

我的朋友

分类: 嵌入式

2018-07-11 10:39:45

原文地址:bcm shell常用调试 作者:32dong809

包含四类寄存器:phy,pcic,pcim,soc

1.查看ge0phy寄存器
 phy ge0
 Port ge0 (PHY addr 0x81): 65LP (Internal 65nm SERDES PHY Driver)
        0x00: 0x0140    0x01: 0x014d    0x02: 0x0143    0x03: 0xbff0
        0x04: 0x00a0    0x05: 0x40a0    0x06: 0x0002    0x07: 0x0000
        0x08: 0x0000    0x09: 0x0000    0x0a: 0x0000    0x0b: 0x0000
        0x0c: 0x0000    0x0d: 0x0000    0x0e: 0x0000    0x0f: 0xc000
        0x10: 0x01c1    0x11: 0x0006    0x12: 0x0046    0x13: 0x0001
        0x14: 0x0016    0x15: 0x0fbf    0x16: 0x02b0    0x17: 0x0000
        0x18: 0x0000    0x19: 0x0000    0x1a: 0x0820    0x1b: 0x0000
        0x1c: 0x0000    0x1d: 0x017c    0x1e: 0x0289    0x1f: 0x0000
BCM.0>
 修改phy寄存器
 phy ge0 0x1f 0x3 //打开访问权限
 phy ge0 0x10 0x02c2 //更改0x10寄存器的值为0x02c2
 
 
2.查看pci寄存器的值
 (1)g pcic 0x00 
  查看pci的地址为0x00寄存器的值
 (2)dump pcic
  查看所有pcic寄存器的值
 
 
3.查看CMICC寄存器的值
 (1)g pcim 0x0130 
  查看地址为0x0130的寄存器值//0x0130寄存器的名称为CMIC_I2C_SLAVE_XADDR,也可以使用:g pcim CMIC_I2C_SLAVE_XADDR
 (2)dump pcim 
  查看所有pcim寄存器的值
  
4.查看soc寄存器的值
 (1)dump soc
  查看所有的soc寄存器的值
 (2)g soc XTHOL
    查看XTHOL寄存器的值,其中soc可以去掉,soc寄存器不支持"g soc 寄存器地址“的方式查看寄存器的值
 (3)s soc XTHOL.hg0 0x1111
    修改XTHOL.hg0为 0x1111
    s soc XTHOL 0x1111
    修改 XTHOL.hg0--XTHOL.hg3为0x1111
    
 


1.读PCI配置寄存器值
g pcic   0x10
g pcim  0x175
 配置PCI寄存器值
s pcic 0x10 0x81000004 
2.读寄存器值
g mac_ctrl
3.配置寄存器值
    s mac_ctrl  0x1


查看寄存器的值:dump


4.probe

5.link
link HwPortBitMap=ge0 off
Note: With linkscan disabled, autonegotiated ports will NOT have
        the MACs updated with speed/duplex

6.开启打印:debug reg
关闭打印:debug -reg

 

端口phy配置自环
BCM.0> phy diag ge0 if=line loopback mode=remote

端口取消自环

BCM.0> phy diag ge0 if=line loopback mode=none

端口内配置自环
port ge0 lb=phy
端口内取消配置自环
port ge0 lb=none

端口配置外环
#ge0配置外环
BCM.0> phy ge0 0x1f 0xffd0
BCM.0> phy ge0 0x1e 0x0
BCM.0> phy ge0 0x1f 0x0
BCM.0> phy ge0 0x10 0x05c1
#ge0 取消外环
BCM.0> phy ge0 0x1f 0xffd0
BCM.0> phy ge0 0x1e 0x0
BCM.0> phy ge0 0x1f 0x0
BCM.0> phy ge0 0x10 0x01c1

xe0端口外环
BCM.0> phy xe0 0x1f 0xffd0
BCM.0> phy xe0 0x1e 0x0
BCM.0> phy xe0 0x1f 0x0
BCM.0> phy xe0 0x10 0x0591
xe0端口取消外环
BCM.0> phy xe0 0x1f 0xffd0
BCM.0> phy xe0 0x1e 0x0
BCM.0> phy xe0 0x1f 0x0
BCM.0> phy xe0 0x10 0x0191

 

 

arp -s 168.1.40.1 00:01:02:03:04:05
ping 168.1.40.1 -c 3 -s 100


port ge0 an=0 speed=10 fd=t


g CPU_CONTROL_1
m CPU_CONTROL_1


m CPU_CONTROL_1 L3UC_TTL1_ERR_TOCPU=1
s CPU_CONTROL_1 NIP_L3ERR_TOCPU=1
命令:
combo

  
//bcm sgmii模式ok的配置
        BCM.0> phy ge0
        Port ge0 (PHY addr 0x81): 65LP (Internal 65nm SERDES PHY Driver)
        0x00: 0x0140    0x01: 0x014d    0x02: 0x0143    0x03: 0xbff0
        0x04: 0x00a0    0x05: 0x40a1    0x06: 0x0000    0x07: 0x0000
        0x08: 0x0000    0x09: 0x0000    0x0a: 0x0000    0x0b: 0x0000
        0x0c: 0x0000    0x0d: 0x0000    0x0e: 0x0000    0x0f: 0xc000
        0x10: 0x01e0    0x11: 0x0006    0x12: 0x0046    0x13: 0x0001
        0x14: 0x0017    0x15: 0x0502    0x16: 0x0220    0x17: 0x0000
        0x18: 0x0000    0x19: 0x0000    0x1a: 0x0820    0x1b: 0x0000
        0x1c: 0x0000    0x1d: 0x017c    0x1e: 0x0289    0x1f: 0x0000


      0x00: 0x0140    0x01: 0x014d    0x02: 0x0143    0x03: 0xbff0
        0x04: 0x01a0    0x05: 0x40a1    0x06: 0x0000    0x07: 0x0000
        0x08: 0x0000    0x09: 0x0000    0x0a: 0x0000    0x0b: 0x0000
        0x0c: 0x0000    0x0d: 0x0000    0x0e: 0x0000    0x0f: 0xc000
        0x10: 0x01e0    0x11: 0x0006    0x12: 0x0046    0x13: 0x0001
        0x14: 0x8017    0x15: 0x0502    0x16: 0x0220    0x17: 0x0000
        0x18: 0x0000    0x19: 0x0000    0x1a: 0x0820    0x1b: 0x0000
        0x1c: 0x0000    0x1d: 0x017c    0x1e: 0x0289    0x1f: 0x0000


PRBS配置
xe8,xe9自环
phy prbs xe8-xe9 set mode=hc p=3
phy prbs xe8-xe9 get mode=hc
  

ge5与对端设备相连
phy prbs  ge5 set mode=hc p=3  //配置prbs,配置后会发送报文,需对端也配置prbs
phy prbs ge5  get mode=hc         //接收prbs
 phy prbs hg0 clear mode=hc  //清楚

查询bcm Shell命令函数调用过程
debug bcm api;phy prbs  hg0 get mode=hc;debug bcm api

#打开调试
debugm bcm api
#关闭调试
debugm bcm -api


xgxs16g.c
配置prbs入口函数:_phy_diag_prbs


#bcm53262 fe端口配置成100M-FX模式:
1. Write 0x2100  to PHY register 0x00-0x01 (SPI offset address): to put the PHY in 100M, full duplex mode with auto-negotiation disabled.
2. Write 0x0220 to PHY register 0x20-0x21 : to bypass the scrambler/descrambler block. Bit 9 bypasses the scrambler and descrambler blocks. Bit 5 enables the 100 BASE-FX Far-End-Fault function 
3. Write 0x0020 to PHY  register 0x2E-0x2F  : to change MLT-3 code to two-level binary.
4. Write 0x008B  to PHY register 0x3E-0x3F:  setting bit 7 to enable the shadow register.
5.Write 0x0200 to PHY register 0x32-0x33 : to enable the special signal detection block.
6. Write 0x0084  to PHY register 0x3A-0x3B : to configure the transmit amplitude to 1v pk-pk.
7.  Write 0x000B  to PHY  register 0x3E-0x3F: to exit the shadow register mode.

具体配置方法如下:
  1.phy fe8 0x00 0x2100
  2.phy fe8 0x10 0x0220
  3.phy fe8 0x17 0x0020
  4.phy fe8 0x1F 0x008B
  5.phy fe8 0x19 0x0200
  6.phy fe8 0x1D 0x0084
  7.phy fe8 0x1F 0x000B

phy fe8 0x00 0x2100
phy fe8 0x10 0x0220
phy fe8 0x17 0x0020
phy fe8 0x1F 0x008B
phy fe8 0x19 0x0200
phy fe8 0x1D 0x0084
phy fe8 0x1F 0x000B

方案2(可行方案):
phy fe8 0x00 0x2100
phy fe8 0x10 0x9220
phy fe8 0x17 0x0020
phy fe8 0x1F 0x008B
phy fe8 0x19 0x0200
phy fe8 0x1D 0x0084
phy fe8 0x11 0x0a01
phy fe8 0x1F 0x000B


phy fe3 0x00 0x2100
phy fe3 0x10 0x9220
phy fe3 0x17 0x0020
phy fe3 0x1F 0x008B
phy fe3 0x19 0x0200
phy fe3 0x1D 0x0084
phy fe3 0x11 0x0a01
phy fe3 0x1F 0x000B

 

 


linux shell下,敲"ps"命令,看到的BCM相关线程如下:


 2708     2 root     SW   [tCOUNTER.2]  //robo芯片报文统计线程

 2707     2 root     SW   [tCOUNTER.1]  //robo芯片报文统计线程

 1553     2 root     SW   [bcmL2X.0]    //L2 shadow table表维护线程

 1550     2 root     SW   [bcmLINK.1]   //link状态扫描线程

 1546     2 root     SW   [bcmLINK.2]   //link状态扫描线程 

 1542     2 root     SW   [bcmARL.2]    //ARL message处理线程

 1548     2 root     SW   [bcmARL.1]

 2705     2 root     SW   [bcmCNTR.0]  //soc统计线程

 1557     2 root     SW   [bcmLINK.0]
 
 1544 root         0 SW   [bcmTX]   //报文发送线程

 1551 root         0 SW   [bcmMEM_SCAN.0]  //内存扫描线程

 1556 root         0 SW   [bcmXGS3AsyncTX]

 1561 root         0 SW   [bcm-shell] //BCM diag shell实例,bcm-diag模块里创建的一个线程,处理bcm shell里用户下发的数据。

 1584 root         0 SW   [bcmRX]  //报文接收线程

 1586 root         0 SW   [bcmDPC] //DPC线程

 

 

 

 

 


 

阅读(3712) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~