drivers/clk/tegra/clk-tegra210.c
Source file repositories/reference/linux-study-clean/drivers/clk/tegra/clk-tegra210.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/tegra/clk-tegra210.c- Extension
.c- Size
- 126082 bytes
- Lines
- 3822
- Domain
- Driver Families
- Bucket
- drivers/clk
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/clk.hlinux/clk-provider.hlinux/clkdev.hlinux/of.hlinux/of_address.hlinux/syscore_ops.hlinux/delay.hlinux/export.hlinux/mutex.hlinux/clk/tegra.hdt-bindings/clock/tegra210-car.hdt-bindings/reset/tegra210-car.hlinux/sizes.hsoc/tegra/pmc.hclk.hclk-id.h
Detected Declarations
struct tegra210_domain_mbist_warstruct utmi_clk_paramfunction tegra210_plle_hw_sequence_is_enabledfunction tegra210_plle_hw_sequence_startfunction tegra210_xusb_pll_hw_control_enablefunction tegra210_xusb_pll_hw_sequence_startfunction tegra210_sata_pll_hw_control_enablefunction tegra210_sata_pll_hw_sequence_startfunction tegra210_set_sata_pll_seq_swfunction tegra210_clk_emc_dll_enablefunction tegra210_clk_emc_dll_update_settingfunction tegra210_clk_emc_update_settingfunction tegra210_generic_mbist_warfunction tegra210_venc_mbist_warfunction tegra210_disp_mbist_warfunction tegra210_vic_mbist_warfunction tegra210_ape_mbist_warfunction _pll_misc_chk_defaultfunction pllcx_check_defaultsfunction tegra210_pllcx_set_defaultsfunction _pllc_set_defaultsfunction _pllc2_set_defaultsfunction _pllc3_set_defaultsfunction _plla1_set_defaultsfunction tegra210_plla_set_defaultsfunction tegra210_plld_set_defaultsfunction Spectrumfunction tegra210_plld2_set_defaultsfunction tegra210_plldp_set_defaultsfunction tegra210_pllc4_set_defaultsfunction tegra210_pllre_set_defaultsfunction pllx_get_dyn_stepsfunction pllx_check_defaultsfunction tegra210_pllx_set_defaultsfunction tegra210_pllmb_set_defaultsfunction pllp_check_defaultsfunction tegra210_pllp_set_defaultsfunction pllu_check_defaultsfunction tegra210_pllu_set_defaultsfunction maskfunction tegra210_pllx_dyn_rampfunction tegra210_pll_fixed_mdiv_cfgfunction tegra210_clk_pll_set_gainfunction tegra210_clk_adjust_vco_minfunction pll_qlin_p_to_pdivfunction pll_expo_p_to_pdivfunction tegra210_clk_handle_mbist_warfunction tegra210_put_utmipll_in_iddq
Annotated Snippet
struct tegra210_domain_mbist_war {
void (*handle_lvl2_ovr)(struct tegra210_domain_mbist_war *mbist);
const u32 lvl2_offset;
const u32 lvl2_mask;
const unsigned int num_clks;
const unsigned int *clk_init_data;
struct clk_bulk_data *clks;
};
static struct clk **clks;
static void __iomem *clk_base;
static void __iomem *pmc_base;
static void __iomem *ahub_base;
static void __iomem *dispa_base;
static void __iomem *vic_base;
static unsigned long osc_freq;
static unsigned long pll_ref_freq;
static DEFINE_SPINLOCK(pll_d_lock);
static DEFINE_SPINLOCK(pll_e_lock);
static DEFINE_SPINLOCK(pll_re_lock);
static DEFINE_SPINLOCK(pll_u_lock);
static DEFINE_SPINLOCK(sor0_lock);
static DEFINE_SPINLOCK(sor1_lock);
static DEFINE_SPINLOCK(emc_lock);
static DEFINE_MUTEX(lvl2_ovr_lock);
/* possible OSC frequencies in Hz */
static unsigned long tegra210_input_freq[] = {
[5] = 38400000,
[8] = 12000000,
};
#define PLL_ENABLE (1 << 30)
#define PLLCX_MISC1_IDDQ (1 << 27)
#define PLLCX_MISC0_RESET (1 << 30)
#define PLLCX_MISC0_DEFAULT_VALUE 0x40080000
#define PLLCX_MISC0_WRITE_MASK 0x400ffffb
#define PLLCX_MISC1_DEFAULT_VALUE 0x08000000
#define PLLCX_MISC1_WRITE_MASK 0x08003cff
#define PLLCX_MISC2_DEFAULT_VALUE 0x1f720f05
#define PLLCX_MISC2_WRITE_MASK 0xffffff17
#define PLLCX_MISC3_DEFAULT_VALUE 0x000000c4
#define PLLCX_MISC3_WRITE_MASK 0x00ffffff
/* PLLA */
#define PLLA_BASE_IDDQ (1 << 25)
#define PLLA_BASE_LOCK (1 << 27)
#define PLLA_MISC0_LOCK_ENABLE (1 << 28)
#define PLLA_MISC0_LOCK_OVERRIDE (1 << 27)
#define PLLA_MISC2_EN_SDM (1 << 26)
#define PLLA_MISC2_EN_DYNRAMP (1 << 25)
#define PLLA_MISC0_DEFAULT_VALUE 0x12000020
#define PLLA_MISC0_WRITE_MASK 0x7fffffff
#define PLLA_MISC2_DEFAULT_VALUE 0x0
#define PLLA_MISC2_WRITE_MASK 0x06ffffff
/* PLLD */
#define PLLD_BASE_CSI_CLKSOURCE (1 << 23)
#define PLLD_MISC0_EN_SDM (1 << 16)
#define PLLD_MISC0_LOCK_OVERRIDE (1 << 17)
#define PLLD_MISC0_LOCK_ENABLE (1 << 18)
#define PLLD_MISC0_IDDQ (1 << 20)
#define PLLD_MISC0_DSI_CLKENABLE (1 << 21)
#define PLLD_MISC0_DEFAULT_VALUE 0x00140000
#define PLLD_MISC0_WRITE_MASK 0x3ff7ffff
#define PLLD_MISC1_DEFAULT_VALUE 0x20
#define PLLD_MISC1_WRITE_MASK 0x00ffffff
/* PLLD2 and PLLDP and PLLC4 */
#define PLLDSS_BASE_LOCK (1 << 27)
#define PLLDSS_BASE_LOCK_OVERRIDE (1 << 24)
#define PLLDSS_BASE_IDDQ (1 << 18)
#define PLLDSS_BASE_REF_SEL_SHIFT 25
#define PLLDSS_BASE_REF_SEL_MASK (0x3 << PLLDSS_BASE_REF_SEL_SHIFT)
#define PLLDSS_MISC0_LOCK_ENABLE (1 << 30)
#define PLLDSS_MISC1_CFG_EN_SDM (1 << 31)
#define PLLDSS_MISC1_CFG_EN_SSC (1 << 30)
Annotation
- Immediate include surface: `linux/io.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/clkdev.h`, `linux/of.h`, `linux/of_address.h`, `linux/syscore_ops.h`, `linux/delay.h`.
- Detected declarations: `struct tegra210_domain_mbist_war`, `struct utmi_clk_param`, `function tegra210_plle_hw_sequence_is_enabled`, `function tegra210_plle_hw_sequence_start`, `function tegra210_xusb_pll_hw_control_enable`, `function tegra210_xusb_pll_hw_sequence_start`, `function tegra210_sata_pll_hw_control_enable`, `function tegra210_sata_pll_hw_sequence_start`, `function tegra210_set_sata_pll_seq_sw`, `function tegra210_clk_emc_dll_enable`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.