summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm/devgpio.c
AgeCommit message (Collapse)Author
2022-12-18devgpio/bcm: (Raspberry Pi3/4, revision 2, bcm scheme) (thans Matt!)cinap_lenrek
Submitted by Matt: *Explain the problem that your change solves. Explain why your change solves the problem well.* The problem is that when using 9front on an Rpi3/Rpi4, on a revision 2 board, in bcm scheme, you cannot use GPIO5 nor GPIO6. If you look at the pinout, https://pinout.xyz/pinout/, you can see GPIO5 and GPIO6 are both GPIO pins - so, you should be able to use them. As you can see in the patch, "5" and "6" were both missing from the bcmtableR2 definition. The changes noted above fix this issue by adding GPIO5 ("5") and GPIO6 ("6") to the bcmtableR2 definition. I specifically only addressed r2 boards b/c I don't have an r1 board and don't want to make any speculations. * If applicable, explain how you tested the patch, and give us a way of reproducing the issue.* I tested this / you can reproduce this by: - Trying using GPIO5 and GPIO6 without the patch. You can do this by: bind -a '#G' /dev cd /dev/gpio echo 'scheme bcm' > ctl echo 'function out 5' > ctl echo 'function out 6' > ctl read -c 1 5 read -c 1 6 - Note that the `read` command above reads '0' from file 5 and from file 6. - Now try to change the GPIO pins from 0 (off) to 1 (on) echo '1' > 5 echo '1' > 6 read -c 1 5 read -c 1 6 - Note that the pins still read '0' - Now, apply the patch and repeat the steps above. Except, after you `echo '1' > 5` and `echo '1' > 6`, and then read files "5" and "6", you will see that the pins now read "1" as intended. Thanks, Matt
2022-02-05devgpio: make reading ctl file return 0 bytescinap_lenrek
2019-07-25bcm, bcm64: make irq.$O optional and add intrdisable(), use intrenable()cinap_lenrek
the raspberry pi 4 has a new interrupt controller and pci support, so get rid of intrenable() macro and properly make intrenable function with tbdf argument.
2018-10-20bcm: import changes for raspi2/3 from richard millercinap_lenrek
2014-05-16added devgpio (thanks Krystian!). Also added getrevision() to vcore which ↵Matthew Veety
allows you to get the raspberry pi board revision. I kept in the segment that allows direct access to the gpio memory