Skip to content

Apple device properties

Lukas Wunner linux-efi 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 2 repliesIn review
  2. v33 patches 7 repliesSuperseded
  3. v23 patches 8 repliesSuperseded

Changes in v4 from the cover letter

- New patch [2/4] which introduces efi_call_proto() and efi_table_attr() macros to allow bitness-agnostic EFI protocol calls and table lookups. Previously when retrieving the properties in patch [3/4], a ternary operator was used to make the code work in mixed-mode, but Matt correctly remarked that it impacted readability. The new approach seeks to maintain readability while avoiding code duplication.

- Address all other comments by Matt on patch [3/4]: In eboot.c, move comparison of fw_vendor and call to retrieve_apple_device_properties() out of efi_main() and into a separate setup_quirks() function which may accommodate future vendor- or device-specific quirks. Fix up comments and curly braces, add newlines and suffix typedefs with "_t" as requested by Matt.

- Fix bug in comparison of fw_vendor in patch [3/4] wherein the system table was assumed to be the 64-bit version when compiling on x86_64, which obviously didn't work in mixed-mode.

- Fix double free in error path in patch [4/4] spotted by Andreas.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4efi: Add device path parserdrivers/firmware/efi/Kconfig drivers/firmware/efi/Makefile drivers/firmware/efi/dev-path-parser.c +1 more+229 -00 replies
2/4efi: Allow bitness-agnostic protocol callsarch/arm/include/asm/efi.h arch/arm64/include/asm/efi.h arch/x86/include/asm/efi.h+17 -51 reply
3/4x86/efi: Retrieve and assign Apple device propertiesDocumentation/kernel-parameters.txt arch/x86/boot/compressed/eboot.c arch/x86/include/uapi/asm/bootparam.h +4 more+350 -00 replies
4/4thunderbolt: Use Device ROM retrieved from EFIdrivers/thunderbolt/Kconfig drivers/thunderbolt/eeprom.c drivers/thunderbolt/switch.c+45 -10 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchLukas WunnerPierre MoreauAndreas Noever
1/4
2/4
3/4T-b T-b
4/4T-b T-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] Apple device properties

Retrieve device properties from EFI on Macs before ExitBootServices is called and assign them to devices (patch [3/4]). The devices that properties pertain to are encoded as EFI Device Paths, so add a parser for these (patch [1/4]). As a first use case, amend the Thunderbolt driver to take advantage of the Device ROM supplied by EFI (patch [4/4]).

Changes since v3:

- New patch [2/4] which introduces efi_call_proto() and efi_table_attr() macros to allow bitness-agnostic EFI protocol calls and table lookups. Previously when retrieving the properties in patch [3/4], a ternary operator was used to make the code work in mixed-mode, but Matt correctly remarked that it impacted readability. The new approach seeks to maintain readability while avoiding code duplication.

- Address all other comments by Matt on patch [3/4]: In eboot.c, move comparison of fw_vendor and call to retrieve_apple_device_properties() out of efi_main() and into a separate setup_quirks() function which may accommodate future vendor- or device-specific quirks. Fix up comments and curly braces, add newlines and suffix typedefs with "_t" as requested by Matt.

- Fix bug in comparison of fw_vendor in patch [3/4] wherein the system table was assumed to be the 64-bit version when compiling on x86_64, which obviously didn't work in mixed-mode.

- Fix double free in error path in patch [4/4] spotted by Andreas.

Link to v3:
http://www.spinics.net/lists/linux-efi/msg09647.html

Browseable on GitHub:
https://github.com/l1k/linux/commits/apple_properties_v4

Thanks,

Lukas

Lukas Wunner (4):
efi: Add device path parser
efi: Allow bitness-agnostic protocol calls x86/efi: Retrieve and assign Apple device properties
thunderbolt: Use Device ROM retrieved from EFI

 Documentation/kernel-parameters.txt     |   5 +
 arch/arm/include/asm/efi.h              |   3 +
 arch/arm64/include/asm/efi.h            |   3 +
 arch/x86/boot/compressed/eboot.c        |  65 +++++++++
 arch/x86/include/asm/efi.h              |  16 ++-
 arch/x86/include/uapi/asm/bootparam.h   |   1 +
 drivers/firmware/efi/Kconfig            |  18 +++
 drivers/firmware/efi/Makefile           |   2 +
 drivers/firmware/efi/apple-properties.c | 248 ++++++++++++++++++++++++++++++++
 drivers/firmware/efi/dev-path-parser.c  | 203 ++++++++++++++++++++++++++
 drivers/thunderbolt/Kconfig             |   1 +
 drivers/thunderbolt/eeprom.c            |  43 ++++++
 drivers/thunderbolt/switch.c            |   2 +-
 include/linux/efi.h                     |  37 +++++
 14 files changed, 641 insertions(+), 6 deletions(-)
 create mode 100644 drivers/firmware/efi/apple-properties.c
 create mode 100644 drivers/firmware/efi/dev-path-parser.c
Signature · 1 line
2.10.1