@@ -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
396412begin
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,
0 commit comments