dde_linux: framebuffer driver for i.MX8 EVK

Fixes #3591
This commit is contained in:
Christian Prochaska 2020-01-06 19:03:38 +01:00 committed by Christian Helmuth
parent fe899eecc7
commit b29112efdf
33 changed files with 5984 additions and 13 deletions

View File

@ -0,0 +1,214 @@
linux-x.x.x/drivers/base/component.c
linux-x.x.x/drivers/base/devres.c
linux-x.x.x/drivers/dma-buf/dma-fence.c
linux-x.x.x/drivers/gpu/drm/drm_atomic.c
linux-x.x.x/drivers/gpu/drm/drm_atomic_helper.c
linux-x.x.x/drivers/gpu/drm/drm_blend.c
linux-x.x.x/drivers/gpu/drm/drm_bridge.c
linux-x.x.x/drivers/gpu/drm/drm_connector.c
linux-x.x.x/drivers/gpu/drm/drm_crtc.c
linux-x.x.x/drivers/gpu/drm/drm_crtc_helper_internal.h
linux-x.x.x/drivers/gpu/drm/drm_crtc_internal.h
linux-x.x.x/drivers/gpu/drm/drm_dp_helper.c
linux-x.x.x/drivers/gpu/drm/drm_edid.c
linux-x.x.x/drivers/gpu/drm/drm_encoder.c
linux-x.x.x/drivers/gpu/drm/drm_fourcc.c
linux-x.x.x/drivers/gpu/drm/drm_framebuffer.c
linux-x.x.x/drivers/gpu/drm/drm_gem.c
linux-x.x.x/drivers/gpu/drm/drm_gem_cma_helper.c
linux-x.x.x/drivers/gpu/drm/drm_gem_framebuffer_helper.c
linux-x.x.x/drivers/gpu/drm/drm_internal.h
linux-x.x.x/drivers/gpu/drm/drm_mm.c
linux-x.x.x/drivers/gpu/drm/drm_mode_config.c
linux-x.x.x/drivers/gpu/drm/drm_mode_object.c
linux-x.x.x/drivers/gpu/drm/drm_modes.c
linux-x.x.x/drivers/gpu/drm/drm_modeset_helper.c
linux-x.x.x/drivers/gpu/drm/drm_modeset_lock.c
linux-x.x.x/drivers/gpu/drm/drm_of.c
linux-x.x.x/drivers/gpu/drm/drm_plane.c
linux-x.x.x/drivers/gpu/drm/drm_probe_helper.c
linux-x.x.x/drivers/gpu/drm/drm_property.c
linux-x.x.x/drivers/gpu/drm/drm_rect.c
linux-x.x.x/drivers/gpu/drm/drm_vblank.c
linux-x.x.x/drivers/gpu/drm/drm_vma_manager.c
linux-x.x.x/drivers/gpu/drm/imx/imx-drm.h
linux-x.x.x/drivers/gpu/drm/imx/imx-drm-core.c
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-crtc.c
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-crtc.h
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-kms.c
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-kms.h
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-plane.c
linux-x.x.x/drivers/gpu/drm/imx/dcss/dcss-plane.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_mcu1_dp.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_mcu1_dp.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_mcu2_dp.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_mcu2_dp.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-arc.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-dp.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-dp.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdcp-private.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdcp.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdcp.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdmi.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdmi.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdp.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/imx-hdp.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/ss28fdsoi_hdmitx_table.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/ss28fdsoi_hdmitx_table.h
linux-x.x.x/drivers/gpu/drm/imx/hdp/t28hpc_hdmitx_table.c
linux-x.x.x/drivers/gpu/drm/imx/hdp/t28hpc_hdmitx_table.h
linux-x.x.x/drivers/gpu/imx/dcss/dcss-common.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-blkctl.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-ctxld.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-dec400d.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-dpr.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-dtg.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-dtrc.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-hdr10.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-hdr10-tables.h
linux-x.x.x/drivers/gpu/imx/dcss/dcss-prv.h
linux-x.x.x/drivers/gpu/imx/dcss/dcss-rdsrc.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-scaler.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-ss.c
linux-x.x.x/drivers/gpu/imx/dcss/dcss-wrscl.c
linux-x.x.x/drivers/i2c/i2c-boardinfo.c
linux-x.x.x/drivers/i2c/i2c-core-base.c
linux-x.x.x/drivers/i2c/i2c-core.h
linux-x.x.x/drivers/irqchip/irq-imx-irqsteer.c
linux-x.x.x/drivers/mxc/hdp/API_AFE.c
linux-x.x.x/drivers/mxc/hdp/API_AFE.h
linux-x.x.x/drivers/mxc/hdp/API_DPTX.c
linux-x.x.x/drivers/mxc/hdp/API_DPTX.h
linux-x.x.x/drivers/mxc/hdp/API_General.c
linux-x.x.x/drivers/mxc/hdp/API_General.h
linux-x.x.x/drivers/mxc/hdp/API_HDCP.c
linux-x.x.x/drivers/mxc/hdp/API_HDCP.h
linux-x.x.x/drivers/mxc/hdp/API_HDMITX.c
linux-x.x.x/drivers/mxc/hdp/API_HDMITX.h
linux-x.x.x/drivers/mxc/hdp/API_Infoframe.c
linux-x.x.x/drivers/mxc/hdp/API_Infoframe.h
linux-x.x.x/drivers/mxc/hdp/address.h
linux-x.x.x/drivers/mxc/hdp/all.h
linux-x.x.x/drivers/mxc/hdp/apb_cfg.h
linux-x.x.x/drivers/mxc/hdp/dptx_framer.h
linux-x.x.x/drivers/mxc/hdp/dptx_stream.h
linux-x.x.x/drivers/mxc/hdp/general_handler.h
linux-x.x.x/drivers/mxc/hdp/hdcp.h
linux-x.x.x/drivers/mxc/hdp/hdcp2.h
linux-x.x.x/drivers/mxc/hdp/hdcp_tran.h
linux-x.x.x/drivers/mxc/hdp/hdmi.h
linux-x.x.x/drivers/mxc/hdp/mailBox.h
linux-x.x.x/drivers/mxc/hdp/mhl_hdtx_top.h
linux-x.x.x/drivers/mxc/hdp/opcodes.h
linux-x.x.x/drivers/mxc/hdp/source_car.h
linux-x.x.x/drivers/mxc/hdp/source_phy.h
linux-x.x.x/drivers/mxc/hdp/source_pif.h
linux-x.x.x/drivers/mxc/hdp/source_vif.h
linux-x.x.x/drivers/mxc/hdp/util.c
linux-x.x.x/drivers/mxc/hdp/util.h
linux-x.x.x/drivers/mxc/hdp-cec/imx-hdp-cec.h
linux-x.x.x/drivers/video/hdmi.c
linux-x.x.x/include/asm-generic/atomic64.h
linux-x.x.x/include/asm-generic/bitops/__ffs.h
linux-x.x.x/include/asm-generic/bitops/ffs.h
linux-x.x.x/include/asm-generic/bitops/fls64.h
linux-x.x.x/include/asm-generic/bitops/__fls.h
linux-x.x.x/include/asm-generic/bitops/fls.h
linux-x.x.x/include/asm-generic/bitops/non-atomic.h
linux-x.x.x/include/drm/drm_atomic.h
linux-x.x.x/include/drm/drm_atomic_helper.h
linux-x.x.x/include/drm/drm_auth.h
linux-x.x.x/include/drm/drm_blend.h
linux-x.x.x/include/drm/drm_bridge.h
linux-x.x.x/include/drm/drm_connector.h
linux-x.x.x/include/drm/drm_crtc.h
linux-x.x.x/include/drm/drm_crtc_helper.h
linux-x.x.x/include/drm/drm_debugfs_crc.h
linux-x.x.x/include/drm/drm_device.h
linux-x.x.x/include/drm/drm_displayid.h
linux-x.x.x/include/drm/drm_dp_helper.h
linux-x.x.x/include/drm/drm_drv.h
linux-x.x.x/include/drm/drm_edid.h
linux-x.x.x/include/drm/drm_encoder.h
linux-x.x.x/include/drm/drm_fb_cma_helper.h
linux-x.x.x/include/drm/drm_fb_helper.h
linux-x.x.x/include/drm/drm_file.h
linux-x.x.x/include/drm/drm_fourcc.h
linux-x.x.x/include/drm/drm_framebuffer.h
linux-x.x.x/include/drm/drm_gem.h
linux-x.x.x/include/drm/drm_gem_cma_helper.h
linux-x.x.x/include/drm/drm_gem_framebuffer_helper.h
linux-x.x.x/include/drm/drm_hashtab.h
linux-x.x.x/include/drm/drm_hdcp.h
linux-x.x.x/include/drm/drm_ioctl.h
linux-x.x.x/include/drm/drm_mm.h
linux-x.x.x/include/drm/drm_mode_config.h
linux-x.x.x/include/drm/drm_mode_object.h
linux-x.x.x/include/drm/drm_modeset_helper.h
linux-x.x.x/include/drm/drm_modeset_helper_vtables.h
linux-x.x.x/include/drm/drm_modeset_lock.h
linux-x.x.x/include/drm/drm_modes.h
linux-x.x.x/include/drm/drm_of.h
linux-x.x.x/include/drm/drm_panel.h
linux-x.x.x/include/drm/drmP.h
linux-x.x.x/include/drm/drm_plane.h
linux-x.x.x/include/drm/drm_plane_helper.h
linux-x.x.x/include/drm/drm_prime.h
linux-x.x.x/include/drm/drm_print.h
linux-x.x.x/include/drm/drm_property.h
linux-x.x.x/include/drm/drm_rect.h
linux-x.x.x/include/drm/drm_vblank.h
linux-x.x.x/include/drm/drm_vma_manager.h
linux-x.x.x/include/linux/irqchip/chained_irq.h
linux-x.x.x/include/linux/busfreq-imx.h
linux-x.x.x/include/linux/component.h
linux-x.x.x/include/linux/dma-fence.h
linux-x.x.x/include/linux/fb.h
linux-x.x.x/include/linux/hdmi.h
linux-x.x.x/include/linux/i2c.h
linux-x.x.x/include/linux/idr.h
linux-x.x.x/include/linux/interval_tree_generic.h
linux-x.x.x/include/linux/interval_tree.h
linux-x.x.x/include/linux/irqdomain.h
linux-x.x.x/include/linux/irqhandler.h
linux-x.x.x/include/linux/list.h
linux-x.x.x/include/linux/list_sort.h
linux-x.x.x/include/linux/log2.h
linux-x.x.x/include/linux/math64.h
linux-x.x.x/include/linux/mod_devicetable.h
linux-x.x.x/include/linux/of_graph.h
linux-x.x.x/include/linux/pm_runtime.h
linux-x.x.x/include/linux/pm_wakeirq.h
linux-x.x.x/include/linux/radix-tree.h
linux-x.x.x/include/linux/ratelimit.h
linux-x.x.x/include/linux/rbtree_augmented.h
linux-x.x.x/include/linux/rbtree.h
linux-x.x.x/include/linux/sort.h
linux-x.x.x/include/linux/vga_switcheroo.h
linux-x.x.x/include/soc/imx8/sc/ipc.h
linux-x.x.x/include/soc/imx8/sc/scfw.h
linux-x.x.x/include/soc/imx8/sc/sci.h
linux-x.x.x/include/soc/imx8/sc/types.h
linux-x.x.x/include/soc/imx8/soc.h
linux-x.x.x/include/uapi/drm/drm_fourcc.h
linux-x.x.x/include/uapi/drm/drm.h
linux-x.x.x/include/uapi/drm/drm_mode.h
linux-x.x.x/include/uapi/linux/byteorder/little_endian.h
linux-x.x.x/include/uapi/linux/cec.h
linux-x.x.x/include/uapi/linux/fb.h
linux-x.x.x/include/uapi/linux/i2c.h
linux-x.x.x/include/uapi/linux/media-bus-format.h
linux-x.x.x/include/uapi/linux/swab.h
linux-x.x.x/include/video/display_timing.h
linux-x.x.x/include/video/of_videomode.h
linux-x.x.x/include/video/videomode.h
linux-x.x.x/include/video/viv-metadata.h
linux-x.x.x/include/video/imx-dcss.h
linux-x.x.x/lib/idr.c
linux-x.x.x/lib/list_sort.c
linux-x.x.x/lib/radix-tree.c
linux-x.x.x/lib/rbtree.c

