Skip to content

Conversation

ktrinh-anduril
Copy link

With these changes, dmidecode works properly on my machine(serial and uuid censored out):

18:39:51 ❯ sudo dmidecode

# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.7.0 present.
Table at 0x10FC6E25020.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: U-Boot
	Version: 2024.04
	Release Date: 04/01/2024
	ROM Size: 64 kB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		Selectable boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 24.4

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: apple
	Product Name:  M1 Max
	Version: Not Specified
	Serial Number: *******
	UUID: *******-*******-*******-*******-************
	Wake-up Type: Reserved
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: apple
	Product Name:  M1 Max
	Version: Not Specified
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Features:
		Board is a hosting board
	Location In Chassis: Not Specified
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

Handle 0x0003, DMI type 3, 21 bytes
Chassis Information
	Manufacturer: Not Specified
	Type: Desktop
	Lock: Not Present
	Version: Not Specified
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: None
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0

Handle 0x0004, DMI type 4, 48 bytes
Processor Information
	Socket Designation: Not Specified
	Type: Central Processor
	Family: Unknown
	Manufacturer: Not Specified
	ID: 00 00 00 00 00 00 00 00
	Version: Not Specified
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: Unknown
	Current Speed: Unknown
	Status: Unpopulated
	Upgrade: None
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Characteristics: None

Handle 0x0005, DMI type 32, 11 bytes
System Boot Information
	Status: No errors detected

Handle 0x0006, DMI type 127, 4 bytes
End Of Table

marcan and others added 21 commits April 2, 2024 20:56
The MTP HID driver will reuse this code, so split it off into another
file.

Signed-off-by: Hector Martin <[email protected]>
This is required for MTP to work properly

Signed-off-by: Hector Martin <[email protected]>
For devices without specific buffer methods, just assume we can give
them raw memory pointers when they request a buffer.

Signed-off-by: Hector Martin <[email protected]>
This driver handles the MTP ASC coprocessor, which does not need any
special handling on the RTKit side and communicates out-of-band.

Signed-off-by: Hector Martin <[email protected]>
Apple M2 devices have an MTP coprocessor in charge of keyboard/trackpad
handling, communicating over a DockChannel interface. Add a simple
driver for this.

The keyboard does not require any initialization messages, but we have a
problem: we cannot reset the MTP so Linux can start it fresh, and it
delivers a number of informative packets on startup. To work around
this, we buffer those messages and re-inject them into the FIFO (which
is big enough to hold all of them) on shutdown, so Linux finds them when
it initializes its driver. The actual MTP coprocessor is quiesced, which
does work properly.

Signed-off-by: Hector Martin <[email protected]>
Find the appropriate EFI system partition on the internal NVMe
storage and set the U-Boot environment variables such that
the file system firmware loader can load firmware from it.

Signed-off-by: Mark Kettenis <[email protected]>
Add a variant of readl_poll_sleep_timeout that reads a single
byte to match the readb_poll_timeout API that Linux has.

Signed-off-by: Mark Kettenis <[email protected]>
The ASMedia XHCI controller found on some of the Apple Silicon
machines needs firmware to operate.  Use the file system
firmware loader interface to read the firmware and load it
onto the controller.  This allows keyboards connected to the
type-A ports on these machines to function in U-Boot.

Signed-off-by: Mark Kettenis <[email protected]>
Now that we have a way to find the appropriate EFI system
partition on the internal NVMe storage, store the U-Boot
environment there.

Signed-off-by: Mark Kettenis <[email protected]>
Now that we have a way to find the appropriate EFI system
partition on the internal NVMe storage, nail it down as the
preferred EFI system partition such that we can use it to
store EFI variables.  This allows multiple OS installations to
exist on Apple Silicon machines without interfering with eachother.

Signed-off-by: Mark Kettenis <[email protected]>
This synchronizes the device trees with those that are in the
process of being upstreamed into Linux. These now match the
current state of the device trees on the asahi branch of the
Asahi Linux github repository.

Signed-off-by: Mark Kettenis <[email protected]>
Device trees for the 14" and 16" MacBook Pro and the Mac Studio.
Taken from the asahi branch of the Asahi Linux github repository.

Signed-off-by: Mark Kettenis <[email protected]>
Device trees for the M2 MacBook Air and the M2 13" MacBook Pro.
Taken from the asahi branch of the Asahi Linux github repository.

Signed-off-by: Mark Kettenis <[email protected]>
Device trees for the 14" and 16" MacBook Pro and the Mac mini.
Taken from the asahi branch of the Asahi Linux github repository.

Signed-off-by: Mark Kettenis <[email protected]>
This will work for u-boot itself, but needs a special workaround in the
MTP driver for Linux handoff to work.

Signed-off-by: Hector Martin <[email protected]>
To be used for special-case oslog support in rtkit-helper.

Signed-off-by: Hector Martin <[email protected]>
The new OSLog region in MTP (firmware 13.3+) persists on handoff to
Linux. To avoid having to come up with some weird DART handoff or DAPF
tricks, let's just steal some of the coprocessor's dedicated SRAM. This
keeps it happy and Linux doesn't need any special handoff then.

Signed-off-by: Hector Martin <[email protected]>
When booting from a block io device, prefer the EFI system
partition over other partitions.

Signed-off-by: Mark Kettenis <[email protected]>
Signed-off-by: Khoi Trinh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants