diff options
author | Angel Pons <th3fanbus@gmail.com> | 2024-05-13 20:07:31 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2024-08-05 08:58:32 +0000 |
commit | 2e7905b1a3557282df8d70a2a35d481d055602f9 (patch) | |
tree | 3fc4628a411da5a7752f2899e1f4df5d3f40946d /util/autoport/main.go | |
parent | ea54d3e4d03654410d673354e2d1f90dad8a7cde (diff) |
util/autoport: Put devicetree devices above chips
For Sandy/Ivy Bridge boards, this results in northbridge devices ending
up north of (above) southbridge devices. Which is the convention pretty
much all boards in the tree uses.
Change-Id: I9dc2ff13182ff9d92141b1736796749cea49d23a
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82406
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util/autoport/main.go')
-rw-r--r-- | util/autoport/main.go | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/util/autoport/main.go b/util/autoport/main.go index 8a3ee6c83e..3b085152c5 100644 --- a/util/autoport/main.go +++ b/util/autoport/main.go @@ -277,34 +277,6 @@ func MatchDev(dev *DevTreeNode) { } for _, slot := range dev.PCISlots { - slotChip, ok := unmatchedPCIChips[slot.PCIAddr] - - if !ok { - continue - } - - if slot.additionalComment != "" && slotChip.Comment != "" { - slotChip.Comment = slot.additionalComment + " " + slotChip.Comment - } else { - slotChip.Comment = slot.additionalComment + slotChip.Comment - } - - delete(unmatchedPCIChips, slot.PCIAddr) - MatchDev(&slotChip) - dev.Children = append(dev.Children, slotChip) - } - - if dev.PCIController { - for slot, slotDev := range unmatchedPCIChips { - if slot.Bus == dev.ChildPCIBus { - delete(unmatchedPCIChips, slot) - MatchDev(&slotDev) - dev.Children = append(dev.Children, slotDev) - } - } - } - - for _, slot := range dev.PCISlots { slotDev, ok := unmatchedPCIDevices[slot.PCIAddr] if !ok { if slot.writeEmpty { @@ -334,6 +306,34 @@ func MatchDev(dev *DevTreeNode) { delete(unmatchedPCIDevices, slot.PCIAddr) } + for _, slot := range dev.PCISlots { + slotChip, ok := unmatchedPCIChips[slot.PCIAddr] + + if !ok { + continue + } + + if slot.additionalComment != "" && slotChip.Comment != "" { + slotChip.Comment = slot.additionalComment + " " + slotChip.Comment + } else { + slotChip.Comment = slot.additionalComment + slotChip.Comment + } + + delete(unmatchedPCIChips, slot.PCIAddr) + MatchDev(&slotChip) + dev.Children = append(dev.Children, slotChip) + } + + if dev.PCIController { + for slot, slotDev := range unmatchedPCIChips { + if slot.Bus == dev.ChildPCIBus { + delete(unmatchedPCIChips, slot) + MatchDev(&slotDev) + dev.Children = append(dev.Children, slotDev) + } + } + } + if dev.MissingParent != "" { for _, child := range MissingChildren[dev.MissingParent] { MatchDev(&child) |