Skip to content

Commit ea24194

Browse files
Changed required for cosmo rev2 sequencer stuff (#425)
A few new pins, a few choices made based on revision pins to enable functionality so that we can use rev2 and rev1 boards with the same FPGA image.
1 parent ba03a69 commit ea24194

File tree

6 files changed

+111
-6
lines changed

6 files changed

+111
-6
lines changed

hdl/projects/cosmo_seq/board_support/board_support_top.vhd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ entity board_support is
2929
hubris_compat_ver : in std_logic_vector(2 downto 0);
3030
-- AXI interface for the "info" block
3131
info_axi_if : view axil_target;
32+
is_rev1 : out std_logic; -- tied high if rev1 board
33+
is_rev2 : out std_logic -- tied high if rev2 board
3234
);
3335
end entity;
3436

@@ -41,6 +43,17 @@ architecture rtl of board_support is
4143

4244
begin
4345

46+
-- Tie off the board revision outputs
47+
-- skipping meta sync here b/c stuff is strapped on board.
48+
-- Providing registers here since there could be some fan-out.
49+
rev_indicators: process(clk_125m)
50+
begin
51+
if rising_edge(clk_125m) then
52+
is_rev1 <= '1' when unsigned(hubris_compat_ver) = 0 else '0'; -- rev1 board
53+
is_rev2 <= '1' when unsigned(hubris_compat_ver) = 1 else '0'; -- rev2 board
54+
end if;
55+
end process;
56+
4457
-- We have a reset pin coming in from the SP. Synchronize it first
4558
-- using the "raw" board clock, pre-PLL. We'll use this as the
4659
-- reset to the PLL, and the aclr the down-stream clocks

