summaryrefslogtreecommitdiff
path: root/plat/marvell
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2018-09-09 01:39:57 +0100
committerAndre Przywara <andre.przywara@arm.com>2018-09-19 09:24:02 +0100
commitdfc0fb272554ea5829fa74c6b75b9e656f55d0b3 (patch)
tree74b4fd77dc28f2457d2bdaa15b137e0762b49f52 /plat/marvell
parent159c52491af33ff8014ee2fa708804bb75540419 (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/marvell')
-rw-r--r--plat/marvell/a8k/common/a8k_common.mk4
-rw-r--r--plat/marvell/a8k/common/include/mentor_i2c_plat.h33
2 files changed, 35 insertions, 2 deletions
diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/a8k/common/a8k_common.mk
index 5956737d..be2ff1e3 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/plat/marvell/a8k/common/include/mentor_i2c_plat.h b/plat/marvell/a8k/common/include/mentor_i2c_plat.h
new file mode 100644
index 00000000..8829a922
--- /dev/null
+++ b/plat/marvell/a8k/common/include/mentor_i2c_plat.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2018 Marvell International Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ * https://spdx.org/licenses
+ */
+/* This driver provides I2C support for Marvell A8K and compatible SoCs */
+
+#ifndef A8K_I2C_H
+#define A8K_I2C_H
+
+#define CONFIG_SYS_TCLK 250000000
+#define CONFIG_SYS_I2C_SPEED 100000
+#define CONFIG_SYS_I2C_SLAVE 0x0
+
+#define I2C_CAN_UNSTUCK
+
+struct mentor_i2c_regs {
+ uint32_t slave_address;
+ uint32_t data;
+ uint32_t control;
+ union {
+ uint32_t status; /* when reading */
+ uint32_t baudrate; /* when writing */
+ };
+ uint32_t xtnd_slave_addr;
+ uint32_t reserved[2];
+ uint32_t soft_reset;
+ uint8_t reserved2[0xa0 - 0x20];
+ uint32_t unstuck;
+};
+
+#endif