Hi,

I'm trying out the mainline kernel on a OLinuXIno LIME2 again. 

I added an UEXT adapter to GPIO-1 and connected an I2C device to it
which worked fine - after (status="okay") device tree modification in
the Linux source tree.

But when I tried the UART on the UEXT it didn't work even after the
following addition:

&uart4 {
        status = "okay";
};

I connected a MT3329 to UEXT pins 3 and 4 (using just a 10 cm cable) and
checked the LIME2 UART input using a multimeter and it had 2.8 V (I
have no oscilloscope at this place right now. But I tried to connect
the MT3329 to an laptop UART adapter instead - and that worked - it
printed something to the laptop without being queried).

But my actual question is more fundamental:

How do I find out which /dev/ttyS* device uses which pins? Are there
files in /sys that I can check?

I found /sys/firmware/devicetree/base/soc@01c00000/pinctrl@01c20800/ so
far which has uart4@0 and uart4@1 with different pins, probably used
either-or.

How do I find out which set is currently connected by the kernel?

(I physically connected the MT3329 to PG10 and PG11 (well, UEXT) and
tried powering it using 5 V and then using 3.31 V instead).

Also, I tried to use dtc to create an external dtb file to avoid having
to modify the kernel's arch/arm/boot . That gave me a syntax error on
the plugin line (see below). Searching the internet gave me some posts
where they said that only very new dtc supports "plugins". I have
Debian 8.1's dtc.

The source dts I tried to use for the external version is:
/dts-v1/;
/plugin/;

/* UEXT on GPIO-1. Note: multiplexed with LCD. */
/* /include/ "sun7i-a20.dtsi"; */

/ {
        compatible = "olimex,a20-olinuxino-lime2",
"allwinner,sun7i-a20"; fragment@0 {
                target = <&i2c2>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&i2c2_pins_a>; /* PB20, PB21 */
                        status = "okay";
                };
        };
        fragment@1 {
                target = <&uart4>;
                /* pins: PG10, PG11 (pins 3 and 4 on UEXT,
respectively). uart4_pins_a */ __overlay__ {
                        status = "okay"; /* TODO test */
                };
        };
        fragment@2 {
                target = <&spi2>;
                /* CS: PC19
                   SCLK: PC20
                   MOSI: PC21
                   MISO: PC22 */
                __overlay__ {
                        status = "okay"; /* TODO test */
                };
        };
};

What is the recommended way to enable UEXT?

Thanks,
   Danny

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to