@@ -43,12 +43,20 @@ static char *ivpu_firmware;
4343module_param_named_unsafe (firmware , ivpu_firmware , charp , 0644 );
4444MODULE_PARM_DESC (firmware , "VPU firmware binary in /lib/firmware/.." );
4545
46+ /* TODO: Remove mtl_vpu.bin from names after transition to generation based FW names */
47+ static struct {
48+ int gen ;
49+ const char * name ;
50+ } fw_names [] = {
51+ { IVPU_HW_37XX , "vpu_37xx.bin" },
52+ { IVPU_HW_37XX , "mtl_vpu.bin" },
53+ { IVPU_HW_37XX , "intel/vpu/vpu_37xx_v0.0.bin" },
54+ { IVPU_HW_40XX , "vpu_40xx.bin" },
55+ { IVPU_HW_40XX , "intel/vpu/vpu_40xx_v0.0.bin" },
56+ };
57+
4658static int ivpu_fw_request (struct ivpu_device * vdev )
4759{
48- static const char * const fw_names [] = {
49- "mtl_vpu.bin" ,
50- "intel/vpu/mtl_vpu_v0.0.bin"
51- };
5260 int ret = - ENOENT ;
5361 int i ;
5462
@@ -60,9 +68,12 @@ static int ivpu_fw_request(struct ivpu_device *vdev)
6068 }
6169
6270 for (i = 0 ; i < ARRAY_SIZE (fw_names ); i ++ ) {
63- ret = firmware_request_nowarn (& vdev -> fw -> file , fw_names [i ], vdev -> drm .dev );
71+ if (fw_names [i ].gen != ivpu_hw_gen (vdev ))
72+ continue ;
73+
74+ ret = firmware_request_nowarn (& vdev -> fw -> file , fw_names [i ].name , vdev -> drm .dev );
6475 if (!ret ) {
65- vdev -> fw -> name = fw_names [i ];
76+ vdev -> fw -> name = fw_names [i ]. name ;
6677 return 0 ;
6778 }
6879 }
@@ -195,7 +206,7 @@ static int ivpu_fw_update_global_range(struct ivpu_device *vdev)
195206 return - EINVAL ;
196207 }
197208
198- ivpu_hw_init_range (& vdev -> hw -> ranges .global_low , start , size );
209+ ivpu_hw_init_range (& vdev -> hw -> ranges .global , start , size );
199210 return 0 ;
200211}
201212
@@ -236,7 +247,7 @@ static int ivpu_fw_mem_init(struct ivpu_device *vdev)
236247 }
237248
238249 if (fw -> shave_nn_size ) {
239- fw -> mem_shave_nn = ivpu_bo_alloc_internal (vdev , vdev -> hw -> ranges .global_high .start ,
250+ fw -> mem_shave_nn = ivpu_bo_alloc_internal (vdev , vdev -> hw -> ranges .shave .start ,
240251 fw -> shave_nn_size , DRM_IVPU_BO_UNCACHED );
241252 if (!fw -> mem_shave_nn ) {
242253 ivpu_err (vdev , "Failed to allocate shavenn buffer\n" );
@@ -434,28 +445,26 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params
434445 * Uncached region of VPU address space, covers IPC buffers, job queues
435446 * and log buffers, programmable to L2$ Uncached by VPU MTRR
436447 */
437- boot_params -> shared_region_base = vdev -> hw -> ranges .global_low .start ;
438- boot_params -> shared_region_size = vdev -> hw -> ranges .global_low .end -
439- vdev -> hw -> ranges .global_low .start ;
448+ boot_params -> shared_region_base = vdev -> hw -> ranges .global .start ;
449+ boot_params -> shared_region_size = vdev -> hw -> ranges .global .end -
450+ vdev -> hw -> ranges .global .start ;
440451
441452 boot_params -> ipc_header_area_start = ipc_mem_rx -> vpu_addr ;
442453 boot_params -> ipc_header_area_size = ipc_mem_rx -> base .size / 2 ;
443454
444455 boot_params -> ipc_payload_area_start = ipc_mem_rx -> vpu_addr + ipc_mem_rx -> base .size / 2 ;
445456 boot_params -> ipc_payload_area_size = ipc_mem_rx -> base .size / 2 ;
446457
447- boot_params -> global_aliased_pio_base =
448- vdev -> hw -> ranges .global_aliased_pio .start ;
449- boot_params -> global_aliased_pio_size =
450- ivpu_hw_range_size (& vdev -> hw -> ranges .global_aliased_pio );
458+ boot_params -> global_aliased_pio_base = vdev -> hw -> ranges .user .start ;
459+ boot_params -> global_aliased_pio_size = ivpu_hw_range_size (& vdev -> hw -> ranges .user );
451460
452461 /* Allow configuration for L2C_PAGE_TABLE with boot param value */
453462 boot_params -> autoconfig = 1 ;
454463
455464 /* Enable L2 cache for first 2GB of high memory */
456465 boot_params -> cache_defaults [VPU_BOOT_L2_CACHE_CFG_NN ].use = 1 ;
457466 boot_params -> cache_defaults [VPU_BOOT_L2_CACHE_CFG_NN ].cfg =
458- ADDR_TO_L2_CACHE_CFG (vdev -> hw -> ranges .global_high .start );
467+ ADDR_TO_L2_CACHE_CFG (vdev -> hw -> ranges .shave .start );
459468
460469 if (vdev -> fw -> mem_shave_nn )
461470 boot_params -> shave_nn_fw_base = vdev -> fw -> mem_shave_nn -> vpu_addr ;
0 commit comments