Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compute module display doc to use 'new' KMS driver #3375

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions documentation/asciidoc/accessories/display/legacy.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
== Legacy Support

WARNING: These instructions are for the original Raspberry Pi, Model A, and B, boards only. You can identify an original board as it is the only model with a 26-pin GPIO header. All other models have the now-standard 40-pin connector.
WARNING: These instructions are for the original Raspberry Pi, Model A, and B, boards only. To identify an original Raspberry Pi, check the GPIO header connector. Only the original model has a 26-pin GPIO header connector; subsequent models have 40 pins.

The DSI connector on both the Raspberry Pi 1 Model A and B boards does not have the I2C connections required to talk to the touchscreen controller and DSI controller. You can work around this by using the additional set of jumper cables provided with the display kit to wire up the I2C bus on the GPIO pins to the display controller board.

Using the jumper cables, connect SCL/SDA on the GPIO header to the horizontal pins marked SCL/SDA on the display board. We also recommend that you power the Model A/B via the GPIO pins using the jumper cables.
The DSI connector on both the Raspberry Pi 1 Model A and B boards does not have the I2C connections required to talk to the touchscreen controller and DSI controller. To work around this, use the additional set of jumper cables provided with the display kit. Connect SCL/SDA on the GPIO header to the horizontal pins marked SCL/SDA on the display board. Power the Model A/B via the GPIO pins using the jumper cables.

DSI display autodetection is disabled by default on these boards. To enable detection, add the following line to the xref:../computers/config_txt.adoc#what-is-config-txt[`/boot/firmware/config.txt`] file:

Expand All @@ -13,4 +11,4 @@ DSI display autodetection is disabled by default on these boards. To enable dete
ignore_lcd=0
----

Power the setup via the `PWR IN` micro-USB connector on the display board. Do not power the setup via the Raspberry Pi's micro-USB port: the input polyfuse's maximum current rating will be exceeded as the display consumes approximately 400mA.
Power the setup via the `PWR IN` micro-USB connector on the display board. Do not power the setup via the Raspberry Pi's micro-USB port. This will exceed the input polyfuse's maximum current rating, since the display consumes approximately 400mA.
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,37 @@ Make sure J4 (USB SLAVE BOOT ENABLE) / J2 (nRPI_BOOT) is set to the disabled pos
[[cm4bootloader]]
=== Compute Module 4 Bootloader

The default bootloader configuration on CM4 is designed to support bringup and development on a https://www.raspberrypi.com/products/compute-module-4-io-board/[Compute Module 4 IO board] and the software version flashed at manufacture may be older than the latest release. For final products please consider:-
The default bootloader configuration on CM4 is designed to support bringup and development on a https://www.raspberrypi.com/products/compute-module-4-io-board/[Compute Module 4 IO board] and the software version flashed at manufacture may be older than the latest release. For final products please consider:

* Selecting and verifying a specific bootloader release. The version in the `usbboot` repo is always a recent stable release.
* Configuring the boot device (e.g. network boot). See `BOOT_ORDER` section in the xref:raspberry-pi.adoc#raspberry-pi-bootloader-configuration[bootloader configuration] guide.
* Enabling hardware write protection on the bootloader EEPROM to ensure that the bootloader can't be modified on remote/inaccessible products.
* Enabling hardware write-protection on the bootloader EEPROM to ensure that the bootloader can't be modified on inaccessible products (such as remote or embedded devices).

N.B. The Compute Module 4 ROM never runs `recovery.bin` from SD/EMMC and the `rpi-eeprom-update` service is not enabled by default. This is necessary because the EMMC is not removable and an invalid `recovery.bin` file would prevent the system from booting. This can be overridden and used with `self-update` mode where the bootloader can be updated from USB MSD or Network boot. However, `self-update` mode is not an atomic update and therefore not safe in the event of a power failure whilst the EEPROM was being updated.
NOTE: The Compute Module 4 ROM never runs `recovery.bin` from SD/EMMC and the `rpi-eeprom-update` service is not enabled by default. This is necessary because the EMMC is not removable and an invalid `recovery.bin` file would prevent the system from booting. This can be overridden and used with `self-update` mode where the bootloader can be updated from USB MSD or Network boot. However, `self-update` mode is not an atomic update and therefore not safe in the event of a power failure whilst the EEPROM was being updated.

==== Flashing storage devices other than SD cards

==== Flashing NVMe / other storage devices.
The new Linux-based https://github.com/raspberrypi/usbboot/blob/master/mass-storage-gadget/README.md[mass-storage gadget] supports flashing of NVMe, EMMC and USB block devices.

This is normally faster than using the `rpiboot` firmware driver and also provides a UART console to the device for easier debug.

