forked from u-boot/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm: apple: nvme: Add SART support and RTKit buffer management
The NVMe firmware in the macOS 13 beta blocks or crashes with u-boot's current minimal RTKit implementation. It does not provide buffers for the firmware's buffer requests. The ANS2 firmware included in macOS 11 and 12 tolerates this. The firmware included in the first macOS 13 beta requires buffers for the crashlog and ioreport endpoints to function. In the case of the NVMe the buffers are physical memory. Access to physical memory is guarded by what Apple calls SART. Import m1n1's SART driver (exclusively used for the NVMe controller). Implement buffer management helpers for RTKit. These are generic since other devices (none in u-boot so far) require different handling. Signed-off-by: Janne Grunau <[email protected]> Reviewed-by: Mark Kettenis <[email protected]> Tested-by: Mark Kettenis <[email protected]>
- Loading branch information
Showing
6 changed files
with
474 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* SPDX-License-Identifier: MIT | ||
* | ||
* The sart code is copied from m1n1 (https://github.com/AsahiLinux/m1n1) and | ||
* licensed as MIT. | ||
* | ||
* (C) Copyright 2022 The Asahi Linux Contributors | ||
*/ | ||
|
||
#ifndef SART_H | ||
#define SART_H | ||
|
||
#include <dm/ofnode.h> | ||
|
||
struct apple_sart; | ||
|
||
struct apple_sart *sart_init(ofnode node); | ||
void sart_free(struct apple_sart *sart); | ||
|
||
bool sart_add_allowed_region(struct apple_sart *sart, void *paddr, size_t sz); | ||
bool sart_remove_allowed_region(struct apple_sart *sart, void *paddr, size_t sz); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
obj-y += board.o | ||
obj-y += lowlevel_init.o | ||
obj-y += rtkit.o | ||
obj-$(CONFIG_NVME_APPLE) += sart.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.