For those how are interested, Nicolas Saenz Julienne and i working on Mainline support for the Raspberry Pi 4. The plan was to introduce initial Raspberry Pi 4 support (only debug UART, no fancy stuff like GENET, V3D, USB 3.0 or arm64) for Linux 5.4. Unfortunately there were a lot of issues (especially DMA stuff) which delayed everything to the next release. At least the pinctrl and the mmc stuff has been merged and the clock will follow soon.
Here is the issue to keep track on this:
https://github.com/lategoodbye/rpi-zero/issues/43
Re: Status of Raspberry Pi 4 in Mainline
Today the relevant I2C changes has been applied to for-next:
https://marc.info/?l=linux-i2c&m=156692552019278
https://marc.info/?l=linux-i2c&m=156692552019278
Re: Status of Raspberry Pi 4 in Mainline
Today i applied the initial Raspberry Pi 4 device tree:
https://marc.info/?l=linux-arm-kernel&m ... 825574&w=2
https://marc.info/?l=linux-arm-kernel&m ... 825574&w=2
Re: Status of Raspberry Pi 4 in Mainline
This week the GENET support has been applied to net-next:
https://lore.kernel.org/netdev/15735017 ... t@gmx.net/
https://lore.kernel.org/netdev/15735017 ... t@gmx.net/
Re: Status of Raspberry Pi 4 in Mainline
I would have thought arm64 is the preferred mainline kernel.
Optimizing for Aarch64 would give a better future and minimize the support required.
Optimizing for Aarch64 would give a better future and minimize the support required.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Status of Raspberry Pi 4 in Mainline
From kernel perspective there is no preference. Both must work, but the BCM2711 / PCIe stuff needs some extra work for arm64. Nicolas Saenz Julienne takes care of this and hopefully in Linux 5.5 there will be basic arm64 support.
Re: Status of Raspberry Pi 4 in Mainline
Linux 5.5 is almost ready, so a short update for the upcoming features in Mainline Linux 5.6:
- hwrng: iproc-rng200 - Add support for BCM2711
- thermal: Add BCM2711 thermal driver
- PCI: brcmstb: Add Broadcom STB PCIe host controller driver
- hwrng: iproc-rng200 - Add support for BCM2711
- thermal: Add BCM2711 thermal driver
- PCI: brcmstb: Add Broadcom STB PCIe host controller driver
Re: Status of Raspberry Pi 4 in Mainline
Nice, thanks for the update.
So it is looking like 5.6 will be the cross over point for Pi4 on mainstream?
Anything missing?
So it is looking like 5.6 will be the cross over point for Pi4 on mainstream?
Anything missing?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Status of Raspberry Pi 4 in Mainline
Have you seen the new v3d stuff in mesa 19.3.0?The whole graphics stuff (VC4, V3D), DMA engine and VCHIQ. I think they are more time consuming.
Compute Shaders yippee, er how do I use them

