LCDproc development and user support list

Text archives Help


[Lcdproc] GPIO connection type for HD44780 driver


Chronological Thread 
  • From: harald at ccbib.org (harald at ccbib.org)
  • Subject: [Lcdproc] GPIO connection type for HD44780 driver
  • Date: Mon, 02 Nov 2015 22:42:54 +0100

On Mon, 2 Nov 2015 21:03:18 +0100, Iker Curro <coiker at live.com> wrote:

>> Hm, can you reproduce this with manually writing to
/sys/class/gpio/...,
>
> Yes. Just
> echo "7"> /sys/class/gpio/export
> echo "out"> /sys/class/gpio/gpio7/direction
> and it's gone.
>
> Now that the LCD works I see that the system is still running.
> My shell over ssh seems to be gone.

You mean ethernet is gone?

> With the WiringPi-tool I can do something similar with the command
> gpio export 13 out
>
> I imagine that these commands change something connected within the
> system.

Well, maybe this pin 13 (or whatever 13 above means) is in use by the
ethernet driver ...

I don't have a sunxi system running, so I can't tell you specifics,
but surely some files in /sys or /proc can tell you more about
used pins, shared interrupts etc...

> Somehow I expected the kernel or the driver to protect me from making
> mistakes like that - but I'm root, so I can do that ;-)

Actually it should protect you even as root, but bugs happen and if
Allwinner is not providing proper documentation, it's even more
difficult to write proper drivers...

According to the link you posted earlier GPIO7 is Pin PA7. Searching
in sun7i-a20.dtsi for PA7 finds:
gmac_pins_rgmii_a: gmac_rgmii at 0 {
allwinner,pins = "PA0", "PA1", "PA2",
"PA3", "PA4", "PA5", "PA6",
"PA7", "PA8", "PA10",
"PA11", "PA12", "PA13",
"PA15", "PA16";
allwinner,function = "gmac";
/*
* data lines in RGMII mode use DDR mode
* and need a higher signal drive strength
*/
allwinner,drive = <SUN4I_PINCTRL_40_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};

and sun7i-a20-bananapi.dts says:
&gmac {
pinctrl-names = "default";
pinctrl-0 = <&gmac_pins_rgmii_a>;
phy = <&phy1>;
phy-mode = "rgmii";
phy-supply = <&reg_gmac_3v3>;
status = "okay";

phy1: ethernet-phy at 1 {
reg = <1>;
};
};


So looks like PA7 is in use by the Ethernet driver without being
properly locked. - On the SoC I'm using (imx233-olinuxino) I get
an EBUSY if I try to /sys/class/gpio/export some pin already in
use ...

Grepping for the compatible-string suggests the responsible driver
is drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c

I think this is enough information.

Next step is to check if this bug is still present in the latest
stable kernel and then write a bug report to the maintainers of
the sunxi gpio driver and above ethernet driver including the
relevant mailing lists. (That is unless you want to propose a
patch yourself, but I can't provide you any help with that ...)

TIA,
Harald




Archive powered by MHonArc 2.6.18.

Top of page