View File

@ -0,0 +1,22 @@
LX_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/drivers/framebuffer/imx8
SRC_DIR := $(REP_DIR)/src/drivers/framebuffer/imx8
# architecture-dependent includes
ifeq ($(filter-out $(SPECS),arm_64),)
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/arm_64 \
$(LX_CONTRIB_DIR)/arch/arm64/include \
$(LX_CONTRIB_DIR)/arch/arm64/include/uapi \
$(LX_CONTRIB_DIR)/arch/arm64/include/generated \
$(LX_CONTRIB_DIR)/arch/arm64/include/generated/uapi
endif # arm_64
INC_DIR += $(SRC_DIR)/include \
$(REP_DIR)/src/include \
$(ARCH_SRC_INC_DIR) \
$(LX_CONTRIB_DIR)/drivers/gpu/drm \
$(LX_CONTRIB_DIR)/drivers/gpu/drm/imx \
$(LX_CONTRIB_DIR)/include \
$(LX_CONTRIB_DIR)/include/uapi \
$(LIB_CACHE_DIR)/imx8_fb_include/include/include/include
CC_OPT += -U__linux__ -D__KERNEL__

View File

@ -0,0 +1,47 @@
LX_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/drivers/framebuffer/imx8
SRC_DIR := $(REP_DIR)/src/drivers/framebuffer/imx8
LIBS += imx8_fb_include
SRC_C :=
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/dma-buf/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/i2c/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/base/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx/dcss/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx/hdp/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/imx/dcss/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/irqchip/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/mxc/hdp/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/video/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/lib/*.c))
#
# Linux sources are C89 with GNU extensions
#
CC_C_OPT += -std=gnu89
#
# Reduce build noise of compiling contrib code
#
CC_WARN = -Wall -Wno-uninitialized -Wno-unused-but-set-variable \
-Wno-unused-variable -Wno-unused-function \
-Wno-pointer-arith -Wno-pointer-sign \
-Wno-int-to-pointer-cast -Wno-stringop-truncation
vpath %.c $(LX_CONTRIB_DIR)/drivers/base
vpath %.c $(LX_CONTRIB_DIR)/drivers/dma-buf
vpath %.c $(LX_CONTRIB_DIR)/drivers/i2c
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx/dcss
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm/imx/hdp
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/imx/dcss
vpath %.c $(LX_CONTRIB_DIR)/drivers/irqchip
vpath %.c $(LX_CONTRIB_DIR)/drivers/mxc/hdp
vpath %.c $(LX_CONTRIB_DIR)/drivers/video
vpath %.c $(LX_CONTRIB_DIR)/lib
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,37 @@
#
# Pseudo library to generate a symlink for each header file included by the
# contrib code. Each symlink points to the same 'lx_emul.h' file, which
# provides our emulation of the Linux kernel API.
#
ifeq ($(called_from_lib_mk),yes)
LX_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/drivers/framebuffer/imx8
LX_EMUL_H := $(REP_DIR)/src/drivers/framebuffer/imx8/include/lx_emul.h
#
# Determine the header files included by the contrib code. For each
# of these header files we create a symlink to 'lx_emul.h'.
#
SCAN_DIRS := $(addprefix $(LX_CONTRIB_DIR)/include/, asm-generic drm linux soc uapi video) \
$(addprefix $(LX_CONTRIB_DIR)/, drivers lib)
GEN_INCLUDES := $(shell grep -rIh "^\#include .*" $(SCAN_DIRS) |\
sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" |\
sort | uniq)
#
# Put Linux headers in 'GEN_INC' dir, since some include use "../../" paths use
# three level include hierarchy
#
GEN_INC := $(shell pwd)/include/include/include
GEN_INCLUDES := $(addprefix $(GEN_INC)/,$(GEN_INCLUDES))
all: $(GEN_INCLUDES)
$(GEN_INCLUDES):
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)ln -sf $(LX_EMUL_H) $@
endif
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,23 @@
dcss_blkctl.patch
diff --git a/drivers/gpu/imx/dcss/dcss-blkctl.c b/drivers/gpu/imx/dcss/dcss-blkctl.c
index 2f13b33..63d48bf 100644
--- a/drivers/gpu/imx/dcss/dcss-blkctl.c
+++ b/drivers/gpu/imx/dcss/dcss-blkctl.c
@@ -115,10 +115,14 @@ int dcss_blkctl_init(struct dcss_soc *dcss, unsigned long blkctl_base)
disp_dev = of_get_property(node, "disp-dev", &len);
if (!disp_dev || !strncmp(disp_dev, "hdmi_disp", 9))
blkctl->hdmi_output = true;
-
+#if 0
+ /*
+ * XXX: for some reason 'HDMI_MIPI_CLK_SEL' does not work with SOC revision
+ * 0x20 and Genode
+ */
if (imx8_get_soc_revision() >= B0_SILICON_ID)
blkctl->clk_setting = HDMI_MIPI_CLK_SEL;
-
+#endif
dcss_blkctl_cfg(dcss);
return 0;

View File

@ -0,0 +1,23 @@
dcss_common.patch
diff --git a/drivers/gpu/imx/dcss/dcss-common.c b/drivers/gpu/imx/dcss/dcss-common.c
index cb15533..90b6b4d 100644
--- a/drivers/gpu/imx/dcss/dcss-common.c
+++ b/drivers/gpu/imx/dcss/dcss-common.c
@@ -19,6 +19,7 @@
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/busfreq-imx.h>
+#include <linux/mod_devicetable.h>
#include <linux/pm_qos.h>
#include <video/imx-dcss.h>
@@ -43,7 +44,7 @@ struct dcss_devtype {
u32 pll_base;
};
-static struct dcss_devtype dcss_type_imx8m = {
+/*static*/ struct dcss_devtype dcss_type_imx8m = {
.name = "DCSS_imx8m",
.blkctl_ofs = 0x2F000,
.ctxld_ofs = 0x23000,

View File

@ -0,0 +1,15 @@
dcss_ctxld.patch
diff --git a/drivers/gpu/imx/dcss/dcss-ctxld.c b/drivers/gpu/imx/dcss/dcss-ctxld.c
index 377a102..1e7a7cf 100644
--- a/drivers/gpu/imx/dcss/dcss-ctxld.c
+++ b/drivers/gpu/imx/dcss/dcss-ctxld.c
@@ -275,7 +275,7 @@ int dcss_ctxld_init(struct dcss_soc *dcss, unsigned long ctxld_base)
}
ret = dcss_ctxld_irq_config(priv);
- if (!ret)
+ if (ret)
return ret;
dcss_ctxld_hw_cfg(dcss);

View File

@ -0,0 +1,15 @@
dcss_scaler.patch
diff --git a/drivers/gpu/imx/dcss/dcss-scaler.c b/drivers/gpu/imx/dcss/dcss-scaler.c
index 051bc4b..fc7b2e3 100644
--- a/drivers/gpu/imx/dcss/dcss-scaler.c
+++ b/drivers/gpu/imx/dcss/dcss-scaler.c
@@ -332,7 +332,7 @@ static int dcss_scaler_ch_init_all(struct dcss_soc *dcss,
ch->base_ofs = scaler_base + i * 0x400;
- ch->base_reg = devm_ioremap(dcss->dev, ch->base_ofs, SZ_4K);
+ ch->base_reg = devm_ioremap(dcss->dev, ch->base_ofs, 0x400);
if (!ch->base_reg) {
dev_err(dcss->dev, "scaler: unable to remap ch base\n");
return -ENOMEM;

View File

@ -0,0 +1,26 @@
drm_connector.patch
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 0986447..d54c1cd 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -525,7 +525,9 @@ void drm_connector_list_iter_begin(struct drm_device *dev,
{
iter->dev = dev;
iter->conn = NULL;
+#ifdef CONFIG_LOCKDEP
lock_acquire_shared_recursive(&connector_list_iter_dep_map, 0, 1, NULL, _RET_IP_);
+#endif
}
EXPORT_SYMBOL(drm_connector_list_iter_begin);
@@ -581,7 +583,9 @@ void drm_connector_list_iter_end(struct drm_connector_list_iter *iter)
iter->dev = NULL;
if (iter->conn)
drm_connector_put(iter->conn);
+#ifdef CONFIG_LOCKDEP
lock_release(&connector_list_iter_dep_map, 0, _RET_IP_);
+#endif
}
EXPORT_SYMBOL(drm_connector_list_iter_end);

View File

@ -0,0 +1,15 @@
drm_edid.patch
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 6f1410b..c874409 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -345,7 +345,7 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector);
static inline struct edid *
drm_load_edid_firmware(struct drm_connector *connector)
{
- return ERR_PTR(-ENOENT);
+ return (struct edid *)ERR_PTR(-ENOENT);
}
#endif

View File

@ -0,0 +1,27 @@
drm_mm.patch
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 1acf3b1..7fd72a0 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -48,6 +48,7 @@
#include <linux/seq_file.h>
#include <linux/export.h>
#include <linux/interval_tree_generic.h>
+#include <linux/math64.h>
/**
* DOC: Overview
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 8d10fc9..452977c 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -423,7 +423,7 @@ static inline int drm_mm_insert_node(struct drm_mm *mm,
struct drm_mm_node *node,
u64 size)
{
- return drm_mm_insert_node_generic(mm, node, size, 0, 0, 0);
+ return drm_mm_insert_node_generic(mm, node, size, 0, 0, DRM_MM_INSERT_BEST);
}
void drm_mm_remove_node(struct drm_mm_node *node);

View File

@ -0,0 +1,14 @@
drm_vblank.patch
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index c2f23a6..f1bc5df 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -27,6 +27,7 @@
#include <drm/drm_vblank.h>
#include <drm/drmP.h>
#include <linux/export.h>
+#include <linux/math64.h>
#include "drm_trace.h"
#include "drm_internal.h"

View File

@ -0,0 +1,45 @@
fb.patch
diff --git a/include/linux/fb.h b/include/linux/fb.h
index bc24e48..5cc1e2a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -461,6 +461,16 @@ struct fb_tile_ops {
output like oopses */
#define FBINFO_CAN_FORCE_OUTPUT 0x200000
+struct aperture {
+ resource_size_t base;
+ resource_size_t size;
+};
+
+struct apertures_struct {
+ unsigned int count;
+ struct aperture ranges[0];
+};
+
struct fb_info {
atomic_t count;
int node;
@@ -514,19 +524,13 @@ struct fb_info {
/* we need the PCI or similar aperture base/size not
smem_start/size as smem_start may just be an object
allocated inside the aperture so may not actually overlap */
- struct apertures_struct {
- unsigned int count;
- struct aperture {
- resource_size_t base;
- resource_size_t size;
- } ranges[0];
- } *apertures;
+ struct apertures_struct *apertures;
bool skip_vt_switch; /* no VT switch on suspend/resume required */
};
static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
- struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
+ struct apertures_struct *a = (struct apertures_struct*)kzalloc(sizeof(struct apertures_struct)
+ max_num * sizeof(struct aperture), GFP_KERNEL);
if (!a)
return NULL;

View File

@ -0,0 +1,53 @@
imx_drm_core.patch
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 76b782c..a2c3a76 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -43,7 +43,9 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
{
struct imx_drm_device *imxdrm = drm->dev_private;
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
+#endif
}
DEFINE_DRM_GEM_CMA_FOPS(imx_drm_driver_fops);
@@ -120,6 +122,17 @@ static int compare_of(struct device *dev, void *data)
{
struct device_node *np = data;
+ if ((strncmp(dev->driver->name, "imx-dcss-crtc", strlen(dev->driver->name)) == 0) &&
+ (strncmp(np->name, "port", strlen(np->name)) == 0))
+ return 1;
+
+ if ((strncmp(dev->driver->name, "i.mx8-hdp", strlen(dev->driver->name)) == 0) &&
+ (strncmp(np->name, "hdmi", strlen(np->name)) == 0))
+ return 1;
+
+ return 0;
+
+#if 0
/* Special case for DI, dev->of_node may not be set yet */
if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) {
struct ipu_client_platformdata *pdata = dev->platform_data;
@@ -161,6 +174,7 @@ static int compare_of(struct device *dev, void *data)
}
return dev->of_node == np;
+#endif
}
static const char *const imx_drm_dpu_comp_parents[] = {
@@ -416,8 +430,10 @@ static void imx_drm_unbind(struct device *dev)
drm_kms_helper_poll_fini(drm);
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper);
+#endif
drm_mode_config_cleanup(drm);

View File

@ -0,0 +1,28 @@
imx_hdcp.patch
diff --git a/drivers/gpu/drm/imx/hdp/imx-hdcp.c b/drivers/gpu/drm/imx/hdp/imx-hdcp.c
index 4f10737..0f5665a 100644
--- a/drivers/gpu/drm/imx/hdp/imx-hdcp.c
+++ b/drivers/gpu/drm/imx/hdp/imx-hdcp.c
@@ -527,6 +527,12 @@ int imx_hdcp_init(struct imx_hdp *hdp, struct device_node *of_node)
int ret;
const char *compat;
u32 temp;
+
+ /*
+ * 'imx_hdcp_disable()' is called regardless of -EPERM early return
+ * and needs an initialized mutex on Genode
+ */
+ mutex_init(&hdp->hdcp.mutex);
ret = of_property_read_string(of_node, "compatible", &compat);
if (ret) {
@@ -561,7 +567,7 @@ int imx_hdcp_init(struct imx_hdp *hdp, struct device_node *of_node)
return ret;
/*connector->hdcp_shim = hdcp_shim;*/
- mutex_init(&hdp->hdcp.mutex);
+ /*mutex_init(&hdp->hdcp.mutex);*/
INIT_DELAYED_WORK(&hdp->hdcp.check_work, imx_hdcp_check_work);
INIT_WORK(&hdp->hdcp.prop_work, imx_hdcp_prop_work);
return 0;

View File

@ -0,0 +1,26 @@
imx_hdp.patch
diff --git a/drivers/gpu/drm/imx/hdp/imx-hdp.c b/drivers/gpu/drm/imx/hdp/imx-hdp.c
index bcfad52..0ed949a 100644
--- a/drivers/gpu/drm/imx/hdp/imx-hdp.c
+++ b/drivers/gpu/drm/imx/hdp/imx-hdp.c
@@ -1478,10 +1478,19 @@ static int imx_hdp_imx_bind(struct device *dev, struct device *master,
return -EINVAL;
}
+#if 0
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
hdp->mem.rst_base = devm_ioremap_resource(dev, res);
if (IS_ERR(hdp->mem.rst_base))
dev_warn(dev, "Failed to get HDP RESET base register\n");
+#else
+ /*
+ * On Genode, the requested address range is already mapped by a different
+ * part of the driver and cannot be mapped again. Fortunately, not mapping
+ * it here didn't show problems so far.
+ */
+ hdp->mem.rst_base = 0;
+#endif
hdp->is_cec = of_property_read_bool(pdev->dev.of_node, "fsl,cec");

View File

@ -0,0 +1,14 @@
irq_imx_irqsteer.patch
diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index e26d242..1b2334b 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -13,6 +13,7 @@
#include <linux/irq.h>
#include <linux/irqchip/chained_irq.h>
#include <linux/irqdomain.h>
+#include <linux/mod_devicetable.h>
#include <linux/of_platform.h>
#include <linux/spinlock.h>
#include <linux/pm_runtime.h>

View File

@ -1 +1 @@
8d086553e63be398b2e00ffa093fb4d44d6e746d
173719007927a108a9558e727b8c9b388f3159a2

View File

@ -3,7 +3,7 @@ VERSION := 2
DOWNLOADS := dwc_otg.git usb.archive intel_fb.archive lxip.archive \
wifi.archive fec.archive libnl.archive wpa_supplicant.git \
fw.archive usb_host.archive dwc_otg_host.git usb_hid.archive \
usb_net.archive
usb_net.archive imx8_fb.archive
#
# Tools
@ -116,6 +116,16 @@ DIR(fec) := $(SRC_DIR_FEC)
TAR_OPT(fec) := --strip-components=1 --files-from - < <(sed 's/-x.x.x/-$(VERSION_FEC)/g' $(REP_DIR)/fec.list)
HASH_INPUT += $(REP_DIR)/fec.list
#
# i.MX8 Framebuffer driver
#
SRC_DIR_IMX8_FB := src/drivers/framebuffer/imx8
URL(imx8_fb) := https://github.com/Freescale/linux-fslc/tarball/1ddf624
NAME(imx8_fb) := linux-4.14-2.0.x-imx.tgz
SHA(imx8_fb) := 879219874f74b420f2f49f197d418d800ad3b716b9cc3d2d7b85a6fbf2296928
TAR_OPT(imx8_fb) := --strip-components=1 --files-from - < <(sed 's/linux-x.x.x/Freescale-linux-fslc-1ddf624/g' $(REP_DIR)/imx8_fb.list)
DIR(imx8_fb) := $(SRC_DIR_IMX8_FB)
#
# libnl sources
#
@ -151,6 +161,7 @@ PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/usb*.patc
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/intel*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/fec_*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/usb_hid*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/imx8_fb*.patch)))
#IP stack
LXIP_OPT = -p1 -d$(SRC_DIR_LXIP)
@ -212,4 +223,20 @@ PATCH_OPT(patches/fec_skbuff_cast.patch) := -p1 -d$(SRC_DIR_FEC)
PATCH_OPT(patches/fec_tx_bounce_dma.patch) := -p1 -d$(SRC_DIR_FEC)
PATCH_OPT(patches/fec_ndev_owner.patch) := -p1 -d$(SRC_DIR_FEC)
# Freescale i.MX8 framebuffer
IMX8_FB_OPT = -p1 -d$(SRC_DIR_IMX8_FB)
PATCH_OPT(patches/imx8_fb_dcss_blkctl.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_dcss_common.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_dcss_ctxld.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_dcss_scaler.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_drm_connector.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_drm_edid.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_drm_mm.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_drm_vblank.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_fb.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_imx_drm_core.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_imx_hdcp.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_imx_hdp.patch) := $(IMX8_FB_OPT)
PATCH_OPT(patches/imx8_fb_irq_imx_irqsteer.patch) := $(IMX8_FB_OPT)
# vi: set ft=make :

View File

@ -0,0 +1,36 @@
This driver is for the i.MX8MQ EVK Board.
Default behaviour
~~~~~~~~~~~~~~~~~
When no configuration is provided to the driver, it will enable the HDMI
connector and use the best resolution as provided by EDID information from
the HDMI display.
Configuration
~~~~~~~~~~~~~
The HDMI connector can be configured explicitly in terms of resolution and
whether it should be enabled or not. This looks like the following:
! <config>
! <connector name="HDMI-A-1" width="1920" height="1080" hz="60" enabled="true"/>
! </config>
When the configuration changes during run-time, the driver will adapt to it.
To present all available connectors and their possible resolutions to the user
the driver is able to export a corresponding report ROM. This has to be
configured too, like in the following:
! <config>
! <report connectors="yes"/>
! </config>
The exported report has the following format:
! <connectors>
! <connector name="HDMI-A-1" connected="1">
! <mode width="1920" height="1080" hz="60"/>
! ...
! </connector>
! </connectors>

View File

@ -0,0 +1,743 @@
#include <lx_emul.h>
#include <lx_emul_c.h>
#include <drm/drm_device.h>
#include <drm/drm_gem.h>
#include <linux/component.h>
#include <linux/irqdomain.h>
#include <linux/irqhandler.h>
#include <linux/ratelimit.h>
#include <soc/imx8/sc/types.h>
#include <uapi/linux/i2c.h>
/************************
** drivers/base/bus.c **
************************/
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
void *data, int (*fn)(struct device_driver *, void *))
{
TRACE_AND_STOP;
return -1;
}
/*************************
** drivers/base/core.c **
*************************/
int device_for_each_child(struct device *dev, void *data,
int (*fn)(struct device *dev, void *data))
{
TRACE_AND_STOP;
return -1;
}
int device_register(struct device *dev)
{
TRACE_AND_STOP;
return -1;
}
/********************************
** drivers/base/dma-mapping.c **
********************************/
void dmam_free_coherent(struct device *dev, size_t size, void *vaddr,
dma_addr_t dma_handle)
{
TRACE_AND_STOP;
}
/*****************************
** drivers/base/platform.c **
*****************************/
int platform_device_put(struct platform_device *pdev)
{
TRACE_AND_STOP;
return 0;
}
void platform_device_unregister(struct platform_device *pdev)
{
TRACE_AND_STOP;
}
/*****************************
** drivers/base/property.c **
*****************************/
int device_add_properties(struct device *dev, const struct property_entry *properties)
{
TRACE_AND_STOP;
}
void device_remove_properties(struct device *dev)
{
TRACE_AND_STOP;
}
/***********************
** drivers/clk/clk.c **
***********************/
struct clk *clk_get_parent(struct clk *clk)
{
TRACE_AND_STOP;
return NULL;
}
bool clk_is_match(const struct clk *p, const struct clk *q)
{
TRACE_AND_STOP;
return false;
}
int clk_set_parent(struct clk *clk, struct clk *parent)
{
TRACE;
return 0;
}
/*******************************
** drivers/gpu/drm/drm_drv.c **
*******************************/
void drm_dev_unref(struct drm_device *dev)
{
TRACE_AND_STOP;
}
void drm_dev_unregister(struct drm_device *dev)
{
TRACE_AND_STOP;
}
/*****************************************
** drivers/gpu/drm/drm_fb_cma_helper.c **
*****************************************/
struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
struct drm_file *file_priv,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
TRACE_AND_STOP;
return NULL;
}
struct drm_fbdev_cma;
void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma)
{
TRACE;
}
/*******************************
** drivers/i2c/i2c-core-of.c **
*******************************/
struct i2c_adapter;
void of_i2c_register_devices(struct i2c_adapter *adap)
{
TRACE_AND_STOP;
}
/**********************************
** drivers/i2c/i2c-core-smbus.c **
**********************************/
struct i2c_adapter;
s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
char read_write, u8 command, int protocol,
union i2c_smbus_data *data) {
TRACE_AND_STOP;
}
/***********************
** drivers/of/base.c **
***********************/
bool of_device_is_available(const struct device_node *device)
{
return device;
}
/**************************
** drivers/of/dynamic.c **
**************************/
struct device_node *of_node_get(struct device_node *node)
{
TRACE;
return node;
}
void of_node_put(struct device_node *node)
{
TRACE;
}
/***********************************
** drivers/soc/imx/sc/main/ipc.c **
***********************************/
int sc_ipc_getMuID(uint32_t *mu_id)
{
TRACE_AND_STOP;
return -1;
}
void sc_ipc_close(sc_ipc_t handle)
{
TRACE_AND_STOP;
}
sc_err_t sc_ipc_open(sc_ipc_t *handle, uint32_t id)
{
TRACE_AND_STOP;
return -1;
}
/********************************************
** drivers/soc/imx/sc/svc/misc/rpc_clnt.c **
********************************************/
sc_err_t sc_misc_set_control(sc_ipc_t ipc, sc_rsrc_t resource,
sc_ctrl_t ctrl, uint32_t val)
{
TRACE_AND_STOP;
return -1;
}
/***********************
** kernel/irq/chip.c **
***********************/
void handle_level_irq(struct irq_desc *desc)
{
TRACE_AND_STOP;
}
void handle_simple_irq(struct irq_desc *desc)
{
TRACE_AND_STOP;
}
void irq_chip_eoi_parent(struct irq_data *data)
{
TRACE;
}
struct irq_data *irq_get_irq_data(unsigned int irq)
{
TRACE_AND_STOP;
}
int irq_set_chip_data(unsigned int irq, void *data)
{
TRACE;
return 0;
}
/****************************
** kernel/irq/irqdomain.c **
****************************/
unsigned int irq_create_mapping(struct irq_domain *host, irq_hw_number_t hwirq)
{
TRACE_AND_STOP;
}
int irq_domain_xlate_twocell(struct irq_domain *d, struct device_node *ctrlr,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_type)
{
TRACE_AND_STOP;
return -1;
}
/******************
** lib/string.c **
******************/
char *strstr(const char * a0, const char * a1)
{
TRACE_AND_STOP;
return NULL;
}
/*****************
** linux/clk.h **
*****************/
void clk_disable_unprepare(struct clk *clk)
{
TRACE;
}
int clk_prepare_enable(struct clk *clk)
{
TRACE;
return 0;
}
/******************
** linux/gpio.h **
******************/
void gpio_free(unsigned gpio)
{
TRACE_AND_STOP;
}
int gpio_get_value(unsigned int gpio)
{
TRACE_AND_STOP;
}
bool gpio_is_valid(int number)
{
TRACE_AND_STOP;
return false;
}
int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
{
TRACE_AND_STOP;
}
void gpio_set_value(unsigned int gpio, int value)
{
TRACE_AND_STOP;
}
/*****************
** linux/i2c.h **
*****************/
struct i2c_client;
const struct of_device_id *i2c_of_match_device(const struct of_device_id *matches,
struct i2c_client *client)
{
TRACE_AND_STOP;
return NULL;
}
/*****************
** linux/irq.h **
*****************/
void irq_set_status_flags(unsigned int irq, unsigned long set)
{
TRACE;
}
void irqd_set_trigger_type(struct irq_data *d, u32 type)
{
TRACE_AND_STOP;
}
/****************
** linux/of.h **
****************/
bool is_of_node(const struct fwnode_handle *fwnode)
{
TRACE_AND_STOP;
return false;
}
/************************
** linux/pm_runtime.h **
************************/
int pm_runtime_get_sync(struct device *dev)
{
TRACE;
return 0;
}
int pm_runtime_put_sync(struct device *dev)
{
TRACE_AND_STOP;
return 0;
}
/**********************
** linux/spinlock.h **
**********************/
void assert_spin_locked(spinlock_t *lock)
{
TRACE;
}
/*************************
** linux/timekeeping.h **
*************************/
ktime_t ktime_get_real(void)
{
TRACE_AND_STOP;
return -1;
}
/*************************
** linux/dma-mapping.h **
*************************/
int
dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
dma_addr_t dma_addr, size_t size,
unsigned long attrs)
{
TRACE_AND_STOP;
return -1;
}
int dma_mmap_wc(struct device *dev,
struct vm_area_struct *vma,
void *cpu_addr, dma_addr_t dma_addr,
size_t size)
{
TRACE_AND_STOP;
return -1;
}
/************************
** linux/pm-runtime.h **
************************/
void pm_runtime_enable(struct device *dev)
{
TRACE;
}
void pm_runtime_disable(struct device *dev)
{
TRACE_AND_STOP;
}
int acpi_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *ev)
{
TRACE_AND_STOP;
return -1;
}
bool acpi_driver_match_device(struct device *dev, const struct device_driver *drv)
{
TRACE_AND_STOP;
return -1;
}
const char *acpi_dev_name(struct acpi_device *adev)
{
TRACE_AND_STOP;
return NULL;
}
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
{
TRACE_AND_STOP;
return -1;
}
void destroy_workqueue(struct workqueue_struct *wq)
{
TRACE_AND_STOP;
}
int device_init_wakeup(struct device *dev, bool val)
{
TRACE_AND_STOP;
return -1;
}
void down_read(struct rw_semaphore *sem)
{
TRACE_AND_STOP;
}
struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj,
int flags)
{
TRACE_AND_STOP;
return NULL;
}
int drm_gem_prime_fd_to_handle(struct drm_device *dev, struct drm_file *file_priv, int prime_fd, uint32_t *handle)
{
TRACE_AND_STOP;
return -1;
}
int drm_gem_prime_handle_to_fd(struct drm_device *dev, struct drm_file *file_priv, uint32_t handle, uint32_t flags, int *prime_fd)
{
TRACE_AND_STOP;
return -1;
}
struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
struct dma_buf *dma_buf)
{
TRACE_AND_STOP;
return NULL;
}
long drm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
TRACE_AND_STOP;
return -1;
}
int drm_open(struct inode *inode, struct file *filp)
{
TRACE_AND_STOP;
return -1;
}
unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
{
TRACE_AND_STOP;
return -1;
}
void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg)
{
TRACE_AND_STOP;
}
ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset)
{
TRACE_AND_STOP;
return -1;
}
int drm_release(struct inode *inode, struct file *filp)
{
TRACE_AND_STOP;
return -1;
}
void ndelay(unsigned long ns)
{
TRACE_AND_STOP;
}
loff_t noop_llseek(struct file *file, loff_t offset, int whence)
{
TRACE_AND_STOP;
return -1;
}
int of_alias_get_id(struct device_node *np, const char *stem)
{
TRACE_AND_STOP;
return -ENOSYS;
}
int of_irq_get(struct device_node *dev, int index)
{
TRACE_AND_STOP;
return -1;
}
int of_irq_get_byname(struct device_node *dev, const char *name)
{
TRACE_AND_STOP;
return -1;
}
pgprot_t pgprot_writecombine(pgprot_t prot)
{
TRACE_AND_STOP;
return prot;
}
void print_hex_dump(const char *level, const char *prefix_str, int prefix_type, int rowsize, int groupsize, const void *buf, size_t len, bool ascii)
{
TRACE;
}
int PTR_ERR_OR_ZERO(__force const void *ptr)
{
TRACE_AND_STOP;
return -1;
}
void up_read(struct rw_semaphore *sem)
{
TRACE_AND_STOP;
}
pgprot_t vm_get_page_prot(unsigned long vm_flags)
{
pgprot_t prot;
TRACE_AND_STOP;
return prot;
}
void ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
{
TRACE_AND_STOP;
}
int ww_mutex_lock_slow_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
{
TRACE_AND_STOP;
return -1;
}
int ww_mutex_trylock(struct ww_mutex *lock)
{
TRACE_AND_STOP;
return -1;
}
int ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
{
TRACE_AND_STOP;
return -1;
}
void might_lock(struct mutex *m)
{
TRACE;
}
void write_lock(rwlock_t *l)
{
TRACE;
}
void write_unlock(rwlock_t *l)
{
TRACE;
}
void read_lock(rwlock_t *l)
{
TRACE_AND_STOP;
}
void read_unlock(rwlock_t *l)
{
TRACE_AND_STOP;
}
void write_seqlock(seqlock_t *l)
{
TRACE;
}
void write_sequnlock(seqlock_t *l)
{
TRACE;
}
unsigned read_seqbegin(const seqlock_t *s)
{
TRACE;
return 0;
}
unsigned read_seqretry(const seqlock_t *s, unsigned x)
{
TRACE;
return 0;
}
struct dma_fence * reservation_object_get_excl_rcu(struct reservation_object *obj)
{
TRACE;
return obj->fence_excl;
}
void rwlock_init(rwlock_t *rw)
{
TRACE;
}
unsigned long vma_pages(struct vm_area_struct *p)
{
TRACE_AND_STOP;
return 0;
}
void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *))
{
TRACE;
func(head);
}
void seqlock_init (seqlock_t *s)
{
TRACE;
}
void irq_domain_remove(struct irq_domain *d)
{
TRACE_AND_STOP;
}
pgprot_t pgprot_decrypted(pgprot_t prot)
{
TRACE_AND_STOP;
return prot;
}
void dma_buf_put(struct dma_buf *buf)
{
TRACE_AND_STOP;
}
int ___ratelimit(struct ratelimit_state *rs, const char *func)
{
TRACE_AND_STOP;
return 0;
}
bool _drm_lease_held(struct drm_file *f, int x)
{
TRACE_AND_STOP;
return false;
}
long long atomic64_add_return(long long i, atomic64_t *p)
{
TRACE;
p->counter += i;
return p->counter;
}

