提交 aee3fddb 编写于 作者: G Gong Qianyu 提交者: Stefano Babic

i2c: mxc: add a condition in case the parameter is NULL

This could avoid executing the code that only applies to i.MX platforms.

The bus_i2c_init() is called before relocation and will assgin value
to a static variable. If U-Boot is then still running in a flash
device, it's theoretically not allowed to write data to flash without
an erasing operation. For i.MX platforms, the U-Boot is always running
in DDR.

Actually it causes asynchronous error when the ARM64 system error
report is enabled and the flash write protect is set.
Signed-off-by: NGong Qianyu <Qianyu.Gong@freescale.com>
Reviewed-by: NHeiko Schocher <hs@denx.de>
上级 40f4839c
......@@ -581,7 +581,15 @@ void bus_i2c_init(int index, int speed, int unused,
return;
}
/*
* Warning: Be careful to allow the assignment to a static
* variable here. This function could be called while U-Boot is
* still running in flash memory. So such assignment is equal
* to write data to flash without erasing.
*/
if (idle_bus_fn)
mxc_i2c_buses[index].idle_bus_fn = idle_bus_fn;
if (idle_bus_data)
mxc_i2c_buses[index].idle_bus_data = idle_bus_data;
ret = enable_i2c_clk(1, index);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册