Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
ce6dd266
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ce6dd266
编写于
12月 22, 2015
作者:
M
Michael Turquette
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'clk-bcm2835' into clk-next
上级
471a9abe
5e63dcc7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
134 addition
and
0 deletion
+134
-0
Documentation/devicetree/bindings/clock/brcm,bcm2835-aux-clock.txt
...tion/devicetree/bindings/clock/brcm,bcm2835-aux-clock.txt
+31
-0
drivers/clk/bcm/Makefile
drivers/clk/bcm/Makefile
+1
-0
drivers/clk/bcm/clk-bcm2835-aux.c
drivers/clk/bcm/clk-bcm2835-aux.c
+85
-0
include/dt-bindings/clock/bcm2835-aux.h
include/dt-bindings/clock/bcm2835-aux.h
+17
-0
未找到文件。
Documentation/devicetree/bindings/clock/brcm,bcm2835-aux-clock.txt
0 → 100644
浏览文件 @
ce6dd266
Broadcom BCM2835 auxiliary peripheral support
This binding uses the common clock binding:
Documentation/devicetree/bindings/clock/clock-bindings.txt
The auxiliary peripherals (UART, SPI1, and SPI2) have a small register
area controlling clock gating to the peripherals, and providing an IRQ
status register.
Required properties:
- compatible: Should be "brcm,bcm2835-aux"
- #clock-cells: Should be <1>. The permitted clock-specifier values can be
found in include/dt-bindings/clock/bcm2835-aux.h
- reg: Specifies base physical address and size of the registers
- clocks: The parent clock phandle
Example:
clocks: cprman@7e101000 {
compatible = "brcm,bcm2835-cprman";
#clock-cells = <1>;
reg = <0x7e101000 0x2000>;
clocks = <&clk_osc>;
};
aux: aux@0x7e215004 {
compatible = "brcm,bcm2835-aux";
#clock-cells = <1>;
reg = <0x7e215000 0x8>;
clocks = <&clocks BCM2835_CLOCK_VPU>;
};
drivers/clk/bcm/Makefile
浏览文件 @
ce6dd266
...
@@ -5,6 +5,7 @@ obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
...
@@ -5,6 +5,7 @@ obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
obj-$(CONFIG_CLK_BCM_KONA)
+=
clk-bcm21664.o
obj-$(CONFIG_CLK_BCM_KONA)
+=
clk-bcm21664.o
obj-$(CONFIG_COMMON_CLK_IPROC)
+=
clk-iproc-armpll.o clk-iproc-pll.o clk-iproc-asiu.o
obj-$(CONFIG_COMMON_CLK_IPROC)
+=
clk-iproc-armpll.o clk-iproc-pll.o clk-iproc-asiu.o
obj-$(CONFIG_ARCH_BCM2835)
+=
clk-bcm2835.o
obj-$(CONFIG_ARCH_BCM2835)
+=
clk-bcm2835.o
obj-$(CONFIG_ARCH_BCM2835)
+=
clk-bcm2835-aux.o
obj-$(CONFIG_COMMON_CLK_IPROC)
+=
clk-ns2.o
obj-$(CONFIG_COMMON_CLK_IPROC)
+=
clk-ns2.o
obj-$(CONFIG_ARCH_BCM_CYGNUS)
+=
clk-cygnus.o
obj-$(CONFIG_ARCH_BCM_CYGNUS)
+=
clk-cygnus.o
obj-$(CONFIG_ARCH_BCM_NSP)
+=
clk-nsp.o
obj-$(CONFIG_ARCH_BCM_NSP)
+=
clk-nsp.o
...
...
drivers/clk/bcm/clk-bcm2835-aux.c
0 → 100644
浏览文件 @
ce6dd266
/*
* Copyright (C) 2015 Broadcom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clk/bcm2835.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/bcm2835-aux.h>
#define BCM2835_AUXIRQ 0x00
#define BCM2835_AUXENB 0x04
static
int
bcm2835_aux_clk_probe
(
struct
platform_device
*
pdev
)
{
struct
device
*
dev
=
&
pdev
->
dev
;
struct
clk_onecell_data
*
onecell
;
const
char
*
parent
;
struct
clk
*
parent_clk
;
struct
resource
*
res
;
void
__iomem
*
reg
,
*
gate
;
parent_clk
=
devm_clk_get
(
dev
,
NULL
);
if
(
IS_ERR
(
parent_clk
))
return
PTR_ERR
(
parent_clk
);
parent
=
__clk_get_name
(
parent_clk
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
reg
=
devm_ioremap_resource
(
dev
,
res
);
if
(
!
reg
)
return
-
ENODEV
;
onecell
=
devm_kmalloc
(
dev
,
sizeof
(
*
onecell
),
GFP_KERNEL
);
if
(
!
onecell
)
return
-
ENOMEM
;
onecell
->
clk_num
=
BCM2835_AUX_CLOCK_COUNT
;
onecell
->
clks
=
devm_kcalloc
(
dev
,
BCM2835_AUX_CLOCK_COUNT
,
sizeof
(
*
onecell
->
clks
),
GFP_KERNEL
);
if
(
!
onecell
->
clks
)
return
-
ENOMEM
;
gate
=
reg
+
BCM2835_AUXENB
;
onecell
->
clks
[
BCM2835_AUX_CLOCK_UART
]
=
clk_register_gate
(
dev
,
"aux_uart"
,
parent
,
0
,
gate
,
0
,
0
,
NULL
);
onecell
->
clks
[
BCM2835_AUX_CLOCK_SPI1
]
=
clk_register_gate
(
dev
,
"aux_spi1"
,
parent
,
0
,
gate
,
1
,
0
,
NULL
);
onecell
->
clks
[
BCM2835_AUX_CLOCK_SPI2
]
=
clk_register_gate
(
dev
,
"aux_spi2"
,
parent
,
0
,
gate
,
2
,
0
,
NULL
);
of_clk_add_provider
(
pdev
->
dev
.
of_node
,
of_clk_src_onecell_get
,
onecell
);
return
0
;
}
static
const
struct
of_device_id
bcm2835_aux_clk_of_match
[]
=
{
{
.
compatible
=
"brcm,bcm2835-aux"
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
bcm2835_aux_clk_of_match
);
static
struct
platform_driver
bcm2835_aux_clk_driver
=
{
.
driver
=
{
.
name
=
"bcm2835-aux-clk"
,
.
of_match_table
=
bcm2835_aux_clk_of_match
,
},
.
probe
=
bcm2835_aux_clk_probe
,
};
builtin_platform_driver
(
bcm2835_aux_clk_driver
);
MODULE_AUTHOR
(
"Eric Anholt <eric@anholt.net>"
);
MODULE_DESCRIPTION
(
"BCM2835 auxiliary peripheral clock driver"
);
MODULE_LICENSE
(
"GPL v2"
);
include/dt-bindings/clock/bcm2835-aux.h
0 → 100644
浏览文件 @
ce6dd266
/*
* Copyright (C) 2015 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#define BCM2835_AUX_CLOCK_UART 0
#define BCM2835_AUX_CLOCK_SPI1 1
#define BCM2835_AUX_CLOCK_SPI2 2
#define BCM2835_AUX_CLOCK_COUNT 3
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录