Apple M2 Enablement For Linux Begins With Good Progress
Earlier this month Apple announced the M2 with new MacBook Air and MacBook Pro models. The Apple M2 can support up to 24GB of LPDDR5 memory, is an 8-core CPU with up to 10-core GPU, up to 18% faster CPU performance over the M1 and up to 35% faster GPU performance, and up to 50% greater memory bandwidth.
Hector Martin on Monday began his Linux M2 bring-up effort, including with a livestream of this reverse engineering / debugging / kernel hacking effort. Hector confirmed NVMe, USB, and SMC functionality are working for the M2 on the first day of the effort.
Hector Martin shows Linux booting on the Apple M2 in early form.
Unfortunately, the keyboard and trackpad with the new Apple M2 devices will require a new driver for support. Additionally, SPMI will need a new driver and the PCIe support needs a fusemap in the m1n1 code to initialize. There is also PCIe, PMU, Thunderbolt, DP Alt Mode, and other functionality not yet tackled.
There is also still the Apple Silicon graphics support that needs to be addressed as the elephant in the room. There is progress being made on that front including the first triangle milestone with a fully open driver, but still will be months before having a full-featured Gallium3D OpenGL driver, a DRM/KMS kernel driver suitable for upstreaming, etc. Obviously Vulkan support will also be a requirement for some users too before considering the hardware fully for daily use. The M1 graphics work continues and hopefully the M2 graphics won't present many major additional hurdles.
More details and his activity around the M2 Linux bring-up can be found via Twitter:
USB works. That's it for today!
— Hector Martin (@marcan42) June 27, 2022
Missing things:
· Speakers untested
· Keyboard/trackpad needs new driver
· IPMI needs new driver
· PCIe needs the fusemap in m1n1 to initialize
Not bad for one day! pic.twitter.com/lfMBd1o87e
Those wanting to track the code progress can see the m1n1 changes via its GitHub repository. The Linux kernel changes meanwhile are being worked on via this Git branch. The current Asahi Linux porting progress for various Apple Mac systems for the M1 and M2 SoCs can be tracked via the Asahi Linux Wiki.