mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
tools/litex_server/pcie: enable pcie device if not already enabledd.
Avoid having to do it manually or through a driver.
This commit is contained in:
parent
bc5873f78c
commit
e4555df095
1 changed files with 6 additions and 0 deletions
|
@ -223,6 +223,12 @@ def main():
|
|||
exit()
|
||||
if "/sys/bus/pci/devices" not in pcie_bar:
|
||||
pcie_bar = f"/sys/bus/pci/devices/0000:{args.pcie_bar}/resource0"
|
||||
# Enable PCIe device is not already enabled.
|
||||
enable = open(pcie_bar.replace("resource0", "enable"), "r+")
|
||||
if enable.read(1) == "0":
|
||||
enable.seek(0)
|
||||
enable.write("1")
|
||||
enable.close()
|
||||
print("[CommPCIe] bar: {} / ".format(pcie_bar), end="")
|
||||
comm = CommPCIe(pcie_bar)
|
||||
elif args.usb:
|
||||
|
|
Loading…
Reference in a new issue