Uboot SPI uclass - question

Moshe, Yaniv yanivmo at amazon.com
Mon Nov 2 19:14:23 CET 2020


Hi Simon,
Hope you're doing good.

My name is Yaniv, and I have a question regarding an old commit in U-boot:
commit 60e2809a848bccd3a8090d3f2237964670f2780c
Author: Simon Glass <sjg at chromium.org<mailto:sjg at chromium.org>>
Date:   Tue Feb 17 15:29:35 2015 -0700

    dm: spi: Avoid setting the speed with every transfer

    Only set the speed if it has changed from last time. Since the speed will
    be 0 when the device is probed it will always be changed on the first
    transfer after the device is probed.

    Signed-off-by: Simon Glass sjg at chromium.org<mailto:sjg at chromium.org>


As far as I understand it, each SPI slave has its own struct. So, when we will use the device for the first time, we will set the speed.
But, if we're jumping between different slaves, the slaves structs were already configured at the first time, and since then there won't be any future speed setting.

e.g:
access flash with max-freq = X - > speed set
access TPM with max-freq =Y -> speed set
access flash again, slave struct already configured, no change between speed and slave->speed, -> speed stay the same as for TPM.

Did I got it wrong? I'm trying to understand what am I missing...

Thanks,
-Yaniv Moshe



More information about the U-Boot mailing list