Re: Excluding pins from Linux control

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

 




On Mon, Feb 27, 2017 at 7:02 PM, Stefan Wahren <stefan.wahren@xxxxxxxx> wrote:

> on BCM2835 (Raspberry Pi) the firmware on the VideoCore and Linux on the ARM core share
> a common pin "space". Depending on the board revision the VideoCore needs to controls
> some pins, which shouldn't be claimed by Linux on the ARM.
>
> What is the right way to exclude control on Linux for those pins in order to avoid possible
> harmful operations?

Do you want to do this statically (at boot) or dynamically (at runtime)?

If you want to do it statically, at boot time:
Just add some NOOP function (i.e. a function that result in
zero register writes or anything) named "videocore-reserved" or
something to the driver in  drivers/pinctrl/bcm/pinctrl-bcm2835.c,
make it applicable to the affected pins, making it possible
to create a state that will combine the function "videocore-reserved"
with these pins, resulting in them being exclusively used for
that.

Then in the videocore device tree node (I assume there is
something like such) create a pinctrl state that just take all these
pins with this dummy function.

(If the videocore does not even have a device tree node, hog all
those pins to that function using hogs as described in
Documentaion/pinctrl.txt, essentially just take the pins for the
pin controller itself.)

If you want to do it at runtime, you need some communication link
to the videocore (I guess) and then it is essentially the same
approach but done using proper states reflecting whether the
videocore is actively using them or not, but for the simple case
even this would be easiest done using the static approach above.
You may need a dynamic solution if you want to remux the
pins to ground when going to sleep for example, then something
must move the pins from "default" to "sleep" state and back,
and that needs to be the videocore driver in the kernel I guess.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux