u-boot/drivers/spi
Andre Przywara fcd6d936aa spi: sunxi: improve SPI clock calculation
The current SPI clock divider calculation has two problems:
- We use a normal round-down division, which results in a divider
  typically being too small, resulting in a too high frequency on the bus.
- The calculaction for the power-of-two divider is very inaccurate, and
  again rounds down, which might lead to wild bus frequencies.

This wasn't a real problem so far, since most chips can handle slightly
higher bus frequencies just fine. Also the actual speed was mostly lost
anyway, due to release_bus() reseting the device. And the power-of-2
calculation was probably never used, because it only applies to
frequencies below 47 KHz.
However this will become a problem for the F1C100s support, due to its
much higher base frequency.

Calculate a safe divider correctly (using round-up), and re-use that
value when calculating the power-of-2 value. We also separate the
maximum frequency and the input clock on the way, since they will be
different for the F1C100s.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-07-18 11:27:59 +01:00
..
altera_spi.c spi: altera_spi: Do not abuse CONFIG namespace 2021-08-30 14:13:28 -04:00
apple_spi.c spi: apple: Add driver for Apple SPI controller 2022-02-10 16:44:23 -05:00
atcspi200_spi.c WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
ath79_spi.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
atmel-quadspi.c spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller 2022-04-26 09:54:41 +03:00
atmel_spi.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
atmel_spi.h spi: atmel: Remove nondm code 2020-06-11 15:14:04 +05:30
bcm63xx_hsspi.c spi: bcm63xx: Don't check clk_free 2022-03-30 13:02:55 -04:00
bcm63xx_spi.c spi: bcm63xx: Don't check clk_free 2022-03-30 13:02:55 -04:00
bcmstb_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
ca_sflash.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
cadence_ospi_versal.c spi: cadence_qspi: Enable apb linear mode for apb read & write operations 2022-06-29 16:00:31 +02:00
cadence_qspi.c spi: cadence-qspi: Fix programming ospi flash speed 2022-06-29 16:00:31 +02:00
cadence_qspi.h spi: cadence_qspi: Enable apb linear mode for apb read & write operations 2022-06-29 16:00:31 +02:00
cadence_qspi_apb.c spi: cadence_qspi: Enable apb linear mode for apb read & write operations 2022-06-29 16:00:31 +02:00
cf_spi.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
davinci_spi.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
designware_spi.c spi: dw: Don't check clk_free 2022-03-30 13:02:55 -04:00
exynos_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
fsl_dspi.c spi: fsl_dspi: rename num-cs to spi-num-chipselects 2021-11-09 17:18:23 +05:30
fsl_espi.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
fsl_qspi.c Merge branch '2021-02-02-drop-asm_global_data-when-unused' 2021-02-15 10:16:45 -05:00
gxp_spi.c spi: gxp_spi: Add GXP SPI controller driver 2022-06-22 21:30:05 -04:00
ich.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
ich.h x86: spl: Move priv/plat structs to headers 2021-01-05 12:24:41 -07:00
iproc_qspi.c driver: spi: add bcm iproc qspi support 2022-02-24 13:42:50 +05:30
Kconfig spi: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
kirkwood_spi.c spi: kirkwood: prevent limiting speed to 0 2021-05-16 06:48:45 +02:00
Makefile arm64: versal: Add versal specific cadence ospi driver 2022-06-29 15:58:48 +02:00
meson_spifc.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mpc8xx_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mpc8xxx_spi.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mscc_bb_spi.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mt7620_spi.c spi: add spi controller support for MediaTek MT7620 SoC 2021-01-24 21:39:26 +01:00
mt7621_spi.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mtk_snfi_spi.c spi: spi-mem: allow specifying a command's extension 2021-06-28 11:55:11 +05:30
mtk_snor.c spi: mtk_snor: add support for MTK SPI NOR controller 2021-01-29 10:35:14 -05:00
mvebu_a3700_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mxc_spi.c spi: mxc_spi: remove redundant code in spi_xchg_single() 2022-02-05 13:38:39 +01:00
mxs_spi.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
npcm_fiu_spi.c spi: npcm-fiu: add NPCM7xx FIU controller driver 2022-05-03 17:49:48 +05:30
nxp_fspi.c spi: nxp_fspi: Fix clock imbalance 2022-06-15 11:34:38 +02:00
octeon_spi.c pci: Add mask parameter to dm_pci_map_bar() 2022-05-03 18:33:29 -04:00
omap3_spi.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
pic32_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pl022_spi.c stm32mp1: fix reference for STMicroelectronics 2022-06-17 14:12:27 +02:00
renesas_rpc_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
rk_spi.c clk: Rename clk_get_by_driver_info() 2021-09-25 09:46:15 -06:00
rk_spi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
rockchip_sfc.c spi: rockchip_sfc: Add missing include for dm/device_compat.h 2022-04-18 11:25:12 +08:00
sandbox_spi.c test: spi: Add sandbox_spi_get_{speed, mode} interface 2020-12-22 20:39:26 -07:00
sh_qspi.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
soft_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
spi-emul-uclass.c dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
spi-mem-nodm.c spi: spi-mem-nodm: Fix read data size issue 2021-08-03 11:50:37 +05:30
spi-mem.c spi: spi-mem: add spi_mem_dtr_supports_op() 2021-06-28 11:56:06 +05:30
spi-mxic.c spi: Add MXIC controller driver 2021-06-25 20:59:45 +05:30
spi-qup.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
spi-sifive.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
spi-sunxi.c spi: sunxi: improve SPI clock calculation 2022-07-18 11:27:59 +01:00
spi-synquacer.c spi: synquacer: simplify tx completion checking 2022-06-10 13:37:32 -04:00
spi-uclass.c spi: spi-uclass: Add new spi_get_bus_and_cs() implementation 2022-05-23 09:33:10 -04:00
spi.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
stm32_qspi.c spi: stm32_qspi: Remove SR_BUSY bit check before sending command 2022-05-19 18:54:18 +02:00
stm32_spi.c spi: stm32: Add ofdata_to_platdata() callback 2021-10-08 08:41:47 +02:00
tegra20_sflash.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tegra20_slink.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tegra114_spi.c dm: Use access methods for dev/uclass private data 2021-01-05 12:24:40 -07:00
tegra210_qspi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tegra_spi.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
ti_qspi.c Fix wrong QSPI clock calculation for AM4372 2022-01-16 08:31:03 -05:00
uniphier_spi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
xilinx_spi.c spi: xilinx_spi: Trivial fixes in axi qspi driver 2021-03-30 12:03:24 +02:00
zynq_qspi.c spi: zynq_qspi: Add SPI memory operations to zynq qspi 2022-02-04 13:20:32 +01:00
zynq_spi.c Xilinx changes for v2021.04-rc3 2021-02-23 10:45:55 -05:00
zynqmp_gqspi.c spi: zynqmp_gqspi: Fix write issue at low frequencies 2021-10-25 10:02:25 +02:00