Intel® Stratix® 10 Hard Processor System Technical Reference Manual

ID 683222
Date 11/28/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

16.5.2.3.1. Changing the Card Clock Frequency

To change the card clock frequency, perform the following steps:
  1. Before disabling the clocks, ensure that the card is not busy with any previous data command. To do so, verify that the data_busy bit of the status register (status) is 0.
  2. Reset the cclk_enable bit of the clkena register to 0, to disable the card clock generation.
  3. Reset the clksrc register to 0.
  4. Set the following bits in the cmd register to 1:
    • update_clk_regs_only—Specifies the update clocks command
    • wait_prvdata_complete—Ensures that clock parameters do not change until any ongoing data transfer is complete
    • start_cmd—Initiates the command
  5. Wait until the start_cmd and update_clk_regs_only bits change to 0. There is no interrupt when the clock modification completes. The controller does not set the command_done bit in the rintsts register upon command completion. The controller might signal a hardware lock error if it already has another command in the queue. In this case, return to Step 4.

    For information about hardware lock errors, refer to the "Interrupt and Error Handling" chapter.

  6. Reset the sdmmc_clk_enable bit to 0 in the enable register of the clock manager peripheral PLL group (perpllgrp).
  7. In the control register (ctrl) of the SDMMC controller group (sdmmcgrp) in the system manager, set the drive clock phase shift select (drvsel) and sample clock phase shift select (smplsel) bits to specify the required phase shift value.
  8. Set the sdmmc_clk_enable bit in the Enable register of the clock manager perpllgrp group to 1.
  9. Set the clkdiv register of the controller to the correct divider value for the required clock frequency.
  10. Set the cclk_enable bit of the clkena register to 1, to enable the card clock generation.

    You can also use the clkena register to enable low‑power mode, which automatically stops the sdmmc_cclk_out clock when the card is idle for more than eight clock cycles.