allwinner: add I2C glue driver
authorIcenowy Zheng <icenowy@aosc.io>
Sun, 22 Jul 2018 13:29:02 +0000 (21:29 +0800)
committerIcenowy Zheng <icenowy@aosc.io>
Fri, 7 Sep 2018 14:13:06 +0000 (22:13 +0800)
Allwinner 64-bit SoCs all use the Mentor Graphics MI2CV I2C controller
core, with inverted clear quirk.

Add a glue driver for this.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
drivers/allwinner/sunxi_i2c.c [new file with mode: 0644]
maintainers.rst

diff --git a/drivers/allwinner/sunxi_i2c.c b/drivers/allwinner/sunxi_i2c.c
new file mode 100644 (file)
index 0000000..cc91ca5
--- /dev/null
@@ -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 */
+
+#include <mmio.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;
+};
+
+#include "../mentor/i2c/mi2cv.c"
index 969d5e5775cd835e52309c7cfa47444efdffc997..3f64b83fd1ccb495fb79ff3e0960a775d34ee532 100644 (file)
@@ -24,6 +24,7 @@ Allwinner ARMv8 platform port
 :G: `smaeul`_
 :F: docs/plat/allwinner.rst
 :F: plat/allwinner/
+:F: drivers/allwinner/
 
 Armv7-A architecture port
 -------------------------