hdl/projects/cosmo_seq/cosmo_seq_pins.xdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,12 @@ set_property -dict { PACKAGE_PIN V12 IOSTANDARD LVCMOS33 } [get_ports { vddio_sp
281281
set_property -dict { PACKAGE_PIN C8 IOSTANDARD LVCMOS33 } [get_ports { vr_v1p8_sys_to_fpga1_alert_l }];
282282
set_property -dict { PACKAGE_PIN A6 IOSTANDARD LVCMOS33 } [get_ports { vr_v3p3_sys_to_fpga1_alert_l }];
283283
set_property -dict { PACKAGE_PIN B8 IOSTANDARD LVCMOS33 } [get_ports { vr_v5p0_sys_to_fpga1_alert_l }];
284+
# New pins for cosmo rev2 only
285+
set_property -dict { PACKAGE_PIN AA15 IOSTANDARD LVCMOS33 } [get_ports { i2c_sp5_sec_v3p3_scl }];
286+
set_property -dict { PACKAGE_PIN AA16 IOSTANDARD LVCMOS33 } [get_ports { i2c_sp5_sec_v3p3_sda }];
287+
set_property -dict { PACKAGE_PIN W8 IOSTANDARD LVCMOS18 } [get_ports { v1p1_i3c_a2_pg }];
288+
set_property -dict { PACKAGE_PIN R19 IOSTANDARD LVCMOS33 } [get_ports { v1p4_nic_a0hp_pg }];
289+
set_property -dict { PACKAGE_PIN E22 IOSTANDARD LVCMOS33 } [get_ports { uart_fpga1_to_debug_dat }];
290+
set_property -dict { PACKAGE_PIN D22 IOSTANDARD LVCMOS33 } [get_ports { uart_debug_to_fpga1_dat }];
291+
set_property -dict { PACKAGE_PIN F21 IOSTANDARD LVCMOS33 } [get_ports { uart_fpga1_to_debug_rts_l }];
292+
set_property -dict { PACKAGE_PIN F22 IOSTANDARD LVCMOS33 } [get_ports { uart_debug_to_fpga1_rts_l }];

hdl/projects/cosmo_seq/cosmo_seq_top.vhd

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ entity cosmo_seq_top is
162162
pwr_cont1_to_fpga1_vddio_sp5_pg : in std_logic;
163163
pwr_fpga1_to_v1p5_sp5_rtc_a2_en : out std_logic;
164164
pwr_v1p5_sp5_rtc_a2_to_fpga1_pg : in std_logic;
165+
v1p1_i3c_a2_pg : in std_logic; -- only rev2+
166+
v1p4_nic_a0hp_pg : in std_logic; -- only rev2+
165167
sp5_to_fpga1_pwrgd_out : in std_logic; -- spare readback from SP5
166168
sp5_to_fpga1_pwrok_unbuf : in std_logic;
167169
sp5_to_fpga1_slp_s3_l : in std_logic;
@@ -253,6 +255,9 @@ entity cosmo_seq_top is
253255
-- I2C SP mux stuff
254256
i2c_sp_to_fpga1_scl : inout std_logic;
255257
i2c_sp_to_fpga1_sda : inout std_logic;
258+
--I2C SP5 SEC stuff (rev2+ only)
259+
i2c_sp5_sec_v3p3_scl : inout std_logic;
260+
i2c_sp5_sec_v3p3_sda : inout std_logic;
256261

257262
fpga1_to_i2c_mux1_sel : out std_logic_vector(1 downto 0);
258263
fpga1_to_i2c_mux2_sel : out std_logic_vector(1 downto 0);
@@ -301,6 +306,12 @@ entity cosmo_seq_top is
301306
uart_local_sp_to_fpga1_dat : in std_logic;
302307
uart_local_sp_to_fpga1_rts_l : in std_logic;
303308

309+
-- Dedicated UART connector rev2+
310+
uart_fpga1_to_debug_dat : out std_logic;
311+
uart_debug_to_fpga1_dat : in std_logic;
312+
uart_fpga1_to_debug_rts_l : out std_logic;
313+
uart_debug_to_fpga1_rts_l : in std_logic;
314+
304315
-- What to do with this stuff?, some maybe removed?
305316
v1p2_fpga2_a2_pg : in std_logic;
306317
v2p5_fpga2_a2_pg : in std_logic;
@@ -392,6 +403,11 @@ architecture rtl of cosmo_seq_top is
392403
signal allow_backplane_pcie_clk : std_logic;
393404
signal nic_dbg_pins : t6_debug_if;
394405
signal reg_alert_l_pins : seq_power_alert_pins_t;
406+
signal is_rev1 : std_logic;
407+
signal dbg_pins_uart_out : std_logic;
408+
signal dbg_pins_uart_out_rts_l : std_logic;
409+
signal dbg_pins_uart_in : std_logic;
410+
signal dbg_pins_uart_in_rts_l : std_logic;
395411

396412
begin
397413

@@ -401,6 +417,10 @@ begin
401417
clk => clk_125m,
402418
sycnd_output => fpga2_hp_irq_n
403419
);
420+
421+
-- SP5 SEC (not available on rev1 cosmo, not yet implemented for rev2!)
422+
i2c_sp5_sec_v3p3_scl <= 'Z';
423+
i2c_sp5_sec_v3p3_sda <= 'Z';
404424
-- misc things tied:
405425
fpga1_to_fpga2_io <= (others => 'Z');
406426
fpga1_to_sp5_sys_reset_l <= 'Z'; -- We don't use this in product, external PU.
@@ -412,8 +432,14 @@ begin
412432
fpga1_uart0_buff_oe_en_l <= '0' when a0_ok else '1';
413433
fpga1_uart1_buff_oe_en_l <= '0' when a0_ok else '1'; -- not used but why not enable anyway?
414434
uart1_fpga1_to_sp5_dat_buff <= '1'; -- Make this idle generally, buffer protects from cross-drive
435+
415436
i3c_sp5_to_fpga1_oe_l <= '0' when sp5_seq_pins.pwr_good else '1';
416-
i3c_fpga1_to_dimm_oe_l <= '0' when sp5_seq_pins.pwr_good else '1';
437+
-- Rev1 cosmo board had a hw bug where one side of the i2c buffers was driven in an A1/A0 domain,
438+
-- preventing access to the DDR SPD EEPROMs until the system was fully powered on. We gate rev1
439+
-- board by the power-good (in A0) signal to prevent hanging the bus in that case, but rev2+ boards
440+
-- don't have this problem so we can immediately enable them regardless of the SP5 power state which
441+
-- is the desired system behavior.
442+
i3c_fpga1_to_dimm_oe_l <= '0' when (not is_rev1) or sp5_seq_pins.pwr_good else '1';
417443

418444
---------------------------------------------
419445
-- FMC to AXI Interface from the SP
@@ -468,7 +494,8 @@ begin
468494
reset_fmc => reset_fmc,
469495
fpga1_status_led => fpga1_status_led,
470496
hubris_compat_ver => seq_rev_id,
471-
info_axi_if => responders(INFO_RESP_IDX)
497+
info_axi_if => responders(INFO_RESP_IDX),
498+
is_rev1 => is_rev1 -- tied high if rev1 board
472499
);
473500