See also: https://github.com/raspberrypi/usbboot/blob/master/Readme.md#compute-module-4-extensions[CM4 rpiboot extensions]

==== Modifying the bootloader configuration

To modify the CM4 bootloader configuration:-
To modify the CM4 bootloader configuration:

* cd `usbboot/recovery`
* Navigate to the `usbboot/recovery` directory
* Replace `pieeprom.original.bin` if a specific bootloader release is required.
* Edit the default `boot.conf` bootloader configuration file. Typically, at least the BOOT_ORDER must be updated:-
** For network boot `BOOT_ORDER=0xf2`
** For SD/EMMC boot `BOOT_ORDER=0xf1`
** For USB boot failing over to EMMC `BOOT_ORDER=0xf15`
* Edit the default `boot.conf` bootloader configuration file. Typically, at least the BOOT_ORDER must be updated:
** For network boot, use `BOOT_ORDER=0xf2`
** For SD/EMMC boot, use `BOOT_ORDER=0xf1`
** For USB boot failing over to EMMC, use `BOOT_ORDER=0xf15`
* Run `./update-pieeprom.sh` to update the EEPROM image `pieeprom.bin` image file.
* If EEPROM write protection is required then edit `config.txt` and add `eeprom_write_protect=1`. Hardware write-protection must be enabled via software and then locked by pulling the `EEPROM_nWP` pin low.
* If EEPROM write-protection is required, edit `config.txt` and add `eeprom_write_protect=1`. Hardware write-protection must be enabled via software and then locked by pulling the `EEPROM_nWP` pin low.
* Run `../rpiboot -d .` to update the bootloader using the updated EEPROM image `pieeprom.bin`

The pieeprom.bin file is now ready to be flashed to the Compute Module 4.
The `pieeprom.bin` file is now ready to be flashed to the Compute Module 4.

==== Flashing the bootloader EEPROM - Compute Module 4

Expand Down
24 changes: 11 additions & 13 deletions documentation/asciidoc/computers/compute-module/cmio-camera.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

The Compute Module has two CSI-2 camera interfaces: CAM1 and CAM0. This section explains how to connect one or two Raspberry Pi Cameras to a Compute Module using the CAM1 and CAM0 interfaces with a Compute Module I/O Board.

IMPORTANT: Camera modules are not hot-pluggable. *Always* power down your board before connecting or disconnecting a camera module.

=== Update your system

Before configuring a camera, ensure your system runs the latest available software:
Expand All @@ -17,7 +15,7 @@ sudo apt full-upgrade

To connect a single camera to a Compute Module, complete the following steps:

. Power the Compute Module down.
. Disconnect the Compute Module from power.
. Connect the Camera Module to the CAM1 port using a RPI-CAMERA board or a Raspberry Pi Zero camera cable.
+
image::images/CMIO-Cam-Adapter.jpg[Connecting the adapter board]
Expand All @@ -30,6 +28,7 @@ image::images/CMIO-Cam-Adapter.jpg[Connecting the adapter board]
+
image::images/CMIO-Cam-GPIO.jpg[GPIO connection for a single camera]

. Reconnect the Compute Module to power.

. Remove (or comment out with the prefix `#`) the following lines, if they exist, in `/boot/firmware/config.txt`:
+
Expand All @@ -40,7 +39,6 @@ camera_auto_detect=1
----
dtparam=i2c_arm=on
----
NOTE: If your Compute Module includes onboard EMMC storage, you can boot, edit the boot configuration, then reboot to load the configuration changes.

. _(CM1, CM3, CM3+, and CM4S only)_: Add the following directive to `/boot/firmware/config.txt` to accommodate the swapped GPIO pin assignment on the I/O board:
+
Expand All @@ -52,7 +50,7 @@ dtoverlay=cm-swap-i2c0
+
----
dtparam=cam1_reg
----
----

. Add the appropriate directive to `/boot/firmware/config.txt` to manually configure the driver for your camera model:
+
Expand All @@ -61,7 +59,7 @@ dtparam=cam1_reg
| camera model
| directive

| v1 camera
| v1 camera
| `dtoverlay=ov5647,cam1`

| v2 camera
Expand All @@ -77,7 +75,7 @@ dtparam=cam1_reg
| `dtoverlay=imx296,cam1`
|===

. Power the Compute Module on.
. Reboot your Compute Module with `sudo reboot`.

. Run the following command to check the list of detected cameras:
+
Expand All @@ -90,8 +88,8 @@ You should see your camera model, referred to by the driver directive in the tab

To connect two cameras to a Compute Module, complete the following steps:

