USB 协议 (一) 应用场景

USB 协议版本
	USB 1.1 UHCI/OHCI	
		// Open Host Controller Interface Rev 1.0 specification 
			// OHCI_Specification_Rev.1.0a.pdf
			// 注意 Open Host Controller Interface Specification for 1394 不是我们的目标文档,这是个 1394 硬件
		// Universal Serial Bus Specification Revision 1.1
	USB 2.0 EHCI
		// ehci-specification-for-usb.pdf
		// Universal Serial Bus Specification Revision 2.0
	USB 3.0 XHCI // https://www.cnblogs.com/coryxie/category/596771.html
		// extensible-host-controler-interface-usb-xhci.pdf
		// Universal Serial Bus Specification Revision 3.0
			// Universal Serial Bus 3.0 Specification.pdf
	USB4于201993日发布
USB 总线协议与USB控制器标准 区别
在 linux-5.11/drivers/usb/host 中
grep HCD_USB11 * -nr  |grep flags
grep HCD_USB2 * -nr  |grep flags
grep HCD_USB3 * -nr  |grep flags
会得到如下数据
USB1.1 		 // USB1.1 是 总线协议
	ohci 	 // ohci 是一种usb控制器标准,符合USB1.1
	uhci     // uhci 是一种usb控制器标准,符合USB1.1
	
	fhci 	 // fhci 是一种usb控制器标准,符合USB1.1 , freescale 推出的
	isp116x  // isp116x 是一种usb控制器标准,符合USB1.1
	isp1362
	max3421
	sl811h
	u132
USB2
	ehci
	fotg210
	oxu
	r8a66597
USB3
	xhci
  • USB 数据线
Mini 和 Micro 5条线,其他 4条线 
4条线 : Vbus D+ D- GND
5条线 : Vbus D+ D- GND ID
----
Vbus 是 5V , D+ D-3.3V
Vbus 和 GND 给设备提供电源 , D+ D- 用来传输数据
D+ D- 是 差分线 , 数据 在线上发送 从低到高
ID 用于 OTG , 接地表示主机, 空置表示设备
USB 应用

之前写过一系列 USB 相关的博客,都是应用角度.没有涉及到 USB 协议

这里面涉及到 host 和 slave
其中 host 	有 PC & OK6410A
其中 slave 	有 "USB转JTAG小板""usb camera"
传输方式的应用场景
usb 协议分层在L5 上分为四种传输
分别是 中断传输 同步传输 批量传输 控制传输
控制传输		control transfer 		枚举 	
批量传输 	bulk transfer 			U盘/打印机/扫描仪
同步传输 	isochronous transfer 	摄像头,音频及其他实时应用场景  	
中断传输		interrupt transfer 		键盘,鼠标	




USB协议版本

在这里插入图片描述

在这里插入图片描述

USB 1
1996年,发布低速:LS(Low Speed),原名 USB 1.0,传输速率1.5Mbps(0.18MB/s)1998年,发布全速:FS(Full Speed),原名 USB 1.1,传输速率12Mbps(1.5MB/s)。
USB 1.0 只有四根线:VCC、 D-、D+、 GND
USB 2
2000年,发布高速:HS(High Speed),原名 USB 2.0,传输速率480Mbps(60MB/s)。
USB 2.0 只有四根线:VCC、 D-、D+、 GND
USB 3
2008年,发布USB 3.2 Gen 1,原名 USB 3.0,传输速率5Gbps(640MB/s)// Gen 1 : 第一代速率,lane:1
2013年,发布USB 3.2 Gen 2,原名 USB 3.1,传输速率10Gbps(1280MB/s)// Gen 2 : 第二代速率,lane:1
2017年,发布USB 3.2 Gen 2x2,原名 USB 3.2,传输速率20Gbps(2560MB/s)// Gen 2x2 : 第二代速率,lane:2
	从USB 3.2开始就只支持USB Type-C接口,而不再支持Type-A和Type-B接口了。
	这是为什么呢?因为从USB 3.2开始定义了USB数据传输的双通道模式,即两组差分对用来发送,两组差分对用来接收,需要4组差分对,只有USB Type-C接口能提供4组差分线。
	单通道模式是一组差分对用来发送,一组差分对用来接收。Type-A和Type-B接口只能提供2对差分线,只适用于单通道模式。
	总之,因为引入了双通道传输USB数据的模式,所以使得USB 3.2及之后的USB4都只能支持USB Type-C接口。

USB 3.0 向下兼容 SUB 2.0
	保留了前面四根线(VCC、 D-、D+、 GND)
	增加了五根线(收发数据线):RX-、RX+、 GND、 TRX-、TX+.
