我有一个使用 imx536 的定制板。该板有两个 USB 设备,一个连接到 OTG 内核,一个连接到 ixm53 上的 Host1 内核。使用 Linux BSP、内核 2.6.35 和 udev 版本 167 我无法使用“udevadm info”来确定哪个设备连接到哪个集线器/端口。在引导过程中,Linux 根据首先看到的设备以不同的方式枚举设备。如何获取 udevadm 信息以进一步跟踪 USB 链?我将其与 TI am3352 进行比较,在 TI am3352 中我可以追溯到每个 USB 设备连接到哪个集线器/端口,以便我可以创建自定义 udev 规则。
在我的 imx53 自定义板上的两个设备上运行“udevadm info”:
# udevadm info -a -n /dev/sda1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/block/sda/sda1':
KERNEL=="sda1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{partition}=="1"
ATTR{start}=="2048"
ATTR{size}=="3909632"
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="4293918720"
ATTR{stat}==" 6 0 42 7 1 0 8 64 0 71 71"
ATTR{inflight}==" 0 0"
looking at parent device '/block/sda':
KERNELS=="sda"
SUBSYSTEMS=="block"
DRIVERS==""
ATTRS{range}=="16"
ATTRS{ext_range}=="256"
ATTRS{removable}=="1"
ATTRS{ro}=="0"
ATTRS{size}=="3911680"
ATTRS{alignment_offset}=="0"
ATTRS{discard_alignment}=="0"
ATTRS{capability}=="51"
ATTRS{stat}==" 7 0 50 24 1 0 8 64 0 88 88"
ATTRS{inflight}==" 0 0"
# udevadm info -a -n /dev/sdb1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/block/sdb/sdb1':
KERNEL=="sdb1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{partition}=="1"
ATTR{start}=="20480"
ATTR{size}=="681984"
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="4284481536"
ATTR{stat}==" 0 0 0 0 0 0 0 0 0 0 0"
ATTR{inflight}==" 0 0"
looking at parent device '/block/sdb':
KERNELS=="sdb"
SUBSYSTEMS=="block"
DRIVERS==""
ATTRS{range}=="16"
ATTRS{ext_range}=="256"
ATTRS{removable}=="1"
ATTRS{ro}=="0"
ATTRS{size}=="15523840"
ATTRS{alignment_offset}=="0"
ATTRS{discard_alignment}=="0"
ATTRS{capability}=="51"
ATTRS{stat}==" 1 0 8 2 0 0 0 0 0 2 2"
ATTRS{inflight}==" 0 0"
谢谢。
编辑:经过一点猜测,我编写了以下规则文件,该文件成功识别了两个 USB 设备,但是,当它创建设备节点时,该文件是字符文件而不是块文件。所以“mount”不能使用该设备。对此有什么想法吗?是否可能找到控制器而不是块设备?