Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kboot/gpu: Add "no-map" property for reserved memory nodes #334

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/kboot_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ static int dt_set_region(void *dt, int sgx, const char *name, const char *path)
if (fdt_setprop_inplace(dt, node, "reg", reg, sizeof(reg)))
bail("FDT: GPU: failed to set reg prop for %s\n", path);

if (fdt_setprop_empty(dt, node, "no-map"))
bail("FDT: GPU: failed to set no-map prop for %s\n", path);

return 0;
}

Expand Down Expand Up @@ -643,6 +646,13 @@ int dt_set_gpu(void *dt)
if (dt_set_region(dt, sgx, "gpu-region", "/reserved-memory/uat-ttbs"))
return -1;

// refresh gpu dt node offset after modifying the dt in dt_set_region()
gpu = fdt_path_offset(dt, "gpu");
if (gpu < 0) {
printf("FDT: GPU: gpu alias not found in device tree\n");
return 0;
}

if (firmware_set_fdt(dt, gpu, "apple,firmware-version", &os_firmware))
return -1;

Expand Down
Loading