Module Name:    src
Committed By:   reinoud
Date:           Thu Aug 14 15:44:42 UTC 2014

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

Log Message:
Add gpio not connected definitions for Exynos5

While here, increase delay around lan9730 powercycle timing to improve its
reset.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.25
--- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.24	Mon Aug  4 18:14:43 2014
+++ src/sys/arch/evbarm/odroid/odroid_machdep.c	Thu Aug 14 15:44:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_machdep.c,v 1.24 2014/08/04 18:14:43 reinoud Exp $ */
+/*	$NetBSD: odroid_machdep.c,v 1.25 2014/08/14 15:44:42 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.24 2014/08/04 18:14:43 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.25 2014/08/14 15:44:42 reinoud Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -536,7 +536,7 @@ odroid_exynos4_gpio_ncs(device_t self, p
 	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 : */
+	/* blue led at bit 0 : heartbeat */
 	prop_dictionary_set_uint32(dict, "nc-GPC1", 0x1f - 0b00000001);
 	prop_dictionary_set_uint32(dict, "nc-GPD0", 0x0f - 0b00000000);
 	/* i2c0 at pin 0,1 and i2c1 at pin 2,3 : */
@@ -595,7 +595,54 @@ odroid_exynos5_gpio_ncs(device_t self, p
 	 * generated by the gpio bootstrap and the values substracted are
 	 * explicitly allowed
 	 */
-	/* TBD: generate these values, see exynos_gpio.c boostrap */
+	prop_dictionary_set_uint32(dict, "nc-GPA0", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPA1", 0x3f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPA2", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPB0", 0x1f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPB1", 0x1f - 0b00000000);
+	/* green led at bit 1 : eMMC activity */
+	/* red   led at bit 2 : heartbeat */
+	prop_dictionary_set_uint32(dict, "nc-GPB2", 0x0f - 0b00000110);
+	prop_dictionary_set_uint32(dict, "nc-GPB3", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPC0", 0x7f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPC1", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPC2", 0x7f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPC3", 0x7f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPD0", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPD1", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY0", 0x3f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY1", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY2", 0x3f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY3", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY4", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY5", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPY6", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-ETC0", 0x3f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-ETC6", 0x7f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-ETC7", 0x1f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPC4", 0x3f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPX0", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPX1", 0xff - 0b00000000);
+	/* blue led at bit 3 : microSD activity */
+	prop_dictionary_set_uint32(dict, "nc-GPX2", 0xff - 0b00001000);
+	prop_dictionary_set_uint32(dict, "nc-GPX3", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPE0", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPE1", 0x03 - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPF0", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPF1", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPG0", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPG1", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPG2", 0x03 - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPH0", 0x0f - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPH1", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPV0", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPV1", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-ETC5", 0x03 - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPV2", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPV3", 0xff - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-ETC8", 0x03 - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPV4", 0x03 - 0b00000000);
+	prop_dictionary_set_uint32(dict, "nc-GPZ",  0x7f - 0b00000000);
 }
 #endif
 
@@ -804,7 +851,7 @@ exynos_usb_powercycle_lan9730(device_t s
 	error = iic_exec(i2c, I2C_OP_WRITE_WITH_STOP, chipid, &reg, 1,
 			&rdata, sizeof(rdata), 0);
 	KASSERT(!error);
-	DELAY(10000);
+	DELAY(20000);
 
 	iic_release_bus(i2c, 0);
 
@@ -817,8 +864,9 @@ exynos_usb_powercycle_lan9730(device_t s
 				"can't reserve GPIO pin %s\n", pin_enable);
 		} else {
 			exynos_gpio_pindata_write(&enable_pin, 0);
-			DELAY(10000);
+			DELAY(20000);
 			exynos_gpio_pindata_write(&enable_pin, 1);
+			DELAY(10000);
 		}
 	} else {
 		aprint_error_dev(self, "failed to lookup lan_power GPIO pin");

Reply via email to