From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Mon, 30 Jul 2018 23:51:09 +0200 Subject: [Buildroot] Random Linux/device tree/GPIO question posted to the wrong list... In-Reply-To: References: Message-ID: <20180730235109.0fe5f681@windsurf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net 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 = , > , > , > , > , > , > , > , > , > , > , > , > , > ; > 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