474501
-- espi and flash interface block
@@ -538,12 +565,40 @@ begin
538565
ipcc_from_espi => ipcc_uart_from_espi_axi_st,
539566
ipcc_to_espi => ipcc_uart_to_espi_axi_st,
540567
--
541-
dbg_pins_uart_out => fpga1_spare_v3p3_7,
542-
dbg_pins_uart_out_rts_l => fpga1_spare_v3p3_4,
543-
dbg_pins_uart_in => fpga1_spare_v3p3_5,
544-
dbg_pins_uart_in_rts_l => fpga1_spare_v3p3_6
568+
dbg_pins_uart_out => dbg_pins_uart_out,
569+
dbg_pins_uart_out_rts_l => dbg_pins_uart_out_rts_l,
570+
dbg_pins_uart_in => dbg_pins_uart_in,
571+
dbg_pins_uart_in_rts_l => dbg_pins_uart_in_rts_l
545572
);
546573

574+
-- Cosmo UART debug mux.
575+
-- Comso rev2+ has a dedicated UART port on the board, use that for rev2+
576+
process(all)
577+
begin
578+
if is_rev1 then
579+
-- Use spare dbg pins for UART
580+
fpga1_spare_v3p3_6 <= dbg_pins_uart_in_rts_l;
581+
fpga1_spare_v3p3_7 <= dbg_pins_uart_out;
582+
dbg_pins_uart_in <= fpga1_spare_v3p3_5;
583+
dbg_pins_uart_out_rts_l <= fpga1_spare_v3p3_4;
584+
-- Un-used and unaccessible in rev1
585+
uart_fpga1_to_debug_dat <= 'Z';
586+
uart_fpga1_to_debug_rts_l <= 'Z';
587+
else
588+
-- Give a tri-state driver here to prevent latches
589+
fpga1_spare_v3p3_6 <= 'Z';
590+
fpga1_spare_v3p3_7 <= 'Z';
591+
-- Dedicated UART connector rev2+
592+
uart_fpga1_to_debug_dat <= dbg_pins_uart_out;
593+
dbg_pins_uart_in <= uart_debug_to_fpga1_dat;
594+
uart_fpga1_to_debug_rts_l <= dbg_pins_uart_in_rts_l;
595+
dbg_pins_uart_out_rts_l <= uart_debug_to_fpga1_rts_l;
596+
597+
end if;
598+
599+
end process;
600+
601+
547602
-- SP I2C muxes
548603
-- i2c is the only input, sycn'd inside the mux block(s)
549604
sp_i2c_subsystem_inst: entity work.sp_i2c_subsystem
@@ -798,6 +853,9 @@ begin
798853
-- sp
799854
i2c_sp_to_fpga1_scl => i2c_sp_to_fpga1_scl,
800855
i2c_sp_to_fpga1_sda => i2c_sp_to_fpga1_sda,
856+
-- sp5 i2c
857+
i2c_sp5_sec_to_fpga1_scl => i2c_sp5_sec_v3p3_scl,
858+
i2c_sp5_sec_to_fpga1_sda => i2c_sp5_sec_v3p3_sda,
801859
-- dimms
802860
i3c_sp5_to_fpga1_abcdef_scl => i3c_sp5_to_fpga1_abcdef_scl,
803861
i3c_sp5_to_fpga1_abcdef_sda => i3c_sp5_to_fpga1_abcdef_sda,

