?? omap1_clk.c
字號:
/* * OMAP clocks. * * Copyright (C) 2006-2007 Andrzej Zaborowski <balrog@zabor.org> * * Clocks data comes in part from arch/arm/mach-omap1/clock.h in Linux. * * 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 "hw.h"#include "omap.h"struct clk { const char *name; const char *alias; struct clk *parent; struct clk *child1; struct clk *sibling;#define ALWAYS_ENABLED (1 << 0)#define CLOCK_IN_OMAP310 (1 << 10)#define CLOCK_IN_OMAP730 (1 << 11)#define CLOCK_IN_OMAP1510 (1 << 12)#define CLOCK_IN_OMAP16XX (1 << 13) uint32_t flags; int id; int running; /* Is currently ticking */ int enabled; /* Is enabled, regardless of its input clk */ unsigned long rate; /* Current rate (if .running) */ unsigned int divisor; /* Rate relative to input (if .enabled) */ unsigned int multiplier; /* Rate relative to input (if .enabled) */ qemu_irq users[16]; /* Who to notify on change */ int usecount; /* Automatically idle when unused */};static struct clk xtal_osc12m = { .name = "xtal_osc_12m", .rate = 12000000, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk xtal_osc32k = { .name = "xtal_osc_32k", .rate = 32768, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk ck_ref = { .name = "ck_ref", .alias = "clkin", .parent = &xtal_osc12m, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};/* If a dpll is disabled it becomes a bypass, child clocks don't stop */static struct clk dpll1 = { .name = "dpll1", .parent = &ck_ref, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk dpll2 = { .name = "dpll2", .parent = &ck_ref, .flags = CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk dpll3 = { .name = "dpll3", .parent = &ck_ref, .flags = CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk dpll4 = { .name = "dpll4", .parent = &ck_ref, .multiplier = 4, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk apll = { .name = "apll", .parent = &ck_ref, .multiplier = 48, .divisor = 12, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk ck_48m = { .name = "ck_48m", .parent = &dpll4, /* either dpll4 or apll */ .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk ck_dpll1out = { .name = "ck_dpll1out", .parent = &dpll1, .flags = CLOCK_IN_OMAP16XX,};static struct clk sossi_ck = { .name = "ck_sossi", .parent = &ck_dpll1out, .flags = CLOCK_IN_OMAP16XX,};static struct clk clkm1 = { .name = "clkm1", .alias = "ck_gen1", .parent = &dpll1, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk clkm2 = { .name = "clkm2", .alias = "ck_gen2", .parent = &dpll1, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk clkm3 = { .name = "clkm3", .alias = "ck_gen3", .parent = &dpll1, /* either dpll1 or ck_ref */ .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk arm_ck = { .name = "arm_ck", .alias = "mpu_ck", .parent = &clkm1, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk armper_ck = { .name = "armper_ck", .alias = "mpuper_ck", .parent = &clkm1, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk arm_gpio_ck = { .name = "arm_gpio_ck", .alias = "mpu_gpio_ck", .parent = &clkm1, .divisor = 1, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,};static struct clk armxor_ck = { .name = "armxor_ck", .alias = "mpuxor_ck", .parent = &ck_ref, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk armtim_ck = { .name = "armtim_ck", .alias = "mputim_ck", .parent = &ck_ref, /* either CLKIN or DPLL1 */ .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk armwdt_ck = { .name = "armwdt_ck", .alias = "mpuwd_ck", .parent = &clkm1, .divisor = 14, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk arminth_ck16xx = { .name = "arminth_ck", .parent = &arm_ck, .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, /* Note: On 16xx the frequency can be divided by 2 by programming * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1 * * 1510 version is in TC clocks. */};static struct clk dsp_ck = { .name = "dsp_ck", .parent = &clkm2, .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,};static struct clk dspmmu_ck = { .name = "dspmmu_ck", .parent = &clkm2, .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,};static struct clk dspper_ck = { .name = "dspper_ck", .parent = &clkm2, .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,};static struct clk dspxor_ck = { .name = "dspxor_ck", .parent = &ck_ref, .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,};static struct clk dsptim_ck = { .name = "dsptim_ck", .parent = &ck_ref, .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,};static struct clk tc_ck = { .name = "tc_ck", .parent = &clkm3, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk arminth_ck15xx = { .name = "arminth_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, /* Note: On 1510 the frequency follows TC_CK * * 16xx version is in MPU clocks. */};static struct clk tipb_ck = { /* No-idle controlled by "tc_ck" */ .name = "tipb_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk l3_ocpi_ck = { /* No-idle controlled by "tc_ck" */ .name = "l3_ocpi_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX,};static struct clk tc1_ck = { .name = "tc1_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX,};static struct clk tc2_ck = { .name = "tc2_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX,};static struct clk dma_ck = { /* No-idle controlled by "tc_ck" */ .name = "dma_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk dma_lcdfree_ck = { .name = "dma_lcdfree_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,};static struct clk api_ck = { .name = "api_ck", .alias = "mpui_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310,};static struct clk lb_ck = { .name = "lb_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,};static struct clk lbfree_ck = { .name = "lbfree_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,};static struct clk hsab_ck = { .name = "hsab_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,};static struct clk rhea1_ck = { .name = "rhea1_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,};static struct clk rhea2_ck = { .name = "rhea2_ck", .parent = &tc_ck, .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,};static struct clk lcd_ck_16xx = { .name = "lcd_ck", .parent = &clkm3, .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730,};static struct clk lcd_ck_1510 = { .name = "lcd_ck", .parent = &clkm3, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,};static struct clk uart1_1510 = { .name = "uart1_ck", /* Direct from ULPD, no real parent */ .parent = &armper_ck, /* either armper_ck or dpll4 */ .rate = 12000000, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk uart1_16xx = { .name = "uart1_ck", /* Direct from ULPD, no real parent */ .parent = &armper_ck, .rate = 48000000, .flags = CLOCK_IN_OMAP16XX,};static struct clk uart2_ck = { .name = "uart2_ck", /* Direct from ULPD, no real parent */ .parent = &armper_ck, /* either armper_ck or dpll4 */ .rate = 12000000, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk uart3_1510 = { .name = "uart3_ck", /* Direct from ULPD, no real parent */ .parent = &armper_ck, /* either armper_ck or dpll4 */ .rate = 12000000, .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED,};static struct clk uart3_16xx = { .name = "uart3_ck", /* Direct from ULPD, no real parent */ .parent = &armper_ck, .rate = 48000000, .flags = CLOCK_IN_OMAP16XX,};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -