Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5b5ac414
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5b5ac414
编写于
12月 07, 2012
作者:
R
Rafał Miłecki
提交者:
John W. Linville
12月 10, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bcma: unify naming schema for clock functions
Signed-off-by:
N
John W. Linville
<
linville@tuxdriver.com
>
上级
576d28a7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
29 addition
and
26 deletion
+29
-26
drivers/bcma/bcma_private.h
drivers/bcma/bcma_private.h
+2
-2
drivers/bcma/driver_chipcommon.c
drivers/bcma/driver_chipcommon.c
+5
-5
drivers/bcma/driver_chipcommon_pmu.c
drivers/bcma/driver_chipcommon_pmu.c
+21
-18
drivers/bcma/driver_mips.c
drivers/bcma/driver_mips.c
+1
-1
未找到文件。
drivers/bcma/bcma_private.h
浏览文件 @
5b5ac414
...
...
@@ -48,8 +48,8 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
#endif
/* CONFIG_BCMA_DRIVER_MIPS */
/* driver_chipcommon_pmu.c */
u32
bcma_pmu_alp_clock
(
struct
bcma_drv_cc
*
cc
);
u32
bcma_pmu_get_c
lockcpu
(
struct
bcma_drv_cc
*
cc
);
u32
bcma_pmu_
get_
alp_clock
(
struct
bcma_drv_cc
*
cc
);
u32
bcma_pmu_get_c
pu_clock
(
struct
bcma_drv_cc
*
cc
);
#ifdef CONFIG_BCMA_SFLASH
/* driver_chipcommon_sflash.c */
...
...
drivers/bcma/driver_chipcommon.c
浏览文件 @
5b5ac414
...
...
@@ -25,10 +25,10 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
return
value
;
}
static
u32
bcma_chipco_alp_clock
(
struct
bcma_drv_cc
*
cc
)
static
u32
bcma_chipco_
get_
alp_clock
(
struct
bcma_drv_cc
*
cc
)
{
if
(
cc
->
capabilities
&
BCMA_CC_CAP_PMU
)
return
bcma_pmu_alp_clock
(
cc
);
return
bcma_pmu_
get_
alp_clock
(
cc
);
return
20000000
;
}
...
...
@@ -79,12 +79,12 @@ static int bcma_chipco_watchdog_ticks_per_ms(struct bcma_drv_cc *cc)
if
(
cc
->
capabilities
&
BCMA_CC_CAP_PMU
)
{
if
(
bus
->
chipinfo
.
id
==
BCMA_CHIP_ID_BCM4706
)
/* 4706 CC and PMU watchdogs are clocked at 1/4 of ALP clock */
return
bcma_chipco_alp_clock
(
cc
)
/
4000
;
return
bcma_chipco_
get_
alp_clock
(
cc
)
/
4000
;
else
/* based on 32KHz ILP clock */
return
32
;
}
else
{
return
bcma_chipco_alp_clock
(
cc
)
/
1000
;
return
bcma_chipco_
get_
alp_clock
(
cc
)
/
1000
;
}
}
...
...
@@ -236,7 +236,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
struct
bcma_serial_port
*
ports
=
cc
->
serial_ports
;
if
(
ccrev
>=
11
&&
ccrev
!=
15
)
{
baud_base
=
bcma_chipco_alp_clock
(
cc
);
baud_base
=
bcma_chipco_
get_
alp_clock
(
cc
);
if
(
ccrev
>=
21
)
{
/* Turn off UART clock before switching clocksource. */
bcma_cc_write32
(
cc
,
BCMA_CC_CORECTL
,
...
...
drivers/bcma/driver_chipcommon_pmu.c
浏览文件 @
5b5ac414
...
...
@@ -168,7 +168,7 @@ void bcma_pmu_init(struct bcma_drv_cc *cc)
bcma_pmu_workarounds
(
cc
);
}
u32
bcma_pmu_alp_clock
(
struct
bcma_drv_cc
*
cc
)
u32
bcma_pmu_
get_
alp_clock
(
struct
bcma_drv_cc
*
cc
)
{
struct
bcma_bus
*
bus
=
cc
->
core
->
bus
;
...
...
@@ -196,7 +196,7 @@ u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)
/* Find the output of the "m" pll divider given pll controls that start with
* pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc.
*/
static
u32
bcma_pmu_clock
(
struct
bcma_drv_cc
*
cc
,
u32
pll0
,
u32
m
)
static
u32
bcma_pmu_
pll_
clock
(
struct
bcma_drv_cc
*
cc
,
u32
pll0
,
u32
m
)
{
u32
tmp
,
div
,
ndiv
,
p1
,
p2
,
fc
;
struct
bcma_bus
*
bus
=
cc
->
core
->
bus
;
...
...
@@ -225,14 +225,14 @@ static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
ndiv
=
(
tmp
&
BCMA_CC_PPL_NDIV_MASK
)
>>
BCMA_CC_PPL_NDIV_SHIFT
;
/* Do calculation in Mhz */
fc
=
bcma_pmu_alp_clock
(
cc
)
/
1000000
;
fc
=
bcma_pmu_
get_
alp_clock
(
cc
)
/
1000000
;
fc
=
(
p1
*
ndiv
*
fc
)
/
p2
;
/* Return clock in Hertz */
return
(
fc
/
div
)
*
1000000
;
}
static
u32
bcma_pmu_clock_bcm4706
(
struct
bcma_drv_cc
*
cc
,
u32
pll0
,
u32
m
)
static
u32
bcma_pmu_
pll_
clock_bcm4706
(
struct
bcma_drv_cc
*
cc
,
u32
pll0
,
u32
m
)
{
u32
tmp
,
ndiv
,
p1div
,
p2div
;
u32
clock
;
...
...
@@ -263,7 +263,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
}
/* query bus clock frequency for PMU-enabled chipcommon */
static
u32
bcma_pmu_get_
clockcontrol
(
struct
bcma_drv_cc
*
cc
)
static
u32
bcma_pmu_get_
bus_clock
(
struct
bcma_drv_cc
*
cc
)
{
struct
bcma_bus
*
bus
=
cc
->
core
->
bus
;
...
...
@@ -271,40 +271,42 @@ static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
case
BCMA_CHIP_ID_BCM4716
:
case
BCMA_CHIP_ID_BCM4748
:
case
BCMA_CHIP_ID_BCM47162
:
return
bcma_pmu_clock
(
cc
,
BCMA_CC_PMU4716_MAINPLL_PLL0
,
return
bcma_pmu_
pll_
clock
(
cc
,
BCMA_CC_PMU4716_MAINPLL_PLL0
,
BCMA_CC_PMU5_MAINPLL_SSB
);
case
BCMA_CHIP_ID_BCM5356
:
return
bcma_pmu_clock
(
cc
,
BCMA_CC_PMU5356_MAINPLL_PLL0
,
return
bcma_pmu_
pll_
clock
(
cc
,
BCMA_CC_PMU5356_MAINPLL_PLL0
,
BCMA_CC_PMU5_MAINPLL_SSB
);
case
BCMA_CHIP_ID_BCM5357
:
case
BCMA_CHIP_ID_BCM4749
:
return
bcma_pmu_clock
(
cc
,
BCMA_CC_PMU5357_MAINPLL_PLL0
,
return
bcma_pmu_
pll_
clock
(
cc
,
BCMA_CC_PMU5357_MAINPLL_PLL0
,
BCMA_CC_PMU5_MAINPLL_SSB
);
case
BCMA_CHIP_ID_BCM4706
:
return
bcma_pmu_clock_bcm4706
(
cc
,
BCMA_CC_PMU4706_MAINPLL_PLL0
,
return
bcma_pmu_pll_clock_bcm4706
(
cc
,
BCMA_CC_PMU4706_MAINPLL_PLL0
,
BCMA_CC_PMU5_MAINPLL_SSB
);
case
BCMA_CHIP_ID_BCM53572
:
return
75000000
;
default:
bcma_warn
(
bus
,
"No b
ackplane
clock specified for %04X device, pmu rev. %d, using default %d Hz
\n
"
,
bcma_warn
(
bus
,
"No b
us
clock specified for %04X device, pmu rev. %d, using default %d Hz
\n
"
,
bus
->
chipinfo
.
id
,
cc
->
pmu
.
rev
,
BCMA_CC_PMU_HT_CLOCK
);
}
return
BCMA_CC_PMU_HT_CLOCK
;
}
/* query cpu clock frequency for PMU-enabled chipcommon */
u32
bcma_pmu_get_c
lockcpu
(
struct
bcma_drv_cc
*
cc
)
u32
bcma_pmu_get_c
pu_clock
(
struct
bcma_drv_cc
*
cc
)
{
struct
bcma_bus
*
bus
=
cc
->
core
->
bus
;
if
(
bus
->
chipinfo
.
id
==
BCMA_CHIP_ID_BCM53572
)
return
300000000
;
/* New PMUs can have different clock for bus and CPU */
if
(
cc
->
pmu
.
rev
>=
5
)
{
u32
pll
;
switch
(
bus
->
chipinfo
.
id
)
{
case
BCMA_CHIP_ID_BCM4706
:
return
bcma_pmu_clock_bcm4706
(
cc
,
return
bcma_pmu_
pll_
clock_bcm4706
(
cc
,
BCMA_CC_PMU4706_MAINPLL_PLL0
,
BCMA_CC_PMU5_MAINPLL_CPU
);
case
BCMA_CHIP_ID_BCM5356
:
...
...
@@ -319,10 +321,11 @@ u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc)
break
;
}
return
bcma_pmu_clock
(
cc
,
pll
,
BCMA_CC_PMU5_MAINPLL_CPU
);
return
bcma_pmu_
pll_
clock
(
cc
,
pll
,
BCMA_CC_PMU5_MAINPLL_CPU
);
}
return
bcma_pmu_get_clockcontrol
(
cc
);
/* On old PMUs CPU has the same clock as the bus */
return
bcma_pmu_get_bus_clock
(
cc
);
}
static
void
bcma_pmu_spuravoid_pll_write
(
struct
bcma_drv_cc
*
cc
,
u32
offset
,
...
...
drivers/bcma/driver_mips.c
浏览文件 @
5b5ac414
...
...
@@ -171,7 +171,7 @@ u32 bcma_cpu_clock(struct bcma_drv_mips *mcore)
struct
bcma_bus
*
bus
=
mcore
->
core
->
bus
;
if
(
bus
->
drv_cc
.
capabilities
&
BCMA_CC_CAP_PMU
)
return
bcma_pmu_get_c
lockcpu
(
&
bus
->
drv_cc
);
return
bcma_pmu_get_c
pu_clock
(
&
bus
->
drv_cc
);
bcma_err
(
bus
,
"No PMU available, need this to get the cpu clock
\n
"
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录