Skip to content
Snippets Groups Projects
Commit b55b8eef authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Heiko Schocher
Browse files

i2c: sh_i2c: Avoid using I2C prior to relocation


If user uses the I2C in before the relocation, board of sh and rmobile
will not start. This will solve this problem.

Signed-off-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
parent 13c2433c
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (C) 2011 Renesas Solutions Corp. * Copyright (C) 2011, 2013 Renesas Solutions Corp.
* Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> * Copyright (C) 2011, 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
* *
* SPDX-License-Identifier: GPL-2.0+ * SPDX-License-Identifier: GPL-2.0+
*/ */
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <common.h> #include <common.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
/* Every register is 32bit aligned, but only 8bits in size */ /* Every register is 32bit aligned, but only 8bits in size */
#define ureg(name) u8 name; u8 __pad_##name##0; u16 __pad_##name##1; #define ureg(name) u8 name; u8 __pad_##name##0; u16 __pad_##name##1;
struct sh_i2c { struct sh_i2c {
...@@ -240,6 +242,10 @@ void i2c_init(int speed, int slaveaddr) ...@@ -240,6 +242,10 @@ void i2c_init(int speed, int slaveaddr)
{ {
int num, denom, tmp; int num, denom, tmp;
/* No i2c support prior to relocation */
if (!(gd->flags & GD_FLG_RELOC))
return;
#ifdef CONFIG_I2C_MULTI_BUS #ifdef CONFIG_I2C_MULTI_BUS
current_bus = 0; current_bus = 0;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment