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] 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)]),