Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
388019f1
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,发现更多精彩内容 >>
提交
388019f1
编写于
12月 06, 2016
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-usb
上级
f22dede2
555a3472
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
81 addition
and
0 deletion
+81
-0
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-pci.c
+81
-0
未找到文件。
drivers/usb/host/xhci-pci.c
浏览文件 @
388019f1
...
...
@@ -7,12 +7,15 @@
*/
#include <common.h>
#include <dm.h>
#include <errno.h>
#include <pci.h>
#include <usb.h>
#include "xhci.h"
#ifndef CONFIG_DM_USB
/*
* Create the appropriate control structures to manage a new XHCI host
* controller.
...
...
@@ -58,3 +61,81 @@ int xhci_hcd_init(int index, struct xhci_hccr **ret_hccr,
void
xhci_hcd_stop
(
int
index
)
{
}
#else
struct
xhci_pci_priv
{
struct
xhci_ctrl
ctrl
;
/* Needs to come first in this struct! */
};
static
void
xhci_pci_init
(
struct
udevice
*
dev
,
struct
xhci_hccr
**
ret_hccr
,
struct
xhci_hcor
**
ret_hcor
)
{
struct
xhci_hccr
*
hccr
;
struct
xhci_hcor
*
hcor
;
u32
cmd
;
hccr
=
(
struct
xhci_hccr
*
)
dm_pci_map_bar
(
dev
,
PCI_BASE_ADDRESS_0
,
PCI_REGION_MEM
);
hcor
=
(
struct
xhci_hcor
*
)((
uintptr_t
)
hccr
+
HC_LENGTH
(
xhci_readl
(
&
hccr
->
cr_capbase
)));
debug
(
"XHCI-PCI init hccr 0x%x and hcor 0x%x hc_length %d
\n
"
,
(
u32
)
hccr
,
(
u32
)
hcor
,
(
u32
)
HC_LENGTH
(
xhci_readl
(
&
hccr
->
cr_capbase
)));
*
ret_hccr
=
hccr
;
*
ret_hcor
=
hcor
;
/* enable busmaster */
dm_pci_read_config32
(
dev
,
PCI_COMMAND
,
&
cmd
);
cmd
|=
PCI_COMMAND_MASTER
;
dm_pci_write_config32
(
dev
,
PCI_COMMAND
,
cmd
);
}
static
int
xhci_pci_probe
(
struct
udevice
*
dev
)
{
struct
xhci_hccr
*
hccr
;
struct
xhci_hcor
*
hcor
;
xhci_pci_init
(
dev
,
&
hccr
,
&
hcor
);
return
xhci_register
(
dev
,
hccr
,
hcor
);
}
static
int
xhci_pci_remove
(
struct
udevice
*
dev
)
{
int
ret
;
ret
=
xhci_deregister
(
dev
);
if
(
ret
)
return
ret
;
return
0
;
}
static
const
struct
udevice_id
xhci_pci_ids
[]
=
{
{
.
compatible
=
"xhci-pci"
},
{
}
};
U_BOOT_DRIVER
(
xhci_pci
)
=
{
.
name
=
"xhci_pci"
,
.
id
=
UCLASS_USB
,
.
probe
=
xhci_pci_probe
,
.
remove
=
xhci_pci_remove
,
.
of_match
=
xhci_pci_ids
,
.
ops
=
&
xhci_usb_ops
,
.
platdata_auto_alloc_size
=
sizeof
(
struct
usb_platdata
),
.
priv_auto_alloc_size
=
sizeof
(
struct
xhci_pci_priv
),
.
flags
=
DM_FLAG_ALLOC_PRIV_DMA
,
};
static
struct
pci_device_id
xhci_pci_supported
[]
=
{
{
PCI_DEVICE_CLASS
(
PCI_CLASS_SERIAL_USB_XHCI
,
~
0
)
},
{},
};
U_BOOT_PCI_DEVICE
(
xhci_pci
,
xhci_pci_supported
);
#endif
/* CONFIG_DM_USB */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录