mmc: bcm2835-host: let firmware manage the clock divisor

Newer firmware can manage the SDCDIV clock divisor register, allowing
the divisor to scale with the core as necessary.

Leverage this ability if the firmware supports it.

Adapted from the following raspberrypi Linux kernel commit:

  bcm2835-sdhost: Firmware manages the clock divisor
  08532d242d

Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
This commit is contained in:
Vincent Fazio
2021-09-14 13:19:19 -05:00
committed by Peter Robinson
parent 0a36afa823
commit 85bdd28d2b
4 changed files with 86 additions and 21 deletions

View File

@@ -22,6 +22,16 @@ int bcm2835_power_on_module(u32 module);
*/
int bcm2835_get_mmc_clock(u32 clock_id);
/**
* bcm2835_set_sdhost_clock() - determine if firmware controls sdhost cdiv
*
* @rate_hz: Input clock frequency
* @rate_1: Returns a clock frequency
* @rate_2: Returns a clock frequency
* @return 0 of OK, -EIO on error
*/
int bcm2835_set_sdhost_clock(u32 rate_hz, u32 *rate_1, u32 *rate_2);
/**
* bcm2835_get_video_size() - get the current display size
*