diff options
author | Tom Rini <trini@ti.com> | 2013-10-17 12:09:49 -0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-10-17 12:09:49 -0400 |
commit | 9dff87a297dabe4af60012ad2d990ff8967f1d55 (patch) | |
tree | 484a3f5785536d6996c68f538b48590d71b6bd8c /drivers/i2c/sh_i2c.c | |
parent | 287df01e6aef0464c5e5bcbd7e87aa4ff1f24f5a (diff) | |
parent | 9a2a73d29fa395f42f3fb477ac99dda4d7f2f21f (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-i2c
Diffstat (limited to 'drivers/i2c/sh_i2c.c')
-rw-r--r-- | drivers/i2c/sh_i2c.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c index 58f8bf1bd5..808202c299 100644 --- a/drivers/i2c/sh_i2c.c +++ b/drivers/i2c/sh_i2c.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2011 Renesas Solutions Corp. - * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * Copyright (C) 2011, 2013 Renesas Solutions Corp. + * Copyright (C) 2011, 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -8,6 +8,8 @@ #include <common.h> #include <asm/io.h> +DECLARE_GLOBAL_DATA_PTR; + /* Every register is 32bit aligned, but only 8bits in size */ #define ureg(name) u8 name; u8 __pad_##name##0; u16 __pad_##name##1; struct sh_i2c { @@ -240,6 +242,10 @@ void i2c_init(int speed, int slaveaddr) { int num, denom, tmp; + /* No i2c support prior to relocation */ + if (!(gd->flags & GD_FLG_RELOC)) + return; + #ifdef CONFIG_I2C_MULTI_BUS current_bus = 0; #endif |