总结:上面已经将phy的状态设置成了 phydev->state = PHY_READY,同时完成了emac接口下的phy设备驱动注册,接下来将分析如何使用该phy设备驱动。
/*分析DM9000网卡驱动之初始化*/ /*找到DM9000.c 文件路径: linux/drivers/net下 找到模块的入口函数处 */ static int __init dm9000_init(void) { printk(KERN_INFO "%s Ethernet Driver, V%s\n", CARDNAME, DRV_VERSION); return platform_driver_register(&dm9000_driver); } /*很明显DM9000
在嵌入式系统里,以太网是一个基本的接口,既用于调试,也用于数据传输。所以在单板调试过程中,以太网是一个基本的任务。如果以太网工作正常,也可以说是一个重要的里程碑。 Xilinx MPSoC支持多个网卡,应用成熟,下面是常见的调试思路。
网卡(Network Interface Card,简称NIC),也称网络适配器,是电脑与局域网相互连接的设备。无论是普通电脑还是高端服务器,只要连接到局域网,就都需要安装一块网卡。如果有必要,一台电脑也可以同时安装两块或多块网卡。
NXP官方linux仓库地址为:https://github.com/Freescale/linux-fslc/tree/5.4-2.1.x-imx。
1)首先根据"snps,dwc3"进行dts和driver的匹配,执行dwc3_probe()
可以看到PHY的数据是RJ45网络接口(网线口)穿过了的差分信号,而PHY作用就是将差分信号转为数字信号,这块内容不用深究,制造商都设计好了。那我们干什么呢?(主要是对phy芯片进行模式选择,比如工作速率,工作模式)
复制一份imx_v6_v7_defconfig,这里我命名为dfos_mini_defconfig。
高通5G平台SDX55支持5G独立组网(SA)和非独立组网(NSA)两种网络架构,同时兼容LTE和WCDMA制式,拥有更快的传输速度,更优秀的承载能力,以及更低的网络延时,可广泛应用于网关、工业监控、远程医疗、无人机、虚拟现实和沉浸式体验(VR和AR)、智慧能源、车联网、工业互联网、智慧教育、高清视频、智慧城市、家庭娱乐等多个领域。
首先定义参考时钟。其中的psgtr_ref_clk_2 ,是SATA使用的125MHz的参考时钟。
在Xilinx的ZCU102和ZCU106单板设计中,使用了管脚PS_MODE1作为外部USB Phy的复位信号。在MPSoC的文档ug1085和ug1087中,关于PS_MODE1的信息比较少。下面是更详细的描述。
I.MX6UL/ULL 有两个网络接口 ENET1 和 ENET2,I.MX6U-ALPHA 开发板提供了这两个网络接口,其中 ENET1 和 ENET2 都使用 LAN8720A 作为 PHY 芯片。
说是网络,其实是网卡驱动。而且是针对于FREESCALE芯片的FEC端的驱动,我不知道别的芯片厂商的FEC模块是怎么样的, 但就我接触过的几款FREESCALE的芯片来看,比如基于POWERPC的860T和ARM系列的MX27等,他们的FEC有一个明显的特点就是 都是由BD和一个DMA缓冲组成,而这个DMA是专用的,也就是只是给FEC使用,区别于芯片内的DMAC模块。我们先来从fec.c这 个与硬件直接相关的看起: 首先找到module_init(fec_enet_module_init);这里fec_enet_module_init为入口点 fec_enet_module_init() 首先调用fec_arch_init,它调用gpio_fec_active设置GPIO为FEC模式,然后如果有电源管理的话,就调用 mxc_fec_power_on开启电源。接着调用clk_get,clk_enable, clk_put设置FEC的CLOCK,这里退出fec_arch_init函数,接 着循环FEC_MAX_PORTS次,也就是有几个FEC就循环几次,在这里我们只有一个FEC,所以这个循环不用管。接下来因为我们 用的是以太网,所以调用dev = alloc_etherdev(sizeof(struct fec_enet_private));申请一个以太网设备描述,其中 struct fec_enet_private是用来描述FEC专有的数据结构。如下: /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and * tx_bd_base always point to the base of the buffer descriptors. The * cur_rx and cur_tx point to the currently available buffer. * The dirty_tx tracks the current buffer that is being sent by the * controller. The cur_tx and dirty_tx are equal under both completely * empty and completely full conditions. The empty/ready indicator in * the buffer descriptor determines the actual condition. */ struct fec_enet_private { /* Hardware registers of the FEC device */ volatile fec_t *hwp; /* The saved address of a sent-in-place packet/buffer, for skfree(). */ unsigned char *tx_bounce[TX_RING_SIZE]; struct sk_buff* tx_skbuff[TX_RING_SIZE]; struct sk_buff* rx_skbuff[RX_RING_SIZE]; ushort skb_cur; ushort skb_dirty; /* CPM dual port RAM relative addresses. */ void * cbd_mem_base; /* save the virtual base address of rx&tx buffer descripter */ cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ cbd_t *tx_bd_base; cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ struct net_device_stats stats; uint tx_full; spinlock_t lock; uint phy_id; uint phy_id_done; uint phy_status; uint phy_speed; phy_info_t const *p
2 在probe里 申请网络结构体net_device、对相关变量函数赋值,注册网络结构体net_device
有这么一个需求:需要远程访问内网的nas。然后现成的解决方案有蒲公英这个方案,但是个人版的话限了只能3个设备,因此找了半天,最后选择了功能类似的zerotier.
现在遇到这样一个问题,没有USB,甚至于USB都没有电压输出,检查电路,USB供电是由一个TPS2051BDBV来控制的,这个芯片又是USB3320C来控制的,说明这个芯片没有工作。经过一天的排查,最后终于找到原因了。是因为没有设置设备树。设备树这方面我并不是很懂,所以整理一下。 首先,先找到编译出来的设备树。文件是images/linux/system.dtb。 在这篇文章 《设备树(device tree)学习笔记》 找到了反向编译工具fdtdump,使用fdtdump工具将其反向编译。 结果就是这样的:
上图来自 瑞昱半导体 (RealTek) 的 RTL8201F 系列网卡 PHY 芯片手册。按OSI 7层网络模型划分,网卡PHY 芯片(图中的RTL8201F)位于物理层,对应的软件层就是本文讨论的 PHY 驱动层;而 MAC 位于 数据链路层,也是通常软件上所说的网卡驱动层,它不是本文的重点,不做展开。另外,可通过 MDIO 接口对 PHY 芯片进行配置(如PHY芯片寄存器读写),而 PHY 和 MAC 通过 MII/RMII 进行数据传输。
系统发育推断(phylogenetic inference)的算法五花八门,从最简单的UPGMA法,到邻接法(neighbor joining)、最大简约法(maximum parsimony),再到复杂的的最大似然法(maximum likelihood)与贝叶斯推断法(Bayesian inference),每种方法都有不少可选择的实现工具。这些方法无一例外都遵循一个规律:越精确则速度越慢。而随着分析的数据越来越庞大,对于用户来说,需要寻找一个尽可能快速而且错误率可以容忍的算法是十分必要的。
本章节为大家讲解RL-TCPnet的底层驱动,主要是STM32自带MAC的驱动实现和PHY的驱动实现。
这个模块是 Asix PHY 的网络驱动程序。它是作为用 C 编写的现有驱动程序的替代方法提供的。这些功能是等效的。
在linux内核映射物理地址的简单代码。 使用request_mem_region和ioremap映射物理地址。 映射之后,可通过虚拟地址读写对应的寄存器。
硬件设备及镜像 主板为:Yuzuki Lizard V851S开发板 宿主机环境:ubuntu 22.04 SDK版本:Yuzukilizard的github上的Docker镜像 img为:github上Yuzukilizard释放的镜像:[01]v851s_linux_lizard_uart0_2022_12_29.img v851s_linux_lizard_uart0_2022_12_29.img
本节主要介绍我们开发过程中,WiFi常用的开发工具,内容主要介绍工具种类以及基本的使用方法,更多使用可以见后面章节。
传输文件每次都插拔 SD 卡太麻烦了,还是使用网线传输文件比较快,借此机会讲述一下 通过 tftp下载 kernel 和 nfs 挂载文件系统
RK33999使用synopsys dwc3的USB3.0控制器IP。早期的初始化需要在两个模块中进行,一个在rockchip官方提供的驱动中初始化,位于drivers/usb/dwc3/dwc3-rockchip.c文件中,主要初始化和CPU紧密相关的内容,如时钟、复位、电源、extcon(用于USB模式切换),另一个在synopsys提供的驱动中初始化,位于drivers/usb/dwc3/core.c文件中,这部分和USB3.0控制器密切相关,如USB3.0控制器内部寄存器地址、USB3.0的PHY、中断等。只有两个模块都初始化完毕,USB3.0控制器才能正常工作。本节只分析USB驱动早期初始化部分。
首先的步骤,安装模型转换工具 下载Verisilicon_Tool_Acuity_Toolkit和Verisilicon_Tool_VivanteIDE,按照文档安装配置
1、 硬件配置,通过电阻上下拉确定;6096的硬件配置不可以错,其在port status寄存器状态中有相应的寄存器位体现硬件配置的工作模式。
CPU用的是Armada-3720,内核是https://github.com/MarvellEmbeddedProcessors/linux-marvell 里面18.12版本,uboot使用的是https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/tree/u-boot-2018.03-armada-18.12。两路网口,一路是RGMII模式(lan1),另外一路是SGMII模式(lan2)。最近发现有时系统起来后用PC去ping lan2会ping不通,phy可以正常识别,执行ifconfig down/up也可以看到正常的打印信息。
一般我们不需要从用户态得到进程虚拟地址对应的物理地址,因为一般来说用户进程是完全不关心物理地址的。
从硬件的角度看,以太网接口电路主要由 MAC(Media Access Control,MAC)控制器和物理层接口 PHY(Physical Layer,PHY)两大部分构成。如下图所示:
Sniffle是一个基于使用TI CC1352/CC26x2硬件的蓝牙5和4.x LE嗅探器。
据此推算,貌似单一线路,网络传输速度也就1.5*(1/4*10^6) = 375M/bs
第一步: 编译路径执行make menucinfig和make ota_menucinfig中分别选中: (1)Allwinner > swupdate (2)Allwinner > swupdate > Swupdate Settings > General Configuration > MTD support (3)Allwinner > swupdate > Image Handlers > ubivol
死锁指两个或更多进程或线程因相互等待对方释放资源而互相阻塞,从而导致系统中所有的进程或线程都无法继续运行的情况。
进程地址空间的隔离 是现代操作系统的一个显著特征。这也是区别于 “古代”操作系统 的显著特征。
SOM-XQ138基于TI OMAP-L138定点/浮点DSP C674x+ARM9处理器,双核主频456MHz,C6000 DSP + ARM设计的工业级核心板;
Xen是一个开放源代码的para-virtualizing虚拟机(VMM),或“管理程序”,是为x86架构的机器而设计的。Xen可以在一套物理硬件上安全的执行多个虚拟机;Xen是基于内核的虚拟程序,它和操作平台结合的极为密切,所以它占用的资源最少。
内核:Linux 4.14.98 Modem:展锐UDX710 驱动:LAN78XX PHY驱动 USB PHY:LAN7800
今天来为大家介绍一款启明云端采用 B to B设计的RK3399核心板,核心板为邮票孔,支持4K、H.265 硬解码!
MPSoC是带ARM处理器和FPGA(PL)的SoC,包含4核A53及其常用外部模块(PS)。A53(PS)使用Arm GIC-400,属于GICv2架构。如果想了解GIC-400的具体细节,请参考文档APU GIC: CoreLink GIC-400 Generic Interrupt Controller, DDI 0471B, r0p1。
g2d 主要功能: 1)旋转:支持90、180、270旋转; 2)镜像反转:H / V; 3) scale:放缩 4)格式转换:yuv 转 rgb 等,多种格式相互间转换; 5)透明叠加功能:实现两个rgb图片叠加; 6)矩形填充,等诸多功能;
linux下设备驱动都有一套标准的结构,字符设备,块设备,网络设备都是自己的一套框架。编写驱动只需要把内核的框架搞清楚,然后照着结构填入参数,注册进内核,在应用层就可以按照标准的形式调用了。 对于网络设备而言,主要目的就是网络数据的收发,编写驱动时将linux网络设备驱动里的接口与实际网卡硬件的操作接口对应上,应用层就可以操作网卡完成网络通信了。底层驱动里编写网卡驱动与单片机一样。
《带你遨游USB世界》中,我们已经初步介绍了USB的整体架构,本文将从以下几个方面继续介绍USB的内容。
内存子系统是 SoC 中最复杂的系统之一,对芯片的整体性能至关重要。近年来,内存市场呈爆炸式增长,在移动、消费和企业系统中势头强劲。这不仅导致内存控制器 (MC) 越来越复杂,还导致将内存子系统连接到外部 DRAM 的 PHY变得非常复杂。
5)电流或电压驱动型的PHY,若为2线共模电感+自耦变压器形式,自耦变压器放在RJ45侧。
在飞凌嵌入式OKA40i-C开发板上虽然只有一个网口,但全志A40i-H处理器本身是有两个网络控制器的,因此在飞凌嵌入式提供的产品资料中提供了双网口解决方案。有的工程师小伙伴在开发过程中会遇见一些网卡的设计问题,今天小编为大家分享3种在使用OKA40i-C开发板时容易遇到的网卡软件问题以及排查思路。
作为一种编程语言,本身是谈不上工作原理的,实际上C语言所有的语法,正是C语言编译器的工作原理或者工作机制的具体实现。要细致的讨论起来是不可能,但是作为C语言程序员,必须了解这个大致的流程。一个程序,从C语言源码,到系统可执行的文件,一般经历四个过程。
CPU用的是Armada-3720,内核版本是4.14。两路网口,eth0用RGMII模式,20_18_2:0默认111, eth1用SGMII模式,20_18_2:0默认001,88e1512的phy地址只能用0、1,(0也是mdio广播地址)。
领取专属 10元无门槛券
手把手带您无忧上云