View File

@ -0,0 +1,227 @@
/*
* \brief i.MX8 framebuffer driver session component
* \author Stefan Kalkowski
* \author Christian Prochaska
* \date 2015-10-16
*/
/*
* Copyright (C) 2015-2019 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef __COMPONENT_H__
#define __COMPONENT_H__
/* Genode includes */
#include <base/component.h>
#include <base/rpc_server.h>
#include <root/component.h>
#include <dataspace/capability.h>
#include <framebuffer_session/framebuffer_session.h>
#include <timer_session/connection.h>
#include <util/reconstructible.h>
#include <base/attached_dataspace.h>
#include <base/attached_ram_dataspace.h>
#include <base/attached_rom_dataspace.h>
#include <os/reporter.h>
#include <os/pixel_rgb565.h>
#include <os/pixel_rgb888.h>
#include <os/dither_painter.h>
#include <lx_emul_c.h>
namespace Framebuffer {
class Driver;
class Session_component;
class Root;
}
class Framebuffer::Driver
{
private:
struct Configuration
{
struct lx_c_fb_config _lx = { 16, 64, 64, 4,
nullptr, 0, nullptr };
} _config;
Session_component &_session;
Timer::Connection _timer;
Genode::Reporter _reporter;
Genode::Signal_context_capability _config_sigh;
drm_display_mode * _preferred_mode(drm_connector *connector,
unsigned &brightness);
public:
Driver(Genode::Env & env, Session_component &session)
: _session(session), _timer(env),
_reporter(env, "connectors") {}
int width() const { return _config._lx.width; }
int height() const { return _config._lx.height; }
int bpp() const { return _config._lx.bpp; }
void * fb_addr() const { return _config._lx.addr; }
unsigned pitch() const { return _config._lx.pitch; }
void finish_initialization();
void update_mode();
void generate_report();
/**
* Register signal handler used for config updates
*
* The signal handler is artificially triggered as a side effect
* of connector changes.
*/
void config_sigh(Genode::Signal_context_capability sigh)
{
_config_sigh = sigh;
}
void trigger_reconfiguration()
{
/*
* Trigger the reprocessing of the configuration following the
* same ontrol flow as used for external config changes.
*/
if (_config_sigh.valid())
Genode::Signal_transmitter(_config_sigh).submit();
else
Genode::warning("config signal handler unexpectedly undefined");
}
};
class Framebuffer::Session_component : public Genode::Rpc_object<Session>
{
private:
template <typename T> using Lazy = Genode::Constructible<T>;
Driver _driver;
Genode::Attached_rom_dataspace &_config;
Genode::Signal_context_capability _mode_sigh;
Timer::Connection _timer;
Genode::Ram_allocator &_ram;
Genode::Attached_ram_dataspace _ds;
bool _in_mode_change = true;
public:
Session_component(Genode::Env &env,
Genode::Attached_rom_dataspace &config)
: _driver(env, *this), _config(config), _timer(env),
_ram(env.ram()), _ds(env.ram(), env.rm(), 0) {}
Driver & driver() { return _driver; }
void config_changed()
{
_config.update();
if (!_config.valid()) return;
_in_mode_change = true;
_driver.update_mode();
if (_mode_sigh.valid())
Genode::Signal_transmitter(_mode_sigh).submit();
}
Genode::Xml_node config() { return _config.xml(); }
int force_width_from_config()
{
return _config.xml().attribute_value<unsigned>("force_width", 0);
}
int force_height_from_config()
{
return _config.xml().attribute_value<unsigned>("force_height", 0);
}
/***********************************
** Framebuffer session interface **
***********************************/
Genode::Dataspace_capability dataspace() override
{
_ds.realloc(&_ram, _driver.width() * _driver.height() *
Mode::bytes_per_pixel(Mode::RGB565));
_in_mode_change = false;
return _ds.cap();
}
Mode mode() const override {
return Mode(_driver.width(), _driver.height(), Mode::RGB565); }
void mode_sigh(Genode::Signal_context_capability sigh) override {
_mode_sigh = sigh; }
void sync_sigh(Genode::Signal_context_capability sigh) override
{
_timer.sigh(sigh);
_timer.trigger_periodic(10*1000);
}
void refresh(int x, int y, int w, int h) override
{
using namespace Genode;
if (!_driver.fb_addr() ||
!_ds.local_addr<void>() ||
_in_mode_change) return;
int width = _driver.width();
int height = _driver.height();
/* clip specified coordinates against screen boundaries */
int x2 = min(x + w - 1, width - 1),
y2 = min(y + h - 1, height - 1);
int x1 = max(x, 0),
y1 = max(y, 0);
if (x1 > x2 || y1 > y2) return;
/* copy pixels from back buffer to physical frame buffer */
Genode::Pixel_rgb565 * src = _ds.local_addr<Genode::Pixel_rgb565>();
Genode::Pixel_rgb888 * dst = (Genode::Pixel_rgb888*)_driver.fb_addr();
for (int row = y1; row <= y2; row++) {
for (int col = x1; col <= x2; col++) {
Genode::Pixel_rgb565 px = src[width * row + col];
dst[width * row + col] = Genode::Pixel_rgb888(px.r(), px.g(), px.b(), px.a());
}
}
}
};
struct Framebuffer::Root
: Genode::Root_component<Framebuffer::Session_component, Genode::Single_client>
{
Session_component session; /* single session */
Session_component *_create_session(const char *) override {
return &session; }
void _destroy_session(Session_component *) override { }
Root(Genode::Env &env, Genode::Allocator &alloc,
Genode::Attached_rom_dataspace &config)
: Genode::Root_component<Session_component,
Genode::Single_client>(env.ep(), alloc),
session(env, config) { }
};
#endif /* __COMPONENT_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
/*
* \brief C-declarations needed for device driver environment
* \author Stefan Kalkowski
* \author Norman Feske
* \date 2016-06-17
*/
#ifndef _LX_EMUL_C_H_
#define _LX_EMUL_C_H_
#if 0
#define TRACE \
do { \
lx_printf("%s not implemented\n", __func__); \
} while (0)
#else
#define TRACE do { ; } while (0)
#endif
#define TRACE_AND_STOP \
do { \
lx_printf("%s not implemented\n", __func__); \
BUG(); \
} while (0)
#define ASSERT(x) \
do { \
if (!(x)) { \
lx_printf("%s:%u assertion failed\n", __func__, __LINE__); \
BUG(); \
} \
} while (0)
#include <lx_emul/extern_c_begin.h>
struct drm_device;
struct drm_framebuffer;
struct drm_display_mode;
struct drm_connector;
struct lx_c_fb_config {
int height;
int width;
unsigned pitch;
unsigned bpp;
void * addr;
unsigned long size;
struct drm_framebuffer * lx_fb;
};
void lx_c_allocate_framebuffer(struct drm_device *,
struct lx_c_fb_config *);
void lx_c_set_mode(struct drm_device *, struct drm_connector *,
struct drm_framebuffer *, struct drm_display_mode *);
void lx_c_set_driver(struct drm_device *, void *);
void * lx_c_get_driver(struct drm_device *);
#include <lx_emul/extern_c_end.h>
#endif /* _LX_EMUL_C_H_ */

View File

@ -0,0 +1,81 @@
/*
* \brief Platform_device implementation for ARM
* \author Sebastian Sumpf
* \date 2016-04-25
*
* Note: Throw away when there exists a plaform device implementation for ARM
* in generic code
*/
/*
* Copyright (C) 2016-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _ARM__PLATFORM_DEVICE__PLATFORM_DEVICE_H_
#define _ARM__PLATFORM_DEVICE__PLATFORM_DEVICE_H_
#include <lx_emul/extern_c_begin.h>
#include <lx_emul/printf.h>
#include <lx_emul/extern_c_end.h>
#include <lx_kit/malloc.h>
#include <platform_device/device.h>
#include <irq_session/connection.h>
#include <util/list.h>
#include <util/reconstructible.h>
namespace Platform { struct Device; }
struct Platform::Device : Platform::Abstract_device, Genode::List<Device>::Element
{
Genode::Env &env;
unsigned irq_num;
Genode::Constructible<Genode::Irq_connection> irq_connection;
Device(Genode::Env &env, unsigned irq) : env(env), irq_num(irq) { }
unsigned vendor_id() { return ~0U; }
unsigned device_id() { return ~0U; }
Genode::Irq_session_capability irq(Genode::uint8_t) override
{
irq_connection.construct(env, irq_num);
return irq_connection->cap();
}
Genode::Io_mem_session_capability io_mem(Genode::uint8_t,
Genode::Cache_attribute,
Genode::addr_t, Genode::size_t) override
{
lx_printf("%s: not implemented\n", __PRETTY_FUNCTION__);
return Genode::Io_mem_session_capability();
}
static Genode::List<Device> &list()
{
static Genode::List<Device> l;
return l;
}
static Device &create(Genode::Env &env, unsigned irq_num)
{
Device *d;
for (d = list().first(); d; d = d->next())
if (d->irq_num == irq_num)
return *d;
d = new (Lx::Malloc::mem()) Device(env, irq_num);
list().insert(d);
return *d;
}
};
#endif /* _ARM__PLATFORM_DEVICE__PLATFORM_DEVICE_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,169 @@
/*
* \brief Linux emulation C helper functions
* \author Stefan Kalkowski
* \author Christian Prochaska
* \date 2016-03-22
*/
/*
* Copyright (C) 2016-2019 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <lx_emul.h>
#include <lx_emul_c.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_modeset_helper.h>
#include <imx/imx-drm.h>
void lx_c_allocate_framebuffer(struct drm_device * dev,
struct lx_c_fb_config *c)
{
/* from drm_fbdev_cma_create() */
struct drm_gem_cma_object *obj;
c->pitch = c->width * c->bpp;
c->size = c->pitch * c->height;
obj = drm_gem_cma_create(dev, c->size);
if (obj == NULL)
return;
c->addr = obj->vaddr;
/* from drm_gem_fb_alloc() */
struct drm_framebuffer *fb = kzalloc(sizeof(*fb), GFP_KERNEL);
if (fb == NULL)
goto err;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
mode_cmd.width = c->width;
mode_cmd.height = c->height;
mode_cmd.pitches[0] = c->pitch;
mode_cmd.pixel_format = DRM_FORMAT_XRGB8888;
drm_helper_mode_fill_fb_struct(dev, fb, &mode_cmd);
fb->obj[0] = &obj->base;
static const struct drm_framebuffer_funcs drm_fb_cma_funcs = {
.destroy = drm_gem_fb_destroy,
};
if (drm_framebuffer_init(dev, fb, &drm_fb_cma_funcs) != 0) {
kfree(fb);
goto err;
}
c->lx_fb = fb;
memset_io(c->addr, 0, c->size);
return;
err:
drm_gem_object_put_unlocked(&obj->base); /* as in drm_gem_cma_create() */
return;
}
void lx_c_set_mode(struct drm_device * dev, struct drm_connector * connector,
struct drm_framebuffer *fb, struct drm_display_mode *mode)
{
struct drm_crtc * crtc = NULL;
struct drm_encoder * encoder = connector->encoder;
if (!encoder) {
struct drm_encoder *enc;
list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
unsigned i;
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++)
if (connector->encoder_ids[i] == enc->base.id) break;
if (i == DRM_CONNECTOR_MAX_ENCODER) continue;
bool used = false;
struct drm_connector *c;
list_for_each_entry(c, &dev->mode_config.connector_list, head) {
if (c->encoder == enc) used = true;
}
if (used) continue;
encoder = enc;
break;
}
}
if (!encoder) {
lx_printf("Found no encoder for the connector %s\n", connector->name);
return;
}
unsigned used_crtc = 0;
crtc = encoder->crtc;
if (!crtc) {
unsigned i = 0;
struct drm_crtc *c;
list_for_each_entry(c, &dev->mode_config.crtc_list, head) {
if (!(encoder->possible_crtcs & (1 << i))) continue;
if (c->state->enable) {
used_crtc ++;
continue;
}
crtc = c;
break;
}
}
if (!crtc) {
if (mode)
lx_printf("Found no crtc for the connector %s used/max %u+1/%u\n",
connector->name, used_crtc, dev->mode_config.num_crtc);
return;
}
DRM_DEBUG("%s%s for connector %s\n", mode ? "set mode " : "no mode",
mode ? mode->name : "", connector->name);
struct drm_mode_set set;
set.crtc = crtc;
set.x = 0;
set.y = 0;
set.mode = mode;
set.connectors = &connector;
set.num_connectors = mode ? 1 : 0;
set.fb = mode ? fb : 0;
uint32_t const ref_cnt_before = drm_framebuffer_read_refcount(fb);
int ret = drm_atomic_helper_set_config(&set, dev->mode_config.acquire_ctx);
if (ret)
lx_printf("Error: set config failed ret=%d refcnt before=%u after=%u\n",
ret, ref_cnt_before, drm_framebuffer_read_refcount(fb));
}
void lx_c_set_driver(struct drm_device * dev, void * driver)
{
struct imx_drm_device *dev_priv = dev->dev_private;
ASSERT(!dev_priv->fbhelper);
dev_priv->fbhelper = (struct drm_fbdev_cma *) driver;
}
void* lx_c_get_driver(struct drm_device * dev)
{
struct imx_drm_device *dev_priv = dev->dev_private;
return (void*) dev_priv->fbhelper;
}