. Follow the single camera quickstart above.
. Power the Compute Module down.
. Follow the single camera instructions above.
. Disconnect the Compute Module from power.
. Connect the Camera Module to the CAM0 port using a RPI-CAMERA board or a Raspberry Pi Zero camera cable.
+
image::images/CMIO-Cam-Adapter.jpg[Connect the adapter board]
Expand All @@ -107,12 +105,13 @@ image:images/CMIO-Cam-GPIO2.jpg[GPIO connection with additional camera]
+
image:images/j6_vertical.jpg[Connect the J6 GPIO pins in vertical orientation]

. Reconnect the Compute Module to power.

. _(CM1, CM3, CM3+, and CM4S only)_: Add the following directive to `/boot/firmware/config.txt` to assign GPIO 31 as the CAM0 regulator:
+
----
dtparam=cam0_reg
----
NOTE: If your Compute Module includes onboard EMMC storage, you can boot, edit the boot configuration, then reboot to load the configuration changes.

. Add the appropriate directive to `/boot/firmware/config.txt` to manually configure the driver for your camera model:
+
Expand All @@ -121,7 +120,7 @@ NOTE: If your Compute Module includes onboard EMMC storage, you can boot, edit t
| camera model
| directive

| v1 camera
| v1 camera
| `dtoverlay=ov5647,cam0`

| v2 camera
Expand All @@ -137,7 +136,7 @@ NOTE: If your Compute Module includes onboard EMMC storage, you can boot, edit t
| `dtoverlay=imx296,cam0`
|===

. Power the Compute Module on.
. Reboot your Compute Module with `sudo reboot`.

. Run the following command to check the list of detected cameras:
+
Expand All @@ -147,7 +146,6 @@ rpicam-hello --list
+
You should see both camera models, referred to by the driver directives in the table above, in the output.


=== Software

Raspberry Pi OS includes the `libcamera` library to help you take images with your Raspberry Pi.
Expand Down
134 changes: 35 additions & 99 deletions documentation/asciidoc/computers/compute-module/cmio-display.adoc
Original file line number Diff line number Diff line change
@@ -1,125 +1,61 @@
== Attaching the Official 7-inch Display
== Attaching the official 7-inch display

NOTE: These instructions are intended for advanced users, if anything is unclear please use the https://forums.raspberrypi.com/viewforum.php?f=98[Raspberry Pi Compute Module forums] for technical help.
NOTE: These instructions are intended for advanced users. If anything is unclear, use the https://forums.raspberrypi.com/viewforum.php?f=98[Raspberry Pi Compute Module forums] for technical help.

Please ensure your system software is updated before starting. Largely speaking the approach taken for Compute Modules 1, 3, and 4 is the same, but there are minor differences in physical setup required. It will be indicated where a step applies only to a specific platform.
Update your system software and firmware to the latest version before starting.
Compute Modules mostly use the same process, but sometimes physical differences force changes for a particular model.

WARNING: The Raspberry Pi Zero camera cable cannot be used as an alternative to the RPI-DISPLAY adaptor, because its wiring is different.
=== Quickstart guide (display only)

WARNING: Please note that the display is *not* designed to be hot pluggable. It (and camera modules) should always be connected or disconnected with the power off.
INFO: The Raspberry Pi Zero camera cable cannot be used as an alternative to the RPI-DISPLAY adapter. The two cables have distinct wiring.

=== Quickstart Guide (Display Only)
To connect a display to DISP1:

Connecting to DISP1
. Disconnect the Compute Module from power.
. Connect the display to the DISP1 port on the Compute Module IO board through the 22W to 15W display adapter.
. _(CM1, CM3, CM3+, and CM4S only)_: Connect the following GPIO pins with jumper cables:
* `0` to `CD1_SDA`
* `1` to `CD1_SCL`

. Connect the display to the DISP1 port on the Compute Module IO board through the 22W to 15W display adaptor.
. (CM1 and CM3 only) Connect these pins together with jumper wires:
. Reconnect the Compute Module to power.
. Add the following line to xref:../computers/config_txt.adoc#what-is-config-txt[`/boot/firmware/config.txt`]:
+
[source,bash]
----
GPIO0 - CD1_SDA
GPIO1 - CD1_SCL
dtoverlay=vc4-kms-dsi-7inch
----
. Reboot your Compute Module with `sudo reboot`. Your device should detect and begin displaying output to your display.

. Power up the Compute Module and run:
+
`+sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-only.bin -O /boot/firmware/dt-blob.bin+`

. Reboot for the `dt-blob.bin` file to be read.
To connect a display to DISP0:

. Connect the display to the DISP0 port on the Compute Module IO board through the 22W to 15W display adapter.
. _(CM1, CM3, CM3+, and CM4S only)_: Connect the following GPIO pins with jumper cables:
* `28` to `CD0_SDA`
* `29` to `CD0_SCL`

Connecting to DISP0

