123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- /*
- * linux/arch/arm/mach-omap1/clock_data.c
- *
- * Copyright (C) 2004 - 2005, 2009-2010 Nokia Corporation
- * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
- * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * To do:
- * - Clocks that are only available on some chips should be marked with the
- * chips that they are present on.
- */
- #include <linux/kernel.h>
- #include <linux/io.h>
- #include <linux/clk.h>
- #include <linux/cpufreq.h>
- #include <linux/delay.h>
- #include <asm/mach-types.h> /* for machine_is_* */
- #include "soc.h"
- #include <mach/hardware.h>
- #include <mach/usb.h> /* for OTG_BASE */
- #include "iomap.h"
- #include "clock.h"
- #include "sram.h"
- /* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */
- #define IDL_CLKOUT_ARM_SHIFT 12
- #define IDLTIM_ARM_SHIFT 9
- #define IDLAPI_ARM_SHIFT 8
- #define IDLIF_ARM_SHIFT 6
- #define IDLLB_ARM_SHIFT 4 /* undocumented? */
- #define OMAP1510_IDLLCD_ARM_SHIFT 3 /* undocumented? */
- #define IDLPER_ARM_SHIFT 2
- #define IDLXORP_ARM_SHIFT 1
- #define IDLWDT_ARM_SHIFT 0
- /* Some MOD_CONF_CTRL_0 bit shifts - used in struct clk.enable_bit */
- #define CONF_MOD_UART3_CLK_MODE_R 31
- #define CONF_MOD_UART2_CLK_MODE_R 30
- #define CONF_MOD_UART1_CLK_MODE_R 29
- #define CONF_MOD_MMC_SD_CLK_REQ_R 23
- #define CONF_MOD_MCBSP3_AUXON 20
- /* Some MOD_CONF_CTRL_1 bit shifts - used in struct clk.enable_bit */
- #define CONF_MOD_SOSSI_CLK_EN_R 16
- /* Some OTG_SYSCON_2-specific bit fields */
- #define OTG_SYSCON_2_UHOST_EN_SHIFT 8
- /* Some SOFT_REQ_REG bit fields - used in struct clk.enable_bit */
- #define SOFT_MMC2_DPLL_REQ_SHIFT 13
- #define SOFT_MMC_DPLL_REQ_SHIFT 12
- #define SOFT_UART3_DPLL_REQ_SHIFT 11
- #define SOFT_UART2_DPLL_REQ_SHIFT 10
- #define SOFT_UART1_DPLL_REQ_SHIFT 9
- #define SOFT_USB_OTG_DPLL_REQ_SHIFT 8
- #define SOFT_CAM_DPLL_REQ_SHIFT 7
- #define SOFT_COM_MCKO_REQ_SHIFT 6
- #define SOFT_PERIPH_REQ_SHIFT 5 /* sys_ck gate for UART2 ? */
- #define USB_REQ_EN_SHIFT 4
- #define SOFT_USB_REQ_SHIFT 3 /* sys_ck gate for USB host? */
- #define SOFT_SDW_REQ_SHIFT 2 /* sys_ck gate for Bluetooth? */
- #define SOFT_COM_REQ_SHIFT 1 /* sys_ck gate for com proc? */
- #define SOFT_DPLL_REQ_SHIFT 0
- /*
- * Omap1 clocks
- */
- static struct clk ck_ref = {
- .name = "ck_ref",
- .ops = &clkops_null,
- .rate = 12000000,
- };
- static struct clk ck_dpll1 = {
- .name = "ck_dpll1",
- .ops = &clkops_null,
- .parent = &ck_ref,
- };
- /*
- * FIXME: This clock seems to be necessary but no-one has asked for its
- * activation. [ FIX: SoSSI, SSR ]
- */
- static struct arm_idlect1_clk ck_dpll1out = {
- .clk = {
- .name = "ck_dpll1out",
- .ops = &clkops_generic,
- .parent = &ck_dpll1,
- .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
- ENABLE_ON_INIT,
- .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
- .enable_bit = EN_CKOUT_ARM,
- .recalc = &followparent_recalc,
- },
- .idlect_shift = IDL_CLKOUT_ARM_SHIFT,
- };
- static struct clk sossi_ck = {
- .name = "ck_sossi",
- .ops = &clkops_generic,
- .parent = &ck_dpll1out.clk,
- .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
- .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
- .enable_bit = CONF_MOD_SOSSI_CLK_EN_R,
- .recalc = &omap1_sossi_recalc,
- .set_rate = &omap1_set_sossi_rate,
- };
- static struct clk arm_ck = {
- .name = "arm_ck",
- .ops = &clkops_null,
- .parent = &ck_dpll1,
- .rate_offset = CKCTL_ARMDIV_OFFSET,
- .recalc = &omap1_ckctl_recalc,
- .round_rate = omap1_clk_round_rate_ckctl_arm,
- .set_rate = omap1_clk_set_rate_ckctl_arm,
- };
|