Make designware_i2c driver platform independent
Subsystems (3)
cover Make designware_i2c driver platform independent
Currently DW I2C driver required a target platform to have "asm/arch/hardware.h" file. This file doesn't exist for most of platforms so it would be good to remove this requirement.
Alexey Brodkin (3):
spear: move CONFIG_SYS_I2C_BASE from arch-spear/hardware to board
configs
designware_i2c: remove inclusion of <asm/arch/hardware.h>
arc: remove "hardware.h"
arch/arc/include/asm/arch-arc700/hardware.h | 10 ---------- arch/arm/include/asm/arch-spear/hardware.h | 4 ---- drivers/i2c/designware_i2c.c | 1 - include/configs/spear-common.h | 9 +++++++++ include/configs/x600.h | 1 + 5 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 arch/arc/include/asm/arch-arc700/hardware.h
Signature · 1 line
1.8.5.3
PATCH 1/3 spear: move CONFIG_SYS_I2C_BASE from arch-spear/hardware to board configs
Having CONFIG_SYS_I2C_BASE requires DW I2C driver to explicitly include <arch/hardware.h> which other platforms may not have at all.
It's always good to have a driver platform-independent.
--- arch/arm/include/asm/arch-spear/hardware.h | 4 ---- include/configs/spear-common.h | 9 +++++++++ include/configs/x600.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/include/asm/arch-spear/hardware.h +0 -4
@@ -26,7 +26,6 @@#define CONFIG_SYS_NAND_ALE (1 << 17)#if defined(CONFIG_SPEAR600 ) -#define CONFIG_SYS_I2C_BASE 0xD0200000#define CONFIG_SYS_FSMC_BASE 0xD1800000#define CONFIG_FSMC_NAND_BASE 0xD2000000
@@ -42,11 +41,9 @@#define CONFIG_SPEAR_MPMCREGS 100#elif defined(CONFIG_SPEAR300 ) -#define CONFIG_SYS_I2C_BASE 0xD0180000#define CONFIG_SYS_FSMC_BASE 0x94000000#elif defined(CONFIG_SPEAR310 ) -#define CONFIG_SYS_I2C_BASE 0xD0180000#define CONFIG_SYS_FSMC_BASE 0x44000000#undef CONFIG_SYS_NAND_CLE
@@ -63,7 +60,6 @@#define CONFIG_SYS_MACB3_BASE 0xB1800000#elif defined(CONFIG_SPEAR320 ) -#define CONFIG_SYS_I2C_BASE 0xD0180000#define CONFIG_SYS_FSMC_BASE 0x4C000000#define CONFIG_SPEAR_EMIBASE 0x40000000
include/configs/spear-common.h +9 -0
@@ -39,6 +39,15 @@/* I2C driver configuration */ #define CONFIG_HARD_I2C #define CONFIG_DW_I2C +#if defined(CONFIG_SPEAR600 ) +#define CONFIG_SYS_I2C_BASE 0xD0200000 +#elif defined(CONFIG_SPEAR300 ) +#define CONFIG_SYS_I2C_BASE 0xD0180000 +#elif defined(CONFIG_SPEAR310 ) +#define CONFIG_SYS_I2C_BASE 0xD0180000 +#elif defined(CONFIG_SPEAR320 ) +#define CONFIG_SYS_I2C_BASE 0xD0180000 +#endif #define CONFIG_SYS_I2C_SPEED 400000#define CONFIG_SYS_I2C_SLAVE 0x02
include/configs/x600.h +1 -0
@@ -85,6 +85,7 @@/* I2C config options */ #define CONFIG_HARD_I2C #define CONFIG_DW_I2C +#define CONFIG_SYS_I2C_BASE 0xD0200000#define CONFIG_SYS_I2C_SPEED 400000#define CONFIG_SYS_I2C_SLAVE 0x02#define CONFIG_I2C_CHIPADDRESS 0x50
Signature · 1 line
1.8.5.3
PATCH 2/3 designware_i2c: remove inclusion of <asm/arch/hardware.h>
In reply to Alexey BrodkinAs soon as all boards have their CONFIG_SYS_I2C_BASE defined in configuration files instead of "asm/arch/hardware.h" it's safe to remove the inclusion in question and make driver platform-independent.
--- drivers/i2c/designware_i2c.c | 1 - 1 file changed, 1 deletion(-)
drivers/i2c/designware_i2c.c +0 -1
@@ -7,7 +7,6 @@#include <common.h> #include <asm/io.h> -#include <asm/arch/hardware.h> #include "designware_i2c.h" #ifdef CONFIG_I2C_MULTI_BUS
Signature · 1 line
1.8.5.3
PATCH 3/3 arc: remove "hardware.h"
In reply to Alexey BrodkinThis file was only required for compilation of designware_i2c driver. Since explicit inclusion of "hardware.h" is now removed from the driver we may safely remove this empty header as well.
--- arch/arc/include/asm/arch-arc700/hardware.h | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 arch/arc/include/asm/arch-arc700/hardware.h
arch/arc/include/asm/arch-arc700/hardware.h deleted +0 -10
@@ -1,10 +0,0 @@ -/* -* Copyright (C) 2014 Synopsys, Inc. All rights reserved. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -/* -* This file is only required to allow compilation of "designware_i2c" driver. -* Which explicitly includes <asm/arch/hardware.h>. -*/
Signature · 1 line
1.8.5.3