From: Florent Kermarrec Date: Fri, 29 May 2020 17:22:35 +0000 (+0200) Subject: targets: simplify Ethernet/Etherbone integration on targets with both. X-Git-Tag: 24jan2021_ls180~258 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5cc564fb8f302f7a5a37e3b6710c6baedbf9f097;p=litex.git targets: simplify Ethernet/Etherbone integration on targets with both. --- diff --git a/litex/boards/targets/arty.py b/litex/boards/targets/arty.py index 98d2e3be..fe6c8f52 100755 --- a/litex/boards/targets/arty.py +++ b/litex/boards/targets/arty.py @@ -79,21 +79,16 @@ class BaseSoC(SoCCore): l2_cache_reverse = True ) - # Ethernet --------------------------------------------------------------------------------- - if with_ethernet: + # Ethernet / Etherbone --------------------------------------------------------------------- + if with_ethernet or with_etherbone: self.submodules.ethphy = LiteEthPHYMII( clock_pads = self.platform.request("eth_clocks"), pads = self.platform.request("eth")) self.add_csr("ethphy") - self.add_ethernet(phy=self.ethphy) - - # Etherbone -------------------------------------------------------------------------------- - if with_etherbone: - self.submodules.ethphy = LiteEthPHYMII( - clock_pads = self.platform.request("eth_clocks"), - pads = self.platform.request("eth")) - self.add_csr("ethphy") - self.add_etherbone(phy=self.ethphy) + if with_ethernet: + self.add_ethernet(phy=self.ethphy) + if with_etherbone: + self.add_etherbone(phy=self.ethphy) # Leds ------------------------------------------------------------------------------------- self.submodules.leds = LedChaser( diff --git a/litex/boards/targets/genesys2.py b/litex/boards/targets/genesys2.py index 4e5e823b..5f96101c 100755 --- a/litex/boards/targets/genesys2.py +++ b/litex/boards/targets/genesys2.py @@ -70,21 +70,16 @@ class BaseSoC(SoCCore): l2_cache_reverse = True ) - # Ethernet --------------------------------------------------------------------------------- - if with_ethernet: + # Ethernet / Etherbone --------------------------------------------------------------------- + if with_ethernet or with_etherbone: self.submodules.ethphy = LiteEthPHYRGMII( clock_pads = self.platform.request("eth_clocks"), pads = self.platform.request("eth")) self.add_csr("ethphy") - self.add_ethernet(phy=self.ethphy) - - # Etherbone -------------------------------------------------------------------------------- - if with_etherbone: - self.submodules.ethphy = LiteEthPHYRGMII( - clock_pads = self.platform.request("eth_clocks"), - pads = self.platform.request("eth")) - self.add_csr("ethphy") - self.add_etherbone(phy=self.ethphy) + if with_ethernet: + self.add_ethernet(phy=self.ethphy) + if with_etherbone: + self.add_etherbone(phy=self.ethphy) # Leds ------------------------------------------------------------------------------------- self.submodules.leds = LedChaser(