Yep camera, mmal stuff is not the job for mere mortals, need wizards for that.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Status of Raspberry Pi 4 in Mainline
Here are the upcoming features for Mainline Linux 5.7:
- 1920x1200@60Hz support for VC4 KMS of BCM283x
- power saving (LPM) support for VIA LABS VL805
- extend pinctrl/gpio driver to support all 58 GPIOs of BCM2711
- add GPIO labels for Raspberry Pi 4 board
- driver for Sony IMX219 sensor
- bcm2835aux-uart: Support RS485 software emulation
Additionally some patches for BCM2711 VC4 KMS and SD power (required for recent RPi 4 boards) has been merged, but are not functional.
- 1920x1200@60Hz support for VC4 KMS of BCM283x
- power saving (LPM) support for VIA LABS VL805
- extend pinctrl/gpio driver to support all 58 GPIOs of BCM2711
- add GPIO labels for Raspberry Pi 4 board
- driver for Sony IMX219 sensor
- bcm2835aux-uart: Support RS485 software emulation
Additionally some patches for BCM2711 VC4 KMS and SD power (required for recent RPi 4 boards) has been merged, but are not functional.
Re: Status of Raspberry Pi 4 in Mainline
How can I try mainline linux kernel for rapsberry pi 4? Is there any instructions to compile mainline kernel? I've tried to compile it using this instructions - https://www.raspberrypi.org/documentati ... uilding.md, but my raspberry struck at loading with rainbow screen and noting on serial console. I tried to use default bootloader, not u-boot.
Re: Status of Raspberry Pi 4 in Mainline
I hope this Gist may help you a little bit: https://gist.github.com/lategoodbye/c73 ... aed8c68f75pihacker wrote: ↑Sat May 30, 2020 8:49 pmHow can I try mainline linux kernel for rapsberry pi 4? Is there any instructions to compile mainline kernel? I've tried to compile it using this instructions - https://www.raspberrypi.org/documentati ... uilding.md, but my raspberry struck at loading with rainbow screen and noting on serial console. I tried to use default bootloader, not u-boot.
Re: Status of Raspberry Pi 4 in Mainline
Compute modules coming? That would be handyextend pinctrl/gpio driver to support all 58 GPIOs of BCM2711
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Status of Raspberry Pi 4 in Mainline
Anyone who wants to test KMS for the RPi 4 could use Maxime Ripard's working branch:
https://git.kernel.org/pub/scm/linux/ke ... h=rpi4-kms
https://git.kernel.org/pub/scm/linux/ke ... h=rpi4-kms
Re: Status of Raspberry Pi 4 in Mainline
Thank you a lot! I finally managed to compile and boot from mainline kernel!swahren wrote: ↑Mon Jun 01, 2020 7:13 pmI hope this Gist may help you a little bit: https://gist.github.com/lategoodbye/c73 ... aed8c68f75
I also faced a couple of issues:
- RPI4 cannot startup from mmcblk0p2 since name of a block device is changed somehow to mmcblk1p2, it just throw me into rootfs emergency shell, so I needed to change cmdline.txt a bit
- During boot, RPI stucks at systemd job "A start job is running for /dev/mmcblk0p1", so wrong block device name appears here again and I don't know where it comes from. Does it relate to initramfs in /boot? Since I didn't change it for one produced with kernel building.
- Ethernet doesn't work. Should I add some config options before kernel building?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3581
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: Status of Raspberry Pi 4 in Mainline
As I understand, "upstream" are wanting to discourage people from using device names to identify partitions, preferring volume labels and UUIDs instead. That is why there is no way to force a particular mmcblk index (e.g. mmcblk0) to be used on a specific MMC interface. In the downstream rpi-* trees we include a patch that sets the index based on aliases found in the DTB. Try using a PARTUUID or PARTLABEL instead.
It's not clear what would be expecting there to be a Bluetooth device on one of the MMC/SDIO interfaces. The upstream .dts file declares a Bluetooth interface ("brcm,bcm43438", interestingly) on UART0.
It's not clear what would be expecting there to be a Bluetooth device on one of the MMC/SDIO interfaces. The upstream .dts file declares a Bluetooth interface ("brcm,bcm43438", interestingly) on UART0.
Re: Status of Raspberry Pi 4 in Mainline
I'm sorry for a wrong error message, I've fixed my previous post. It actually was two unrelated messages -- one about bluetooth and second about mmcblk0p1, and rpi stuck for a 90 second during boot at that message.
The bigger problem is actually ethernet, I've looked into dmesg and found two messages:
could not attach to PHY
bcmgenet fd580000.ethernet eth0: failed to connect to PHY
What could that mean?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3581
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: Status of Raspberry Pi 4 in Mainline
What is the value of the phy-mode property in your bcm2711-rpi-4-b.dts? If it's "rgmii-rxid" then try changing it to "rgmii", and vice versa.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3581
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: Status of Raspberry Pi 4 in Mainline
I'm sure @swahren will be able to help with that.
Re: Status of Raspberry Pi 4 in Mainline
@PhilE thanks. It's even more strange because wifi works! But still missing ethernet 
UPD: One more thing to notice is that I use almost empty config.txt. Maybe I should add some options to make eth working with mainline kernel?
UPD2: It seems that GPIO doesn't work too, because serial console doesn't show anything to me.

UPD: One more thing to notice is that I use almost empty config.txt. Maybe I should add some options to make eth working with mainline kernel?
UPD2: It seems that GPIO doesn't work too, because serial console doesn't show anything to me.
Re: Status of Raspberry Pi 4 in Mainline
At first the intention of this thread wasn't to solve mainline kernel issues. This should be separate threads.
@pihacker You never mentioned the kernel version or the base of your kernel config you are using.
Did you overwrite the bcm2711-rpi-4-b.dtb on your sd card with the mainline version?
For ethernet you should use multi_v7_defconfig and make sure CONFIG_BROADCOM_PHY=y
For USB you also need to enable CONFIG_ARM_LPAE and CONFIG_PCIE_BRCMSTB.
In order to get a serial console, please replace serial0 with ttyS1 in the cmdline.txt.
Edit: For experiments with the mainline kernel, i strongly recommend to use Raspbian / Raspberry Pi OS as rootfs.
@pihacker You never mentioned the kernel version or the base of your kernel config you are using.
Did you overwrite the bcm2711-rpi-4-b.dtb on your sd card with the mainline version?
For ethernet you should use multi_v7_defconfig and make sure CONFIG_BROADCOM_PHY=y
For USB you also need to enable CONFIG_ARM_LPAE and CONFIG_PCIE_BRCMSTB.
In order to get a serial console, please replace serial0 with ttyS1 in the cmdline.txt.
Edit: For experiments with the mainline kernel, i strongly recommend to use Raspbian / Raspberry Pi OS as rootfs.
Re: Status of Raspberry Pi 4 in Mainline
@swahren moved discussion to a new thread -- viewtopic.php?f=71&t=276236