IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> Linux ARM平台开发系列讲解(网络篇) 2.3 Marvell 88EA6321/88EA6320 Switch 设备树的配置分析 -> 正文阅读

[系统运维]Linux ARM平台开发系列讲解(网络篇) 2.3 Marvell 88EA6321/88EA6320 Switch 设备树的配置分析

1. 概述

交换机设备树主要是要配置它的端口数量,每个Port的物理模式(例如Mac to Phy)、双工模式、连接速度、地址和与之连接的PHY地址等等,这一节就以88EA6321做例子解析一下DSA设备树,以主控S32G274A为例。

2. 参考文档

Linux5.10中,有Marvell 的交换机系列的设备树配置参考手册,具体如下:

  • 源码地址:/linux/Documentation/devicetree/bindings/net/dsa/marvell.txt

3.设备树配置

3.1 Marvell 交换机引脚Pinctrl配置

&pinctrl0 {
			/* 复位引脚 */
			pinctrl_mv88exxx_gpio_reset: mv88exxx_reset {
					fsl,pins = <
							S32_GEN1_PAD_PC_11_LLCE_CAN0_RX_O
							S32_GEN1_PAD_PC_12_LLCE_CAN0_TX
					>;
			};
			/* 中断引脚 */
			pinctrl_switch_mv88exxx_irq: mv88exxx_irq {
				fsl,pins = <
						S32_GEN1_PAD_PC_11_LLCE_CAN0_RX_O
						S32_GEN1_PAD_PC_12_LLCE_CAN0_TX
				>;
			};
};

3.2 添加交换机复位引脚

在前几章硬件篇中总结到,Marvell交换机有一个复位引脚,主要是用来主动复位交换机的,具体配置方法如下:

/ {

	gpio-marverll{
		/* 88ea6321复位引脚  */
		compatible = "marvell_gpio,mv88e6321";
		reset {
				label = "marvell-reset";
				gpios = <&gpiosb 21 GPIO_ACTIVE_LOW>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_mv88exxx_gpio_reset>;
				status = "okay";
		};
	};
};

3.3 S32G274A GMAC配置

对于GMAC或者MAC来说,配置方法都大同小异,因为交换机与S32G274A是以MAC TO MAC的方式连接,所以要修改原设备书中的MAC TO PHYMAC TO MAC;其次,由于使用的是RGMII的方式连接,应当设置tx-delayrx-delay2ns,具体如下:

&gmac0 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&switch_cpu>;
		tx_delay=<0x2f>;
		rx_delay=<0x24>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl0_gmac0_rgmii_c>,
                                <&pinctrl0_gmac0_mdio_c>;
};

3.4 配置Marvell交换机Port口配置

Marvell 88EA6321 是采用SMI通信配置的,所以首先需要给它配置一个PHY ID,其次再给它的每个Port MAC配置PHY IDPort MAC的连接方式 ,具体如下:

&gmac0_mdio {
        marvell88ea6321:mv88ea6321-phy@5{
            compatible = "marvell,mv88e6085";
			/* 交换机接收中断引脚 */
			pinctrl-0 = <&pinctrl_switch_mv88exxx_irq>;
			pinctrl-names = "default";
			status = "okay";
			/* mdio phy地址 */
			reg = <5>;
			dsa,member = <0 0>;
			/* eeprom大小 */
			eeprom-length = <512>;
			/* 中断引脚 */
			interrupt-parent = <&gic>;
			/* 中断触发方式 */
			interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
			interrupt-controller;
			#interrupt-cells = <2>;
			/* Port口Port号和配置 */
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					/* prot口序号 */
					reg = <1>;
					/* port口名字 */
					label = "lan0";
					/* phy信息 */
					phy-handle = <&switchphy0>;
				};

				port@1 {
					reg = <2>;
					label = "lan1";
					phy-handle = <&switchphy1>;
				};

				port@2 {
					reg = <3>;
					label = "lan2";
					phy-handle = <&switchphy5>;

				};

				port@3 {
					reg = <4>;
					label = "lan3";
					phy-handle = <&switchphy3>;
				};

				port@4 {
					reg = <5>;
					label = "lan4";
					phy-handle = <&switchphy4>;
				};

				switch_cpu: port@5 {
					reg = <6>;
					label = "cpu";
					/* 需要和CPU模式匹配 */
					phy-mode = "rgmii";
					/*与 CPU GMAC 关联*/
					ethernet = <&gmac0>;
					/* Mac to Mac 需要设置固定的双工模式和速度 */
					fixed-link {
						speed = <1000>;
						full-duplex;
					};
				};

				port@6 {
					reg = <7>;
					label = "lan6";
					phy-handle = <&switchphy6>;
				};
				
			};

			mdio {
				#address-cells = <1>;
				#size-cells = <0>;

				switchphy0: switchphy@0 {
					/* phy ID */
					reg = <1>;
					/* 中断优先级 */
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy1: switchphy@1 {
					reg = <2>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy2: switchphy@2 {
					reg = <3>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy3: switchphy@3 {
					reg = <4>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy4: switchphy@4 {
					reg = <5>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy5: switchphy@5 {
					reg = <6>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
				};

				switchphy6: switchphy@6 {
					reg = <7>;
					interrupt-parent = <&marvell88ea6321>;
					interrupts = <6 IRQ_TYPE_LEVEL_HIGH>;
				};
			};


};

返回总目录

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-08-19 19:40:14  更:2022-08-19 19:40:27 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/18 18:55:22-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码