View File

@ -0,0 +1,264 @@
/*
* \brief i.MX8 framebuffer driver
* \author Norman Feske
* \author Stefan Kalkowski
* \author Christian Prochaska
* \date 2015-08-19
*/
/*
* Copyright (C) 2015-2019 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/log.h>
#include <base/component.h>
#include <base/heap.h>
#include <base/attached_rom_dataspace.h>
/* Server related local includes */
#include <component.h>
/* Linux emulation environment includes */
#include <lx_emul.h>
#include <lx_kit/env.h>
#include <lx_kit/malloc.h>
#include <lx_kit/scheduler.h>
#include <lx_kit/timer.h>
#include <lx_kit/irq.h>
#include <lx_kit/work.h>
/* Linux module functions */
extern "C" void radix_tree_init(); /* called by start_kernel(void) normally */
extern "C" void drm_connector_ida_init(); /* called by drm_core_init(void) normally */
extern "C" int module_irq_imx_irqsteer_init();
extern "C" int module_imx_drm_pdrv_init();
extern "C" int module_dcss_driver_init();
extern "C" int module_dcss_crtc_driver_init();
extern "C" int module_imx_hdp_imx_platform_driver_init();
static void run_linux(void * m);
unsigned long jiffies;
struct Main
{
Genode::Env &env;
Genode::Entrypoint &ep { env.ep() };
Genode::Attached_rom_dataspace config { env, "config" };
Genode::Heap heap { env.ram(), env.rm() };
Framebuffer::Root root { env, heap, config };
/* Linux task that handles the initialization */
Genode::Constructible<Lx::Task> linux;
Main(Genode::Env &env) : env(env)
{
Genode::log("--- i.MX8 framebuffer driver ---");
Lx_kit::construct_env(env);
LX_MUTEX_INIT(bridge_lock);
LX_MUTEX_INIT(core_lock);
LX_MUTEX_INIT(component_mutex);
/* init singleton Lx::Scheduler */
Lx::scheduler(&env);
Lx::malloc_init(env, heap);
/* init singleton Lx::Timer */
Lx::timer(&env, &ep, &heap, &jiffies);
/* init singleton Lx::Irq */
Lx::Irq::irq(&ep, &heap);
/* init singleton Lx::Work */
Lx::Work::work_queue(&heap);
linux.construct(run_linux, reinterpret_cast<void*>(this),
"linux", Lx::Task::PRIORITY_0, Lx::scheduler());
/* give all task a first kick before returning */
Lx::scheduler().schedule();
}
void announce() { env.parent().announce(ep.manage(root)); }
Lx::Task &linux_task() { return *linux; }
};
struct Policy_agent
{
Main &main;
Genode::Signal_handler<Policy_agent> handler;
bool _pending = false;
void handle()
{
_pending = true;
main.linux_task().unblock();
Lx::scheduler().schedule();
}
bool pending()
{
bool ret = _pending;
_pending = false;
return ret;
}
Policy_agent(Main &m)
: main(m), handler(main.ep, *this, &Policy_agent::handle) {}
};
static void run_linux(void * m)
{
Main * main = reinterpret_cast<Main*>(m);
system_wq = alloc_workqueue("system_wq", 0, 0);
radix_tree_init();
drm_connector_ida_init();
module_irq_imx_irqsteer_init();
module_dcss_driver_init();
module_imx_drm_pdrv_init();
module_dcss_crtc_driver_init();
module_imx_hdp_imx_platform_driver_init();
/**
* This device is originally created with the name '32e2d000.irqsteer'
* via 'of_platform_bus_create()'. Here it is called 'imx-irqsteer' to match
* the driver name.
*/
struct platform_device *imx_irqsteer_pdev =
platform_device_alloc("imx-irqsteer", 0);
static resource imx_irqsteer_resources[] = {
{ 0x32e2d000, 0x32e2dfff, "imx-irqsteer", IORESOURCE_MEM },
{ 50, 50, "imx-irqsteer", IORESOURCE_IRQ },
};
imx_irqsteer_pdev->num_resources = 2;
imx_irqsteer_pdev->resource = imx_irqsteer_resources;
imx_irqsteer_pdev->dev.of_node = (device_node*)kzalloc(sizeof(device_node), 0);
imx_irqsteer_pdev->dev.of_node->name = "imx-irqsteer";
imx_irqsteer_pdev->dev.of_node->full_name = "imx-irqsteer";
platform_device_register(imx_irqsteer_pdev);
/**
* This device is originally created with the name '32e00000.dcss'
* via 'of_platform_bus_create()'. Here it is called 'dcss-core' to match
* the driver name.
*/
struct platform_device *dcss_pdev =
platform_device_alloc("dcss-core", 0);
static resource dcss_resources[] = {
{ 0x32e00000, 0x32efffff, "dcss", IORESOURCE_MEM },
{ 3, 3, "dpr_dc_ch0", IORESOURCE_IRQ },
{ 4, 4, "dpr_dc_ch1", IORESOURCE_IRQ },
{ 5, 5, "dpr_dc_ch2", IORESOURCE_IRQ },
{ 6, 6, "ctx_ld", IORESOURCE_IRQ },
{ 8, 8, "ctxld_kick", IORESOURCE_IRQ },
{ 9, 9, "dtg_prg1", IORESOURCE_IRQ },
{ 16, 16, "dtrc_ch1", IORESOURCE_IRQ },
{ 17, 17, "dtrc_ch2", IORESOURCE_IRQ },
};
dcss_pdev->num_resources = 9;
dcss_pdev->resource = dcss_resources;
dcss_pdev->dev.of_node = (device_node*)kzalloc(sizeof(device_node), 0);
dcss_pdev->dev.of_node->name = "dcss";
dcss_pdev->dev.of_node->full_name = "dcss";
dcss_pdev->dev.of_node->properties = (property*)kzalloc(sizeof(property), 0);
dcss_pdev->dev.of_node->properties->name = "disp-dev";
dcss_pdev->dev.of_node->properties->value = (void*)"hdmi_disp";
platform_device_register(dcss_pdev);
/**
* This device is originally created with the name '32c00000.hdmi'
* via 'of_platform_bus_create()'. Here it is called 'i.mx8-hdp' to match
* the driver name.
*/
struct platform_device *hdp_pdev =
platform_device_alloc("i.mx8-hdp", 0);
static resource hdp_resources[] = {
{ 0x32c00000, 0x32cfffff, "hdp_ctrl", IORESOURCE_MEM },
{ 0x32e40000, 0x32e7ffff, "hdp_crs", IORESOURCE_MEM },
{ 0x32e2f000, 0x32e2f00f, "hdp_reset", IORESOURCE_MEM },
{ 48, 48, "plug_in", IORESOURCE_IRQ },
{ 57, 57, "plug_out", IORESOURCE_IRQ },
};
hdp_pdev->num_resources = 5;
hdp_pdev->resource = hdp_resources;
hdp_pdev->dev.of_node = (device_node*)kzalloc(sizeof(device_node), 0);
hdp_pdev->dev.of_node->name = "hdmi";
hdp_pdev->dev.of_node->full_name = "hdmi";
hdp_pdev->dev.of_node->properties = (property*)kzalloc(sizeof(property), 0);
hdp_pdev->dev.of_node->properties->name = "compatible";
hdp_pdev->dev.of_node->properties->value = (void*)"fsl,imx8mq-hdmi";
platform_device_register(hdp_pdev);
/**
* This device is originally created with the name 'display-subsystem'
* via 'of_platform_bus_create()'. Here it is called 'imx-drm' to match
* the driver name.
*/
struct platform_device *display_subsystem_pdev =
platform_device_alloc("imx-drm", 0);
static device_node display_subsystem_of_node = { "display-subsystem" };
display_subsystem_pdev->dev.of_node = &display_subsystem_of_node;
platform_device_register(display_subsystem_pdev);
main->root.session.driver().finish_initialization();
main->announce();
Policy_agent pa(*main);
main->root.session.driver().config_sigh(pa.handler);
main->config.sigh(pa.handler);
while (1) {
Lx::scheduler().current()->block_and_schedule();
while (pa.pending())
main->root.session.config_changed();
}
}
void Component::construct(Genode::Env &env)
{
/* XXX execute constructors of global statics */
env.exec_static_constructors();
static Main m(env);
}

