Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
410cf5e0
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
410cf5e0
编写于
8月 06, 2020
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
https://gitlab.denx.de/u-boot/custodians/u-boot-usb
- XHCI updates to support MIPS better
上级
ce272490
b5152a65
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
25 deletion
+24
-25
drivers/usb/host/usb-uclass.c
drivers/usb/host/usb-uclass.c
+4
-4
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-mem.c
+15
-15
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci-ring.c
+4
-4
drivers/usb/host/xhci.c
drivers/usb/host/xhci.c
+1
-2
未找到文件。
drivers/usb/host/usb-uclass.c
浏览文件 @
410cf5e0
...
...
@@ -416,21 +416,21 @@ static int usb_match_device(const struct usb_device_descriptor *desc,
const
struct
usb_device_id
*
id
)
{
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_VENDOR
)
&&
id
->
idVendor
!=
le16_to_cpu
(
desc
->
idVendor
)
)
id
->
idVendor
!=
desc
->
idVendor
)
return
0
;
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_PRODUCT
)
&&
id
->
idProduct
!=
le16_to_cpu
(
desc
->
idProduct
)
)
id
->
idProduct
!=
desc
->
idProduct
)
return
0
;
/* No need to test id->bcdDevice_lo != 0, since 0 is never
greater than any unsigned number. */
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_DEV_LO
)
&&
(
id
->
bcdDevice_lo
>
le16_to_cpu
(
desc
->
bcdDevice
)
))
(
id
->
bcdDevice_lo
>
desc
->
bcdDevice
))
return
0
;
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_DEV_HI
)
&&
(
id
->
bcdDevice_hi
<
le16_to_cpu
(
desc
->
bcdDevice
)
))
(
id
->
bcdDevice_hi
<
desc
->
bcdDevice
))
return
0
;
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_DEV_CLASS
)
&&
...
...
drivers/usb/host/xhci-mem.c
浏览文件 @
410cf5e0
...
...
@@ -110,7 +110,7 @@ static void xhci_scratchpad_free(struct xhci_ctrl *ctrl)
ctrl
->
dcbaa
->
dev_context_ptrs
[
0
]
=
0
;
free
((
void
*
)(
uintptr_t
)
ctrl
->
scratchpad
->
sp_array
[
0
]
);
free
((
void
*
)(
uintptr_t
)
le64_to_cpu
(
ctrl
->
scratchpad
->
sp_array
[
0
])
);
free
(
ctrl
->
scratchpad
->
sp_array
);
free
(
ctrl
->
scratchpad
);
ctrl
->
scratchpad
=
NULL
;
...
...
@@ -226,8 +226,9 @@ static void xhci_link_segments(struct xhci_segment *prev,
return
;
prev
->
next
=
next
;
if
(
link_trbs
)
{
val_64
=
(
uintptr_t
)
next
->
trbs
;
prev
->
trbs
[
TRBS_PER_SEGMENT
-
1
].
link
.
segment_ptr
=
val_64
;
val_64
=
virt_to_phys
(
next
->
trbs
);
prev
->
trbs
[
TRBS_PER_SEGMENT
-
1
].
link
.
segment_ptr
=
cpu_to_le64
(
val_64
);
/*
* Set the last TRB in the segment to
...
...
@@ -488,10 +489,10 @@ int xhci_alloc_virt_device(struct xhci_ctrl *ctrl, unsigned int slot_id)
/* Allocate endpoint 0 ring */
virt_dev
->
eps
[
0
].
ring
=
xhci_ring_alloc
(
1
,
true
);
byte_64
=
(
uintptr_t
)
(
virt_dev
->
out_ctx
->
bytes
);
byte_64
=
virt_to_phys
(
virt_dev
->
out_ctx
->
bytes
);
/* Point to output device context in dcbaa. */
ctrl
->
dcbaa
->
dev_context_ptrs
[
slot_id
]
=
byte_64
;
ctrl
->
dcbaa
->
dev_context_ptrs
[
slot_id
]
=
cpu_to_le64
(
byte_64
)
;
xhci_flush_cache
((
uintptr_t
)
&
ctrl
->
dcbaa
->
dev_context_ptrs
[
slot_id
],
sizeof
(
__le64
));
...
...
@@ -513,7 +514,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
uint64_t
val_64
;
uint64_t
trb_64
;
uint32_t
val
;
u
nsigned
long
deq
;
u
int64_t
deq
;
int
i
;
struct
xhci_segment
*
seg
;
...
...
@@ -525,7 +526,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
return
-
ENOMEM
;
}
val_64
=
(
uintptr_t
)
ctrl
->
dcbaa
;
val_64
=
virt_to_phys
(
ctrl
->
dcbaa
)
;
/* Set the pointer in DCBAA register */
xhci_writeq
(
&
hcor
->
or_dcbaap
,
val_64
);
...
...
@@ -533,7 +534,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
ctrl
->
cmd_ring
=
xhci_ring_alloc
(
1
,
true
);
/* Set the address in the Command Ring Control register */
trb_64
=
(
uintptr_t
)
ctrl
->
cmd_ring
->
first_seg
->
trbs
;
trb_64
=
virt_to_phys
(
ctrl
->
cmd_ring
->
first_seg
->
trbs
)
;
val_64
=
xhci_readq
(
&
hcor
->
or_crcr
);
val_64
=
(
val_64
&
(
u64
)
CMD_RING_RSVD_BITS
)
|
(
trb_64
&
(
u64
)
~
CMD_RING_RSVD_BITS
)
|
...
...
@@ -563,10 +564,9 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
for
(
val
=
0
,
seg
=
ctrl
->
event_ring
->
first_seg
;
val
<
ERST_NUM_SEGS
;
val
++
)
{
trb_64
=
0
;
trb_64
=
(
uintptr_t
)
seg
->
trbs
;
trb_64
=
virt_to_phys
(
seg
->
trbs
);
struct
xhci_erst_entry
*
entry
=
&
ctrl
->
erst
.
entries
[
val
];
xhci_writeq
(
&
entry
->
seg_addr
,
trb_64
);
entry
->
seg_addr
=
cpu_to_le64
(
trb_64
);
entry
->
seg_size
=
cpu_to_le32
(
TRBS_PER_SEGMENT
);
entry
->
rsvd
=
0
;
seg
=
seg
->
next
;
...
...
@@ -574,7 +574,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
xhci_flush_cache
((
uintptr_t
)
ctrl
->
erst
.
entries
,
ERST_NUM_SEGS
*
sizeof
(
struct
xhci_erst_entry
));
deq
=
(
unsigned
long
)
ctrl
->
event_ring
->
dequeue
;
deq
=
virt_to_phys
(
ctrl
->
event_ring
->
dequeue
)
;
/* Update HC event ring dequeue pointer */
xhci_writeq
(
&
ctrl
->
ir_set
->
erst_dequeue
,
...
...
@@ -589,7 +589,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
/* this is the event ring segment table pointer */
val_64
=
xhci_readq
(
&
ctrl
->
ir_set
->
erst_base
);
val_64
&=
ERST_PTR_MASK
;
val_64
|=
((
uintptr_t
)(
ctrl
->
erst
.
entries
)
&
~
ERST_PTR_MASK
)
;
val_64
|=
virt_to_phys
(
ctrl
->
erst
.
entries
)
&
~
ERST_PTR_MASK
;
xhci_writeq
(
&
ctrl
->
ir_set
->
erst_base
,
val_64
);
...
...
@@ -773,7 +773,7 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
debug
(
"route string %x
\n
"
,
route
);
#endif
slot_ctx
->
dev_info
|=
route
;
slot_ctx
->
dev_info
|=
cpu_to_le32
(
route
)
;
switch
(
speed
)
{
case
USB_SPEED_SUPER
:
...
...
@@ -857,7 +857,7 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
cpu_to_le32
(((
0
&
MAX_BURST_MASK
)
<<
MAX_BURST_SHIFT
)
|
((
3
&
ERROR_COUNT_MASK
)
<<
ERROR_COUNT_SHIFT
));
trb_64
=
(
uintptr_t
)
virt_dev
->
eps
[
0
].
ring
->
first_seg
->
trbs
;
trb_64
=
virt_to_phys
(
virt_dev
->
eps
[
0
].
ring
->
first_seg
->
trbs
)
;
ep0_ctx
->
deq
=
cpu_to_le64
(
trb_64
|
virt_dev
->
eps
[
0
].
ring
->
cycle_state
);
/*
...
...
drivers/usb/host/xhci-ring.c
浏览文件 @
410cf5e0
...
...
@@ -275,7 +275,7 @@ void xhci_queue_command(struct xhci_ctrl *ctrl, u8 *ptr, u32 slot_id,
u32
ep_index
,
trb_type
cmd
)
{
u32
fields
[
4
];
u64
val_64
=
(
uintptr_t
)
ptr
;
u64
val_64
=
virt_to_phys
(
ptr
)
;
BUG_ON
(
prepare_ring
(
ctrl
,
ctrl
->
cmd_ring
,
EP_STATE_RUNNING
));
...
...
@@ -399,7 +399,7 @@ void xhci_acknowledge_event(struct xhci_ctrl *ctrl)
/* Inform the hardware */
xhci_writeq
(
&
ctrl
->
ir_set
->
erst_dequeue
,
(
uintptr_t
)
ctrl
->
event_ring
->
dequeue
|
ERST_EHB
);
virt_to_phys
(
ctrl
->
event_ring
->
dequeue
)
|
ERST_EHB
);
}
/**
...
...
@@ -577,7 +577,7 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,
u64
addr
;
int
ret
;
u32
trb_fields
[
4
];
u64
val_64
=
(
uintptr_t
)
buffer
;
u64
val_64
=
virt_to_phys
(
buffer
)
;
debug
(
"dev=%p, pipe=%lx, buffer=%p, length=%d
\n
"
,
udev
,
pipe
,
buffer
,
length
);
...
...
@@ -876,7 +876,7 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe,
if
(
length
>
0
)
{
if
(
req
->
requesttype
&
USB_DIR_IN
)
field
|=
TRB_DIR_IN
;
buf_64
=
(
uintptr_t
)
buffer
;
buf_64
=
virt_to_phys
(
buffer
)
;
trb_fields
[
0
]
=
lower_32_bits
(
buf_64
);
trb_fields
[
1
]
=
upper_32_bits
(
buf_64
);
...
...
drivers/usb/host/xhci.c
浏览文件 @
410cf5e0
...
...
@@ -631,8 +631,7 @@ static int xhci_set_configuration(struct usb_device *udev)
cpu_to_le32
(
MAX_BURST
(
max_burst
)
|
ERROR_COUNT
(
err_count
));
trb_64
=
(
uintptr_t
)
virt_dev
->
eps
[
ep_index
].
ring
->
enqueue
;
trb_64
=
virt_to_phys
(
virt_dev
->
eps
[
ep_index
].
ring
->
enqueue
);
ep_ctx
[
ep_index
]
->
deq
=
cpu_to_le64
(
trb_64
|
virt_dev
->
eps
[
ep_index
].
ring
->
cycle_state
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录