u-boot-brain/drivers/i2c
Simon Glass bcf08503f5 i2c: designware_i2c: Tidy up use of NULL priv
At present we still have pre-driver-model code in this driver and it makes
things a bit confusing. In particular calc_bus_speed() is called with priv
as NULL if not using driver model.

This results in spk_cnt and comp_param1 being read from an invalid address
if not using driver model. For comp_param1 this may not cause problems if
reading from addresses close to 0 happens to be allowed, as high speed is
only supported by DM code. But spk_cnt is subsequently used to calculate
the bus periods and so this may cause problems (e.g. on spear600 board
which has not been migrated yet).

Add a new parameter regs parameter to calc_bus_speed() and add more
comments to this function and to _dw_i2c_set_bus_speed(), which calls it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-28 05:50:00 +02:00
..
muxes common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ast_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ast_i2c.h i2c: ast_i2c: Update to use standard enums for speed 2020-01-27 07:22:41 +01:00
at91_i2c.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
at91_i2c.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cros_ec_ldo.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cros_ec_tunnel.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
davinci_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
davinci_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
designware_i2c_pci.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
designware_i2c.c i2c: designware_i2c: Tidy up use of NULL priv 2020-05-28 05:50:00 +02:00
designware_i2c.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
exynos_hs_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
fsl_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
i2c_core.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
i2c-cdns.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
i2c-emul-uclass.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
i2c-gpio.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
i2c-uclass.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
i2c-uniphier-f.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
i2c-uniphier.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
i2c-versatile.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ihs_i2c.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
imx_lpi2c.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
intel_i2c.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
iproc_i2c.c drivers: i2c: add brcm iproc I2C driver support 2020-04-20 06:52:28 +02:00
iproc_i2c.h drivers: i2c: add brcm iproc I2C driver support 2020-04-20 06:52:28 +02:00
Kconfig rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA 2020-05-15 14:47:35 -04:00
kona_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
lpc32xx_i2c.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Makefile drivers: i2c: add brcm iproc I2C driver support 2020-04-20 06:52:28 +02:00
meson_i2c.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mv_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mv_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mvtwsi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mxc_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
omap24xx_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
omap24xx_i2c.h i2c: omap: Update to use standard enums for speed 2020-01-27 07:23:26 +01:00
rcar_i2c.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rcar_iic.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rk_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
s3c24x0_i2c.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
s3c24x0_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox_i2c.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
sh_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
soft_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
stm32f7_i2c.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
tegra186_bpmp_i2c.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
xilinx_xiic.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00