View File

@ -0,0 +1,39 @@
/*
* \brief Platform driver relevant lx_kit backend functions
* \author Stefan Kalkowski
* \date 2017-11-01
*
* Taken from the USB driver.
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <base/ram_allocator.h>
#include <lx_kit/backend_alloc.h>
#include <lx_kit/env.h>
/****************************
** lx_kit/backend_alloc.h **
****************************/
void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&,
Genode::Allocator&)
{
/* intentionally left blank */
}
Genode::Ram_dataspace_capability
Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) {
return Lx_kit::env().env().ram().alloc(size, cached); }
void Lx::backend_free(Genode::Ram_dataspace_capability cap) {
return Lx_kit::env().env().ram().free(cap); }

View File

@ -0,0 +1,23 @@
REQUIRES = arm_v8a
TARGET = imx8_fb_drv
LIBS = base imx8_fb_include lx_kit_setjmp imx8_fb_drv
SRC_CC = main.cc platform.cc lx_emul.cc
SRC_C = dummies.c lx_emul_c.c
# lx_kit
SRC_CC += printf.cc \
env.cc \
irq.cc \
malloc.cc \
scheduler.cc \
timer.cc \
work.cc
INC_DIR += $(REP_DIR)/src/include
vpath %.cc $(PRG_DIR)
vpath %.cc $(REP_DIR)/src/lx_kit
CC_CXX_WARN_STRICT =
CC_OPT += -Wno-narrowing

View File

@ -154,8 +154,8 @@ LX_MUTEX_INIT_DECLARE(phy_fixup_lock);
#include <lx_emul/bitops.h>
#include <lx_emul/atomic.h>
#include <lx_emul/work.h>
#include <lx_emul/spinlock.h>
#include <lx_emul/work.h>
#include <lx_emul/errno.h>
#include <lx_emul/string.h>
#include <lx_emul/module.h>

View File

@ -20,6 +20,7 @@
***********************/
enum {
WQ_UNBOUND = 1 << 1,
WQ_FREEZABLE = 1 << 2,
WQ_MEM_RECLAIM = 1 << 3,
WQ_HIGHPRI = 1 << 4,
@ -147,7 +148,10 @@ enum {
typedef struct wait_queue_entry wait_queue_entry_t;
typedef int (*wait_queue_func_t)(wait_queue_entry_t *, unsigned, int, void *);
typedef struct wait_queue_head { void *list; } wait_queue_head_t;
typedef struct wait_queue_head {
spinlock_t lock;
void *list;
} wait_queue_head_t;
struct wait_queue_entry {
unsigned int flags;
void *private;
@ -176,6 +180,7 @@ void __wake_up(wait_queue_head_t *q, bool all);
#define wake_up(x) __wake_up(x, false)
#define wake_up_all(x) __wake_up(x, true)
#define wake_up_all_locked(x) __wake_up(x, true)
#define wake_up_interruptible(x) __wake_up(x, false)
#define wake_up_interruptible_all(x) __wake_up(x, true)
@ -202,6 +207,7 @@ void ___wait_event(wait_queue_head_t*);
#define _wait_event(wq, condition) while (!(condition)) { __wait_event(wq); }
#define wait_event(wq, condition) ({ _wait_event(wq, condition); })
#define wait_event_interruptible(wq, condition) ({ _wait_event(wq, condition); 0; })
#define wait_event_interruptible_locked(wq, condition) ({ _wait_event(wq, condition); 0; })
#define _wait_event_timeout(wq, condition, timeout) \
({ int res = 1; \

View File

@ -987,17 +987,8 @@ unsigned long int_sqrt(unsigned long);
** linux/workqueue.h **
***********************/
struct workqueue_struct; /* XXX fix in lx_emul/work.h */
#include <lx_emul/work.h>
enum {
WQ_UNBOUND = 1<<1,
// WQ_MEM_RECLAIM = 1<<3,
// WQ_HIGHPRI = 1<<4,
// WQ_CPU_INTENSIVE = 1<<5,
};
extern struct workqueue_struct *system_power_efficient_wq;