• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision2a75bc1303b34e88745fcecfeacbe94f2a4bd1e2 (tree)
Time2022-07-26 16:34:21
AuthorAshok Reddy Soma <ashok.reddy.soma@xili...>
CommiterMichal Simek

Log Message

spi: zynq_qspi: Fix programming qspi speed

When programming qspi flash speed we need to check the requested flash
speed not to exceed the spi max frequency. In the current implementation
we are checking qspi ref clk instead. This commit fixes the issue by
checking the requested speed and programs the specified max frequency.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657893679-20039-5-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

Change Summary

Incremental Difference

--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
@@ -622,15 +622,12 @@ static int zynq_qspi_set_speed(struct udevice *bus, uint speed)
622622 uint32_t confr;
623623 u8 baud_rate_val = 0;
624624
625- if (speed > plat->frequency)
626- speed = plat->frequency;
625+ if (!speed || speed > priv->max_hz)
626+ speed = priv->max_hz;
627627
628628 /* Set the clock frequency */
629629 confr = readl(&regs->cr);
630- if (speed == 0) {
631- /* Set baudrate x8, if the freq is 0 */
632- baud_rate_val = 0x2;
633- } else if (plat->speed_hz != speed) {
630+ if (plat->speed_hz != speed) {
634631 while ((baud_rate_val < ZYNQ_QSPI_CR_BAUD_MAX) &&
635632 ((plat->frequency /
636633 (2 << baud_rate_val)) > speed))