Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bone/black.h"
- #include "gpio.h"
- // XXX not compatible with cape-universal!
- // Requires a sufficiently recent kernel by rcn (4.9-bone or 4.9-ti).
- //
- // A udev rule along these lines is recommended:
- //
- // SUBSYSTEM=="subsystem", KERNEL=="gpio", ACTION=="add", \
- // RUN+="/bin/mkdir -p /dev/gpio"
- //
- // SUBSYSTEM=="gpio", ACTION=="add", TEST=="value", ATTR{label}!="sysfs", \
- // RUN+="/bin/ln -sT '/sys/class/gpio/%k' /dev/gpio/%s{label}"
- / {
- // If you want to use multiple overlays that do gpio configuration, be
- // sure that each uses a different device tree node!
- gpio-demo {
- compatible = "gpio-of-helper";
- // It is usually not *strictly* required to perform pinmux for
- // GPIOs since this is typically their default, but it's good
- // practice to do it anyway since:
- // 1. it makes *sure* the pinmux is right
- // 2. you can configure internal pull-up/down
- // 3. it lets the kernel know the pins are in use
- pinctrl-names = "default";
- pinctrl-0 = <&gpio_demo_pins>;
- // Note that gpio numbers for each pin can be found in the
- // comments in include/bone/black.h
- // custom (new) configuration
- P9_14 {
- gpio = <&gpio1 18 ACTIVE_HIGH>; // P9.14
- output;
- init-low;
- };
- P9_15 {
- gpio = <&gpio1 16 ACTIVE_HIGH>; // P9.15
- input;
- };
- P9_23 {
- gpio = <&gpio1 17 ACTIVE_HIGH>; // P9.23
- output;
- init-low;
- };
- P9_27 {
- gpio = <&gpio3 19 ACTIVE_HIGH>; // P9.27
- output;
- init-low;
- };
- P8_3 {
- gpio = <&gpio1 6 ACTIVE_HIGH>; // P8.3
- output;
- init-low;
- };
- P8_4 {
- gpio = <&gpio1 7 ACTIVE_HIGH>; // P8.4
- output;
- init-low;
- };
- P8_5 {
- gpio = <&gpio1 2 ACTIVE_HIGH>; // P8.5
- output;
- init-low;
- };
- P8_6 {
- gpio = <&gpio1 3 ACTIVE_HIGH>; // P8.6
- output;
- init-low;
- };
- P8_11 {
- gpio = <&gpio1 13 ACTIVE_HIGH>; // P8.11
- output;
- init-low;
- };
- P8_12 {
- gpio = <&gpio1 12 ACTIVE_HIGH>; // P8.12
- output;
- init-low;
- };
- P8_14 {
- gpio = <&gpio0 26 ACTIVE_HIGH>; // P8.14
- output;
- init-low;
- };
- P8_15 {
- gpio = <&gpio1 15 ACTIVE_HIGH>; // P8.15
- input;
- };
- P8_16 {
- gpio = <&gpio1 14 ACTIVE_HIGH>; // P8.16
- input;
- };
- P8_17 {
- gpio = <&gpio0 27 ACTIVE_HIGH>; // P8.17
- input;
- };
- P8_18 {
- gpio = <&gpio2 1 ACTIVE_HIGH>; // P8.18
- input;
- };
- P8_20 {
- gpio = <&gpio1 31 ACTIVE_HIGH>; // P8.20
- output;
- init-low;
- };
- P8_21 {
- gpio = <&gpio1 30 ACTIVE_HIGH>; // P8.21
- output;
- init-low;
- };
- P8_22 {
- gpio = <&gpio1 5 ACTIVE_HIGH>; // P8.22
- output;
- init-low;
- };
- P8_23 {
- gpio = <&gpio1 4 ACTIVE_HIGH>; // P8.23
- output;
- init-low;
- };
- P8_24 {
- gpio = <&gpio1 1 ACTIVE_HIGH>; // P8.24
- output;
- init-low;
- };
- P8_25 {
- gpio = <&gpio1 0 ACTIVE_HIGH>; // P8.25
- input;
- };
- P8_26 {
- gpio = <&gpio1 29 ACTIVE_HIGH>; // P8.26
- input;
- };
- P8_27 {
- gpio = <&gpio2 22 ACTIVE_HIGH>; // P8.27
- input;
- };
- P8_28 {
- gpio = <&gpio2 24 ACTIVE_HIGH>; // P8.28
- input;
- };
- P8_29 {
- gpio = <&gpio2 23 ACTIVE_HIGH>; // P8.29
- input;
- };
- P8_30 {
- gpio = <&gpio2 25 ACTIVE_HIGH>; // P8.30
- input;
- };
- P8_39 {
- gpio = <&gpio2 12 ACTIVE_HIGH>; // P8.39
- input;
- };
- P8_40 {
- gpio = <&gpio2 13 ACTIVE_HIGH>; // P8.40
- input;
- };
- P8_41 {
- gpio = <&gpio2 10 ACTIVE_HIGH>; // P8.41
- output;
- init-low;
- };
- P8_42 {
- gpio = <&gpio2 11 ACTIVE_HIGH>; // P8.42
- output;
- init-low;
- };
- P8_43 {
- gpio = <&gpio2 8 ACTIVE_HIGH>; // P8.43
- output;
- init-low;
- };
- P8_44 {
- gpio = <&gpio2 9 ACTIVE_HIGH>; // P8.44
- input;
- };
- P8_45 {
- gpio = <&gpio2 6 ACTIVE_HIGH>; // P8.45
- input;
- };
- P8_46 {
- gpio = <&gpio2 7 ACTIVE_HIGH>; // P8.46
- input;
- };
- };
- };
- &am33xx_pinmux {
- gpio_demo_pins: gpio-demo {
- pinctrl-single,pins = <
- //PIN_PULLUP( P8_07, 7 ) // gpio 2.02 / button
- //PIN_PULLUP( P8_08, 7 ) // gpio 2.03 / reset-thing
- //PIN_PULLUP( P8_09, 7 ) // gpio 2.05 / input-bidi
- //PIN_PULLUP( P8_10, 7 ) // gpio 2.04 / output-bidi
- PIN_PULLDN( P9_14, 7 ) //gpio 1.18
- PIN_NOPULL( P9_15a, 7 ) //gpio 1.16
- PIN_NOPULL( P9_15b, 7 ) //gpio 1.16 //for some reason there are two processors on P9_15?
- PIN_PULLDN( P9_23, 7 ) // gpio 1.17 // use PIN_PULLUP/PIN_PULLDN/PIN_NOPULL mode 7
- PIN_PULLDN( P9_27, 7 ) // gpio 3.19 //if we want slow slew rate: PIN_PULLUP( P9_26, 3 | SLEW_SLOW)
- //AIN1-3 not configurable?
- PIN_PULLDN( P8_03, 7 ) // gpio 1.6
- PIN_PULLDN( P8_04, 7 ) // gpio 1.7
- PIN_PULLDN( P8_05, 7 ) // gpio 1.2
- PIN_PULLDN( P8_06, 7 ) // gpio 1.3
- PIN_PULLDN( P8_11, 7 ) // gpio 1.13
- PIN_PULLDN( P8_12, 7 ) // gpio 1.12
- PIN_PULLDN( P8_14, 7 ) // gpio 1.26
- PIN_NOPULL( P8_15, 7 ) // gpio 1.15
- PIN_NOPULL( P8_16, 7 ) // gpio 1.14
- PIN_NOPULL( P8_17, 7 ) // gpio 2.1?
- PIN_NOPULL( P8_18, 7 ) // gpio 2.1?
- PIN_PULLDN( P8_20, 7 ) // gpio 1.31
- PIN_PULLDN( P8_21, 7 ) // gpio 1.30
- PIN_PULLDN( P8_22, 7 ) // gpio 1.5
- PIN_NOPULL( P8_23, 7 ) // gpio 1.4
- PIN_PULLDN( P8_24, 7 ) // gpio 1.1
- PIN_NOPULL( P8_25, 7 ) // gpio 1.0
- PIN_NOPULL( P8_26, 7 ) // gpio 1.29
- PIN_NOPULL( P8_27, 7 ) // gpio 2.22
- PIN_NOPULL( P8_28, 7 ) // gpio 2.24
- PIN_NOPULL( P8_29, 7 ) // gpio 2.23
- PIN_NOPULL( P8_30, 7 ) // gpio 2.25
- PIN_NOPULL( P8_39, 7 ) // gpio 2.12
- PIN_NOPULL( P8_40, 7 ) // gpio 2.13
- PIN_PULLDN( P8_41, 7 ) // gpio 2.10
- PIN_PULLDN( P8_42, 7 ) // gpio 2.11
- PIN_PULLDN( P8_43, 7 ) // gpio 2.8
- PIN_NOPULL( P8_44, 7 ) // gpio 2.9
- PIN_NOPULL( P8_45, 7 ) // gpio 2.6
- PIN_NOPULL( P8_46, 7 ) // gpio 2.7
- //PIN_NOPULL( P9_19, 7 ) // gpio
- //PIN_NOPULL( P9_20, 7 ) // gpio
- >;
- };
- uart4_pins: uart4 {
- pinctrl-single,pins = <
- PIN_PULLUP( P9_13, 6 ) // txd
- PIN_PULLUP( P9_11, 6 ) // rxd
- >;
- };
- uart2_pins: uart2 {
- pinctrl-single,pins = <
- PIN_PULLUP( P9_21, 1 ) // txd
- PIN_PULLUP( P9_22, 1 ) // rxd
- >;
- };
- uart1_pins: uart1 {
- pinctrl-single,pins = <
- PIN_PULLUP( P9_24, 0 ) // txd
- PIN_PULLUP( P9_26, 0 ) // rxd
- >;
- };
- };
- // configure and enable uart modules
- &uart4 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&uart4_pins>;
- };
- &uart2 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&uart2_pins>;
- };
- &uart1 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&uart1_pins>;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement