diff options
author | Dinh Nguyen <dinguyen@altera.com> | 2012-07-18 18:07:18 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-07-19 04:39:00 -0400 |
commit | 66314223aa5e862c9d1d068cb7186b4fd58ebeaa (patch) | |
tree | c1d825523095ce89c079f7dad536d448b890838c /drivers/clk | |
parent | 31a985f5bdc7e0708fc2cf02fac06c74664a7910 (diff) |
ARM: socfpga: initial support for Altera's SOCFPGA platform
Adding core definitions for Altera's SOCFPGA ARM platform.
Mininum support for Altera's SOCFPGA Cyclone 5 hardware.
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/Makefile | 1 | ||||
-rw-r--r-- | drivers/clk/socfpga/Makefile | 1 | ||||
-rw-r--r-- | drivers/clk/socfpga/clk.c | 51 |
3 files changed, 53 insertions, 0 deletions
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index b9a5158a30b1..96014e89f1ac 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile | |||
@@ -4,4 +4,5 @@ obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \ | |||
4 | clk-mux.o clk-divider.o clk-fixed-factor.o | 4 | clk-mux.o clk-divider.o clk-fixed-factor.o |
5 | # SoCs specific | 5 | # SoCs specific |
6 | obj-$(CONFIG_ARCH_MXS) += mxs/ | 6 | obj-$(CONFIG_ARCH_MXS) += mxs/ |
7 | obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ | ||
7 | obj-$(CONFIG_PLAT_SPEAR) += spear/ | 8 | obj-$(CONFIG_PLAT_SPEAR) += spear/ |
diff --git a/drivers/clk/socfpga/Makefile b/drivers/clk/socfpga/Makefile new file mode 100644 index 000000000000..0303c0b99cd0 --- /dev/null +++ b/drivers/clk/socfpga/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-y += clk.o | |||
diff --git a/drivers/clk/socfpga/clk.c b/drivers/clk/socfpga/clk.c new file mode 100644 index 000000000000..2c855a6394ff --- /dev/null +++ b/drivers/clk/socfpga/clk.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Altera Corporation <www.altera.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | #include <linux/clk.h> | ||
18 | #include <linux/clkdev.h> | ||
19 | #include <linux/clk-provider.h> | ||
20 | |||
21 | #define SOCFPGA_OSC1_CLK 10000000 | ||
22 | #define SOCFPGA_MPU_CLK 800000000 | ||
23 | #define SOCFPGA_MAIN_QSPI_CLK 432000000 | ||
24 | #define SOCFPGA_MAIN_NAND_SDMMC_CLK 250000000 | ||
25 | #define SOCFPGA_S2F_USR_CLK 125000000 | ||
26 | |||
27 | void __init socfpga_init_clocks(void) | ||
28 | { | ||
29 | struct clk *clk; | ||
30 | |||
31 | clk = clk_register_fixed_rate(NULL, "osc1_clk", NULL, CLK_IS_ROOT, SOCFPGA_OSC1_CLK); | ||
32 | clk_register_clkdev(clk, "osc1_clk", NULL); | ||
33 | |||
34 | clk = clk_register_fixed_rate(NULL, "mpu_clk", NULL, CLK_IS_ROOT, SOCFPGA_MPU_CLK); | ||
35 | clk_register_clkdev(clk, "mpu_clk", NULL); | ||
36 | |||
37 | clk = clk_register_fixed_rate(NULL, "main_clk", NULL, CLK_IS_ROOT, SOCFPGA_MPU_CLK/2); | ||
38 | clk_register_clkdev(clk, "main_clk", NULL); | ||
39 | |||
40 | clk = clk_register_fixed_rate(NULL, "dbg_base_clk", NULL, CLK_IS_ROOT, SOCFPGA_MPU_CLK/2); | ||
41 | clk_register_clkdev(clk, "dbg_base_clk", NULL); | ||
42 | |||
43 | clk = clk_register_fixed_rate(NULL, "main_qspi_clk", NULL, CLK_IS_ROOT, SOCFPGA_MAIN_QSPI_CLK); | ||
44 | clk_register_clkdev(clk, "main_qspi_clk", NULL); | ||
45 | |||
46 | clk = clk_register_fixed_rate(NULL, "main_nand_sdmmc_clk", NULL, CLK_IS_ROOT, SOCFPGA_MAIN_NAND_SDMMC_CLK); | ||
47 | clk_register_clkdev(clk, "main_nand_sdmmc_clk", NULL); | ||
48 | |||
49 | clk = clk_register_fixed_rate(NULL, "s2f_usr_clk", NULL, CLK_IS_ROOT, SOCFPGA_S2F_USR_CLK); | ||
50 | clk_register_clkdev(clk, "s2f_usr_clk", NULL); | ||
51 | } | ||