查看: 1931|回复: 0

LS 1028A开发板之GPIO复用、以太网子系统

[复制链接]
发表于 2022-4-19 17:10:32 | 显示全部楼层 |阅读模式
关键词: 编程 , 嵌入式 , 单片机

由于OK1028A-[color=inherit !important]C这块开发板在日常的客户咨询过程中关于[color=inherit !important]GPIO的复用、网口的对应关系以及TSN的相关特性问的比较多,故整理了这篇文档,以解决客户的疑问。

一、GPIO的复用

以[color=inherit !important]SPI复用为GPIO为例

在[color=inherit !important]LS1028A.pdf中查找可以看到,1028底板上SPI_SIN可以复用为GPIO_DAT13,SPI3_SCK可复用为GPIO3_DAT14,SPI_SIN可复用为GPIO3_DAT13,SPI3_SOUT可复用为GPIO3_DAT16。

在[color=inherit !important]LS1028ARM.pdf中可以看到对应的RCW字段为SPI3_PMUX。

通过此图可知 ,当SPI3_PMUX=1时,[color=inherit !important]引脚被配置为GPIO3_DAT[16:13],在RCW中修改后,重新编译替换烧写即可。

RCW路径:

OK1028-linux-fs/packages/firmware/rcw/ls1028ardb/R_SQPP_0x85bb/rcw_1500_gpu600.rcw

[color=inherit !important]LS028A开发板验证阶段:

root@forlinx:~#ls /sys/class/gpio

export gpiochip416  gpiochip448  gpiochip480  unexport

输入上述[color=inherit !important]命令出现四组gpiochip,一般对应关系为:

Gpiochip480对应gpio1[];

Gpiochip448对应gpio2[];

Gpiochip416对应gpio3[];   

若要验证单个引脚则在此基础上做加法即可,GPIO3_DATx=gpiochip416+x,

以GPIO3_DAT14为例:

root@forlinx:~#echo 430 > /sys/class/gpio/export

root@forlinx:~#echo out > /sys/class/gpio/gpio430/direction

root@forlinx:~#echo 1 > /sys/class/gpio/gpio430/value

root@forlinx:~#cat  /sys/class/gpio/gpio430/value

1

root@forlinx:~#echo 0 > /sys/class/gpio/gpio430/value

root@forlinx:~#cat  /sys/class/gpio/gpio430/value

0

同时可以量出此引脚高低[color=inherit !important]电平的变化。

SPI3接口复用为GPIO时是整组复用的,当SPI3_PMUX=1时,引脚被配置为GPIO3_DAT[16:13]。

二、OK1028A-C网口对应关系

eno0为[color=inherit !important]SGMII1G-T protocol,swp0-swp3为QSGMII1G。

1、网口switch介绍

以太网系统由两个组件组成:以太网控制器(EN[color=inherit !important]ETC)和支持TSN的以太网交换机。

下图描述了LS1028A中的以太网子系统。



以太网控制器ENETC是一个虚拟以太网控制器,支持GbE速度和时间敏感网络(TSN)功能。ENETC提供完全集成的GbE媒体访问控制器(MACs)。

它支持抢占和各种三层加速和卸载功能的协议,包括IP,TCP, UDP和ICMP,同时保持线速度在所有接口。

2、以太网控制器特性

以太网控制器支持以下特性:

•Implements the full 802.3 specification withpreamble/SFD generation, frame padding generation, CRC generation andchecking.

•One 10/100/1000/2500 Mbit/s Ethernet port. ThroughSerDes, SGMII (1G/2.[color=inherit !important]5G) and USXGMII (2.5G) MAC-PHY

specificationsare supported.

•One 10/100/1000 Mbit/s Ethernet port with [color=inherit !important]RGMIIinterface.

•One 2500 Mbit/s Ethernet port connected internallyto TSN Switch for switch data transmission.

•One 1000-Mbit/s Ethernet port connected internallyto TSN Switch for switch management.

•Supports jumbo Ethernet frames with a size up to9600 bytes

•Supports double tagged VLAN frames according toIEEE 802.1Q

•Supports IEEE 802.1Qbu preemption

CI Express root complex integrated endpointdevice

3、TSN以太网交换机特性

TSN以太网交换机提供了一组丰富的以太网交换特性,例如高级的基于TCAM的VLAN和QOS处理,以及使用基于TCAM的通用内容感知处理器(VCAP)的安全处理。

设备提供对时间敏感的组网特性,包括IEEE1588精确时间协议、时间感知整形、无缝冗余、逐流过滤和监管、抢占、切通交换等。

TSN以太网交换机支持以下特性:

•Four external 10/100/1000/2500-Mbit/s Ethernetports. Through SerDes, SGMII (1G/2.5G) and USXGMII (2.5G) MAC

PHYspecifications are supported.

•One 2500 Mbit/s Ethernet port connected internallyto ENETC for data transmission.

•One 1000 Mbit/s Ethernet port connected internallyto ENETC for management.

•One internal CPU port, for frame extraction andinjection.

•128KB of integrated shared packet memory.

•Fully nonblocking wire-speed switching performancewith weighted random early detection (WRED) for all frame sizes.


概括起来就是LS1028A最多可以引出6个网口,且都支持TSN。

至此文章已结束,希望您通过本篇文章可以对LS1028A的ENETC、TSN交换机的特性有更深的了解。再遇到OK1028A-C开发板GPIO的复用时,可以有一定参考。

如您拿到产品的使用过程中有其他问题,可以联系我们的技术支持获取帮助。https://www.forlinx.com/product/126.html


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关于我们  -  服务条款  -  使用指南  -  站点地图  -  友情链接  -  联系我们
电子工程网 © 版权所有   京ICP备16069177号 | 京公网安备11010502021702
快速回复 返回顶部 返回列表