u-boot/drivers/i2c
Stefan Mavrodiev 004b4cdaec i2c: mvtwsi.c: Fix set speed
Previous patch for this driver breaks i2c initialization.

commit 8bcf12ccce ("i2c: mvtwsi.c: Avoid NULL dereference")

If actual_speed is passed as NULL in this function:
static void __twsi_i2c_init(struct mvtwsi_registers *twsi, int speed,
			    int slaveadd, uint *actual_speed)
than __twsi_i2c_set_bus_speed never get called. This causes i2c clock
to run on default speed - 2MHz (measured with oscilloscope). This is issue
on some boards, sunxi for example, since on I2C0 bus PMU is connected.

The bootlogs with and without the patch are as follows:

Wihtout the patch:
U-Boot SPL 2018.03-rc2 (Feb 13 2018 - 09:23:17 +0200)
DRAM: 1024 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from FEL

U-Boot 2018.03-rc2 (Feb 13 2018 - 09:23:17 +0200) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0

With the patch:
U-Boot SPL 2018.03-rc2-00001-g838ff85 (Feb 13 2018 - 09:24:34 +0200)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from FEL

U-Boot 2018.03-rc2-00001-g838ff85 (Feb 13 2018 - 09:24:34 +0200) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-02-19 08:21:38 +01:00
..
muxes i2c: muxes: pca954x: look up width from chip_desc 2017-10-11 06:17:22 +02:00
ast_i2c.c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
ast_i2c.h aspeed: Add I2C Driver 2017-05-08 11:57:34 -04:00
at91_i2c.c i2c: at91_i2c: remove the .probe_chip function 2017-12-07 09:29:19 +01:00
at91_i2c.h i2c: atmel: add i2c driver 2016-08-15 22:12:00 +02:00
cros_ec_ldo.c i2c: Drop redundant platform data setting in drivers 2016-08-12 06:41:41 +02:00
cros_ec_tunnel.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
davinci_i2c.c Configs: Migrate I2C_BUS_MAX to CONFIG_SYS_I2C_BUS_MAX 2017-09-01 17:56:20 -04:00
davinci_i2c.h i2c, davinci: convert driver to new mutlibus/mutliadapter framework 2014-04-17 17:24:38 -04:00
designware_i2c.c i2c: designware: Allow sending restart conditions 2017-08-10 12:02:50 +02:00
designware_i2c.h i2c: designware_i2c: Add ic_enable_status to ic_regs struct 2016-04-25 07:31:04 +02:00
exynos_hs_i2c.c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
fsl_i2c.c i2c: fsl_i2c: Make live-tree compatible 2018-02-06 06:59:59 +01:00
i2c-cdns.c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
i2c-emul-uclass.c dm: i2c: Add I2C emulation driver for sandbox 2014-12-11 13:18:42 -07:00
i2c-gpio.c treewide: replace with error() with pr_err() 2017-10-04 11:59:44 -04:00
i2c-uclass-compat.c i2c: i2c-uclass-compat: avoid any BSS usage 2016-08-08 13:33:00 -04:00
i2c-uclass.c i2c: remove DECLARE_GLOBAL_DATA_PTR from i2c-uclass 2017-10-17 11:27:42 +02:00
i2c-uniphier-f.c i2c: uniphier-f: replace debug() with dev_dbg() 2017-10-15 22:32:25 +09:00
i2c-uniphier.c i2c: uniphier: replace debug() with dev_dbg() 2017-10-15 22:32:24 +09:00
i2c_core.c powerpc, 8xx: remove support for 8xx 2017-06-12 08:37:55 -04:00
ihs_i2c.c i2c: ihs_i2c: Factor out send_buffer method 2018-02-06 07:02:11 +01:00
imx_lpi2c.c i2c: lpi2c: do not add 4 for bus seq 2018-01-16 06:58:59 +01:00
intel_i2c.c x86: i2c: Fix cast of address to 32-bit value 2016-10-11 11:55:33 +08:00
Kconfig i2c: rcar_iic: Allow IIC on RCar Gen2 2018-02-17 21:59:22 +01:00
kona_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00
lpc32xx_i2c.c i2c: lpc32xx: Force consistent bus numbering 2017-03-28 06:27:20 +02:00
Makefile i2c: rcar_iic: Add RCar IIC driver 2017-11-30 02:32:34 +01:00
meson_i2c.c i2c: meson: add some comments 2017-12-07 09:28:42 +01:00
mv_i2c.c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
mv_i2c.h i2c: mv_i2c.c: Enable runtime speed selection (standard vs fast mode) 2016-09-26 10:42:37 +02:00
mvtwsi.c i2c: mvtwsi.c: Fix set speed 2018-02-19 08:21:38 +01:00
mxc_i2c.c i2c: mxc_i2c: Use or operation 2018-01-16 06:59:39 +01:00
mxs_i2c.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
omap24xx_i2c.c treewide: replace with error() with pr_err() 2017-10-04 11:59:44 -04:00
omap24xx_i2c.h i2c: ti: Update SCLH and SCLL to be in sync with v4.9 Linux kernel 2017-03-28 06:27:33 +02:00
rcar_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00
rcar_iic.c i2c: rcar_iic: Add RCar IIC driver 2017-11-30 02:32:34 +01:00
rk_i2c.c rockchip: i2c: rk3328: support i2c for rk3328 SoC 2017-10-01 00:33:33 +02:00
s3c24x0_i2c.c samsung: Drop more references fo s3c24x0 2017-06-05 11:02:31 -04:00
s3c24x0_i2c.h samsung: i2c: Split the high-speed I2C code into a new driver 2016-12-05 13:27:54 +01:00
sandbox_i2c.c dm: sandbox: i2c: Drop fdtdec.h header 2017-06-01 07:03:16 -06:00
sh_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00
sh_sh7734_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00
soft_i2c.c powerpc: Remove 8260 remainders 2017-07-23 09:24:47 -04:00
stm32f7_i2c.c i2c: stm32f7_i2c: fix usage of useless local variable 2017-10-17 11:28:41 +02:00
tegra186_bpmp_i2c.c dm: gpio: Correct use of -ENODEV in drivers 2017-10-08 20:41:09 -06:00
tegra_i2c.c treewide: replace with error() with pr_err() 2017-10-04 11:59:44 -04:00
tsi108_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00
zynq_i2c.c dm: i2c: Add a note to I2C drivers which need conversion 2016-12-05 13:28:03 +01:00