Skip to content

Commit

Permalink
gateware.platform: add apollo_gateware_phy to LUNAApolloPlatform (#269)
Browse files Browse the repository at this point in the history
Adds the apollo_gateware_phy property to LUNAApolloPlatform to specify
the preferred USB PHY for Apollo gateware.

When the platform does not share a port with Apollo, it defaults to
default_usb_connection.
  • Loading branch information
mndza authored Jul 5, 2024
1 parent 160f06d commit 09eb1f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions luna/gateware/platform/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def port_sharing(self, phy_name):
sharing = getattr(self, "apollo_port_sharing", {})
return sharing.get(phy_name, None)


@property
def apollo_gateware_phy(self):
""" Returns the USB PHY for Apollo gateware. """

sharing = getattr(self, "apollo_port_sharing", {})
if len(sharing) == 0:
return self.default_usb_connection
return list(sharing.keys())[0]


def toolchain_program(self, products, name):
""" Programs the relevant LUNA board via its sideband connection. """

Expand Down

0 comments on commit 09eb1f6

Please sign in to comment.