summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c')
-rw-r--r--drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c b/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
index cfc3e12df2fc..b8a7938d2d1a 100644
--- a/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
+++ b/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
@@ -10,6 +10,7 @@
#include <linux/firmware.h>
#include <linux/pm_domain.h>
#include <linux/clk.h>
+#include <linux/delay.h>
#include <drm/drmP.h>
#include "cdns-mhdp-imx.h"
@@ -538,13 +539,6 @@ int cdns_mhdp_firmware_write_section(struct imx_mhdp_device *imx_mhdp,
return 0;
}
-static void cdns_mhdp_firmware_load_cont(const struct firmware *fw, void *context)
-{
- struct imx_mhdp_device *imx_mhdp = context;
-
- imx_mhdp->fw = fw;
-}
-
static int cdns_mhdp_firmware_load(struct imx_mhdp_device *imx_mhdp)
{
const u8 *iram;
@@ -564,23 +558,25 @@ static int cdns_mhdp_firmware_load(struct imx_mhdp_device *imx_mhdp)
goto out;
if (!imx_mhdp->fw) {
- ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
+ ret = request_firmware_direct(&imx_mhdp->fw,
imx_mhdp->firmware_name,
- imx_mhdp->mhdp.dev, GFP_KERNEL,
- imx_mhdp,
- cdns_mhdp_firmware_load_cont);
+ imx_mhdp->mhdp.dev);
if (ret < 0) {
DRM_ERROR("failed to load firmware\n");
- return -ENOENT;
+ /* Maybe U-Boot loaded the firmware. Therefore, still try to
+ * reset the controller */
+ goto out;
}
- } else {
- iram = imx_mhdp->fw->data + FW_IRAM_OFFSET;
- dram = iram + FW_IRAM_SIZE;
-
- cdns_mhdp_firmware_write_section(imx_mhdp, iram, FW_IRAM_SIZE, ADDR_IMEM);
- cdns_mhdp_firmware_write_section(imx_mhdp, dram, FW_DRAM_SIZE, ADDR_DMEM);
}
+ iram = imx_mhdp->fw->data + FW_IRAM_OFFSET;
+ dram = iram + FW_IRAM_SIZE;
+
+ cdns_mhdp_firmware_write_section(imx_mhdp, iram,
+ FW_IRAM_SIZE, ADDR_IMEM);
+ cdns_mhdp_firmware_write_section(imx_mhdp, dram,
+ FW_DRAM_SIZE, ADDR_DMEM);
+
out:
/* un-reset ucpu */
cdns_mhdp_bus_write(0, &imx_mhdp->mhdp, APB_CTRL);