* @disabled: is device disabled.
* @late_init_done: is late init stage was done during initialization.
* @hwmon_initialized: is H/W monitor sensors was initialized.
- * @heartbeat: is heartbeat sanity check towards CPU-CP enabled.
* @reset_on_lockup: true if a reset should be done in case of stuck CS, false
* otherwise.
* @dram_default_page_mapping: is DRAM default page mapping enabled.
* @is_compute_ctx_active: Whether there is an active compute context executing.
* @compute_ctx_in_release: true if the current compute context is being released.
* @supports_mmu_prefetch: true if prefetch is supported, otherwise false.
+ * @reset_upon_device_release: reset the device when the user closes the file descriptor of the
+ * device.
+ * @nic_ports_mask: Controls which NIC ports are enabled. Used only for testing.
+ * @fw_components: Controls which f/w components to load to the device. There are multiple f/w
+ * stages and sometimes we want to stop at a certain stage. Used only for testing.
+ * @mmu_enable: Whether to enable or disable the device MMU(s). Used only for testing.
+ * @cpu_queues_enable: Whether to enable queues communication vs. the f/w. Used only for testing.
+ * @pldm: Whether we are running in Palladium environment. Used only for testing.
+ * @hard_reset_on_fw_events: Whether to do device hard-reset when a fatal event is received from
+ * the f/w. Used only for testing.
+ * @bmc_enable: Whether we are running in a box with BMC. Used only for testing.
+ * @reset_on_preboot_fail: Whether to reset the device if preboot f/w fails to load.
+ * Used only for testing.
+ * @heartbeat: Controls if we want to enable the heartbeat mechanism vs. the f/w, which verifies
+ * that the f/w is always alive. Used only for testing.
*/
struct hl_device {
struct pci_dev *pdev;
u8 disabled;
u8 late_init_done;
u8 hwmon_initialized;
- u8 heartbeat;
u8 reset_on_lockup;
u8 dram_default_page_mapping;
u8 memory_scrub;
u8 is_compute_ctx_active;
u8 compute_ctx_in_release;
u8 supports_mmu_prefetch;
+ u8 reset_upon_device_release;
/* Parameters for bring-up */
u64 nic_ports_mask;
u64 fw_components;
u8 mmu_enable;
- u8 mmu_huge_page_opt;
- u8 reset_pcilink;
u8 cpu_queues_enable;
u8 pldm;
- u8 sram_scrambler_enable;
- u8 dram_scrambler_enable;
u8 hard_reset_on_fw_events;
u8 bmc_enable;
u8 reset_on_preboot_fail;
- u8 reset_upon_device_release;
- u8 reset_if_device_not_idle;
+ u8 heartbeat;
};
if (gaudi->hw_cap_initialized & HW_CAP_SRAM_SCRAMBLER)
return;
- if (!hdev->sram_scrambler_enable)
- return;
-
WREG32(mmNIF_RTR_CTRL_0_SCRAM_SRAM_EN,
1 << IF_RTR_CTRL_SCRAM_SRAM_EN_VAL_SHIFT);
WREG32(mmNIF_RTR_CTRL_1_SCRAM_SRAM_EN,
if (gaudi->hw_cap_initialized & HW_CAP_HBM_SCRAMBLER)
return;
- if (!hdev->dram_scrambler_enable)
- return;
-
WREG32(mmNIF_RTR_CTRL_0_SCRAM_HBM_EN,
1 << IF_RTR_CTRL_SCRAM_HBM_EN_VAL_SHIFT);
WREG32(mmNIF_RTR_CTRL_1_SCRAM_HBM_EN,
WREG32(mmDMA_IF_W_S_DOWN_CH1_E2E_PCI_WR_SIZE, 162);
WREG32(mmDMA_IF_W_S_DOWN_CH1_E2E_PCI_RD_SIZE, 338);
- if (!hdev->dram_scrambler_enable) {
- WREG32(mmSIF_RTR_CTRL_0_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_0_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_1_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_1_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_1_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_2_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_2_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_2_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_2_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_3_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_3_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_3_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_3_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_4_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_4_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_4_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_4_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_5_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_5_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_5_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_5_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_6_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_6_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_6_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_6_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmSIF_RTR_CTRL_7_NL_HBM_SEL_0, 0x21);
- WREG32(mmSIF_RTR_CTRL_7_NL_HBM_SEL_1, 0x22);
- WREG32(mmSIF_RTR_CTRL_7_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmSIF_RTR_CTRL_7_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_0_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_0_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_1_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_1_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_1_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_2_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_2_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_2_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_2_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_3_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_3_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_3_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_3_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_4_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_4_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_4_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_4_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_5_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_5_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_5_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_5_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_6_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_6_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_6_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_6_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmNIF_RTR_CTRL_7_NL_HBM_SEL_0, 0x21);
- WREG32(mmNIF_RTR_CTRL_7_NL_HBM_SEL_1, 0x22);
- WREG32(mmNIF_RTR_CTRL_7_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmNIF_RTR_CTRL_7_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_E_N_DOWN_CH0_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_E_N_DOWN_CH0_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_E_N_DOWN_CH0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_E_N_DOWN_CH0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_E_N_DOWN_CH1_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_E_N_DOWN_CH1_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_E_N_DOWN_CH1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_E_N_DOWN_CH1_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_E_S_DOWN_CH0_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_E_S_DOWN_CH0_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_E_S_DOWN_CH0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_E_S_DOWN_CH0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_E_S_DOWN_CH1_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_E_S_DOWN_CH1_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_E_S_DOWN_CH1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_E_S_DOWN_CH1_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_W_N_DOWN_CH0_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_W_N_DOWN_CH0_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_W_N_DOWN_CH0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_W_N_DOWN_CH0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_W_N_DOWN_CH1_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_W_N_DOWN_CH1_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_W_N_DOWN_CH1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_W_N_DOWN_CH1_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_W_S_DOWN_CH0_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_W_S_DOWN_CH0_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_W_S_DOWN_CH0_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_W_S_DOWN_CH0_NL_HBM_PC_SEL_3, 0x20);
-
- WREG32(mmDMA_IF_W_S_DOWN_CH1_NL_HBM_SEL_0, 0x21);
- WREG32(mmDMA_IF_W_S_DOWN_CH1_NL_HBM_SEL_1, 0x22);
- WREG32(mmDMA_IF_W_S_DOWN_CH1_NL_HBM_OFFSET_18, 0x1F);
- WREG32(mmDMA_IF_W_S_DOWN_CH1_NL_HBM_PC_SEL_3, 0x20);
- }
-
WREG32(mmSIF_RTR_CTRL_0_E2E_HBM_EN,
1 << IF_RTR_CTRL_E2E_HBM_EN_VAL_SHIFT);
WREG32(mmSIF_RTR_CTRL_0_E2E_PCI_EN,
WREG32(mmMMU_UP_MMU_ENABLE, 1);
WREG32(mmMMU_UP_SPI_MASK, 0xF);
- WREG32(mmSTLB_HOP_CONFIGURATION,
- hdev->mmu_huge_page_opt ? 0x30440 : 0x40440);
+ WREG32(mmSTLB_HOP_CONFIGURATION, 0x30440);
/*
* The H/W expects the first PI after init to be 1. After wraparound