reg_clockcontrol (SDIO) Register Description
Register Name | reg_clockcontrol |
---|---|
Offset Address | 0x000000002C |
Absolute Address |
0x00FF16002C (SD0) 0x00FF17002C (SD1) |
Width | 16 |
Type | mixedMixed types. See bit-field details. |
Reset Value | 0x00000000 |
Description | Clock Frequency Control and State. |
Program the clock frequency select, generator select, clock enable, and internal clock state.
reg_clockcontrol (SDIO) Register Bit-Field Summary
Field Name | Bits | Type | Reset Value | Description |
---|---|---|---|---|
clkctrl_sdclkfreqsel | 15:8 | rwNormal read/write | 0x0 | This register is used to select the frequency of the SDCLK pin. The frequency is not programmed directly; rather this register holds the divisor of the Base Clock Frequency For SD clock in the capabilities register. Only the following settings are allowed. (1) 8-bit Divided Clock Mode 80h - base clock divided by 256 40h - base clock divided by 128 20h - base clock divided by 64 10h - base clock divided by 32 08h - base clock divided by 16 04h - base clock divided by 8 02h - base clock divided by 4 01h - base clock divided by 2 00h - base clock(10MHz-63MHz) Setting 00h specifies the highest frequency of the SD Clock. When setting multiple bits, the most significant bit is used as the divisor. But multiple bits should not be set. The two default divider values can be calculated by the frequency that is defined by the Base Clock Frequency For SD Clock in the Capabilities register. 1) 25 MHz divider value. 2) 400 KHz divider value. The frequency of the SDCLK is set by the following formula: Clock Frequency = (Baseclock) / divisor. Thus choose the smallest possible divisor which results in a clock frequency that is less than or equal to the target frequency. Maximum Frequency for SD = 50Mhz (base clock) Maximum Frequency for MMC = 52Mhz (base clock) Minimum Frequency = 195.3125Khz (50Mhz / 256), same calculation for MMC also. (2) 10-bit Divided Clock Mode Host Controller Version 3.00 supports this mandatory mode instead of the 8-bit Divided Clock Mode. The length of divider is extended to10 bits and all divider values shall be supported. 3FFh --1/2046 Divided Clock N -------1/2N Divided Clock (Duty 50%) 002h -- 1/4 Divided Clock 001h ---1/2 Divided Clock 000h --- Base Clock (10MHz-254MHz) |
clkctrl_sdclkfreqsel_upperbits | 7:6 | rwNormal read/write | 0x0 | Bit 07-06 is assigned to bit 09-08 of clock divider in SDCLK Frequency Select. |
clkctrl_clkgensel | 5 | rwNormal read/write | 0x0 | This bit is used to select the clock generator mode in SDCLK Frequency Select. If the Programmable Clock Mode is supported (non-zero value is set to Clock Multiplier in the Capabilities register), this bit attribute is RW, and if not supported, this bit attribute is RO and zero is read. This bit depends on the setting of Preset Value Enable in the Host Control 2 register. If the Preset Value Enable = 0, this bit is set by Host Driver. If the Preset Value Enable = 1, this bit is automatically set to a value specified in one of Preset Value registers. 0 Divided Clock Mode 1 Programmable Clock Mode |
clkctrl_sdclkena | 2 | rwNormal read/write | 0x0 | The HC shall stop SDCLK when writing this bit to 0. SDCLK frequency Select can be changed when this bit is 0. Then, the HC shall maintain the same clock frequency until SDCLK is stopped (Stop at SDCLK = 0). If the HC detects the No Card state, this bit shall be cleared. 0 Disable, 1 Enable |
sdhcclkgen_intclkstable_dsync | 1 | roRead-only | 0x0 | This bit is set to 1 when SD clock is stable after writing to Internal Clock Enable in this register to 1. The SD Host Driver shall wait to set SD Clock Enable until this bit is set to 1. Note: This is useful when using PLL for a clock oscillator that requires setup time. 0 Not Ready, 1 Ready |
clkctrl_intclkena | 0 | rwNormal read/write | 0x0 | This bit is set to 0 when the HD is not using the HC or the HC awaits a wakeup event. The HC should stop its internal clock to go very low power state. Still, registers shall be able to be read and written. Clock starts to oscillate when this bit is set to 1. When clock oscillation is stable, the HC shall set Internal Clock Stable in this register to 1. This bit shall not affect card detection. 0 Stop, 1 Oscillate |