Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/odroid Provide iic logic and bits for Odroid...



details:   https://anonhg.NetBSD.org/src/rev/f7a0b67a4563
branches:  trunk
changeset: 329365:f7a0b67a4563
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed May 21 12:24:11 2014 +0000

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

diffstat:

 sys/arch/evbarm/odroid/odroid_machdep.c |  30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diffs (92 lines):

diff -r 48890b03a816 -r f7a0b67a4563 sys/arch/evbarm/odroid/odroid_machdep.c
--- a/sys/arch/evbarm/odroid/odroid_machdep.c   Wed May 21 12:19:59 2014 +0000
+++ b/sys/arch/evbarm/odroid/odroid_machdep.c   Wed May 21 12:24:11 2014 +0000
@@ -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 @@
         * 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 @@
        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 @@
                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 @@
                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 @@
 }
 
 
+
 void
 odroid_device_register_post_config(device_t self, void *aux)
 {
@@ -674,7 +683,6 @@
 
        if (device_is_a(self, "exyousb")) {
                exynos_usb_init_usb3503_hub(self);
-               /* TBD power cycle USB ethernet chip */
        }
 }
 



Home | Main Index | Thread Index | Old Index