-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds a minimal stub clock driver for the BCM2835. Its sole purpose is to allow the PL011 AMBA clk_get() API calls to provide something that looks enough like a clock that the driver probes and operates correctly. This patch was extracted from git://github.com/lp0/linux.git branch rpi-split as of 2012/09/08, and modified as follows: * Reworked to call clk_register_fixed_rate(), and clk_register_clkdev() rather than using static data to represent the clocks. * Moved implementation to drivers/clk/. * Modified .dev_id for UART clocks to match UART DT node names. * s/bcm2708/bcm2835/. * Modified device tree vendor prefix. Signed-off-by: Chris Boot <bootc@bootc.net> Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Dom Cobley <dc4@broadcom.com> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Mike Turquette <mturquette@linaro.org>
- Loading branch information
Simon Arlott
authored and
Stephen Warren
committed
Sep 20, 2012
1 parent
ee4af56
commit 75fabc3
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2010 Broadcom | ||
* Copyright (C) 2012 Stephen Warren | ||
* | ||
* 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. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <linux/clk-provider.h> | ||
#include <linux/clkdev.h> | ||
#include <linux/clk/bcm2835.h> | ||
|
||
/* | ||
* These are fixed clocks. They're probably not all root clocks and it may | ||
* be possible to turn them on and off but until this is mapped out better | ||
* it's the only way they can be used. | ||
*/ | ||
void __init bcm2835_init_clocks(void) | ||
{ | ||
struct clk *clk; | ||
int ret; | ||
|
||
clk = clk_register_fixed_rate(NULL, "sys_pclk", NULL, CLK_IS_ROOT, | ||
250000000); | ||
if (!clk) | ||
pr_err("sys_pclk not registered\n"); | ||
|
||
clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, | ||
126000000); | ||
if (!clk) | ||
pr_err("apb_pclk not registered\n"); | ||
|
||
clk = clk_register_fixed_rate(NULL, "uart0_pclk", NULL, CLK_IS_ROOT, | ||
3000000); | ||
if (!clk) | ||
pr_err("uart0_pclk not registered\n"); | ||
ret = clk_register_clkdev(clk, NULL, "20201000.uart"); | ||
if (ret) | ||
pr_err("uart0_pclk alias not registered\n"); | ||
|
||
clk = clk_register_fixed_rate(NULL, "uart1_pclk", NULL, CLK_IS_ROOT, | ||
125000000); | ||
if (!clk) | ||
pr_err("uart1_pclk not registered\n"); | ||
ret = clk_register_clkdev(clk, NULL, "20215000.uart"); | ||
if (ret) | ||
pr_err("uart0_pclk alias not registered\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) 2010 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. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifndef __LINUX_CLK_BCM2835_H_ | ||
#define __LINUX_CLK_BCM2835_H_ | ||
|
||
void __init bcm2835_init_clocks(void); | ||
|
||
#endif |