Skip to contentSkip to conversation

firmware_loader: Add /lib/firmware/vendor paths for Apple ARM platforms

PATCH In review Neal Gompa 2 participants 4 messages Jul 30

Subsystems (3)
lore
Share & tools
lore

Neal Gompa

author
#0 lore raw

PATCH 1/1 firmware_loader: Add /lib/firmware/vendor paths for Apple ARM platforms

On Apple ARM machines (branded Apple Silicon Macs), there is non-redistributable firmware provided in macOS that is required for Linux to leverage the hardware to run properly.

The firmware covers Wi-Fi+BT support, USB, hardware ISP, the touchbar touchscreen, and the trackpad.

In order to ensure this firmware can be installed without messing with firmware provided by linux-firmware and other packages that put things in the tree, the empty "vendor" subdirectory was created to serve this purpose. This directory is used by the asahi dracut module as part of the Asahi Linux installation process to transfer firmware from macOS to the newly installed Linux system.

This is based on the patch originally written by Hector Martin for Asahi Linux.

---
 Documentation/driver-api/firmware/fw_search_path.rst | 2 ++
 drivers/base/firmware_loader/main.c                  | 2 ++
 2 files changed, 4 insertions(+)
Documentation/driver-api/firmware/fw_search_path.rst +2 -0
index d7cb1e8f0076..ddd945a47fed 100644
@@ -6,6 +6,8 @@ The following search paths are used to look for firmware on your
 root filesystem.
 
 * fw_path_para - module parameter - default is empty so this is ignored
+* /lib/firmware/vendor/UTS_RELEASE/
+* /lib/firmware/vendor/
 * /lib/firmware/updates/UTS_RELEASE/
 * /lib/firmware/updates/
 * /lib/firmware/UTS_RELEASE/
drivers/base/firmware_loader/main.c +2 -0
index 24213a0ea831..1acc5842fb24 100644
@@ -471,6 +471,8 @@ static int fw_decompress_xz(struct device *dev, struct fw_priv *fw_priv,
 static char fw_path_para[256];
 static const char * const fw_path[] = {
 	fw_path_para,
+	"/lib/firmware/vendor/" UTS_RELEASE,
+	"/lib/firmware/vendor",
 	"/lib/firmware/updates/" UTS_RELEASE,
 	"/lib/firmware/updates",
 	"/lib/firmware/" UTS_RELEASE,
Signature · 1 line
2.55.0
#1 lore raw
Quoted 7 lines · Neal Gompa

On Apple ARM machines (branded Apple Silicon Macs), there is non-redistributable firmware provided in macOS that is required for Linux to leverage the hardware to run properly.

The firmware covers Wi-Fi+BT support, USB, hardware ISP, the touchbar touchscreen, and the trackpad.

Quoted 6 lines

In order to ensure this firmware can be installed without messing with firmware provided by linux-firmware and other packages that put things in the tree, the empty "vendor" subdirectory was created to serve this purpose. This directory is used by the asahi dracut module as part of the Asahi Linux installation process to transfer firmware from macOS to the newly installed Linux system.

Why is this needed when there is the ability for userspace to add their own firmware search path to the list today?

We aren't going to keep adding random paths here, please use the option that is designed specifically for this:

Quoted 1 line

* fw_path_para - module parameter - default is empty so this is ignored

Right there.

thanks,

greg k-h

author
#2 lore raw
Quoted 19 lines · Greg Kroah-Hartman
Quoted 7 lines · Neal Gompa

On Apple ARM machines (branded Apple Silicon Macs), there is non-redistributable firmware provided in macOS that is required for Linux to leverage the hardware to run properly.

The firmware covers Wi-Fi+BT support, USB, hardware ISP, the touchbar touchscreen, and the trackpad.

Quoted 6 lines

In order to ensure this firmware can be installed without messing with firmware provided by linux-firmware and other packages that put things in the tree, the empty "vendor" subdirectory was created to serve this purpose. This directory is used by the asahi dracut module as part of the Asahi Linux installation process to transfer firmware from macOS to the newly installed Linux system.

Why is this needed when there is the ability for userspace to add their own firmware search path to the list today?

Quoted 6 lines

We aren't going to keep adding random paths here, please use the option that is designed specifically for this:

Quoted 1 line

* fw_path_para - module parameter - default is empty so this is ignored

Right there.

I was not familiar with this feature, and I had inherited the patch as part of our cleanup effort to upstream the Asahi work. Sorry about that!

Based on the documentation, this is the patch I've created for our dracut module: https://github.com/AsahiLinux/asahi-scripts/pull/72

Is this how it is supposed to be used?

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
#3 lore raw
Quoted 28 lines · Neal Gompa
Quoted 19 lines · Greg Kroah-Hartman
Quoted 7 lines · Neal Gompa

On Apple ARM machines (branded Apple Silicon Macs), there is non-redistributable firmware provided in macOS that is required for Linux to leverage the hardware to run properly.

The firmware covers Wi-Fi+BT support, USB, hardware ISP, the touchbar touchscreen, and the trackpad.

Quoted 6 lines

In order to ensure this firmware can be installed without messing with firmware provided by linux-firmware and other packages that put things in the tree, the empty "vendor" subdirectory was created to serve this purpose. This directory is used by the asahi dracut module as part of the Asahi Linux installation process to transfer firmware from macOS to the newly installed Linux system.

Why is this needed when there is the ability for userspace to add their own firmware search path to the list today?

Quoted 6 lines

We aren't going to keep adding random paths here, please use the option that is designed specifically for this:

Quoted 1 line

* fw_path_para - module parameter - default is empty so this is ignored

Right there.

Quoted 8 lines

I was not familiar with this feature, and I had inherited the patch as part of our cleanup effort to upstream the Asahi work. Sorry about that!

Based on the documentation, this is the patch I've created for our dracut module: https://github.com/AsahiLinux/asahi-scripts/pull/72

Is this how it is supposed to be used?

If it works, yes :)