TianoCore EDK2 master
Loading...
Searching...
No Matches
PciConfigSpaceParser.c
Go to the documentation of this file.
1
15#include "CmObjectDescUtility.h"
17#include <Library/DebugLib.h>
18
19#include "FdtHwInfoParser.h"
21
27 { "pci-host-ecam-generic" }
28};
29
35};
36
57EFIAPI
59 IN CONST VOID *Fdt,
60 IN INT32 HostPciNode,
61 OUT INT32 *SegGroup
62 )
63{
64 CONST UINT8 *Data;
65 INT32 DataSize;
66 STATIC INT32 LocalSegGroup = 0;
67
68 if ((Fdt == NULL) ||
69 (SegGroup == NULL))
70 {
71 ASSERT (0);
72 return EFI_INVALID_PARAMETER;
73 }
74
75 Data = fdt_getprop (Fdt, HostPciNode, "linux,pci-domain", &DataSize);
76 if ((Data == NULL) || (DataSize < 0)) {
77 // Did not find property, assign the DomainIds ourselves.
78 if (LocalSegGroup < 0) {
79 // "linux,pci-domain" property was defined for another node.
80 ASSERT (0);
81 return EFI_ABORTED;
82 }
83
84 *SegGroup = LocalSegGroup++;
85 return EFI_SUCCESS;
86 }
87
88 if ((DataSize > sizeof (UINT32)) ||
89 (LocalSegGroup > 0))
90 {
91 // Property on more than 1 cell or
92 // "linux,pci-domain" property was not defined for a node.
93 ASSERT (0);
94 return EFI_ABORTED;
95 }
96
97 // If one node has the "linux,pci-domain" property, then all the host-pci
98 // nodes must have it.
99 LocalSegGroup = -1;
100
101 *SegGroup = fdt32_to_cpu (*(UINT32 *)Data);
102 return EFI_SUCCESS;
103}
104
116STATIC
118EFIAPI
120 IN CONST VOID *Fdt,
121 IN INT32 HostPciNode,
122 IN OUT PCI_PARSER_TABLE *PciInfo
123 )
124{
125 CONST UINT8 *Data;
126 INT32 DataSize;
127 UINT32 StartBus;
128 UINT32 EndBus;
129
130 if ((Fdt == NULL) ||
131 (PciInfo == NULL))
132 {
133 ASSERT (0);
134 return EFI_INVALID_PARAMETER;
135 }
136
137 Data = fdt_getprop (Fdt, HostPciNode, "bus-range", &DataSize);
138 if ((Data == NULL) || (DataSize < 0)) {
139 // No evidence this property is mandatory. Use default values.
140 StartBus = 0;
141 EndBus = 255;
142 } else if (DataSize == (2 * sizeof (UINT32))) {
143 // If available, the property is on two integers.
144 StartBus = fdt32_to_cpu (((UINT32 *)Data)[0]);
145 EndBus = fdt32_to_cpu (((UINT32 *)Data)[1]);
146 } else {
147 ASSERT (0);
148 return EFI_ABORTED;
149 }
150
151 PciInfo->PciConfigSpaceInfo.StartBusNumber = StartBus;
152 PciInfo->PciConfigSpaceInfo.EndBusNumber = EndBus;
153
154 return EFI_SUCCESS;
155}
156
173STATIC
175EFIAPI
177 IN CONST VOID *Fdt,
178 IN INT32 HostPciNode,
179 IN INT32 AddressCells,
180 IN OUT PCI_PARSER_TABLE *PciInfo
181 )
182{
183 CONST UINT8 *Data;
184 INT32 DataSize;
185 UINT32 Index;
186 UINT32 Offset;
187 UINT32 AddressMapSize;
188 UINT32 Count;
189 UINT32 PciAddressAttr;
190
191 CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO *PciAddressMapInfo;
192 UINT32 BufferSize;
193
194 // The mapping is done on AddressMapSize bytes.
195 AddressMapSize = (PCI_ADDRESS_CELLS + AddressCells + PCI_SIZE_CELLS) *
196 sizeof (UINT32);
197
198 Data = fdt_getprop (Fdt, HostPciNode, "ranges", &DataSize);
199 if ((Data == NULL) ||
200 (DataSize < 0) ||
201 ((DataSize % AddressMapSize) != 0))
202 {
203 // If error or not on AddressMapSize bytes.
204 ASSERT (0);
205 return EFI_ABORTED;
206 }
207
208 Count = DataSize / AddressMapSize;
209
210 // Allocate a buffer to store each address mapping.
211 BufferSize = Count * sizeof (CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO);
212 PciAddressMapInfo = AllocateZeroPool (BufferSize);
213 if (PciAddressMapInfo == NULL) {
214 ASSERT (0);
215 return EFI_OUT_OF_RESOURCES;
216 }
217
218 for (Index = 0; Index < Count; Index++) {
219 Offset = Index * AddressMapSize;
220
221 // Pci address attributes
222 PciAddressAttr = fdt32_to_cpu (*(UINT32 *)&Data[Offset]);
223 PciAddressMapInfo[Index].SpaceCode = READ_PCI_SS (PciAddressAttr);
224 Offset += sizeof (UINT32);
225
226 // Pci address
227 PciAddressMapInfo[Index].PciAddress =
228 fdt64_to_cpu (*(UINT64 *)&Data[Offset]);
229 Offset += (PCI_ADDRESS_CELLS - 1) * sizeof (UINT32);
230
231 // Cpu address
232 if (AddressCells == 2) {
233 PciAddressMapInfo[Index].CpuAddress =
234 fdt64_to_cpu (*(UINT64 *)&Data[Offset]);
235 } else {
236 PciAddressMapInfo[Index].CpuAddress =
237 fdt32_to_cpu (*(UINT32 *)&Data[Offset]);
238 }
239
240 Offset += AddressCells * sizeof (UINT32);
241
242 // Address size
243 PciAddressMapInfo[Index].AddressSize =
244 fdt64_to_cpu (*(UINT64 *)&Data[Offset]);
245 Offset += PCI_SIZE_CELLS * sizeof (UINT32);
246 } // for
247
248 PciInfo->Mapping[PciMappingTableAddress].ObjectId =
250 PciInfo->Mapping[PciMappingTableAddress].Size =
252 PciInfo->Mapping[PciMappingTableAddress].Data = PciAddressMapInfo;
253 PciInfo->Mapping[PciMappingTableAddress].Count = Count;
254
255 return EFI_SUCCESS;
256}
257
282STATIC
284EFIAPI
286 IN CONST VOID *Fdt,
287 IN INT32 HostPciNode,
288 IN OUT PCI_PARSER_TABLE *PciInfo
289 )
290{
291 EFI_STATUS Status;
292 CONST UINT8 *Data;
293 INT32 DataSize;
294 UINT32 Index;
295 UINT32 Offset;
296
297 INT32 IntcNode;
298 INT32 IntcAddressCells;
299 INT32 IntcCells;
300
301 INT32 PciIntCells;
302 INT32 IntcPhandle;
303
304 INT32 IrqMapSize;
305 UINT32 IrqMapCount;
306 CONST UINT8 *IrqMapMask;
307 INT32 IrqMapMaskSize;
308
309 INT32 PHandleOffset;
310
311 UINT32 PciAddressAttr;
312
313 CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO *PciInterruptMapInfo;
314 UINT32 BufferSize;
315
316 Data = fdt_getprop (Fdt, HostPciNode, "interrupt-map", &DataSize);
317 if ((Data == NULL) || (DataSize <= 0)) {
318 DEBUG ((
319 DEBUG_WARN,
320 "Fdt parser: No Legacy interrupts found for PCI configuration space at "
321 "address: 0x%lx, group segment: %d\n",
322 PciInfo->PciConfigSpaceInfo.BaseAddress,
323 PciInfo->PciConfigSpaceInfo.PciSegmentGroupNumber
324 ));
325 return EFI_NOT_FOUND;
326 }
327
328 // PCI interrupts are expected to be on 1 cell. Check it.
329 Status = FdtGetInterruptCellsInfo (Fdt, HostPciNode, &PciIntCells);
330 if (EFI_ERROR (Status)) {
331 ASSERT (0);
332 return Status;
333 }
334
335 if (PciIntCells != PCI_INTERRUPTS_CELLS) {
336 ASSERT (0);
337 return EFI_ABORTED;
338 }
339
340 IrqMapMask = fdt_getprop (
341 Fdt,
342 HostPciNode,
343 "interrupt-map-mask",
344 &IrqMapMaskSize
345 );
346 if ((IrqMapMask == NULL) ||
347 (IrqMapMaskSize !=
348 (PCI_ADDRESS_CELLS + PCI_INTERRUPTS_CELLS) * sizeof (UINT32)))
349 {
350 ASSERT (0);
351 return EFI_ABORTED;
352 }
353
354 // Get the interrupt-controller of the first irq mapping.
355 PHandleOffset = (PCI_ADDRESS_CELLS + PciIntCells) * sizeof (UINT32);
356 if (PHandleOffset > DataSize) {
357 ASSERT (0);
358 return EFI_ABORTED;
359 }
360
361 IntcPhandle = fdt32_to_cpu (*(UINT32 *)&Data[PHandleOffset]);
362 IntcNode = fdt_node_offset_by_phandle (Fdt, IntcPhandle);
363 if (IntcNode < 0) {
364 ASSERT (0);
365 return EFI_ABORTED;
366 }
367
368 // Get the "address-cells" property of the IntcNode.
369 Status = FdtGetIntcAddressCells (Fdt, IntcNode, &IntcAddressCells, NULL);
370 if (EFI_ERROR (Status)) {
371 ASSERT (0);
372 return Status;
373 }
374
375 // Get the "interrupt-cells" property of the IntcNode.
376 Status = FdtGetInterruptCellsInfo (Fdt, IntcNode, &IntcCells);
377 if (EFI_ERROR (Status)) {
378 ASSERT (0);
379 return Status;
380 }
381
382 // An irq mapping is done on IrqMapSize bytes
383 // (which includes 1 cell for the PHandle).
384 IrqMapSize = (PCI_ADDRESS_CELLS + PciIntCells + 1
385 + IntcAddressCells + IntcCells) * sizeof (UINT32);
386 if ((DataSize % IrqMapSize) != 0) {
387 // The mapping is not done on IrqMapSize bytes.
388 ASSERT (0);
389 return EFI_ABORTED;
390 }
391
392 IrqMapCount = DataSize / IrqMapSize;
393
394 // We assume the same interrupt-controller is used for all the mappings.
395 // Check this is correct.
396 for (Index = 0; Index < IrqMapCount; Index++) {
397 if (IntcPhandle != fdt32_to_cpu (
398 *(UINT32 *)&Data[(Index * IrqMapSize) + PHandleOffset]
399 ))
400 {
401 ASSERT (0);
402 return EFI_ABORTED;
403 }
404 }
405
406 // Allocate a buffer to store each interrupt mapping.
407 IrqMapCount = DataSize / IrqMapSize;
408 BufferSize = IrqMapCount * sizeof (CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO);
409 PciInterruptMapInfo = AllocateZeroPool (BufferSize);
410 if (PciInterruptMapInfo == NULL) {
411 ASSERT (0);
412 return EFI_OUT_OF_RESOURCES;
413 }
414
415 for (Index = 0; Index < IrqMapCount; Index++) {
416 Offset = Index * IrqMapSize;
417
418 // Pci address attributes
419 PciAddressAttr = fdt32_to_cpu (
420 (*(UINT32 *)&Data[Offset]) &
421 (*(UINT32 *)&IrqMapMask[0])
422 );
423 PciInterruptMapInfo[Index].PciBus = READ_PCI_BBBBBBBB (PciAddressAttr);
424 PciInterruptMapInfo[Index].PciDevice = READ_PCI_DDDDD (PciAddressAttr);
425 Offset += PCI_ADDRESS_CELLS * sizeof (UINT32);
426
427 // Pci irq
428 PciInterruptMapInfo[Index].PciInterrupt = fdt32_to_cpu (
429 (*(UINT32 *)&Data[Offset]) &
430 (*(UINT32 *)&IrqMapMask[3 * sizeof (UINT32)])
431 );
432 // -1 to translate from device-tree (INTA=1) to ACPI (INTA=0) irq IDs.
433 PciInterruptMapInfo[Index].PciInterrupt -= 1;
434 Offset += PCI_INTERRUPTS_CELLS * sizeof (UINT32);
435
436 // PHandle (skip it)
437 Offset += sizeof (UINT32);
438
439 // "Parent unit address" (skip it)
440 Offset += IntcAddressCells * sizeof (UINT32);
441
442 // Interrupt controller interrupt and flags
443 PciInterruptMapInfo[Index].IntcInterrupt.Interrupt =
444 FdtGetInterruptId ((UINT32 *)&Data[Offset]);
445 PciInterruptMapInfo[Index].IntcInterrupt.Flags =
446 FdtGetInterruptFlags ((UINT32 *)&Data[Offset]);
447 } // for
448
449 PciInfo->Mapping[PciMappingTableInterrupt].ObjectId =
451 PciInfo->Mapping[PciMappingTableInterrupt].Size =
452 sizeof (CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO) * IrqMapCount;
453 PciInfo->Mapping[PciMappingTableInterrupt].Data = PciInterruptMapInfo;
454 PciInfo->Mapping[PciMappingTableInterrupt].Count = IrqMapCount;
455
456 return Status;
457}
458
470STATIC
472EFIAPI
474 IN CONST VOID *Fdt,
475 IN INT32 HostPciNode,
476 IN OUT PCI_PARSER_TABLE *PciInfo
477 )
478{
479 EFI_STATUS Status;
480 INT32 AddressCells;
481 INT32 SizeCells;
482 CONST UINT8 *Data;
483 INT32 DataSize;
484 INT32 SegGroup;
485
486 if ((Fdt == NULL) ||
487 (PciInfo == NULL))
488 {
489 ASSERT (0);
490 return EFI_INVALID_PARAMETER;
491 }
492
493 // Segment Group / DomainId
494 Status = GetPciSegGroup (Fdt, HostPciNode, &SegGroup);
495 if (EFI_ERROR (Status)) {
496 ASSERT (0);
497 return Status;
498 }
499
500 PciInfo->PciConfigSpaceInfo.PciSegmentGroupNumber = SegGroup;
501
502 // Bus range
503 Status = PopulateBusRange (Fdt, HostPciNode, PciInfo);
504 if (EFI_ERROR (Status)) {
505 ASSERT (0);
506 return Status;
507 }
508
509 Status = FdtGetParentAddressInfo (
510 Fdt,
511 HostPciNode,
512 &AddressCells,
513 &SizeCells
514 );
515 if (EFI_ERROR (Status)) {
516 ASSERT (0);
517 return Status;
518 }
519
520 // Only support 32/64 bits addresses.
521 if ((AddressCells < 1) ||
522 (AddressCells > 2) ||
523 (SizeCells < 1) ||
524 (SizeCells > 2))
525 {
526 ASSERT (0);
527 return EFI_ABORTED;
528 }
529
530 Data = fdt_getprop (Fdt, HostPciNode, "reg", &DataSize);
531 if ((Data == NULL) ||
532 (DataSize != ((AddressCells + SizeCells) * sizeof (UINT32))))
533 {
534 // If error or wrong size.
535 ASSERT (0);
536 return EFI_ABORTED;
537 }
538
539 // Base address
540 if (AddressCells == 2) {
541 PciInfo->PciConfigSpaceInfo.BaseAddress = fdt64_to_cpu (*(UINT64 *)Data);
542 } else {
543 PciInfo->PciConfigSpaceInfo.BaseAddress = fdt32_to_cpu (*(UINT32 *)Data);
544 }
545
546 // Address map
547 Status = ParseAddressMap (
548 Fdt,
549 HostPciNode,
550 AddressCells,
551 PciInfo
552 );
553 if (EFI_ERROR (Status)) {
554 ASSERT (0);
555 return Status;
556 }
557
558 // Irq map
559 Status = ParseIrqMap (
560 Fdt,
561 HostPciNode,
562 PciInfo
563 );
564 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
565 ASSERT (0);
566 }
567
568 return EFI_SUCCESS;
569}
570
586STATIC
588EFIAPI
590 IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle,
591 IN PCI_PARSER_TABLE *PciTableInfo
592 )
593{
594 EFI_STATUS Status;
595 CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO *PciConfigSpaceInfo;
596
597 if ((FdtParserHandle == NULL) ||
598 (PciTableInfo == NULL))
599 {
600 ASSERT (0);
601 return EFI_INVALID_PARAMETER;
602 }
603
604 PciConfigSpaceInfo = &PciTableInfo->PciConfigSpaceInfo;
605
606 // Add the address map space CmObj to the Configuration Manager.
608 FdtParserHandle,
609 &PciTableInfo->Mapping[PciMappingTableAddress],
610 &PciConfigSpaceInfo->AddressMapToken
611 );
612 if (EFI_ERROR (Status)) {
613 ASSERT (0);
614 return Status;
615 }
616
617 // Add the interrupt map space CmObj to the Configuration Manager.
618 // Possible to have no legacy interrupts, or no device described and
619 // thus no interrupt-mapping.
620 if (PciTableInfo->Mapping[PciMappingTableInterrupt].Count != 0) {
622 FdtParserHandle,
623 &PciTableInfo->Mapping[PciMappingTableInterrupt],
624 &PciConfigSpaceInfo->InterruptMapToken
625 );
626 if (EFI_ERROR (Status)) {
627 ASSERT (0);
628 return Status;
629 }
630 }
631
632 // Add the configuration space CmObj to the Configuration Manager.
633 Status = AddSingleCmObj (
634 FdtParserHandle,
637 ),
638 &PciTableInfo->PciConfigSpaceInfo,
640 NULL
641 );
642 ASSERT_EFI_ERROR (Status);
643 return Status;
644}
645
654STATIC
656EFIAPI
658 IN PCI_PARSER_TABLE *PciTableInfo
659 )
660{
661 UINT32 Index;
662 VOID *Data;
663
664 if (PciTableInfo == NULL) {
665 ASSERT (0);
666 return EFI_INVALID_PARAMETER;
667 }
668
669 for (Index = 0; Index < PciMappingTableMax; Index++) {
670 Data = PciTableInfo->Mapping[Index].Data;
671 if (Data != NULL) {
672 FreePool (Data);
673 }
674 }
675
676 return EFI_SUCCESS;
677}
678
721EFIAPI
723 IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle,
724 IN INT32 FdtBranch
725 )
726{
727 EFI_STATUS Status;
728 UINT32 Index;
729 INT32 PciNode;
730 UINT32 PciNodeCount;
731 PCI_PARSER_TABLE PciTableInfo;
732 VOID *Fdt;
733
734 if (FdtParserHandle == NULL) {
735 ASSERT (0);
736 return EFI_INVALID_PARAMETER;
737 }
738
739 Fdt = FdtParserHandle->Fdt;
740
741 // Only search host-pci devices.
742 // PCI Firmware Specification Revision 3.0, s4.1.2. "MCFG Table Description":
743 // "This table directly refers to PCI Segment Groups defined in the system
744 // via the _SEG object in the ACPI name space for the applicable host bridge
745 // device."
747 Fdt,
748 FdtBranch,
750 &PciNodeCount
751 );
752 if (EFI_ERROR (Status)) {
753 ASSERT (0);
754 return Status;
755 }
756
757 if (PciNodeCount == 0) {
758 return EFI_NOT_FOUND;
759 }
760
761 // Parse each host-pci node in the branch.
762 PciNode = FdtBranch;
763 for (Index = 0; Index < PciNodeCount; Index++) {
764 ZeroMem (&PciTableInfo, sizeof (PCI_PARSER_TABLE));
765
767 Fdt,
768 FdtBranch,
770 &PciNode
771 );
772 if (EFI_ERROR (Status)) {
773 ASSERT (0);
774 if (Status == EFI_NOT_FOUND) {
775 // Should have found the node.
776 Status = EFI_ABORTED;
777 }
778
779 return Status;
780 }
781
782 Status = PciNodeParser (Fdt, PciNode, &PciTableInfo);
783 if (EFI_ERROR (Status)) {
784 ASSERT (0);
785 goto error_handler;
786 }
787
788 // Add Pci information to the Configuration Manager.
789 Status = PciInfoAdd (FdtParserHandle, &PciTableInfo);
790 if (EFI_ERROR (Status)) {
791 ASSERT (0);
792 goto error_handler;
793 }
794
795 Status = FreeParserTable (&PciTableInfo);
796 if (EFI_ERROR (Status)) {
797 ASSERT (0);
798 return Status;
799 }
800 } // for
801
802 return Status;
803
804error_handler:
805 FreeParserTable (&PciTableInfo);
806 return Status;
807}
struct CmArchCommonPciInterruptMapInfo CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO
struct CmArchCommonPciAddressMapInfo CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO
@ EArchCommonObjPciAddressMapInfo
9 - Pci Address Map Info
@ EArchCommonObjPciInterruptMapInfo
10 - Pci Interrupt Map Info
@ EArchCommonObjPciConfigSpaceInfo
8 - PCI Configuration Space Info
UINT32 EFIAPI FdtGetInterruptId(UINT32 CONST *Data)
EFI_STATUS EFIAPI FdtGetIntcAddressCells(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
UINT32 EFIAPI FdtGetInterruptFlags(UINT32 CONST *Data)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI AddMultipleCmObjWithCmObjRef(IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN CM_OBJ_DESCRIPTOR *CmObjDesc, OUT CM_OBJECT_TOKEN *Token)
EFI_STATUS EFIAPI AddSingleCmObj(IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN CM_OBJECT_ID ObjectId, IN VOID *Data, IN UINT32 Size, OUT CM_OBJECT_TOKEN *Token OPTIONAL)
#define CREATE_CM_ARCH_COMMON_OBJECT_ID(ObjectId)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI FdtGetNextCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, IN OUT INT32 *Node)
Definition: FdtUtility.c:398
EFI_STATUS EFIAPI FdtGetParentAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
Definition: FdtUtility.c:833
EFI_STATUS EFIAPI FdtCountCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, OUT UINT32 *NodeCount)
Definition: FdtUtility.c:573
EFI_STATUS EFIAPI FdtGetInterruptCellsInfo(IN CONST VOID *Fdt, IN INT32 IntcNode, OUT INT32 *IntCells)
Definition: FdtUtility.c:726
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define ARRAY_SIZE(Array)
Definition: Base.h:1393
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
STATIC EFI_STATUS EFIAPI FreeParserTable(IN PCI_PARSER_TABLE *PciTableInfo)
STATIC EFI_STATUS EFIAPI GetPciSegGroup(IN CONST VOID *Fdt, IN INT32 HostPciNode, OUT INT32 *SegGroup)
STATIC EFI_STATUS EFIAPI PciNodeParser(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN OUT PCI_PARSER_TABLE *PciInfo)
STATIC CONST COMPATIBILITY_INFO PciCompatibleInfo
STATIC EFI_STATUS EFIAPI PopulateBusRange(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN OUT PCI_PARSER_TABLE *PciInfo)
STATIC EFI_STATUS EFIAPI ParseIrqMap(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN OUT PCI_PARSER_TABLE *PciInfo)
STATIC EFI_STATUS EFIAPI ParseAddressMap(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN INT32 AddressCells, IN OUT PCI_PARSER_TABLE *PciInfo)
STATIC CONST COMPATIBILITY_STR PciCompatibleStr[]
EFI_STATUS EFIAPI PciConfigInfoParser(IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch)
STATIC EFI_STATUS EFIAPI PciInfoAdd(IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN PCI_PARSER_TABLE *PciTableInfo)
#define READ_PCI_BBBBBBBB(ADDR)
Bus number.
#define READ_PCI_DDDDD(ADDR)
Device number.
@ PciMappingTableMax
2 - Max
@ PciMappingTableInterrupt
1 - Interrupt mapping
@ PciMappingTableAddress
0 - Address mapping
#define PCI_ADDRESS_CELLS
#define READ_PCI_SS(ADDR)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
CM_ARCH_COMMON_GENERIC_INTERRUPT IntcInterrupt