Skip to content
midi-uart0-overlay.dts 679 B
Newer Older
/dts-v1/;
/plugin/;

#include <dt-bindings/clock/bcm2835.h>

/*
 * Fake a higher clock rate to get a larger divisor, and thereby a lower
 * baudrate. The real clock is 48MHz, which we scale so that requesting
 * 38.4kHz results in an actual 31.25kHz.
 *
 *   48000000*38400/31250 = 58982400
 */

/{
	compatible = "brcm,bcm2835";

	fragment@0 {
		target-path = "/";
		__overlay__ {
			midi_clk: midi_clk {
				compatible = "fixed-clock";
				#clock-cells = <0>;
				clock-output-names = "uart0_pclk";
				clock-frequency = <58982400>;
			};
		};
	};

	fragment@1 {
		target = <&uart0>;
		__overlay__ {
			clocks = <&midi_clk>,
			         <&clocks BCM2835_CLOCK_VPU>;
		};
	};
};