From ac1f1cd6a7372154014b86b4f6778710689f9739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Wed, 27 May 2020 12:47:43 +0200 Subject: [PATCH 1/2] zcu104: add I2C --- litex_boards/platforms/zcu104.py | 6 ++++++ litex_boards/targets/zcu104.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/litex_boards/platforms/zcu104.py b/litex_boards/platforms/zcu104.py index 29cc614..72a2e14 100644 --- a/litex_boards/platforms/zcu104.py +++ b/litex_boards/platforms/zcu104.py @@ -43,6 +43,12 @@ _io = [ IOStandard("LVCMOS18") ), + ("i2c", 1, + Subsignal("sda", Pins("P12")), + Subsignal("scl", Pins("N12")), + IOStandard("LVCMOS33") + ), + ("ddram", 0, Subsignal("a", Pins( "AH16 AG14 AG15 AF15 AF16 AJ14 AH14 AF17", diff --git a/litex_boards/targets/zcu104.py b/litex_boards/targets/zcu104.py index d77a728..a4c2193 100755 --- a/litex_boards/targets/zcu104.py +++ b/litex_boards/targets/zcu104.py @@ -16,6 +16,7 @@ from litex.soc.integration.soc_core import * from litex.soc.integration.soc_sdram import * from litex.soc.integration.builder import * from litex.soc.cores.led import LedChaser +from litex.soc.cores.bitbang import I2CMaster from litedram.modules import MTA4ATF51264HZ from litedram.phy import usddrphy @@ -77,6 +78,9 @@ class BaseSoC(SoCCore): l2_cache_reverse = True ) + self.submodules.i2c = I2CMaster(platform.request("i2c", 1)) + self.add_csr("i2c") + # Leds ------------------------------------------------------------------------------------- self.submodules.leds = LedChaser( pads = Cat(*[platform.request("user_led", i) for i in range(4)]), From e5578a1ae83dd83785f43d6c216ba73144aeb83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Wed, 27 May 2020 14:31:22 +0200 Subject: [PATCH 2/2] zcu104/platform: change I2C number to 0 --- litex_boards/platforms/zcu104.py | 2 +- litex_boards/targets/zcu104.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litex_boards/platforms/zcu104.py b/litex_boards/platforms/zcu104.py index 72a2e14..cabfc22 100644 --- a/litex_boards/platforms/zcu104.py +++ b/litex_boards/platforms/zcu104.py @@ -43,7 +43,7 @@ _io = [ IOStandard("LVCMOS18") ), - ("i2c", 1, + ("i2c", 0, Subsignal("sda", Pins("P12")), Subsignal("scl", Pins("N12")), IOStandard("LVCMOS33") diff --git a/litex_boards/targets/zcu104.py b/litex_boards/targets/zcu104.py index a4c2193..fcf6014 100755 --- a/litex_boards/targets/zcu104.py +++ b/litex_boards/targets/zcu104.py @@ -78,7 +78,7 @@ class BaseSoC(SoCCore): l2_cache_reverse = True ) - self.submodules.i2c = I2CMaster(platform.request("i2c", 1)) + self.submodules.i2c = I2CMaster(platform.request("i2c")) self.add_csr("i2c") # Leds -------------------------------------------------------------------------------------