drm/i915/uc: Add params for specifying firmware
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>
Tue, 14 Mar 2017 14:28:14 +0000 (15:28 +0100)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 15 Mar 2017 12:26:30 +0000 (14:26 +0200)
`guc_firmware_path` and `huc_firmware_path` module parameters are added.

Using the parameter disables version checks and loads desired firmware
instead of the default one.

v2: make params unsafe && notice about disabled fw check (J. Lahtinen)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_params.c
drivers/gpu/drm/i915/i915_params.h
drivers/gpu/drm/i915/intel_guc_loader.c
drivers/gpu/drm/i915/intel_huc.c
drivers/gpu/drm/i915/intel_uc.c

index 2e9645e6555aab3486b4e98126a7c2e79904a342..b6a7e363d07699e79a6b3d957c1444299a3f8fe6 100644 (file)
@@ -59,6 +59,8 @@ struct i915_params i915 __read_mostly = {
        .enable_guc_loading = 0,
        .enable_guc_submission = 0,
        .guc_log_level = -1,
+       .guc_firmware_path = NULL,
+       .huc_firmware_path = NULL,
        .enable_dp_mst = true,
        .inject_load_failure = 0,
        .enable_dpcd_backlight = false,
@@ -230,6 +232,14 @@ module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
        "GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
 
+module_param_named_unsafe(guc_firmware_path, i915.guc_firmware_path, charp, 0400);
+MODULE_PARM_DESC(guc_firmware_path,
+       "GuC firmware path to use instead of the default one");
+
+module_param_named_unsafe(huc_firmware_path, i915.huc_firmware_path, charp, 0400);
+MODULE_PARM_DESC(huc_firmware_path,
+       "HuC firmware path to use instead of the default one");
+
 module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
 MODULE_PARM_DESC(enable_dp_mst,
        "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
index 55d47eea172e1e959009d0ed0764702f91b0acea..34148cc8637c1ac721bb6f481a9a2f7b1d671d66 100644 (file)
@@ -46,6 +46,8 @@
        func(int, enable_guc_loading); \
        func(int, enable_guc_submission); \
        func(int, guc_log_level); \
+       func(char *, guc_firmware_path); \
+       func(char *, huc_firmware_path); \
        func(int, use_mmio_flip); \
        func(int, mmio_debug); \
        func(int, edp_vswing); \
index f8c9e3126074e84d3261c392eb3439d5016d769d..d1d183b2f365c164afc4fd03f1ac81c94071b7ed 100644 (file)
@@ -407,7 +407,11 @@ int intel_guc_select_fw(struct intel_guc *guc)
        guc->fw.load_status = INTEL_UC_FIRMWARE_NONE;
        guc->fw.fw = INTEL_UC_FW_TYPE_GUC;
 
-       if (IS_SKYLAKE(dev_priv)) {
+       if (i915.guc_firmware_path) {
+               guc->fw.path = i915.guc_firmware_path;
+               guc->fw.major_ver_wanted = 0;
+               guc->fw.minor_ver_wanted = 0;
+       } else if (IS_SKYLAKE(dev_priv)) {
                guc->fw.path = I915_SKL_GUC_UCODE;
                guc->fw.major_ver_wanted = SKL_FW_MAJOR;
                guc->fw.minor_ver_wanted = SKL_FW_MINOR;
index ea67abc4748d2724c6fe5ad678d3695652dc9077..ab4ee08c3d44db685560a02b61ddf6ba9246852a 100644 (file)
@@ -153,7 +153,11 @@ void intel_huc_select_fw(struct intel_huc *huc)
        huc->fw.load_status = INTEL_UC_FIRMWARE_NONE;
        huc->fw.fw = INTEL_UC_FW_TYPE_HUC;
 
-       if (IS_SKYLAKE(dev_priv)) {
+       if (i915.huc_firmware_path) {
+               huc->fw.path = i915.huc_firmware_path;
+               huc->fw.major_ver_wanted = 0;
+               huc->fw.minor_ver_wanted = 0;
+       } else if (IS_SKYLAKE(dev_priv)) {
                huc->fw.path = I915_SKL_HUC_UCODE;
                huc->fw.major_ver_wanted = SKL_HUC_FW_MAJOR;
                huc->fw.minor_ver_wanted = SKL_HUC_FW_MINOR;
index eaa2b758fc9ab7f824f191578805e8ff5951bc6f..c31f05a641c06522e51d944c2891887325ad3ea7 100644 (file)
@@ -356,8 +356,10 @@ void intel_uc_prepare_fw(struct drm_i915_private *dev_priv,
                goto fail;
        }
 
-       if (uc_fw->major_ver_found != uc_fw->major_ver_wanted ||
-           uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) {
+       if (uc_fw->major_ver_wanted == 0 && uc_fw->minor_ver_wanted == 0) {
+               DRM_NOTE("Skipping uC firmware version check\n");
+       } else if (uc_fw->major_ver_found != uc_fw->major_ver_wanted ||
+                  uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) {
                DRM_NOTE("uC firmware version %d.%d, required %d.%d\n",
                        uc_fw->major_ver_found, uc_fw->minor_ver_found,
                        uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted);