Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Implement i2c using gpio for Exynos5 and Odroid-XU
details: https://anonhg.NetBSD.org/src/rev/ad8c3acd7780
branches: trunk
changeset: 331693:ad8c3acd7780
user: reinoud <reinoud%NetBSD.org@localhost>
date: Tue Aug 19 16:18:15 2014 +0000
description:
Implement i2c using gpio for Exynos5 and Odroid-XU
diffstat:
sys/arch/arm/samsung/exynos5_loc.c | 12 +++++++++++-
sys/arch/evbarm/odroid/odroid_machdep.c | 15 +++++++++++++--
2 files changed, 24 insertions(+), 3 deletions(-)
diffs (65 lines):
diff -r eef224df777b -r ad8c3acd7780 sys/arch/arm/samsung/exynos5_loc.c
--- a/sys/arch/arm/samsung/exynos5_loc.c Tue Aug 19 15:46:46 2014 +0000
+++ b/sys/arch/arm/samsung/exynos5_loc.c Tue Aug 19 16:18:15 2014 +0000
@@ -91,7 +91,7 @@
#define IRQ_CPU_NFIQ_1 IRQ_SPI(67)
#define IRQ_CPU_NFIQ_0 IRQ_SPI(66)
#define IRQ_TMU IRQ_SPI(65)
-#define IRQ_I2C IRQ_SPI(64)
+#define IRQ_HDMI_I2C IRQ_SPI(64)
#define IRQ_I2C7 IRQ_SPI(63)
#define IRQ_I2C6 IRQ_SPI(62)
#define IRQ_I2C5 IRQ_SPI(61)
@@ -229,6 +229,16 @@
/* flag signal the use of gpio */
static const struct exyo_locators exynos5_i2c_locators[] = {
+ /* busname, sdabit, slcbit, func */
+ { "iic0", OFFANDSIZE(,I2C0), 0, IRQ_I2C0_USI0, 1 , "GPB3", 0, 1, 2 },
+ { "iic1", OFFANDSIZE(,I2C1), 1, IRQ_I2C1_USI1, 1 , "GPB3", 2, 3, 2 },
+ { "iic2", OFFANDSIZE(,I2C2), 2, IRQ_I2C2_USI2, 1 , "GPA0", 6, 7, 3 },
+ { "iic3", OFFANDSIZE(,I2C3), 3, IRQ_I2C3_USI3, 1 , "GPA1", 2, 3, 3 },
+ { "iic4", OFFANDSIZE(,I2C4), 4, IRQ_I2C4, 1 , "GPA2", 0, 1, 3 },
+ { "iic5", OFFANDSIZE(,I2C5), 5, IRQ_I2C5, 1 , "GPA2", 2, 3, 3 },
+ { "iic6", OFFANDSIZE(,I2C6), 6, IRQ_I2C6, 1 , "GPB1", 3, 4, 4 },
+ { "iic7", OFFANDSIZE(,I2C7), 7, IRQ_I2C7, 1 , "GPB2", 2, 3, 3 },
+ { "iic8", OFFANDSIZE(,I2CHDMI), 8, IRQ_HDMI_I2C, 0 , "", 0, 0, 0 },
};
diff -r eef224df777b -r ad8c3acd7780 sys/arch/evbarm/odroid/odroid_machdep.c
--- a/sys/arch/evbarm/odroid/odroid_machdep.c Tue Aug 19 15:46:46 2014 +0000
+++ b/sys/arch/evbarm/odroid/odroid_machdep.c Tue Aug 19 16:18:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: odroid_machdep.c,v 1.26 2014/08/14 15:57:51 reinoud Exp $ */
+/* $NetBSD: odroid_machdep.c,v 1.27 2014/08/19 16:18:15 reinoud Exp $ */
/*
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.26 2014/08/14 15:57:51 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.27 2014/08/19 16:18:15 reinoud Exp $");
#include "opt_evbarm_boardtype.h"
#include "opt_exynos.h"
@@ -720,6 +720,17 @@
/* internal hub IIRC, unknown if this line exists */
//prop_dictionary_set_cstring(dict, "p3v3_en", ">GPA1[3]");
}
+ if (device_is_a(self, "exyoiic") && (IS_EXYNOS5_P())) {
+ /* IIC0 not used (NC) */
+ prop_dictionary_set_bool(dict, "iic1_enable", true);
+ prop_dictionary_set_bool(dict, "iic2_enable", true);
+ /* IIC3 not used (NC) */
+ prop_dictionary_set_bool(dict, "iic4_enable", true);
+ /* IIC5 not used (NC) */
+ /* IIC6 used differently (SCLK used as led1) */
+ /* IIC7 used differently (PWM, though NC) */
+ /* IIC8 HDMI, not possible trough GPIO */
+ }
#endif
}
Home |
Main Index |
Thread Index |
Old Index