diff --git a/repos/dde_linux/imx8_fb.list b/repos/dde_linux/imx8_fb.list
index c82d1c0dff..49c4384075 100644
--- a/repos/dde_linux/imx8_fb.list
+++ b/repos/dde_linux/imx8_fb.list
@@ -18,6 +18,7 @@ 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_mipi_dsi.c
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
@@ -31,8 +32,10 @@ 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/bridge/nwl-dsi.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/nwl_dsi-imx.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
@@ -61,6 +64,7 @@ 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/drm/panel/panel-raydium-rm67191.c
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
@@ -111,6 +115,7 @@ 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/phy/phy-mixel-mipi-dsi.c
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
@@ -145,6 +150,7 @@ 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_mipi_dsi.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
@@ -163,6 +169,7 @@ 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/drm/bridge/nwl_dsi.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
@@ -183,12 +190,16 @@ 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/phy.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/linux/mfd/syscon/imx8mq-iomuxc-gpr.h
+linux-x.x.x/include/linux/phy/phy.h
+linux-x.x.x/include/linux/phy/phy-mixel-mipi-dsi.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
@@ -204,6 +215,7 @@ 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/mipi_display.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
diff --git a/repos/dde_linux/lib/mk/spec/arm_64/imx8_fb_drv.mk b/repos/dde_linux/lib/mk/spec/arm_64/imx8_fb_drv.mk
index d177acfcac..a80f3fd11a 100644
--- a/repos/dde_linux/lib/mk/spec/arm_64/imx8_fb_drv.mk
+++ b/repos/dde_linux/lib/mk/spec/arm_64/imx8_fb_drv.mk
@@ -8,20 +8,27 @@ 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/bridge/*.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/drm/panel/*.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/phy/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/video/*.c))
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/lib/*.c))
+
+CC_OPT_nwl-dsi += -DMOD_SUFFIX=_bridge
+
#
# Linux sources are C89 with GNU extensions
#
CC_C_OPT += -std=gnu89
+
#
# Reduce build noise of compiling contrib code
#
@@ -34,12 +41,15 @@ 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/bridge
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/drm/panel
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/phy
vpath %.c $(LX_CONTRIB_DIR)/drivers/video
vpath %.c $(LX_CONTRIB_DIR)/lib
diff --git a/repos/dde_linux/patches/imx8_fb_dcss_blkctl.patch b/repos/dde_linux/patches/imx8_fb_dcss_blkctl.patch
index 66a974f364..3b0f41942b 100644
--- a/repos/dde_linux/patches/imx8_fb_dcss_blkctl.patch
+++ b/repos/dde_linux/patches/imx8_fb_dcss_blkctl.patch
@@ -1,23 +1,13 @@
-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
+index 2f13b33..a4b0620 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);
+@@ -81,7 +81,7 @@ void dcss_blkctl_cfg(struct dcss_soc *dcss)
+ struct dcss_blkctl_priv *blkctl = dcss->blkctl_priv;
- return 0;
+ if (blkctl->hdmi_output)
+- dcss_writel((blkctl->clk_setting ^ HDMI_MIPI_CLK_SEL),
++ dcss_writel((blkctl->clk_setting),
+ blkctl->base_reg + DCSS_BLKCTL_CONTROL0);
+ else
+ dcss_writel((blkctl->clk_setting ^ HDMI_MIPI_CLK_SEL) |
diff --git a/repos/dde_linux/patches/imx8_fb_imx_drm_core.patch b/repos/dde_linux/patches/imx8_fb_imx_drm_core.patch
index dfef7cb5cd..e32b32ceda 100644
--- a/repos/dde_linux/patches/imx8_fb_imx_drm_core.patch
+++ b/repos/dde_linux/patches/imx8_fb_imx_drm_core.patch
@@ -1,7 +1,5 @@
-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
+index 453100d..05ef413 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)
@@ -14,7 +12,7 @@ index 76b782c..a2c3a76 100644
}
DEFINE_DRM_GEM_CMA_FOPS(imx_drm_driver_fops);
-@@ -120,6 +122,17 @@ static int compare_of(struct device *dev, void *data)
+@@ -120,6 +122,20 @@ static int compare_of(struct device *dev, void *data)
{
struct device_node *np = data;
@@ -26,13 +24,16 @@ index 76b782c..a2c3a76 100644
+ (strncmp(np->name, "hdmi", strlen(np->name)) == 0))
+ return 1;
+
++ if (strcmp(dev->driver->name, "nwl_dsi-imx") == 0 && strcmp(np->name, "mipi_dsi") == 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)
+@@ -161,6 +177,7 @@ static int compare_of(struct device *dev, void *data)
}
return dev->of_node == np;
@@ -40,7 +41,7 @@ index 76b782c..a2c3a76 100644
}
static const char *const imx_drm_dpu_comp_parents[] = {
-@@ -416,8 +430,10 @@ static void imx_drm_unbind(struct device *dev)
+@@ -416,8 +433,10 @@ static void imx_drm_unbind(struct device *dev)
drm_kms_helper_poll_fini(drm);
diff --git a/repos/dde_linux/ports/dde_linux.hash b/repos/dde_linux/ports/dde_linux.hash
index a033b2de3a..b8ac8ff75f 100644
--- a/repos/dde_linux/ports/dde_linux.hash
+++ b/repos/dde_linux/ports/dde_linux.hash
@@ -1 +1 @@
-173719007927a108a9558e727b8c9b388f3159a2
+12e42f3a812a4d84a068782f0a65936e7e7de884
diff --git a/repos/dde_linux/recipes/pkg/drivers_interactive-imx8q_evk/hash b/repos/dde_linux/recipes/pkg/drivers_interactive-imx8q_evk/hash
index b74ef6a06a..2687128b26 100644
--- a/repos/dde_linux/recipes/pkg/drivers_interactive-imx8q_evk/hash
+++ b/repos/dde_linux/recipes/pkg/drivers_interactive-imx8q_evk/hash
@@ -1 +1 @@
-2020-09-16 20a4af22bc5eb3b01c66324e77645662e8801b1a
+2020-06-12 ce8ce6fad1a020458658f5bb86e582eab4758dee
diff --git a/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/drivers.config b/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/drivers.config
index 31c0191211..19fab72224 100644
--- a/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/drivers.config
+++ b/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/drivers.config
@@ -64,18 +64,44 @@
parent="system_pll1_clk"
rate="400000000"
driver_name="rtrm"/>
-
+
+ rate="120000000"
+ driver_name="pix"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -89,6 +115,8 @@
+
+
@@ -104,7 +132,13 @@
-
+
+
+
+
+
+
+
@@ -115,17 +149,21 @@
-
+
+
+
+
+
+
+
-
+
-
-
diff --git a/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/fb_drv.config b/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/fb_drv.config
index 86163198e2..87dd8ee5f1 100644
--- a/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/fb_drv.config
+++ b/repos/dde_linux/recipes/raw/drivers_interactive-imx8q_evk/fb_drv.config
@@ -1,3 +1,4 @@
+
diff --git a/repos/dde_linux/recipes/src/imx8_fb_drv/hash b/repos/dde_linux/recipes/src/imx8_fb_drv/hash
index d971fadbc2..42b6a8db59 100644
--- a/repos/dde_linux/recipes/src/imx8_fb_drv/hash
+++ b/repos/dde_linux/recipes/src/imx8_fb_drv/hash
@@ -1 +1 @@
-2020-09-16 fad4ed0507a29556deddce535fc45963241f856d
+2020-06-12 b9cbb9da87bc382d55c3345bcb5da6b845b57aec
diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/dummies.c b/repos/dde_linux/src/drivers/framebuffer/imx8/dummies.c
index 685980f5cb..9a4dd1811b 100644
--- a/repos/dde_linux/src/drivers/framebuffer/imx8/dummies.c
+++ b/repos/dde_linux/src/drivers/framebuffer/imx8/dummies.c
@@ -121,6 +121,29 @@ void drm_dev_unregister(struct drm_device *dev)
}
+/***********************
+ ** linux/drm_panel.h **
+ ***********************/
+
+void drm_panel_init(struct drm_panel *panel)
+{
+ TRACE;
+}
+
+
+void drm_panel_remove(struct drm_panel *panel)
+{
+ TRACE_AND_STOP;
+}
+
+
+int drm_panel_detach(struct drm_panel *panel)
+{
+ TRACE;
+ return -1;
+}
+
+
/*****************************************
** drivers/gpu/drm/drm_fb_cma_helper.c **
*****************************************/
@@ -295,12 +318,6 @@ void clk_disable_unprepare(struct clk *clk)
TRACE;
}
-int clk_prepare_enable(struct clk *clk)
-{
- TRACE;
- return 0;
-}
-
/******************
** linux/gpio.h **
@@ -373,6 +390,7 @@ bool is_of_node(const struct fwnode_handle *fwnode)
}
+
/************************
** linux/pm_runtime.h **
************************/
@@ -411,6 +429,53 @@ ktime_t ktime_get_real(void)
}
+/***********************
+ ** linux/of_device.h **
+ ***********************/
+
+int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env)
+{
+ TRACE_AND_STOP;
+ return -ENODEV;
+}
+
+
+/********************
+ ** linux/device.h **
+ ********************/
+
+void device_initialize(struct device *dev)
+{
+ TRACE;
+}
+
+void device_unregister(struct device *dev)
+{
+ TRACE;
+}
+
+
+/***********************
+ ** video/videomode.h **
+ ***********************/
+
+void videomode_from_timing(const struct display_timing *dt, struct videomode *vm)
+{
+ TRACE_AND_STOP;
+}
+
+
+/***********************
+ ** linux/backlight.h **
+ ***********************/
+
+int backlight_disable(struct backlight_device *bd)
+{
+ TRACE_AND_STOP;
+ return -1;
+}
+
+
/*************************
** linux/dma-mapping.h **
*************************/
@@ -434,6 +499,76 @@ int dma_mmap_wc(struct device *dev,
}
+/*****************
+ ** linux/phy.h **
+ *****************/
+struct phy;
+struct phy_provider *__devm_of_phy_provider_register(struct device *dev,
+ struct device_node *children,
+ struct module *owner,
+ struct phy * (*of_xlate)(struct device *dev,
+ struct of_phandle_args *args))
+{
+ TRACE;
+ return NULL;
+}
+
+
+struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args *args)
+{
+ TRACE_AND_STOP;
+ return NULL;
+}
+
+
+int phy_power_off(struct phy *phy)
+{
+ TRACE;
+ return -1;
+}
+
+
+int phy_exit(struct phy *phy)
+{
+ TRACE;
+ return -1;
+}
+
+
+/***********************
+ ** linux/interrupt.h **
+ ***********************/
+
+void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id)
+{
+ TRACE;
+}
+
+
+/********************************
+ ** linux/unaligned/generic.h **
+ ********************************/
+
+u32 get_unaligned_le32(const void *p)
+{
+ TRACE_AND_STOP;
+ return 0;
+}
+
+
+/********************
+ ** linux/regmap.h **
+ ********************/
+
+struct regmap;
+
+int regmap_write(struct regmap *map, unsigned int reg, unsigned int val)
+{
+ TRACE_AND_STOP;
+
+ return 0;
+}
+
/************************
** linux/pm-runtime.h **
************************/
@@ -561,12 +696,6 @@ loff_t noop_llseek(struct file *file, loff_t offset, int whence)
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;
@@ -592,8 +721,8 @@ void print_hex_dump(const char *level, const char *prefix_str, int prefix_type,
int PTR_ERR_OR_ZERO(__force const void *ptr)
{
- TRACE_AND_STOP;
- return -1;
+ TRACE;
+ return 0;
}
void up_read(struct rw_semaphore *sem)
diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul.h b/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul.h
index 817b808c60..f11a661715 100644
--- a/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul.h
+++ b/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul.h
@@ -111,14 +111,17 @@ LX_MUTEX_INIT_DECLARE(component_mutex);
** asm-generic/io.h **
**********************/
+#include
+
+
static inline u32 __raw_readl(const volatile void __iomem *addr)
{
- return *(const volatile u32 __force *) addr;
+ return readl(addr);
}
static inline void __raw_writel(u32 b, volatile void __iomem *addr)
{
- *(volatile u32 __force *) addr = b;
+ writel(b, addr);
}
@@ -756,6 +759,13 @@ enum rpm_status {
RPM_SUSPENDED,
};
+#define pm_generic_suspend NULL
+#define pm_generic_resume NULL
+#define pm_generic_freeze NULL
+#define pm_generic_thaw NULL
+#define pm_generic_poweroff NULL
+#define pm_generic_restore NULL
+
/***********************
** linux/pm_domain.h **
@@ -784,6 +794,7 @@ struct bus_type
const char *name;
int (*match)(struct device *dev, struct device_driver *drv);
+ int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
int (*probe)(struct device *dev);
int (*remove)(struct device *dev);
void (*shutdown)(struct device *dev);
@@ -855,8 +866,12 @@ struct device_attribute {
#define dev_printk(level, dev, format, arg...) \
lx_printf("dev_printk: " format , ## arg)
+#if DEBUG_DRIVER
#define dev_dbg(dev, format, arg...) \
lx_printf("dev_dbg: " format, ## arg)
+#else
+#define dev_dbg(dev, format, arg...)
+#endif
#define dev_err_ratelimited(dev, fmt, ...) \
dev_err(dev, fmt, ##__VA_ARGS__)
@@ -869,7 +884,10 @@ struct device_driver
const struct of_device_id *of_match_table;
const struct acpi_device_id *acpi_match_table;
const struct dev_pm_ops *pm;
- int (*probe) (struct device *dev);
+
+ int (*probe) (struct device *dev);
+ int (*remove) (struct device *dev);
+ void (*shutdown) (struct device *dev);
};
int driver_register(struct device_driver *drv);
@@ -899,9 +917,15 @@ int device_add(struct device *dev);
int device_register(struct device *dev);
void device_unregister(struct device *dev);
+void device_initialize(struct device *dev);
+
+
const char *dev_name(const struct device *dev);
+struct device *bus_find_device(struct bus_type *bus, struct device *start, void *data,
+ int (*match)(struct device *dev, void *data));
+
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
void *data, int (*fn)(struct device_driver *, void *));
@@ -913,6 +937,7 @@ struct acpi_device;
void devm_kfree(struct device *dev, void *p);
void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
+void *devm_kcalloc(struct device *dev, size_t n, size_t size, gfp_t flags);
typedef void (*dr_release_t)(struct device *dev, void *res);
typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
@@ -931,6 +956,9 @@ void *devres_open_group(struct device *dev, void *id, gfp_t gfp);
int devres_release_group(struct device *dev, void *id);
void devres_remove_group(struct device *dev, void *id);
+void *devres_find(struct device *dev, dr_release_t release,
+ dr_match_t match, void *match_data);
+
int dev_to_node(struct device *dev);
@@ -938,9 +966,6 @@ int dev_to_node(struct device *dev);
** linux/io.h **
****************/
-#define writel(value, addr) (*(volatile uint32_t *)(addr) = (value))
-#define readl(addr) (*(volatile uint32_t *)(addr))
-
#define readl_relaxed readl
#define writel_relaxed(v, a) writel(v, a)
@@ -1163,6 +1188,13 @@ extern struct page *shmem_read_mapping_page( struct address_space *mapping, pgof
struct file *shmem_file_setup(const char *, loff_t, unsigned long);
+/********************************
+ ** linux/unaligned/generic.h **
+ ********************************/
+
+u32 get_unaligned_le32(const void *p);
+
+
/*****************
** linux/i2c.h **
*****************/
@@ -1170,10 +1202,23 @@ struct file *shmem_file_setup(const char *, loff_t, unsigned long);
enum i2c_slave_event { DUMMY };
+/***********************
+ ** uapi/linux/uuid.h **
+ ***********************/
+
+typedef struct {
+ __u8 b[16];
+} uuid_le;
+
+
/****************
** linux/of.h **
****************/
+struct of_phandle_args;
+
+#include
+
int of_alias_get_id(struct device_node *np, const char *stem);
struct device_node *of_node_get(struct device_node *node);
void of_node_put(struct device_node *);
@@ -1187,6 +1232,10 @@ int of_property_read_u32_index(const struct device_node *, const char *, u32,
for (child = of_get_next_child(parent, NULL); child != NULL; \
child = of_get_next_child(parent, child))
+#define for_each_available_child_of_node(parent, child) \
+ for (child = of_get_next_child(parent, NULL); child != NULL; \
+ child = of_get_next_child(parent, child))
+
struct property {
const char * name;
void * value;
@@ -1216,6 +1265,10 @@ int of_property_read_string(const struct device_node *np, const char *propname,
const char **out_string);
int of_property_read_u32(const struct device_node *np, const char *propname, u32 *out_value);
+struct property *of_find_property(const struct device_node *np,
+ const char *name, int *lenp);
+int of_modalias_node(struct device_node *node, char *modalias, int len);
+
bool is_of_node(const struct fwnode_handle *fwnode);
#define to_of_node(__fwnode) \
@@ -1228,6 +1281,9 @@ bool is_of_node(const struct fwnode_handle *fwnode);
NULL; \
})
+struct device_node *of_get_child_by_name(const struct device_node *node,
+ const char *name);
+
/***********************
** linux/of_device.h **
@@ -1238,6 +1294,28 @@ const void *of_device_get_match_data(const struct device *dev);
const struct of_device_id *of_match_device(const struct of_device_id *matches,
const struct device *dev);
+int of_driver_match_device(struct device *dev, const struct device_driver *drv);
+
+int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
+
+
+/**************************
+ ** linux/of_videomode.h **
+ **************************/
+
+struct videomode;
+
+int of_get_videomode(struct device_node *np, struct videomode *vm, int index);
+
+
+/***********************
+ ** video/videomode.h **
+ ***********************/
+
+struct display_timing;
+
+void videomode_from_timing(const struct display_timing *dt, struct videomode *vm);
+
/******************
** linux/acpi.h **
@@ -1284,6 +1362,51 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
void gpio_set_value(unsigned int gpio, int value);
+/***************************
+ ** linux/gpio/consumer.h **
+ ***************************/
+
+#define GPIOD_FLAGS_BIT_DIR_SET BIT(0)
+#define GPIOD_FLAGS_BIT_DIR_OUT BIT(1)
+#define GPIOD_FLAGS_BIT_DIR_VAL BIT(2)
+
+enum gpiod_flags {
+ GPIOD_OUT_HIGH = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT |
+ GPIOD_FLAGS_BIT_DIR_VAL
+};
+
+struct gpio_desc
+{
+ u32 pin;
+};
+
+struct gpio_desc *
+devm_gpiod_get(struct device *dev, const char *con_id, enum gpiod_flags flags);
+
+void gpiod_set_value(struct gpio_desc *desc, int value);
+
+
+/********************
+ ** linux/regmap.h **
+ ********************/
+
+struct regmap
+{
+ u8 *base;
+};
+
+int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
+
+int regmap_update_bits(struct regmap *map, unsigned reg, unsigned mask,
+ unsigned val);
+
+/************************
+ ** linux/mfd/syscon.h **
+ ************************/
+
+struct regmap *syscon_regmap_lookup_by_phandle( struct device_node *np, const char *property);
+
+
/* needed by drivers/gpu/drm/drm_modes.c */
#include
@@ -1544,6 +1667,58 @@ int device_property_read_u32(struct device *, const char *, u32 *);
void call_rcu(struct rcu_head *, void (*)(struct rcu_head *));
+/***********************
+ ** linux/backlight.h **
+ ***********************/
+
+enum backlight_type {
+ BACKLIGHT_RAW = 1,
+};
+
+struct backlight_properties
+{
+ int brightness;
+ int max_brightness;
+ enum backlight_type type;
+};
+
+struct backlight_ops;
+
+struct backlight_device
+{
+ struct backlight_properties props;
+ struct backlight_ops const *ops;
+ struct device dev;
+};
+
+struct backlight_ops {
+ int (*update_status)(struct backlight_device *);
+ int (*get_brightness)(struct backlight_device *);
+};
+
+int backlight_enable(struct backlight_device *bd);
+int backlight_disable(struct backlight_device *bd);
+
+void *bl_get_data(struct backlight_device *bl_dev);
+
+struct backlight_device *
+devm_backlight_device_register(struct device *dev, const char *name,
+ struct device *parent, void *devdata,
+ const struct backlight_ops *ops,
+ const struct backlight_properties *props);
+
+/****************************
+ ** drivers/phy/phy-core.c **
+ ****************************/
+
+void devm_phy_consume(struct device *dev, void *res);
+
+/***********************
+ ** linux/backlight.h **
+ ***********************/
+
+struct drm_panel;
+
/************************
** drm/drm_os_linux.h **
************************/
@@ -1622,7 +1797,9 @@ static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
#define CONFIG_MMU 1
#define CONFIG_OF 1
#define CONFIG_VIDEOMODE_HELPERS 1
-
+#define CONFIG_PHY_MIXEL_MIPI_DSI 1
+#define CONFIG_GENERIC_PHY 1
+#define CONFIG_DRM_PANEL 1
/**************************
** Dummy trace funtions **
@@ -1653,6 +1830,7 @@ void enable_irq(unsigned int);
void disable_irq(unsigned int);
int disable_irq_nosync(unsigned int);
+void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
/*****************************
** linux/platform_device.h **
@@ -1704,30 +1882,32 @@ struct platform_driver {
int platform_driver_register(struct platform_driver *);
void platform_driver_unregister(struct platform_driver *);
+#ifndef MOD_SUFFIX
+#define MOD_SUFFIX
+#endif
+
+#define _MOD_CONCAT(a,b,c) a##b##c
+#define MOD_CONCAT(a,b,c) _MOD_CONCAT(a,b,c)
+
#define module_driver(__driver, __register, __unregister, ...) \
-static int __init __driver##_init(void) \
+static int __init MOD_CONCAT(__driver, MOD_SUFFIX, _init)(void) \
{ \
return __register(&(__driver) , ##__VA_ARGS__); \
} \
-module_init(__driver##_init); \
-static void __exit __driver##_exit(void) \
+int MOD_CONCAT(module_##__driver, MOD_SUFFIX, _init)() { \
+ return MOD_CONCAT(__driver, MOD_SUFFIX, _init)(); } \
+static void __exit MOD_CONCAT(__driver, MOD_SUFFIX, _exit)(void) \
{ \
__unregister(&(__driver) , ##__VA_ARGS__); \
} \
-module_exit(__driver##_exit);
+void MOD_CONCAT(module_exit_##__driver, MOD_SUFFIX, _exit)() { \
+ MOD_CONCAT(__driver, MOD_SUFFIX, _exit)(); }
+
#define module_platform_driver(__platform_driver) \
module_driver(__platform_driver, platform_driver_register, \
platform_driver_unregister)
-/***********************
- ** uapi/linux/uuid.h **
- ***********************/
-
-typedef struct {
- __u8 b[16];
-} uuid_le;
-
/************************
** linux/cpuhotplug.h **
@@ -1743,7 +1923,8 @@ enum cpuhp_state {
*******************/
enum {
- SZ_4K = 0x00001000,
+ SZ_256 = 0x00000100,
+ SZ_4K = 0x00001000,
SZ_16K = 0x00004000,
};
@@ -1763,11 +1944,27 @@ enum {
IOMEM_END_HDMI_CRS = 0x33ffff,
IOMEM_BASE_HDMI_RST = 0x340000,
IOMEM_END_HDMI_RST = 0x34000f,
+ IOMEM_BASE_MIPI_DSI = 0x400000,
+ IOMEM_BASE_MIPI_DPHY = 0x400300,
+ IOMEM_END_MIPI_DSI = 0x400fff,
IRQ_IRQSTEER = 32,
IRQ_HDMI_IN = 33,
- IRQ_HDMI_OUT = 34
+ IRQ_HDMI_OUT = 34,
+ IRQ_MIPI_DSI = 35,
+ IOMEM_BASE_SRC = 0x410000,
+ IOMEM_END_SRC = 0xf1ffff,
};
+
+/************************************
+ ** drivers/gpu/drm/drm_mipi_dsi.c **
+ ************************************/
+
+//XXX: init in startup code before drm_mipi_dsi.c
+LX_MUTEX_INIT_DECLARE(host_lock);
+
+#define host_lock LX_MUTEX(host_lock)
+
#include
#endif /* _LX_EMUL_H_ */
diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul_c.h b/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul_c.h
index 8ef5ba8583..35812df15d 100644
--- a/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul_c.h
+++ b/repos/dde_linux/src/drivers/framebuffer/imx8/include/lx_emul_c.h
@@ -19,7 +19,7 @@
#define TRACE_AND_STOP \
do { \
- lx_printf("%s not implemented\n", __func__); \
+ lx_printf("%s not implemented called from %p\n", __func__, __builtin_return_address(0)); \
BUG(); \
} while (0)
diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc b/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc
index b476b7ef33..8f66acdfa4 100644
--- a/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc
+++ b/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc
@@ -30,9 +30,12 @@
#include
#include
#include
+#include
#include "drm_crtc_internal.h"
#include "drm_internal.h"
#include
+#include
+#include