Commit 378b02dc authored by Ohad Sharabi's avatar Ohad Sharabi Committed by Greg Kroah-Hartman

habanalabs: set non-0 value in dram default page size

Looking forward we will need to report to the user what is the default
page size used.

This will be done more conveniently by explicitly updating the property
rather than to rely on a "0 meaning default" value.
Signed-off-by: default avatarOhad Sharabi <osharabi@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cafada1f
...@@ -528,6 +528,10 @@ struct hl_hints_range { ...@@ -528,6 +528,10 @@ struct hl_hints_range {
* @fw_app_cpu_boot_dev_sts1: bitmap representation of application security * @fw_app_cpu_boot_dev_sts1: bitmap representation of application security
* status reported by FW, bit description can be * status reported by FW, bit description can be
* found in CPU_BOOT_DEV_STS1 * found in CPU_BOOT_DEV_STS1
* @device_mem_alloc_default_page_size: may be different than dram_page_size only for ASICs for
* which the property supports_user_set_page_size is true
* (i.e. the DRAM supports multiple page sizes), otherwise
* it will shall be equal to dram_page_size.
* @collective_first_sob: first sync object available for collective use * @collective_first_sob: first sync object available for collective use
* @collective_first_mon: first monitor available for collective use * @collective_first_mon: first monitor available for collective use
* @sync_stream_first_sob: first sync object available for sync stream use * @sync_stream_first_sob: first sync object available for sync stream use
...@@ -626,6 +630,7 @@ struct asic_fixed_properties { ...@@ -626,6 +630,7 @@ struct asic_fixed_properties {
u32 fw_bootfit_cpu_boot_dev_sts1; u32 fw_bootfit_cpu_boot_dev_sts1;
u32 fw_app_cpu_boot_dev_sts0; u32 fw_app_cpu_boot_dev_sts0;
u32 fw_app_cpu_boot_dev_sts1; u32 fw_app_cpu_boot_dev_sts1;
u32 device_mem_alloc_default_page_size;
u16 collective_first_sob; u16 collective_first_sob;
u16 collective_first_mon; u16 collective_first_mon;
u16 sync_stream_first_sob; u16 sync_stream_first_sob;
......
...@@ -41,7 +41,7 @@ static int set_alloc_page_size(struct hl_device *hdev, struct hl_mem_in *args, u ...@@ -41,7 +41,7 @@ static int set_alloc_page_size(struct hl_device *hdev, struct hl_mem_in *args, u
return -EINVAL; return -EINVAL;
} }
} else { } else {
psize = hdev->asic_prop.dram_page_size; psize = prop->device_mem_alloc_default_page_size;
} }
*page_size = psize; *page_size = psize;
......
...@@ -595,6 +595,7 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev) ...@@ -595,6 +595,7 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev)
prop->mmu_hop_table_size = HOP_TABLE_SIZE_512_PTE; prop->mmu_hop_table_size = HOP_TABLE_SIZE_512_PTE;
prop->mmu_hop0_tables_total_size = HOP0_512_PTE_TABLES_TOTAL_SIZE; prop->mmu_hop0_tables_total_size = HOP0_512_PTE_TABLES_TOTAL_SIZE;
prop->dram_page_size = PAGE_SIZE_2MB; prop->dram_page_size = PAGE_SIZE_2MB;
prop->device_mem_alloc_default_page_size = prop->dram_page_size;
prop->dram_supports_virtual_memory = false; prop->dram_supports_virtual_memory = false;
prop->pmmu.hop0_shift = MMU_V1_1_HOP0_SHIFT; prop->pmmu.hop0_shift = MMU_V1_1_HOP0_SHIFT;
......
...@@ -413,6 +413,7 @@ int goya_set_fixed_properties(struct hl_device *hdev) ...@@ -413,6 +413,7 @@ int goya_set_fixed_properties(struct hl_device *hdev)
prop->mmu_hop_table_size = HOP_TABLE_SIZE_512_PTE; prop->mmu_hop_table_size = HOP_TABLE_SIZE_512_PTE;
prop->mmu_hop0_tables_total_size = HOP0_512_PTE_TABLES_TOTAL_SIZE; prop->mmu_hop0_tables_total_size = HOP0_512_PTE_TABLES_TOTAL_SIZE;
prop->dram_page_size = PAGE_SIZE_2MB; prop->dram_page_size = PAGE_SIZE_2MB;
prop->device_mem_alloc_default_page_size = prop->dram_page_size;
prop->dram_supports_virtual_memory = true; prop->dram_supports_virtual_memory = true;
prop->dmmu.hop0_shift = MMU_V1_0_HOP0_SHIFT; prop->dmmu.hop0_shift = MMU_V1_0_HOP0_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment