diff options
author | Andre Przywara <andre.przywara@arm.com> | 2018-09-09 01:39:57 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2018-09-19 09:24:02 +0100 |
commit | dfc0fb272554ea5829fa74c6b75b9e656f55d0b3 (patch) | |
tree | 74b4fd77dc28f2457d2bdaa15b137e0762b49f52 /plat/allwinner | |
parent | 159c52491af33ff8014ee2fa708804bb75540419 (diff) |
drivers: i2c: mentor: move platform code into header files
At the moment we have two I2C stub drivers (for the Allwinner and the
Marvell platform), which #include the actual .c driver file.
Change this into the more usual design, by renaming and moving the stub
drivers into platform specific header files and including these from the
actual driver file. The platform specific include directories make sure
the driver picks up the right header automatically.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'plat/allwinner')
-rw-r--r-- | plat/allwinner/common/include/mentor_i2c_plat.h | 28 | ||||
-rw-r--r-- | plat/allwinner/sun50i_h6/platform.mk | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/plat/allwinner/common/include/mentor_i2c_plat.h b/plat/allwinner/common/include/mentor_i2c_plat.h new file mode 100644 index 00000000..f547f9a4 --- /dev/null +++ b/plat/allwinner/common/include/mentor_i2c_plat.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 Icenowy Zheng <icenowy@aosc.io> + * + * SPDX-License-Identifier: BSD-3-Clause + * https://spdx.org/licenses + */ +/* This driver provides I2C support for Allwinner sunXi SoCs */ + +#ifndef SUNXI_I2C_H +#define SUNXI_I2C_H + +#define CONFIG_SYS_TCLK 24000000 +#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C_SLAVE 0 + +#define I2C_INTERRUPT_CLEAR_INVERTED + +struct mentor_i2c_regs { + uint32_t slave_address; + uint32_t xtnd_slave_addr; + uint32_t data; + uint32_t control; + uint32_t status; + uint32_t baudrate; + uint32_t soft_reset; +}; + +#endif diff --git a/plat/allwinner/sun50i_h6/platform.mk b/plat/allwinner/sun50i_h6/platform.mk index c3901d01..90987020 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 |