hdl/projects/cosmo_seq/debug_module/debug_header.vhd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ entity debug_header is
2525
-- sp
2626
i2c_sp_to_fpga1_scl: in std_logic;
2727
i2c_sp_to_fpga1_sda: in std_logic;
28+
-- sp5 sec i2c
29+
i2c_sp5_sec_to_fpga1_scl : in std_logic;
30+
i2c_sp5_sec_to_fpga1_sda : in std_logic;
2831
-- dimms
2932
i3c_sp5_to_fpga1_abcdef_scl: in std_logic;
3033
i3c_sp5_to_fpga1_abcdef_sda: in std_logic;
@@ -74,6 +77,8 @@ architecture rtl of debug_header is
7477
signal i3c_fpga1_to_dimm_abcdef_sda_int: std_logic;
7578
signal i3c_fpga1_to_dimm_ghijkl_scl_int: std_logic;
7679
signal i3c_fpga1_to_dimm_ghijkl_sda_int: std_logic;
80+
signal i2c_sp5_sec_to_fpga1_scl_int :std_logic;
81+
signal i2c_sp5_sec_to_fpga1_sda_int : std_logic;
7782
signal uart1_sp_to_fpga1_dat_int : std_logic;
7883
signal uart1_fpga1_to_sp_dat_int : std_logic;
7984
signal uart0_sp_to_fpga1_dat_int : std_logic;
@@ -101,6 +106,8 @@ sample_reg: process(clk_200m, reset_200m)
101106
i2c_sp_to_fpga1_scl_int <= i2c_sp_to_fpga1_scl;
102107
i2c_sp5_to_fpgax_hp_sda_int <= i2c_sp5_to_fpgax_hp_sda;
103108
i2c_sp5_to_fpgax_hp_scl_int <= i2c_sp5_to_fpgax_hp_scl;
109+
i2c_sp5_sec_to_fpga1_scl_int <= i2c_sp5_sec_to_fpga1_scl;
110+
i2c_sp5_sec_to_fpga1_sda_int <= i2c_sp5_sec_to_fpga1_sda;
104111
i3c_sp5_to_fpga1_abcdef_scl_int <= i3c_sp5_to_fpga1_abcdef_scl;
105112
i3c_sp5_to_fpga1_abcdef_sda_int <= i3c_sp5_to_fpga1_abcdef_sda;
106113
i3c_sp5_to_fpga1_ghijkl_scl_int <= i3c_sp5_to_fpga1_ghijkl_scl;
@@ -202,6 +209,9 @@ hdr_dbg_reg_1v8: process(clk_200m, reset_200m)
202209
-- Mux3 select pins
203210
fpga1_spare_reg(7) <= mux3_sel_int(1);
204211
fpga1_spare_reg(6) <= mux3_sel_int(0);
212+
when I2C_SP5_SEC_BUS =>
213+
fpga1_spare_reg(7) <= i2c_sp5_sec_to_fpga1_scl_int;
214+
fpga1_spare_reg(6) <= i2c_sp5_sec_to_fpga1_sda_int;
205215
when others =>
206216
-- Default case, do nothing
207217
fpga1_spare_reg(7 downto 6) <= (others => '0');
@@ -254,6 +264,9 @@ hdr_dbg_reg_1v8: process(clk_200m, reset_200m)
254264
-- Mux3 select pins
255265
fpga1_spare_reg(5) <= mux3_sel_int(1);
256266
fpga1_spare_reg(4) <= mux3_sel_int(0);
267+
when I2C_SP5_SEC_BUS =>
268+
fpga1_spare_reg(5) <= i2c_sp5_sec_to_fpga1_scl_int;
269+
fpga1_spare_reg(4) <= i2c_sp5_sec_to_fpga1_sda_int;
257270
when others =>
258271
-- Default case, do nothing
259272
fpga1_spare_reg(5 downto 4) <= (others => '0');
@@ -302,6 +315,9 @@ hdr_dbg_reg_1v8: process(clk_200m, reset_200m)
302315
when MUX3_SEL =>
303316
fpga1_spare_reg(3) <= mux3_sel_int(1);
304317
fpga1_spare_reg(2) <= mux3_sel_int(0);
318+
when I2C_SP5_SEC_BUS =>
319+
fpga1_spare_reg(3) <= i2c_sp5_sec_to_fpga1_scl_int;
320+
fpga1_spare_reg(2) <= i2c_sp5_sec_to_fpga1_sda_int;
305321
when others =>
306322
-- Default case, do nothing
307323
fpga1_spare_reg(3 downto 2) <= (others => '0');
@@ -351,6 +367,9 @@ hdr_dbg_reg_1v8: process(clk_200m, reset_200m)
351367
when MUX3_SEL =>
352368
fpga1_spare_reg(1) <= mux3_sel_int(1);
353369
fpga1_spare_reg(0) <= mux3_sel_int(0);
370+
when I2C_SP5_SEC_BUS =>
371+
fpga1_spare_reg(1) <= i2c_sp5_sec_to_fpga1_scl_int;
372+
fpga1_spare_reg(0) <= i2c_sp5_sec_to_fpga1_sda_int;
354373
when others =>
355374
-- Default case, do nothing
356375
fpga1_spare_reg(1 downto 0) <= (others => '0');

