lategoodbye / rpi-zero

Linux kernel source tree
Other
22 stars 3 forks source link

Upstream CM4 and CMIO4 #48

Closed lategoodbye closed 3 years ago

lategoodbye commented 3 years ago

The new CM4 is similiar to the Raspberry Pi 4 B

Differences:

TODO:

Datasheets: https://datasheets.raspberrypi.org/cm4/cm4-datasheet.pdf https://datasheets.raspberrypi.org/cm4io/cm4io-datasheet.pdf

lategoodbye commented 3 years ago

Here is a first draft: https://github.com/lategoodbye/rpi-zero/tree/v5.14-cm4-v1

CyrilBrulebois commented 3 years ago

Oh wow, very nice!

I've tried to cross-build a linux-image package from that tree, using the .config from the latest Debian kernel (based on 5.10 for now, being stabilized for the upcoming Debian 11 release), using oldconfig and picking all default choices for new options.

I've deployed the resulting package in a Debian environment running on a regular Pi and the machine didn't manage to reboot into the new kernel. I suppose there are a lot of changes to catch up with between 5.10 and 5.14, so I've decided to test things a little more manually: I copied the generated bcm2711-rpi-cm4-io.dtb file manually in the first partition of a regular Debian Pi image (as built thanks to https://salsa.debian.org/raspi-team/image-specs), both under that name and under the name that can be found in the official Raspberry OS images: bcm2711-rpi-cm4.dtb; the said image uses a 5.10.46 kernel, and the arm64 architecture.

Two hardware environments, and rather good results overall:

I'm assuming you're testing with a 32-bit environment, and I'm therefore suggesting the following patch to have the DTB built for arm64 as well. :) → for-stefan-0001-arm64-dts-broadcom-Add-reference-to-Compute-Module-4.patch.txt

Thanks, that looks very promising!

lategoodbye commented 3 years ago

@CyrilBrulebois Thanks again for the hardware.

Yes, as written above this is just a draft. It has only been tested with a CM4 (not a CM4L) and only 32 bit Raspbian. The DTB has been optimized for eMMC, which should provide HS200 instead of DDR52. So be careful about your data it's possible that this speed is too high for the hardware. It took me 2 days to figure out that the firmware was patching the MDIO address of the ethernet PHY. So i wanted to provide the first version which probes ethernet (also untested).

Until i found a smart solution, i could provide a DTS for the CM4 Lite which should boot properly.

Regarding the kernel, please use either the latest mainline release 5.13 or this repo.

lategoodbye commented 3 years ago

Here is a the second version: https://github.com/lategoodbye/rpi-zero/tree/v5.14-cm4-v2

nullr0ute commented 3 years ago

Here is a the second version: https://github.com/lategoodbye/rpi-zero/tree/v5.14-cm4-v2

Has that been posted to mailing lists?

lategoodbye commented 3 years ago

Not yet (not finished). As usual i will post a link in case i send it to the mailing list.

lategoodbye commented 3 years ago

Okay, here is the third version: https://github.com/lategoodbye/rpi-zero/tree/v5.14-cm4-v3

which has been sent to the mailing list: https://marc.info/?l=linux-arm-kernel&m=162782110325813&w=2

lategoodbye commented 3 years ago

Next round: https://github.com/lategoodbye/rpi-zero/tree/v5.14-cm4-v4

which has also been sent to the mailing list: https://marc.info/?l=linux-arm-kernel&m=162833462918135&w=2

lategoodbye commented 3 years ago

I will close this, since it has been applied to linux-next.