Skip to content

Instantly share code, notes, and snippets.

@smortex
Last active December 16, 2022 20:23
Show Gist options
  • Save smortex/faf190418e5424ef900198db83856f6a to your computer and use it in GitHub Desktop.
Save smortex/faf190418e5424ef900198db83856f6a to your computer and use it in GitHub Desktop.
Enable UART on BeagleBone Black
Index: sys/gnu/dts/arm/am335x-bone-common.dtsi
===================================================================
--- sys/gnu/dts/arm/am335x-bone-common.dtsi (révision 326470)
+++ sys/gnu/dts/arm/am335x-bone-common.dtsi (copie de travail)
@@ -95,6 +95,40 @@
>;
};
+ uart1_pins: pinmux_uart1_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
+ AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
+ >;
+ };
+
+ uart2_pins: pinmux_uart2_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE1) /* uart2_rxd.uart2_rxd */
+ AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* uart2_txd.uart2_txd */
+ >;
+ };
+
+ uart3_pins: pinmux_uart3_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x964, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* uart3_txd.uart3_txd */
+ >;
+ };
+
+ uart4_pins: pinmux_uart4_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* uart4_rxd.uart4_rxd */
+ AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* uart4_txd.uart4_txd */
+ >;
+ };
+
+ uart5_pins: pinmux_uart5_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x8c4, PIN_INPUT_PULLUP | MUX_MODE4) /* uart5_rxd.uart5_rxd */
+ AM33XX_IOPAD(0x8c0, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* uart5_txd.uart5_txd */
+ >;
+ };
+
clkout2_pin: pinmux_clkout2_pin {
pinctrl-single,pins = <
AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
@@ -184,6 +218,41 @@
status = "okay";
};
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+
+ status = "okay";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+
+ status = "okay";
+};
+
+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart3_pins>;
+
+ status = "okay";
+};
+
+&uart4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart4_pins>;
+
+ status = "okay";
+};
+
+&uart5 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart5_pins>;
+
+ status = "okay";
+};
+
&usb {
status = "okay";
};
Index: sys/gnu/dts/arm/am335x-boneblack.dts
===================================================================
--- sys/gnu/dts/arm/am335x-boneblack.dts (révision 326470)
+++ sys/gnu/dts/arm/am335x-boneblack.dts (copie de travail)
@@ -66,6 +66,7 @@
};
};
+/*
&lcdc {
status = "okay";
port {
@@ -90,6 +91,7 @@
};
};
};
+*/
&rtc {
system-power-controller;
Index: sys/gnu/dts/arm/am335x-bone-common.dtsi
===================================================================
--- sys/gnu/dts/arm/am335x-bone-common.dtsi (révision 326470)
+++ sys/gnu/dts/arm/am335x-bone-common.dtsi (copie de travail)
@@ -95,6 +95,13 @@
>;
};
+ uart1_pins: pinmux_uart1_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
+ AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
+ >;
+ };
+
clkout2_pin: pinmux_clkout2_pin {
pinctrl-single,pins = <
AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
@@ -184,6 +191,13 @@
status = "okay";
};
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+
+ status = "okay";
+};
+
&usb {
status = "okay";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment