@@ -13,7 +13,10 @@ use ieee.numeric_std_unsigned.all;
13
13
use work.axil_common_pkg.all ;
14
14
use work.axil26x32_pkg;
15
15
use work.axil8x32_pkg;
16
+ use work.i2c_common_pkg.all ;
17
+ use work.stream8_pkg;
16
18
use work.time_pkg.all ;
19
+ use work.tristate_if_pkg.all ;
17
20
18
21
entity grapefruit_top is
19
22
port (
@@ -244,7 +247,15 @@ architecture rtl of grapefruit_top is
244
247
signal sp5_owns_flash : std_logic ;
245
248
signal spi_nor_block_data_o : std_logic_vector (3 downto 0 );
246
249
signal spi_nor_block_data_oe : std_logic_vector (3 downto 0 );
247
-
250
+
251
+ -- TODO: remove after hacking
252
+ signal ruby_scl_if : tristate;
253
+ signal ruby_sda_if : tristate;
254
+ signal dimm_scl_if : tristate;
255
+ signal dimm_sda_if : tristate;
256
+ -- stubs
257
+ signal i2c_tx_st_if : stream8_pkg.data_channel;
258
+ signal i2c_rx_st_if : stream8_pkg.data_channel;
248
259
begin
249
260
250
261
espi_scm_to_hpm_alert_l <= 'Z' ;
@@ -570,8 +581,6 @@ begin
570
581
571
582
i3c_hpm_to_scm_dimm0_abcdef_scl <= not counter(26 );
572
583
i3c_hpm_to_scm_dimm0_abcdef_sda <= not counter(26 );
573
- i3c_hpm_to_scm_dimm0_ghijkl_scl <= not counter(26 );
574
- i3c_hpm_to_scm_dimm0_ghijkl_sda <= not counter(26 );
575
584
576
585
i3c_hpm_to_scm_dimm1_abcdef_scl <= not counter(26 );
577
586
i3c_hpm_to_scm_dimm1_abcdef_sda <= not counter(26 );
@@ -580,13 +589,45 @@ begin
580
589
581
590
i3c_scm_to_dimm0_abcdef_scl <= not counter(26 );
582
591
i3c_scm_to_dimm0_abcdef_sda <= not counter(26 );
583
- i3c_scm_to_dimm0_ghijkl_scl <= not counter(26 );
584
- i3c_scm_to_dimm0_ghijkl_sda <= not counter(26 );
585
592
586
593
i3c_scm_to_dimm1_abcdef_scl <= not counter(26 );
587
594
i3c_scm_to_dimm1_abcdef_sda <= not counter(26 );
588
595
i3c_scm_to_dimm1_ghijkl_scl <= not counter(26 );
589
596
i3c_scm_to_dimm1_ghijkl_sda <= not counter(26 );
590
597
591
-
598
+ -- -- Ruby -> Grapefruit bus
599
+ i3c_hpm_to_scm_dimm0_ghijkl_scl <= ruby_scl_if.o when ruby_scl_if.oe else 'Z' ;
600
+ ruby_scl_if.i <= i3c_hpm_to_scm_dimm0_ghijkl_scl;
601
+ i3c_hpm_to_scm_dimm0_ghijkl_sda <= ruby_sda_if.o when ruby_sda_if.oe else 'Z' ;
602
+ ruby_sda_if.i <= i3c_hpm_to_scm_dimm0_ghijkl_sda;
603
+
604
+ -- -- Grapefruit -> DIMM bus
605
+ i3c_scm_to_dimm0_ghijkl_scl <= dimm_scl_if.o when dimm_scl_if.oe else 'Z' ;
606
+ dimm_scl_if.i <= i3c_scm_to_dimm0_ghijkl_scl;
607
+ i3c_scm_to_dimm0_ghijkl_sda <= dimm_sda_if.o when dimm_sda_if.oe else 'Z' ;
608
+ dimm_sda_if.i <= i3c_scm_to_dimm0_ghijkl_sda;
609
+
610
+ spd_proxy_top_inst : entity work .spd_proxy_top
611
+ generic map (
612
+ CLK_PER_NS => 8 ,
613
+ I2C_MODE => FAST_PLUS
614
+ )
615
+ port map (
616
+ clk => clk,
617
+ reset => not reset_l,
618
+ cpu_scl_if => ruby_scl_if,
619
+ cpu_sda_if => ruby_sda_if,
620
+ dimm_scl_if => dimm_scl_if,
621
+ dimm_sda_if => dimm_sda_if,
622
+ i2c_command => (
623
+ op => RANDOM_READ,
624
+ addr => b"1010000" , -- 0x50
625
+ reg => x"80" ,
626
+ len => x"10"
627
+ ),
628
+ i2c_command_valid => '0' ,
629
+ i2c_ctrlr_idle => open ,
630
+ i2c_tx_st_if => i2c_tx_st_if,
631
+ i2c_rx_st_if => i2c_rx_st_if
632
+ );
592
633
end rtl ;
0 commit comments