Skip to content

Commit

Permalink
DTS: overlays: fix Pi 5 midi-over-UART
Browse files Browse the repository at this point in the history
The UART source clock is 50MHz not 100MHz, so fix the fake-clock used to
munge the baudrate.

See https://forums.raspberrypi.com/viewtopic.php?p=2212755

Signed-off-by: Jonathan Bell <[email protected]>
  • Loading branch information
P33M authored and popcornmix committed Jun 3, 2024
1 parent cea1c0e commit 7d25375
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/overlays/midi-uart0-pi5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

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

/{
Expand All @@ -21,7 +21,7 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "uart0_pclk";
clock-frequency = <122880000>;
clock-frequency = <61440000>;
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/overlays/midi-uart1-pi5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

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

/{
Expand All @@ -21,7 +21,7 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "uart1_pclk";
clock-frequency = <122880000>;
clock-frequency = <61440000>;
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/overlays/midi-uart2-pi5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

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

/{
Expand All @@ -21,7 +21,7 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "uart2_pclk";
clock-frequency = <122880000>;
clock-frequency = <61440000>;
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/overlays/midi-uart3-pi5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

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

/{
Expand All @@ -21,7 +21,7 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "uart3_pclk";
clock-frequency = <122880000>;
clock-frequency = <61440000>;
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/overlays/midi-uart4-pi5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

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

/{
Expand All @@ -21,7 +21,7 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "uart4_pclk";
clock-frequency = <122880000>;
clock-frequency = <61440000>;
};
};
};
Expand Down

0 comments on commit 7d25375

Please sign in to comment.