From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] Random Linux/device tree/GPIO question posted to the wrong list...
Date: Mon, 30 Jul 2018 23:51:09 +0200 [thread overview]
Message-ID: <20180730235109.0fe5f681@windsurf> (raw)
In-Reply-To: <CAF_dkJBrU=bF+LZOSe6RNKukbGFjPHOMJUfUXRHs4_8NJ-50Dw@mail.gmail.com>
Hello Patrick,
On Mon, 30 Jul 2018 17:29:36 -0400, Patrick Doyle wrote:
> But you folks all know about this sort of stuff anyway, so I figured
> I'd start by asking here.
>
> I was just shocked to learn that, although I allocated a pin to a
> certain function in my device tree, I was able to override the
> operation of that pin via /sys/class/gpio (and thus crash my board
> when it could no longer access it's flash properly).
>
> Can anybody here tell me how I can prevent the GPIO subsystem from
> overriding the pinmux I specified in my device tree? I guess I
> thought that:
>
> pinctrl at fc038000 {
> pinctrl_nand_default: nand_default {
> pinmux = <PIN_PA8__NWE_NANDWE>,
> <PIN_PA9__NCS3>,
> <PIN_PA10__A21_NANDALE>,
> <PIN_PA11__A22_NANDCLE>,
> <PIN_PA12__NRD_NANDOE>,
> <PIN_PD8__NANDRDY>,
> <PIN_PA0__D0>,
> <PIN_PA1__D1>,
> <PIN_PA2__D2>,
> <PIN_PA3__D3>,
> <PIN_PA4__D4>,
> <PIN_PA5__D5>,
> <PIN_PA6__D6>,
> <PIN_PA7__D7>;
> bias-disable;
> };
>
> would have done the trick (on my Microchip SAMA5D2x device).
This snippet of Device Tree only declares a pinmux configuration. If
there is nothing referencing pinctrl_nand_default, then this pinmux
configuration is not used/applied, and the pins are not "reserved".
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-07-30 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 21:29 [Buildroot] Random Linux/device tree/GPIO question posted to the wrong list Patrick Doyle
2018-07-30 21:51 ` Thomas Petazzoni [this message]
2018-07-31 13:53 ` Patrick Doyle
2018-07-31 14:17 ` Thomas Petazzoni
2018-07-31 15:17 ` Patrick Doyle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180730235109.0fe5f681@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox