/* * Tegra CLK_OUT_ENB registers have some undefined bits which are not used and * any accidental write of 1 to these bits can cause PSLVERR. * So below are the valid mask defines for each CLK_OUT_ENB register used to * turn ON only the valid clocks.
*/ #define TEGRA210_CLK_ENB_VLD_MSK_L 0xdcd7dff9 #define TEGRA210_CLK_ENB_VLD_MSK_H 0x87d1f3e7 #define TEGRA210_CLK_ENB_VLD_MSK_U 0xf3fed3fa #define TEGRA210_CLK_ENB_VLD_MSK_V 0xffc18cfb #define TEGRA210_CLK_ENB_VLD_MSK_W 0x793fb7ff #define TEGRA210_CLK_ENB_VLD_MSK_X 0x3fe66fff #define TEGRA210_CLK_ENB_VLD_MSK_Y 0xfc1fc7ff
/** * struct tegra_clk_sync_source - external clock source from codec * * @hw: handle between common and hardware-specific interfaces * @rate: input frequency from source * @max_rate: max rate allowed
*/ struct tegra_clk_sync_source { struct clk_hw hw; unsignedlong rate; unsignedlong max_rate;
};
/** * struct tegra_clk_frac_div - fractional divider clock * * @hw: handle between common and hardware-specific interfaces * @reg: register containing divider * @flags: hardware-specific flags * @shift: shift to the divider bit field * @width: width of the divider bit field * @frac_width: width of the fractional bit field * @lock: register lock * * Flags: * TEGRA_DIVIDER_ROUND_UP - This flags indicates to round up the divider value. * TEGRA_DIVIDER_FIXED - Fixed rate PLL dividers has addition override bit, this * flag indicates that this divider is for fixed rate PLL. * TEGRA_DIVIDER_INT - Some modules can not cope with the duty cycle when * fraction bit is set. This flags indicates to calculate divider for which * fracton bit will be zero. * TEGRA_DIVIDER_UART - UART module divider has additional enable bit which is * set when divider value is not 0. This flags indicates that the divider * is for UART module.
*/ struct tegra_clk_frac_div { struct clk_hw hw; void __iomem *reg;
u8 flags;
u8 shift;
u8 width;
u8 frac_width;
spinlock_t *lock;
};
/* * Tegra PLL: * * In general, there are 3 requirements for each PLL * that SW needs to be comply with. * (1) Input frequency range (REF). * (2) Comparison frequency range (CF). CF = REF/DIVM. * (3) VCO frequency range (VCO). VCO = CF * DIVN. * * The final PLL output frequency (FO) = VCO >> DIVP.
*/
/** * struct tegra_clk_pll_freq_table - PLL frequecy table * * @input_rate: input rate from source * @output_rate: output rate from PLL for the input rate * @n: feedback divider * @m: input divider * @p: post divider * @cpcon: charge pump current * @sdm_data: fraction divider setting (0 = disabled)
*/ struct tegra_clk_pll_freq_table { unsignedlong input_rate; unsignedlong output_rate;
u32 n;
u32 m;
u8 p;
u8 cpcon;
u16 sdm_data;
};
/** * struct pdiv_map - map post divider to hw value * * @pdiv: post divider * @hw_val: value to be written to the PLL hw
*/ struct pdiv_map {
u8 pdiv;
u8 hw_val;
};
/** * struct div_nmp - offset and width of m,n and p fields * * @divn_shift: shift to the feedback divider bit field * @divn_width: width of the feedback divider bit field * @divm_shift: shift to the input divider bit field * @divm_width: width of the input divider bit field * @divp_shift: shift to the post divider bit field * @divp_width: width of the post divider bit field * @override_divn_shift: shift to the feedback divider bitfield in override reg * @override_divm_shift: shift to the input divider bitfield in override reg * @override_divp_shift: shift to the post divider bitfield in override reg
*/ struct div_nmp {
u8 divn_shift;
u8 divn_width;
u8 divm_shift;
u8 divm_width;
u8 divp_shift;
u8 divp_width;
u8 override_divn_shift;
u8 override_divm_shift;
u8 override_divp_shift;
};
#define MAX_PLL_MISC_REG_COUNT 6
struct tegra_clk_pll;
/** * struct tegra_clk_pll_params - PLL parameters * * @input_min: Minimum input frequency * @input_max: Maximum input frequency * @cf_min: Minimum comparison frequency * @cf_max: Maximum comparison frequency * @vco_min: Minimum VCO frequency * @vco_max: Maximum VCO frequency * @base_reg: PLL base reg offset * @misc_reg: PLL misc reg offset * @lock_reg: PLL lock reg offset * @lock_mask: Bitmask for PLL lock status * @lock_enable_bit_idx: Bit index to enable PLL lock * @iddq_reg: PLL IDDQ register offset * @iddq_bit_idx: Bit index to enable PLL IDDQ * @reset_reg: Register offset of where RESET bit is * @reset_bit_idx: Shift of reset bit in reset_reg * @sdm_din_reg: Register offset where SDM settings are * @sdm_din_mask: Mask of SDM divider bits * @sdm_ctrl_reg: Register offset where SDM enable is * @sdm_ctrl_en_mask: Mask of SDM enable bit * @ssc_ctrl_reg: Register offset where SSC settings are * @ssc_ctrl_en_mask: Mask of SSC enable bit * @aux_reg: AUX register offset * @dyn_ramp_reg: Dynamic ramp control register offset * @ext_misc_reg: Miscellaneous control register offsets * @pmc_divnm_reg: n, m divider PMC override register offset (PLLM) * @pmc_divp_reg: p divider PMC override register offset (PLLM) * @flags: PLL flags * @stepa_shift: Dynamic ramp step A field shift * @stepb_shift: Dynamic ramp step B field shift * @lock_delay: Delay in us if PLL lock is not used * @max_p: maximum value for the p divider * @defaults_set: Boolean signaling all reg defaults for PLL set. * @pdiv_tohw: mapping of p divider to register values * @div_nmp: offsets and widths on n, m and p fields * @freq_table: array of frequencies supported by PLL * @fixed_rate: PLL rate if it is fixed * @mdiv_default: Default value for fixed mdiv for this PLL * @round_p_to_pdiv: Callback used to round p to the closed pdiv * @set_gain: Callback to adjust N div for SDM enabled * PLL's based on fractional divider value. * @calc_rate: Callback used to change how out of table * rates (dividers and multipler) are calculated. * @adjust_vco: Callback to adjust the programming range of the * divider range (if SDM is present) * @set_defaults: Callback which will try to initialize PLL * registers to sane default values. This is first * tried during PLL registration, but if the PLL * is already enabled, it will be done the first * time the rate is changed while the PLL is * disabled. * @dyn_ramp: Callback which can be used to define a custom * dynamic ramp function for a given PLL. * @pre_rate_change: Callback which is invoked just before changing * PLL's rate. * @post_rate_change: Callback which is invoked right after changing * PLL's rate. * * Flags: * TEGRA_PLL_USE_LOCK - This flag indicated to use lock bits for * PLL locking. If not set it will use lock_delay value to wait. * TEGRA_PLL_HAS_CPCON - This flag indicates that CPCON value needs * to be programmed to change output frequency of the PLL. * TEGRA_PLL_SET_LFCON - This flag indicates that LFCON value needs * to be programmed to change output frequency of the PLL. * TEGRA_PLL_SET_DCCON - This flag indicates that DCCON value needs * to be programmed to change output frequency of the PLL. * TEGRA_PLLU - PLLU has inverted post divider. This flags indicated * that it is PLLU and invert post divider value. * TEGRA_PLLM - PLLM has additional override settings in PMC. This * flag indicates that it is PLLM and use override settings. * TEGRA_PLL_FIXED - We are not supposed to change output frequency * of some plls. * TEGRA_PLLE_CONFIGURE - Configure PLLE when enabling. * TEGRA_PLL_LOCK_MISC - Lock bit is in the misc register instead of the * base register. * TEGRA_PLL_BYPASS - PLL has bypass bit * TEGRA_PLL_HAS_LOCK_ENABLE - PLL has bit to enable lock monitoring * TEGRA_MDIV_NEW - Switch to new method for calculating fixed mdiv * it may be more accurate (especially if SDM present) * TEGRA_PLLMB - PLLMB has should be treated similar to PLLM. This * flag indicated that it is PLLMB. * TEGRA_PLL_VCO_OUT - Used to indicate that the PLL has a VCO output
*/ struct tegra_clk_pll_params { unsignedlong input_min; unsignedlong input_max; unsignedlong cf_min; unsignedlong cf_max; unsignedlong vco_min; unsignedlong vco_max;
/** * struct tegra_audio_clk_info - Tegra Audio Clk Information * * @name: name for the audio pll * @pll_params: pll_params for audio pll * @clk_id: clk_ids for the audio pll * @parent: name of the parent of the audio pll
*/ struct tegra_audio_clk_info { char *name; struct tegra_clk_pll_params *pll_params; int clk_id; char *parent;
};
/** * struct tegra_clk_periph_regs - Registers controlling peripheral clock * * @enb_reg: read the enable status * @enb_set_reg: write 1 to enable clock * @enb_clr_reg: write 1 to disable clock * @rst_reg: read the reset status * @rst_set_reg: write 1 to assert the reset of peripheral * @rst_clr_reg: write 1 to deassert the reset of peripheral
*/ struct tegra_clk_periph_regs {
u32 enb_reg;
u32 enb_set_reg;
u32 enb_clr_reg;
u32 rst_reg;
u32 rst_set_reg;
u32 rst_clr_reg;
};
/** * struct tegra_clk_periph_gate - peripheral gate clock * * @magic: magic number to validate type * @hw: handle between common and hardware-specific interfaces * @clk_base: address of CAR controller * @regs: Registers to control the peripheral * @flags: hardware-specific flags * @clk_num: Clock number * @enable_refcnt: array to maintain reference count of the clock * * Flags: * TEGRA_PERIPH_NO_RESET - This flag indicates that reset is not allowed * for this module. * TEGRA_PERIPH_ON_APB - If peripheral is in the APB bus then read the * bus to flush the write operation in apb bus. This flag indicates * that this peripheral is in apb bus. * TEGRA_PERIPH_WAR_1005168 - Apply workaround for Tegra114 MSENC bug
*/ struct tegra_clk_periph_gate {
u32 magic; struct clk_hw hw; void __iomem *clk_base;
u8 flags; int clk_num; int *enable_refcnt; conststruct tegra_clk_periph_regs *regs;
};
/** * struct clk_super_mux - super clock * * @hw: handle between common and hardware-specific interfaces * @reg: register controlling multiplexer * @width: width of the multiplexer bit field * @flags: hardware-specific flags * @div2_index: bit controlling divide-by-2 * @pllx_index: PLLX index in the parent list * @lock: register lock * * Flags: * TEGRA_DIVIDER_2 - LP cluster has additional divider. This flag indicates * that this is LP cluster clock. * TEGRA210_CPU_CLK - This flag is used to identify CPU cluster for gen5 * super mux parent using PLLP branches. To use PLLP branches to CPU, need * to configure additional bit PLLP_OUT_CPU in the clock registers. * TEGRA20_SUPER_CLK - Tegra20 doesn't have a dedicated divider for Super * clocks, it only has a clock-skipper.
*/ struct tegra_clk_super_mux { struct clk_hw hw; void __iomem *reg; struct tegra_clk_frac_div frac_div; conststruct clk_ops *div_ops;
u8 width;
u8 flags;
u8 div2_index;
u8 pllx_index;
spinlock_t *lock;
};
/** * struct clk_init_table - clock initialization table * @clk_id: clock id as mentioned in device tree bindings * @parent_id: parent clock id as mentioned in device tree bindings * @rate: rate to set * @state: enable/disable
*/ struct tegra_clk_init_table { unsignedint clk_id; unsignedint parent_id; unsignedlong rate; int state;
};
/** * struct clk_duplicate - duplicate clocks * @clk_id: clock id as mentioned in device tree bindings * @lookup: duplicate lookup entry for the clock
*/ struct tegra_clk_duplicate { int clk_id; struct clk_lookup lookup;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.