mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: DTS: make rpi3/4 use pl011 uart as primary
@ 2022-06-11 18:28 Daniel Brát
  2022-06-15  8:24 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Brát @ 2022-06-11 18:28 UTC (permalink / raw)
  To: barebox; +Cc: Daniel Brát

When the videocore first-stage bootloader finds 'dtoverlay=disable-bt' in the
'config.txt', asides from applying said overlay, it also disables fixed
clock for the vpu, which miniuart requires to calculate correct baudrate,
rendering it non-functional. This can be fixed by adding 'core_freq=250'
to the config, but since barebox has drivers for the pl011 full-fledged UART,
lets just make barebox use it instead.

Signed-off-by: Daniel Brát <danek.brat@gmail.com>
---
 arch/arm/dts/bcm2711-rpi-4.dts       |  8 +-------
 arch/arm/dts/bcm2837-rpi-3.dts       |  2 ++
 arch/arm/dts/rpi-use-pl011-uart.dtsi | 24 ++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/rpi-use-pl011-uart.dtsi

diff --git a/arch/arm/dts/bcm2711-rpi-4.dts b/arch/arm/dts/bcm2711-rpi-4.dts
index 3c0caa73f..e082ad868 100644
--- a/arch/arm/dts/bcm2711-rpi-4.dts
+++ b/arch/arm/dts/bcm2711-rpi-4.dts
@@ -9,10 +9,4 @@
 	status = "disabled";
 };
 
-&uart1 {
-	/* VPU core clock is reported at 200MHz, but needs to be 500Mhz
-	 * for ns16550 driver to set correct baudrate. Until that's
-	 * figured out, hardcode clock frequency to the expected value
-	 */
-	clock-frequency = <500000000>;
-};
+#include "rpi-use-pl011-uart.dtsi"
diff --git a/arch/arm/dts/bcm2837-rpi-3.dts b/arch/arm/dts/bcm2837-rpi-3.dts
index e82d518fa..6af9e9d7c 100644
--- a/arch/arm/dts/bcm2837-rpi-3.dts
+++ b/arch/arm/dts/bcm2837-rpi-3.dts
@@ -7,3 +7,5 @@
 &sdhci {
 	status = "disabled";
 };
+
+#include "rpi-use-pl011-uart.dtsi"
diff --git a/arch/arm/dts/rpi-use-pl011-uart.dtsi b/arch/arm/dts/rpi-use-pl011-uart.dtsi
new file mode 100644
index 000000000..7c75b07f8
--- /dev/null
+++ b/arch/arm/dts/rpi-use-pl011-uart.dtsi
@@ -0,0 +1,24 @@
+/* https://www.raspberrypi.com/documentation/computers/configuration.html#primary-and-secondary-uart */
+
+/* Makes barebox use pl011 uart as primary */
+
+&uart1 {
+        status = "disabled";
+};
+
+&uart0 {
+        pinctrl-names = "default";
+        pinctrl-0 = <&uart0_gpio14>;
+        status = "okay";
+};
+
+/delete-node/ &bt;
+
+&{/aliases} {
+        serial0 = &uart0;
+        serial1 = &uart1;
+};
+
+&{/chosen} {
+        stdout-path = "/serial0:115200n8";
+};
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-15  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-11 18:28 [PATCH] ARM: DTS: make rpi3/4 use pl011 uart as primary Daniel Brát
2022-06-15  8:24 ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox