Module Name: src Committed By: reinoud Date: Tue Aug 19 16:18:15 UTC 2014
Modified Files: src/sys/arch/arm/samsung: exynos5_loc.c src/sys/arch/evbarm/odroid: odroid_machdep.c Log Message: Implement i2c using gpio for Exynos5 and Odroid-XU To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/samsung/exynos5_loc.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/odroid/odroid_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/samsung/exynos5_loc.c diff -u src/sys/arch/arm/samsung/exynos5_loc.c:1.8 src/sys/arch/arm/samsung/exynos5_loc.c:1.9 --- src/sys/arch/arm/samsung/exynos5_loc.c:1.8 Thu Aug 14 15:46:57 2014 +++ src/sys/arch/arm/samsung/exynos5_loc.c Tue Aug 19 16:18:15 2014 @@ -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 @@ const struct exyo_locinfo exynos5_locinf /* 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 }, }; Index: src/sys/arch/evbarm/odroid/odroid_machdep.c diff -u src/sys/arch/evbarm/odroid/odroid_machdep.c:1.26 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.27 --- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.26 Thu Aug 14 15:57:51 2014 +++ src/sys/arch/evbarm/odroid/odroid_machdep.c Tue Aug 19 16:18:15 2014 @@ -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 @@ odroid_device_register(device_t self, vo /* 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 }