|
From: openocd-gerrit <ope...@us...> - 2024-01-13 14:48:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via c7073853ebcbb8a94af0ef405cb05f94b7fd02e5 (commit)
from 995a7af21d6f97f628382e26dc21dc38e4fa846e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c7073853ebcbb8a94af0ef405cb05f94b7fd02e5
Author: Ahmed BOUDJELIDA <abo...@na...>
Date: Wed Nov 29 15:21:27 2023 +0100
contrib/firmware: Add direction control for 'SCL' i2c signal
We want to keep the tri-state buffers located between the FPGA
and the board, in 'Z' state until we launch an i2c connection.
We launch an i2c start condition, make the SCL
direction 'OUT' to start the i2c protocol and at the end
of the i2c connection at the stop condition, we re-make
the tri-state buffers at 'Z' state.
Change-Id: Ic597a70d0427832547f6b539864c24ce20a18c64
Signed-off-by: Ahmed BOUDJELIDA <abo...@na...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7989
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/contrib/firmware/angie/c/include/io.h b/contrib/firmware/angie/c/include/io.h
index af488f4ed..19289d11d 100644
--- a/contrib/firmware/angie/c/include/io.h
+++ b/contrib/firmware/angie/c/include/io.h
@@ -66,7 +66,7 @@
#define PIN_SDA IOD0
#define PIN_SCL IOD1
#define PIN_SDA_DIR IOD2
-/* PD3 Not Connected */
+#define PIN_SCL_DIR IOD3
/* PD4 Not Connected */
/* PD5 Not Connected */
/* PD6 Not Connected */
diff --git a/contrib/firmware/angie/c/src/i2c.c b/contrib/firmware/angie/c/src/i2c.c
index 53840100b..10a463bf7 100644
--- a/contrib/firmware/angie/c/src/i2c.c
+++ b/contrib/firmware/angie/c/src/i2c.c
@@ -14,6 +14,9 @@
void start_cd(void)
{
+ PIN_SCL_DIR = 0;
+ PIN_SDA_DIR = 0;
+ delay_us(10);
PIN_SDA = 0; //SDA = 1;
delay_us(1);
PIN_SCL = 0; //SCL = 1;
@@ -40,6 +43,10 @@ void stop_cd(void)
delay_us(1);
PIN_SDA = 1;
delay_us(1);
+ PIN_SDA_DIR = 1;
+ delay_us(1);
+ PIN_SCL_DIR = 1;
+ delay_us(1);
}
void clock_cd(void)
diff --git a/contrib/firmware/angie/c/src/usb.c b/contrib/firmware/angie/c/src/usb.c
index 1b7aa4765..de1964130 100644
--- a/contrib/firmware/angie/c/src/usb.c
+++ b/contrib/firmware/angie/c/src/usb.c
@@ -886,9 +886,6 @@ void io_init(void)
PORTACFG = 0x01; /* 0: normal ou 1: alternate function (each bit) */
OEA = 0xEF; /* all OUT exept INIT_B IN */
IOA = 0xFF;
- PIN_RDWR_B = 1;
- PIN_CSI_B = 1;
- PIN_PROGRAM_B = 1;
/* PORT B */
OEB = 0xEF; /* all OUT exept TDO */
@@ -899,8 +896,6 @@ void io_init(void)
PIN_TDI = 0;
PIN_SRST = 1;
-
-
/* PORT C */
PORTCCFG = 0x00; /* 0: normal ou 1: alternate function (each bit) */
OEC = 0xFF;
@@ -909,5 +904,4 @@ void io_init(void)
/* PORT D */
OED = 0xFF;
IOD = 0xFF;
- PIN_SDA_DIR = 0;
}
diff --git a/contrib/firmware/angie/hdl/src/angie_bitstream.ucf b/contrib/firmware/angie/hdl/src/angie_bitstream.ucf
index 92a89c99e..9eb0c85c3 100644
--- a/contrib/firmware/angie/hdl/src/angie_bitstream.ucf
+++ b/contrib/firmware/angie/hdl/src/angie_bitstream.ucf
@@ -20,6 +20,7 @@ net SRST LOC = 'P61' ;
net SDA LOC = 'P50' ;
net SCL LOC = 'P51' ;
net SDA_DIR LOC = 'P56' ;
+net SCL_DIR LOC = 'P57' ;
net SI_TDO LOC = 'P16' ;
net SO_TRST LOC = 'P32' ;
diff --git a/contrib/firmware/angie/hdl/src/angie_bitstream.vhd b/contrib/firmware/angie/hdl/src/angie_bitstream.vhd
index 21ddb844a..6004bf2ff 100644
--- a/contrib/firmware/angie/hdl/src/angie_bitstream.vhd
+++ b/contrib/firmware/angie/hdl/src/angie_bitstream.vhd
@@ -26,8 +26,9 @@ entity S609 is port(
SDA : inout std_logic;
SDA_DIR : in std_logic;
SCL : in std_logic;
+ SCL_DIR : in std_logic;
- FTP : out std_logic_vector(7 downto 0):=(others => '1'); -- Test points
+ FTP : out std_logic_vector(7 downto 0); -- Test points
SI_TDO : in std_logic;
ST_0 : out std_logic;
ST_1 : out std_logic;
@@ -55,8 +56,6 @@ begin
ST_0 <= '0';
ST_1 <= '1';
-ST_4 <= '0';
-
--TDO:
TDO <= not SI_TDO;
@@ -75,13 +74,21 @@ SO_SDA_OUT <= SDA;
process(SDA_DIR)
begin
- if(SDA_DIR = '1') then
- ST_5 <= '1';
- else
+ if(SDA_DIR = '0') then
ST_5 <= '0';
+ else
+ ST_5 <= '1';
end if;
end process;
+process(SCL_DIR)
+begin
+ if(SCL_DIR = '0') then
+ ST_4 <= '0';
+ else
+ ST_4 <= '1';
+ end if;
+end process;
--Points de test:
FTP(0) <= SDA;
diff --git a/src/jtag/drivers/angie/angie_bitstream.bit b/src/jtag/drivers/angie/angie_bitstream.bit
index aebd3700b..7b3a88f7c 100644
Binary files a/src/jtag/drivers/angie/angie_bitstream.bit and b/src/jtag/drivers/angie/angie_bitstream.bit differ
diff --git a/src/jtag/drivers/angie/angie_firmware.bin b/src/jtag/drivers/angie/angie_firmware.bin
index da69631d9..23c4a8234 100644
Binary files a/src/jtag/drivers/angie/angie_firmware.bin and b/src/jtag/drivers/angie/angie_firmware.bin differ
-----------------------------------------------------------------------
Summary of changes:
contrib/firmware/angie/c/include/io.h | 2 +-
contrib/firmware/angie/c/src/i2c.c | 7 +++++++
contrib/firmware/angie/c/src/usb.c | 6 ------
contrib/firmware/angie/hdl/src/angie_bitstream.ucf | 1 +
contrib/firmware/angie/hdl/src/angie_bitstream.vhd | 19 +++++++++++++------
src/jtag/drivers/angie/angie_bitstream.bit | Bin 340704 -> 340704 bytes
src/jtag/drivers/angie/angie_firmware.bin | Bin 10158 -> 10256 bytes
7 files changed, 22 insertions(+), 13 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|