~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/cpu/clock-cpg.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #include <linux/clk.h>
  3 #include <linux/compiler.h>
  4 #include <linux/slab.h>
  5 #include <linux/io.h>
  6 #include <linux/clkdev.h>
  7 #include <asm/clock.h>
  8 
  9 static struct clk master_clk = {
 10         .flags          = CLK_ENABLE_ON_INIT,
 11         .rate           = CONFIG_SH_PCLK_FREQ,
 12 };
 13 
 14 static struct clk peripheral_clk = {
 15         .parent         = &master_clk,
 16         .flags          = CLK_ENABLE_ON_INIT,
 17 };
 18 
 19 static struct clk bus_clk = {
 20         .parent         = &master_clk,
 21         .flags          = CLK_ENABLE_ON_INIT,
 22 };
 23 
 24 static struct clk cpu_clk = {
 25         .parent         = &master_clk,
 26         .flags          = CLK_ENABLE_ON_INIT,
 27 };
 28 
 29 /*
 30  * The ordering of these clocks matters, do not change it.
 31  */
 32 static struct clk *onchip_clocks[] = {
 33         &master_clk,
 34         &peripheral_clk,
 35         &bus_clk,
 36         &cpu_clk,
 37 };
 38 
 39 static struct clk_lookup lookups[] = {
 40         /* main clocks */
 41         CLKDEV_CON_ID("master_clk", &master_clk),
 42         CLKDEV_CON_ID("peripheral_clk", &peripheral_clk),
 43         CLKDEV_CON_ID("bus_clk", &bus_clk),
 44         CLKDEV_CON_ID("cpu_clk", &cpu_clk),
 45 };
 46 
 47 int __init __deprecated cpg_clk_init(void)
 48 {
 49         int i, ret = 0;
 50 
 51         for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) {
 52                 struct clk *clk = onchip_clocks[i];
 53                 arch_init_clk_ops(&clk->ops, i);
 54                 if (clk->ops)
 55                         ret |= clk_register(clk);
 56         }
 57 
 58         clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 59 
 60         clk_add_alias("fck", "sh-tmu-sh3.0", "peripheral_clk", NULL);
 61         clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL);
 62         clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL);
 63         clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL);
 64         clk_add_alias("fck", "sh-mtu2", "peripheral_clk", NULL);
 65         clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
 66         clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
 67 
 68         return ret;
 69 }
 70 
 71 /*
 72  * Placeholder for compatibility, until the lazy CPUs do this
 73  * on their own.
 74  */
 75 int __init __weak arch_clk_init(void)
 76 {
 77         return cpg_clk_init();
 78 }
 79 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php