From ea1851bf4d8a34531d3ffd465da898e5fb672ab2 Mon Sep 17 00:00:00 2001 From: andrum99 <58046090+andrum99@users.noreply.github.com> Date: Sat, 20 Mar 2021 17:11:40 +0000 Subject: [PATCH 1/5] configuration/UART.md - minor simplifications --- configuration/uart.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/configuration/uart.md b/configuration/uart.md index 3e29d1588..6ba96c88c 100644 --- a/configuration/uart.md +++ b/configuration/uart.md @@ -4,7 +4,7 @@ There are two types of UART available on the Raspberry Pi - [PL011](http://info All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties. -## Pi Zero, 1, 2 and 3 - two UARTs +## Pi Zero, 1, Compute Module 1, 2, 3 - two UARTs The Raspberry Pi Zero, 1, 2, and 3 each contain two UARTs as follows: @@ -13,9 +13,9 @@ The Raspberry Pi Zero, 1, 2, and 3 each contain two UARTs as follows: |UART0 |PL011 | |UART1 |mini UART | -## Pi 4 - six UARTS +## Pi 4 and 400 - six UARTS -The Raspberry Pi 4 has four additional PL011s, which are disabled by default. The full list of UARTs on the Pi 4 is: +The Raspberry Pi 4B and 400 have four additional PL011s, which are disabled by default: | Name | Type | |------|------| @@ -34,9 +34,9 @@ On the Raspberry Pi, one UART is selected to be present on GPIO 14 (transmit) an The secondary UART is not normally present on the GPIO connector. By default, the secondary UART is connected to the Bluetooth side of the combined wireless LAN/Bluetooth controller, on models which contain this controller. -## Configuration +## Primary / secondary UART assignments -By default, only UART0 is enabled. The following table summarises the assignment of the first two UARTs: +The following table summarises the assignment of the first two UARTs: | Model | first PL011 (UART0)| mini UART | |-------|-----------|-------| @@ -91,25 +91,28 @@ By default, the primary UART is assigned to the Linux console. If you wish to us ## Enabling early console (earlycon) for Linux -Although the Linux kernel starts the UARTs relatively early in the boot process, it is still long after some critical bits of infrastructure have been set up. A failure in those early stages can be hard to diagnose without access to the kernel log messages from that time. That's the problem that the "earlycon" mechanism was created to work around. Consoles that support earlycon usage present an additional interface to the kernel that allows for simple, synchronous output - printk won't return until the characters have been output to the UART. +Although the Linux kernel starts the UARTs relatively early in the boot process, it is still long after some critical bits of infrastructure have been set up. A failure in those early stages can be hard to diagnose without access to the kernel log messages from that time. To enable earlycon support for one of the UARTs, add one of the following options to `cmdline.txt`, depending on which UART is the primary: -Enable earlycon with a kernel command line parameter - add one of the following to `cmdline.txt`, depending on which UART is the primary: + +For Pi 4, 400 and Compute Module 4: ``` -# For Pi 4 and Compute Module 4 (BCM2711) earlycon=uart8250,mmio32,0xfe215040 earlycon=pl011,mmio32,0xfe201000 +``` -# For Pi 2, Pi 3 and Compute Module 3 (BCM2836 & BCM2837) +For Pi 2, Pi 3 and Compute Module 3: +``` earlycon=uart8250,mmio32,0x3f215040 earlycon=pl011,mmio32,0x3f201000 - -# For Pi 1, Pi Zero and Compute Module (BCM2835) +``` +For Pi 1, Pi Zero and Compute Module: +``` earlycon=uart8250,mmio32,0x20215040 earlycon=pl011,mmio32,0x20201000 ``` -The baudrate is set to 115200. +The baudrate defaults to 115200bps. -N.B. Selecting the wrong early console can prevent the Pi from booting. +**Note:** Selecting the wrong early console can prevent the Pi from booting. ## UARTs and Device Tree From 40742a37f4310831b8fe080ef123d43566f6611c Mon Sep 17 00:00:00 2001 From: andrum99 <58046090+andrum99@users.noreply.github.com> Date: Sat, 20 Mar 2021 17:12:22 +0000 Subject: [PATCH 2/5] Update uart.md --- configuration/uart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/uart.md b/configuration/uart.md index 6ba96c88c..9fd09b389 100644 --- a/configuration/uart.md +++ b/configuration/uart.md @@ -4,7 +4,7 @@ There are two types of UART available on the Raspberry Pi - [PL011](http://info All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties. -## Pi Zero, 1, Compute Module 1, 2, 3 - two UARTs +## Pi Zero, 1, 2 and 3 - two UARTs The Raspberry Pi Zero, 1, 2, and 3 each contain two UARTs as follows: From 9614225583cdc0c9885e5afa0558a9ac49e2a112 Mon Sep 17 00:00:00 2001 From: andrum99 <58046090+andrum99@users.noreply.github.com> Date: Sat, 20 Mar 2021 17:19:10 +0000 Subject: [PATCH 3/5] Add CM-specific details Fixes #1754 --- configuration/uart.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configuration/uart.md b/configuration/uart.md index 9fd09b389..6d25613ec 100644 --- a/configuration/uart.md +++ b/configuration/uart.md @@ -26,6 +26,14 @@ The Raspberry Pi 4B and 400 have four additional PL011s, which are disabled by d |UART4 |PL011 | |UART5 |PL011 | +## Compute Module, Compute Module 3, Compute Module 3+ and Compute Module 4 + +On compute modules, the UARTs are disabled by default and must be explicitly enabled using a device tree overlay, and specifying which GPIO pins to use for the interface, for example: + +``` +dtoverlay=uart1,txd1_pin=32,rxd1_pin=33 +``` + ## Primary UART On the Raspberry Pi, one UART is selected to be present on GPIO 14 (transmit) and 15 (receive) - this is the primary UART. By default, this will also be the UART on which a Linux console may be present. Note that GPIO 14 is pin 8 on the GPIO header, while GPIO 15 is pin 10. From 93bae2fd771728eb11612da7a4fa7115821575bf Mon Sep 17 00:00:00 2001 From: andrum99 <58046090+andrum99@users.noreply.github.com> Date: Sun, 21 Mar 2021 16:19:28 +0000 Subject: [PATCH 4/5] Update uart.md --- configuration/uart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/uart.md b/configuration/uart.md index 6d25613ec..e7b63465d 100644 --- a/configuration/uart.md +++ b/configuration/uart.md @@ -28,7 +28,7 @@ The Raspberry Pi 4B and 400 have four additional PL011s, which are disabled by d ## Compute Module, Compute Module 3, Compute Module 3+ and Compute Module 4 -On compute modules, the UARTs are disabled by default and must be explicitly enabled using a device tree overlay, and specifying which GPIO pins to use for the interface, for example: +On compute modules, the UARTs are disabled by default and must be explicitly enabled using a device tree overlay. You must also specify which GPIO pins to use, for example: ``` dtoverlay=uart1,txd1_pin=32,rxd1_pin=33 From fdf729a68bebcd0c40ac2f57337e9efbad92b0e4 Mon Sep 17 00:00:00 2001 From: andrum99 <58046090+andrum99@users.noreply.github.com> Date: Sun, 21 Mar 2021 16:23:47 +0000 Subject: [PATCH 5/5] Update uart.md --- configuration/uart.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration/uart.md b/configuration/uart.md index e7b63465d..679825fd6 100644 --- a/configuration/uart.md +++ b/configuration/uart.md @@ -28,7 +28,9 @@ The Raspberry Pi 4B and 400 have four additional PL011s, which are disabled by d ## Compute Module, Compute Module 3, Compute Module 3+ and Compute Module 4 -On compute modules, the UARTs are disabled by default and must be explicitly enabled using a device tree overlay. You must also specify which GPIO pins to use, for example: +The first generation Compute Module, together with Compute Module 3 and Compute Module 3+ each have two UARTs, while Compute Module 4 has six UARTs as described above. + +On all models of compute module, the UARTs are disabled by default and must be explicitly enabled using a device tree overlay. You must also specify which GPIO pins to use, for example: ``` dtoverlay=uart1,txd1_pin=32,rxd1_pin=33