Home | History | Annotate | Download | only in FdtDxe

Lines Matching refs:fdt

33 // Additional size that could be used for FDT entries added by the UEFI OS Loader

194 IN VOID *fdt,
201 node = fdt_subnode_offset (fdt, 0, "smb");
203 subnode = fdt_subnode_offset (fdt, node, device);
205 rc = fdt_setprop_string(fdt, subnode, "status", enable ? "ok" : "disabled");
218 IN VOID *fdt,
225 node = fdt_subnode_offset (fdt, 0, "smb");
227 subnode = fdt_subnode_offset (fdt, node, device);
229 rc = fdt_setprop(fdt, subnode, "mac-address", (void *)&mac_addr, 6);
241 IN VOID *fdt
250 SetDeviceStatus (fdt, "sata@e0d00000",
252 SetDeviceStatus (fdt, "gpio@e0020000", IsRevB1);
253 SetDeviceStatus (fdt, "gpio@e0030000", IsRevB1);
254 SetDeviceStatus (fdt, "gwdt@e0bb0000", IsRevB1);
256 SetDeviceStatus (fdt, "kcs@e0010000", IsRevB1);
258 SetDeviceStatus (fdt, "kcs@e0010000", FALSE);
264 IN VOID *fdt
268 SetDeviceStatus (fdt, "xgmac@e0700000", TRUE);
269 SetDeviceStatus (fdt, "phy@e1240800", TRUE);
270 SetDeviceStatus (fdt, "xgmac@e0900000", TRUE);
271 SetDeviceStatus (fdt, "phy@e1240c00", TRUE);
273 SetMacAddress (fdt, "xgmac@e0700000", PcdGet64 (PcdEthMacA));
274 SetMacAddress (fdt, "xgmac@e0900000", PcdGet64 (PcdEthMacB));
276 SetDeviceStatus (fdt, "xgmac@e0700000", FALSE);
277 SetDeviceStatus (fdt, "phy@e1240800", FALSE);
278 SetDeviceStatus (fdt, "xgmac@e0900000", FALSE);
279 SetDeviceStatus (fdt, "phy@e1240c00", FALSE);
285 ** Relocate the FDT blob to a more appropriate location for the Linux kernel.
286 ** This function will allocate memory for the relocated FDT blob.
307 // If FDT load address needs to be aligned, allocate more space.
320 DEBUG ((EFI_D_WARN, "Warning: Failed to load FDT below address 0x%lX (%r). Will try again at a random address anywhere.\n", *RelocatedFdt, Status));
332 DEBUG ((EFI_D_WARN, "WARNING: Loaded FDT at random address 0x%lX.\nWARNING: There is a risk of accidental overwriting by other code/data.\n", *RelocatedFdt));
341 // Load the Original FDT tree into the new region
371 VOID *fdt;
408 // Sanity checks on the original FDT blob.
416 // The original FDT blob might have been loaded partially.
420 Print (L"ERROR: Incomplete FDT. Only %d/%d bytes have been loaded.\n",
426 // Relocate the FDT to its final location.
434 fdt = (VOID*)(UINTN)NewFdtBlobBase;
436 node = fdt_subnode_offset (fdt, 0, "chosen");
439 node = fdt_add_subnode(fdt, 0, "chosen");
448 BootArg = fdt_getprop(fdt, node, "bootargs", &lenp);
458 err = fdt_setprop(fdt, node, "bootargs", CommandLineArguments, AsciiStrSize(CommandLineArguments));
469 err = fdt_setprop(fdt, node, "linux,initrd-start", &InitrdImageStart, sizeof(EFI_PHYSICAL_ADDRESS));
474 err = fdt_setprop(fdt, node, "linux,initrd-end", &InitrdImageEnd, sizeof(EFI_PHYSICAL_ADDRESS));
483 node = fdt_subnode_offset(fdt, 0, "memory");
486 node = fdt_add_subnode(fdt, 0, "memory");
488 fdt_setprop_string(fdt, node, "name", "memory");
489 fdt_setprop_string(fdt, node, "device_type", "memory");
497 err = fdt_setprop(fdt, node, "reg", &Region, sizeof(Region));
533 err = fdt_add_mem_rsv(fdt, MemoryMapPtr->PhysicalStart, MemoryMapPtr->NumberOfPages * EFI_PAGE_SIZE);
567 pmu_node = fdt_subnode_offset (fdt, 0, "pmu");
569 fdt_del_node (fdt, pmu_node);
571 pmu_node = fdt_add_subnode(fdt, 0, "pmu");
580 DEBUG ((EFI_D_ERROR, "FDT: Error getting PMU interrupt for MpId '0x%x'\n", MpId));
587 fdt_appendprop(fdt, pmu_node, "interrupts", &PmuInt, sizeof(PmuInt));
589 fdt_setprop_string(fdt, pmu_node, "compatible", "arm,armv8-pmuv3");
591 DEBUG((EFI_D_ERROR,"FDT: Error creating 'pmu' node\n"));
597 node = fdt_subnode_offset (fdt, 0, "psci");
600 fdt_del_node (fdt, node);
605 node = fdt_add_subnode(fdt, 0, "psci");
607 fdt_setprop_string(fdt, node, "compatible", "arm,psci-0.2");
608 fdt_appendprop_string(fdt, node, "compatible", "arm,psci");
609 fdt_setprop_string(fdt, node, "method", "smc");
611 DEBUG((EFI_D_ERROR,"FDT: Error creating 'psci' node\n"));
618 node = fdt_subnode_offset (fdt, 0, "cpus");
620 fdt_del_node (fdt, node);
622 node = fdt_add_subnode(fdt, 0, "cpus");
625 fdt_setprop_string(fdt, node, "name", "cpus");
626 fdt_setprop_cell (fdt, node, "#address-cells", sizeof (UINTN) / 4);
627 fdt_setprop_cell(fdt, node, "#size-cells", 0);
629 DEBUG((EFI_D_ERROR,"FDT: Error creating 'cpus' node\n"));
635 // Walk the processor table in reverse order for proper listing in FDT
641 cpu_node = fdt_add_subnode (fdt, node, Name);
643 DEBUG ((EFI_D_ERROR, "FDT: Error on creating '%a' node\n", Name));
647 phandle[Index] = fdt_alloc_phandle(fdt);
648 fdt_setprop_cell (fdt, cpu_node, "phandle", phandle[Index]);
649 fdt_setprop_cell (fdt, cpu_node, "linux,phandle", phandle[Index]);
653 fdt_setprop_string(fdt, cpu_node, "enable-method", "psci");
655 fdt_setprop_string(fdt, cpu_node, "enable-method", "spin-table");
658 fdt_setprop (fdt, cpu_node, "cpu-release-addr", &MbAddr, sizeof (MbAddr));
663 fdt_setprop (fdt, cpu_node, "reg", &MpId, sizeof (MpId));
664 fdt_setprop_string(fdt, cpu_node, "compatible", "arm,armv8");
665 fdt_setprop_string (fdt, cpu_node, "device_type", "cpu");
670 fdt_setprop_string(fdt, cpu_node, "status", "disabled");
675 map_node = fdt_subnode_offset (fdt, node, "cpu-map");
677 fdt_del_node (fdt, map_node);
679 map_node = fdt_add_subnode(fdt, node, "cpu-map");
687 cluster_node = fdt_add_subnode (fdt, map_node, Name);
689 DEBUG ((EFI_D_ERROR, "FDT: Error creating '%a' node\n", Name));
702 cpu_node = fdt_add_subnode (fdt, cluster_node, Name);
704 DEBUG ((EFI_D_ERROR, "FDT: Error creating '%a' node\n", Name));
708 fdt_setprop_cell (fdt, cpu_node, "cpu", phandle[CoreIndex]);
729 DEBUG((EFI_D_ERROR,"FDT: Error creating 'cpu-map' node\n"));
734 SetSocIdStatus (fdt);
735 SetXgbeStatus (fdt);
738 // DebugDumpFdt (fdt);
756 // Return success even if we failed to update the FDT blob.