diff --git a/drivers/mentor/i2c/mi2cv.c b/drivers/mentor/i2c/mi2cv.c index 1b73e6f1642db570ab645ce599c4391fd56f8d92..8ebd9662b14e353070c9466151ee84e878a1fac1 100644 --- a/drivers/mentor/i2c/mi2cv.c +++ b/drivers/mentor/i2c/mi2cv.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #if LOG_LEVEL >= LOG_LEVEL_VERBOSE diff --git a/drivers/allwinner/sunxi_i2c.c b/plat/allwinner/common/include/mentor_i2c_plat.h similarity index 90% rename from drivers/allwinner/sunxi_i2c.c rename to plat/allwinner/common/include/mentor_i2c_plat.h index cc91ca58afbf9720e181f7f630e7720bcfb1e6e1..f547f9a48163c254a5f511763600f4219e5505fd 100644 --- a/drivers/allwinner/sunxi_i2c.c +++ b/plat/allwinner/common/include/mentor_i2c_plat.h @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-3-Clause * https://spdx.org/licenses */ - /* This driver provides I2C support for Allwinner sunXi SoCs */ -#include +#ifndef SUNXI_I2C_H +#define SUNXI_I2C_H #define CONFIG_SYS_TCLK 24000000 #define CONFIG_SYS_I2C_SPEED 100000 @@ -25,4 +25,4 @@ struct mentor_i2c_regs { uint32_t soft_reset; }; -#include "../mentor/i2c/mi2cv.c" +#endif diff --git a/plat/allwinner/sun50i_h6/platform.mk b/plat/allwinner/sun50i_h6/platform.mk index c3901d0174836be60ef8cee078c441a2f8b24249..90987020632fd8b26060edb0c0dd10579f4a3f02 100644 --- a/plat/allwinner/sun50i_h6/platform.mk +++ b/plat/allwinner/sun50i_h6/platform.mk @@ -15,8 +15,8 @@ PLAT_INCLUDES := -Iinclude/plat/arm/common \ -I${AW_PLAT}/${PLAT}/include PLAT_BL_COMMON_SOURCES := drivers/console/${ARCH}/console.S \ + drivers/mentor/i2c/mi2cv.c \ drivers/ti/uart/${ARCH}/16550_console.S \ - ${AW_DRIVERS}/sunxi_i2c.c \ ${XLAT_TABLES_LIB_SRCS} \ ${AW_PLAT}/common/plat_helpers.S \ ${AW_PLAT}/common/sunxi_common.c diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/a8k/common/a8k_common.mk index 5956737db1ba94b9f6604e0a52b28a2d8d50eb59..be2ff1e3af2e606cf8d0c34bbb8fedf9ffc6ecbd 100644 --- a/plat/marvell/a8k/common/a8k_common.mk +++ b/plat/marvell/a8k/common/a8k_common.mk @@ -57,9 +57,9 @@ BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \ MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c -BLE_SOURCES := $(PLAT_COMMON_BASE)/plat_ble_setup.c \ +BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \ + $(PLAT_COMMON_BASE)/plat_ble_setup.c \ $(MARVELL_MOCHI_DRV) \ - $(MARVELL_DRV_BASE)/i2c/a8k_i2c.c \ $(PLAT_COMMON_BASE)/plat_pm.c \ $(MARVELL_DRV_BASE)/thermal.c \ $(PLAT_COMMON_BASE)/plat_thermal.c \ diff --git a/drivers/marvell/i2c/a8k_i2c.c b/plat/marvell/a8k/common/include/mentor_i2c_plat.h similarity index 92% rename from drivers/marvell/i2c/a8k_i2c.c rename to plat/marvell/a8k/common/include/mentor_i2c_plat.h index 1c0f922cdad4fb4959ee9401ba05816ddc4b3cef..8829a922cdb7b6e32d4e446205fbf69fcfe4bb5c 100644 --- a/drivers/marvell/i2c/a8k_i2c.c +++ b/plat/marvell/a8k/common/include/mentor_i2c_plat.h @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-3-Clause * https://spdx.org/licenses */ - /* This driver provides I2C support for Marvell A8K and compatible SoCs */ -#include +#ifndef A8K_I2C_H +#define A8K_I2C_H #define CONFIG_SYS_TCLK 250000000 #define CONFIG_SYS_I2C_SPEED 100000 @@ -30,4 +30,4 @@ struct mentor_i2c_regs { uint32_t unstuck; }; -#include "../../mentor/i2c/mi2cv.c" +#endif