. Connect the display to the DISP0 port on the Compute Module IO board through the 22W to 15W display adaptor.
. (CM1 and CM3 only) Connect these pins together with jumper wires:
. Reconnect the Compute Module to power.
. Add the following line to `/boot/firmware/config.txt`:
+
[source,bash]
----
GPIO28 - CD0_SDA
GPIO29 - CD0_SCL
dtoverlay=vc4-kms-dsi-7inch
----
. Reboot your Compute Module with `sudo reboot`. Your device should detect and begin displaying output to your display.

. Power up the Compute Module and run:
+
`+sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-disp0-only.bin -O /boot/firmware/dt-blob.bin+`

. Reboot for the `dt-blob.bin` file to be read.
=== Disable touchscreen

=== Quickstart Guide (Display and Cameras)
The touchscreen requires no additional configuration. Connect it to your Compute Module, and both the touchscreen element and display should work once successfully detected.

==== To enable the display and one camera:*
To disable the touchscreen element, but still use the display, add the following line to `/boot/firmware/config.txt`:

. Connect the display to the DISP1 port on the Compute Module IO board through the 22W to 15W display adaptor, called RPI-DISPLAY.
. Connect the Camera Module to the CAM1 port on the Compute Module IO board through the 22W to 15W adaptor called RPI-CAMERA. Alternatively, the Raspberry Pi Zero camera cable can be used.
. (CM1 and CM3 only) Connect these pins together with jumper wires:
+
[source]
----
GPIO0 - CD1_SDA
GPIO1 - CD1_SCL
GPIO2 - CAM1_IO1
GPIO3 - CAM1_IO0
disable_touchscreen=1
----
+
image:images/CMIO-Cam-Disp-GPIO.jpg[GPIO connection for a single display and Camera Modules]
(Please note this image needs to be updated to have the extra jumper leads removed and use the standard wiring (2&3 not 4&5))

. Power up the Compute Module and run:
+
`+sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-cam1.bin -O /boot/firmware/dt-blob.bin+`
To entirely ignore the display when connected, add the following line to to `/boot/firmware/config.txt`:

. Reboot for the `dt-blob.bin` file to be read.

==== To enable the display and both cameras:*

. Follow the steps for connecting the display and one camera above.
. Connect the Camera Module to the CAM0 port on the Compute Module IO board through the 22W to 15W adaptor called RPI-CAMERA. Alternatively, the Raspberry Pi Zero camera cable can be used.
. (CM1 and CM3 only) Add links:
+
[source]
----
GPIO28 - CD0_SDA
GPIO29 - CD0_SCL
GPIO30 - CAM0_IO1
GPIO31 - CAM0_IO0
ignore_lcd=1
----

. (CM4 only) Add jumpers to J6.
. Power up the Compute Module and run:
+
`+sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-cam2.bin -O /boot/firmware/dt-blob.bin+`

. Reboot for the `dt-blob.bin` file to be read.
+
image:images/CMIO-Cam-Disp-Example.jpg[Camera Preview on the 7 inch display]
(Please note this image needs to be updated to show two Camera Modules and the standard wiring)

=== Software Support

There is no additional configuration required to enable the touchscreen. The touch interface should work out of the box once the screen is successfully detected.

If you wish to disable the touchscreen element and only use the display side, you can add the command `disable_touchscreen=1` to xref:../computers/config_txt.adoc#what-is-config-txt[`/boot/firmware/config.txt`] to do so.

To make the firmware to ignore the display even if connected, then add `ignore_lcd=1` to `/boot/firmware/config.txt`.

=== Firmware Configuration

The firmware looks at the dt-blob.bin file for the relevant configuration to use
for the screen. It looks at the pin_number@ defines for

----
DISPLAY_I2C_PORT
DISPLAY_SDA
DISPLAY_SCL
DISPLAY_DSI_PORT
----

The I2C port, SDA and SCL pin numbers are self explanatory. DISPLAY_DSI_PORT
selects between DSI1 (the default) and DSI0.

Once all the required changes have been made to the `dts` file, it needs to be compiled and placed on the boot partition of the device.

Instructions for doing this can be found on the xref:configuration.adoc#change-the-default-pin-configuration[Pin Configuration] page.

==== Sources

* https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-only.dts[dt-blob-disp1-only.dts]
* https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-cam1.dts[dt-blob-disp1-cam1.dts]
* https://datasheets.raspberrypi.com/cmio/dt-blob-disp1-cam2.dts[dt-blob-disp1-cam2.dts]
* https://datasheets.raspberrypi.com/cmio/dt-blob-disp0-only.dts[dt-blob-disp0-only.dts] (Uses wiring as for CAM0)
Binary file not shown.
Binary file not shown.