# Source: kernel-command-line-config.adoc

*Note: This file could not be automatically converted from AsciiDoc.*

== Kernel command line (`cmdline.txt`)

The Linux kernel accepts a collection of command line parameters during boot. On the Raspberry Pi, this command line is defined in a file in the boot partition, called `cmdline.txt`. You can edit this text file with any text editor.

[source,console]
----
$ sudo nano /boot/firmware/cmdline.txt
----

IMPORTANT: Put all parameters in `cmdline.txt` on the same line. Do _not_ use newlines.

To view the command line passed to the kernel at boot time, run the following command:

[source,console]
----
$ cat /proc/cmdline
----

Because Raspberry Pi firmware makes changes to the command line before launching the kernel, the output of this command will not exactly match the contents of `cmdline.txt`.

=== Command line options

There are many kernel command line parameters, some of which are defined by the kernel itself. Others are defined by code that the kernel may be using, such as the Plymouth splash screen system.

==== Standard entries

`console`:: defines the serial console. There are usually two entries:

* `console=serial0,115200`
* `console=tty1`

`root`:: defines the location of the root filesystem. e.g. `root=/dev/mmcblk0p2` means multimedia card block 0 partition 2.

`rootfstype`:: defines what type of filesystem the rootfs uses, e.g. `rootfstype=ext4`.

`quiet`:: sets the default kernel log level to `KERN_WARNING`, which suppresses all but very serious log messages during boot.

==== Set the KMS display mode

The legacy firmware and FKMS display modes used in earlier versions of Raspberry Pi OS are no longer supported. Instead, recent OS versions use KMS (Kernel Mode Setting).

If no `video` entry is present in `cmdline.txt`, Raspberry Pi OS uses the https://en.wikipedia.org/wiki/Extended_Display_Identification_Data[EDID] of the HDMI-connected monitor to automatically pick the best resolution supported by your display based on information in the Linux kernel. In Raspberry Pi OS Lite or console mode, you must customise the `video` entry to control resolution and rotation.

[source,bash]
----
video=HDMI-A-1:1920x1080M@60
----

In addition, it is possible to add rotation and reflect parameters as documented in the standard https://github.com/raspberrypi/linux/blob/rpi-6.1.y/Documentation/fb/modedb.rst[Linux framebuffer documentation]. The following example defines a display named `HDMI-A-1` at a resolution of 1080p, a refresh rate of 60Hz, 90 degrees of rotation, and a reflection over the X axis:

[source,bash]
----
video=HDMI-A-1:1920x1080M@60,rotate=90,reflect_x
----

You must specify the resolution explicitly when specifying rotation and reflection parameters.

Possible options for the display type - the first part of the `video=` entry - include:

[cols="1m,3"]
|===
| Video Option | Display

| HDMI-A-1
| HDMI 1 (HDMI 0 on silkscreen of Raspberry Pi 4B, HDMI on single HDMI boards)

| HDMI-A-2
| HDMI 2 (HDMI 1 on silkscreen of Raspberry Pi 4B)

| DSI-1
| DSI or DPI

| Composite-1
| Composite
|===

==== Other entries

This section contains some of the other entries you can use in the kernel command line. This list is not exhaustive.

`splash`:: tells the boot to use a splash screen via the Plymouth module.

`plymouth.ignore-serial-consoles`:: normally if the Plymouth module is enabled it will prevent boot messages from appearing on any serial console which may be present. This flag tells Plymouth to ignore all serial consoles, making boot messages visible again, as they would be if Plymouth was not running.

`dwc_otg.lpm_enable=0`:: turns off Link Power Management (LPM) in the `dwc_otg` driver, which drives the USB controller built into the processor used on Raspberry Pi computers. On Raspberry Pi 4, this controller is disabled by default, and is only connected to the USB type C power input connector. The USB-A ports on Raspberry Pi 4 are driven by a separate USB controller which is not affected by this setting.

`dwc_otg.speed`:: sets the speed of the USB controller built into the processor on Raspberry Pi computers. `dwc_otg.speed=1` will set it to full speed (USB 1.0), which is slower than high speed (USB 2.0). This option should not be set except during troubleshooting of problems with USB devices.

`smsc95xx.turbo_mode`:: enables/disables the wired networking driver turbo mode. `smsc95xx.turbo_mode=N` turns turbo mode off.

`usbhid.mousepoll`:: specifies the mouse polling interval. If you have problems with a slow or erratic wireless mouse, setting this to 0 with `usbhid.mousepoll=0` might help.

`drm.edid_firmware=HDMI-A-1:edid/your_edid.bin`:: Override your monitor's built-in EDID with the contents of `/usr/lib/firmware/edid/your_edid.bin`.