Module Name:    src
Committed By:   reinoud
Date:           Wed May 21 12:24:11 UTC 2014

Modified Files:
        src/sys/arch/evbarm/odroid: odroid_machdep.c

Log Message:
Provide iic logic and bits for Odroid-U's exynos i2c interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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/evbarm/odroid/odroid_machdep.c
diff -u src/sys/arch/evbarm/odroid/odroid_machdep.c:1.19 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.20
--- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.19	Thu May 15 15:35:37 2014
+++ src/sys/arch/evbarm/odroid/odroid_machdep.c	Wed May 21 12:24:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_machdep.c,v 1.19 2014/05/15 15:35:37 reinoud Exp $ */
+/*	$NetBSD: odroid_machdep.c,v 1.20 2014/05/21 12:24:11 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.19 2014/05/15 15:35:37 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.20 2014/05/21 12:24:11 reinoud Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -488,14 +488,17 @@ odroid_exynos4_gpio_ncs(device_t self, p
 	 * generated by the gpio bootstrap and the values substracted are
 	 * explicitly allowed
 	 */
-	prop_dictionary_set_uint32(dict, "nc-GPA0", 0xff - 0b00000000);
-	prop_dictionary_set_uint32(dict, "nc-GPA1", 0x3f - 0b00000000);
+	/* i2c at pin 6,7 */
+	prop_dictionary_set_uint32(dict, "nc-GPA0", 0xff - 0b11000000);
+	/* p3v3 enable on pin 3 */
+	prop_dictionary_set_uint32(dict, "nc-GPA1", 0x3f - 0b00001000);
 	prop_dictionary_set_uint32(dict, "nc-GPB",  0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPC0", 0x1f - 0b00000000);
 	/* blue led at bit 0 : */
 	prop_dictionary_set_uint32(dict, "nc-GPC1", 0x1f - 0b00000001);
 	prop_dictionary_set_uint32(dict, "nc-GPD0", 0x0f - 0b00000000);
-	prop_dictionary_set_uint32(dict, "nc-GPD1", 0x0f - 0b00000000);
+	/* i2c0 at pin 0,1 and i2c1 at pin 2,3 : */
+	prop_dictionary_set_uint32(dict, "nc-GPD1", 0x0f - 0b00001111);
 	prop_dictionary_set_uint32(dict, "nc-GPF0", 0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPF1", 0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPF2", 0xff - 0b00000000);
@@ -524,9 +527,10 @@ odroid_exynos4_gpio_ncs(device_t self, p
 	prop_dictionary_set_uint32(dict, "nc-GPM3", 0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPM4", 0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPX0", 0xff - 0b00000000);
-	prop_dictionary_set_uint32(dict, "nc-GPX1", 0xff - 0b00000000);
+	/* expansion connector bits at pin 0,1,5 : */
+	prop_dictionary_set_uint32(dict, "nc-GPX1", 0xff - 0b00100011);
 	prop_dictionary_set_uint32(dict, "nc-GPX2", 0xff - 0b00000000);
-	/* hub communication at pin 0, 4, 5: */
+	/* hub communication at pin 0,4,5 : */
 	prop_dictionary_set_uint32(dict, "nc-GPX3", 0xff - 0b00110001);
 	prop_dictionary_set_uint32(dict, "nc-GPZ",  0xff - 0b00000000);
 	prop_dictionary_set_uint32(dict, "nc-GPV0", 0xff - 0b00000000);
@@ -572,6 +576,7 @@ odroid_device_register(device_t self, vo
 		prop_dictionary_set_cstring(dict, "nreset", "hub_nreset");
 		prop_dictionary_set_cstring(dict, "hubconnect", "hub_connect");
 		prop_dictionary_set_cstring(dict, "nint", "hub_nint");
+		prop_dictionary_set_cstring(dict, "lan_power", "p3v3_en");
 	}
 
 #ifdef EXYNOS4
@@ -586,9 +591,12 @@ odroid_device_register(device_t self, vo
 		prop_dictionary_set_cstring(dict, "hub_connect", ">GPX3[4]");
 		prop_dictionary_set_cstring(dict, "hub_nint", "<GPX3[0]");
 
-		prop_dictionary_set_cstring(dict, "iic0_enable", "gpio");
-		prop_dictionary_set_cstring(dict, "iic1_enable", "gpio");
-		prop_dictionary_set_cstring(dict, "iic2_enable", "gpio");
+		prop_dictionary_set_cstring(dict, "p3v3_en", ">GPA1[3]");
+	}
+	if (device_is_a(self, "exyoiic") && (IS_EXYNOS4_P())) {
+		prop_dictionary_set_bool(dict, "iic0_enable", true);
+		prop_dictionary_set_bool(dict, "iic1_enable", true);
+		prop_dictionary_set_bool(dict, "iic2_enable", true);
 		/* IIC3 not used (NC) */
 		/* IIC4 not used (NC) */
 		/* IIC5 not used (NC) */
@@ -667,6 +675,7 @@ exynos_usb_init_usb3503_hub(device_t sel
 }
 
 
+
 void
 odroid_device_register_post_config(device_t self, void *aux)
 {
@@ -674,7 +683,6 @@ odroid_device_register_post_config(devic
 
 	if (device_is_a(self, "exyousb")) {
 		exynos_usb_init_usb3503_hub(self);
-		/* TBD power cycle USB ethernet chip */
 	}
 }
 

Reply via email to