USB 4
在介绍USB4之前就不得不提一下Intel和苹果公司合作推出的雷电协议。
雷电协议是组合协议,整合了DisplayPort协议(简称DP)和PCI-Express协议(简称PCIe)而成。
先后推出了雷电1和雷电2协议,但都反响平平。
后来推出了雷电3协议(Thunderbolt 3,简称TBT3),传输速度达到了40Gbps,后来Intel选择将协议交给了USB-IF协会。

2019年,USB-IF在USB 3.2的基础上整合了雷电3协议(简称TBT3),推出了USB4 Gen 3x2。
这次改名和以往不同的是依然保留了USB 3.2的名字。
USB4就是在原先USB 3.2传输速度基础上进行了倍增,达到了40Gbps,也就是USB4 Gen 3x2的速度。
USB4同时支持USB 3.2和TBT3的传输。
总之,USB4=USB 3.2+TBT3。
USB4和USB 3.2一样,也有单通道模式和双通道模式,USB4接口和USB 3.2接口一样,都支持搭载USB PD快充协议。

2019年,发布USB4 V1.0,原名 USB4,传输速率40Gbps(5GB/s)
2022年,即将发布USB4 V2.0,传输速率80Gbps(10GB/s)
USB的命名
USB 3.0的接口速率5Gbps,也就是大家常见的蓝色USB接口,目前也是很多电脑上的绝对主力接口。

不过从USB 3.1开始,USB组织开始了混乱的改名,
	USB 3.0被改名为 USB 3.1 Gen1,
在USB 3.2时代再次改名
	USB 3.0 被改名为 USB 3.2 Gen1。

2022-09-30

	USB4 V2.0 草案时,USB-IF组织现在做出两项重大决定,
		一是正式删除USB 3.x/USB4的商用命名方式
		二是取消SuperSpeed USB品牌(其实就是USB 3)。

现在,USB 3.X和USB4将变更为“USB+传输速度”的命名方式,即
	USB 5Gbps 		USB3.0
	USB 10Gbps 		USB3.1
	USB 20Gbps 		USB3.2
	USB 40Gbps 		USB4.1
	USB 80Gbps 		USB4.2
USB2 与 USB3 的区别
usb 是如何兼容的
一个port 上兼容
	USB 2.0(EHCI) 的设备 和 USB1.0(OHCI) 的设备
在硬件上,
	有两个HC (EHCI的HC和OHCI的HC) 接到了 这个port上 , 即这个芯片有两个 USB IP
在硬件上,
	先按EHCI的驱动走,如果枚举过程有问题(知道他是low speed设备,或者他是 full speed 设备)
	再按OHCI的驱动走,
	参考:https://www.cnblogs.com/hellokitty2/p/9981179.html
注意:
	USB3.0兼容USB2.0,不一定是兼容EHCI.
	EHCI只是USB2.0的一种实现参考而已,还有其他的参考.
This chapter presents an overview of Universal Serial Bus 4 (USB4™) architecture and key concepts. USB4 is similar to earlier versions of USB in that it is a cable bus supporting data exchange between a host computer and a wide range of simultaneously accessible peripherals. However, USB4 also allows a host computer to setup data exchange between compatible peripherals. The attached peripherals share bandwidth as configured by the host computer. The bus allows peripherals to be attached, configured, used, and detached while the host and other peripherals are in operation. When configured over a USB Type-C® connector interface, USB4 functionally replaces USB 3.2 while retaining USB 2.0 bus operating in parallel. Enhanced SuperSpeed USB, as defined in USB 3.2, remains the fundamental architecture for USB data transfer on a USB4 Fabric. The difference with USB4 versus USB 3.2 is that USB4 is a connection -oriented, tunneling architecture designed to combine multiple protocols onto a single physical interface, so that the total speed and performance of the USB4 Fabric can be dynamically shared. USB4 allows for USB data transfers to operate in parallel with other independent protocols specific to display, load/store and host-to-host interfaces. Additionally, USB4 extends performance beyond the 20 Gbps (Gen 2 x 2) of USB 3.2 to 40 Gbps (Gen 3 x 2) over the same dual-lane, dual-simplex architecture. This specification introduces the concept of protocol tunneling to USB bus architecture. Besides tunneling Enhanced SuperSpeed USB (USB3), display tunneling based on DisplayPort (DP) protocol and load/store tunneling based on PCI Express (PCIe) are defined. These protocol tunnels operate independently over the USB4 transport and physical layers. Additionally, USB4 allocates packets for bus configuration and management, and packe ts can be allocated specifically for host-to-host data connections.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值