hdl/projects/cosmo_seq/debug_module/debug_module_top.vhd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ entity debug_module_top is
3636
-- sp
3737
i2c_sp_to_fpga1_scl: in std_logic;
3838
i2c_sp_to_fpga1_sda: in std_logic;
39+
-- sp5 sec i2c
40+
i2c_sp5_sec_to_fpga1_scl : in std_logic;
41+
i2c_sp5_sec_to_fpga1_sda : in std_logic;
3942
-- dimms
4043
i3c_sp5_to_fpga1_abcdef_scl: in std_logic;
4144
i3c_sp5_to_fpga1_abcdef_sda: in std_logic;
@@ -94,6 +97,8 @@ begin
9497
i2c_sp5_to_fpgax_hp_scl => i2c_sp5_to_fpgax_hp_scl,
9598
i2c_sp_to_fpga1_scl => i2c_sp_to_fpga1_scl,
9699
i2c_sp_to_fpga1_sda => i2c_sp_to_fpga1_sda,
100+
i2c_sp5_sec_to_fpga1_scl => i2c_sp5_sec_to_fpga1_scl,
101+
i2c_sp5_sec_to_fpga1_sda => i2c_sp5_sec_to_fpga1_sda,
97102
i3c_sp5_to_fpga1_abcdef_scl => i3c_sp5_to_fpga1_abcdef_scl,
98103
i3c_sp5_to_fpga1_abcdef_sda => i3c_sp5_to_fpga1_abcdef_sda,
99104
i3c_sp5_to_fpga1_ghijkl_scl => i3c_sp5_to_fpga1_ghijkl_scl,

hdl/projects/cosmo_seq/debug_module/debug_regs.rdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ addrmap debug_regs {
127127
mux1_sel = 8'h0c {desc = "Mux1 sel pins debug output to pins";};
128128
mux2_sel = 8'h0d {desc = "Mux2 sel pins debug output to pins";};
129129
mux3_sel = 8'h0e {desc = "Mux3 sel pins debug output to pins";};
130+
i2c_sp5_sec_bus = 8'h0f {desc = "SP5 -> FPGA sec i2c bus to pins";};
130131
};
131132
field {
132133
desc = "Selects which debug output is sent to the 1v8 debug header in sets of two pins.

0 commit comments

Comments
 (0)