From 705df3d275a71294406940f48dffbe05d3d5edb9 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Thu, 20 Jun 2024 20:00:33 +0800
Subject: [PATCH] PATCH:IGKBoard-IMX6ULL: Update linux kernel patch for LCD display

---
 kernel/patches/igkboard-imx6ull/linux-imx-lf-6.1.36-2.1.0.patch |  181 ++++++++++++++------------------------------
 1 files changed, 58 insertions(+), 123 deletions(-)

diff --git a/kernel/patches/igkboard-imx6ull/linux-imx-lf-6.1.36-2.1.0.patch b/kernel/patches/igkboard-imx6ull/linux-imx-lf-6.1.36-2.1.0.patch
index fffccc6..daa7315 100644
--- a/kernel/patches/igkboard-imx6ull/linux-imx-lf-6.1.36-2.1.0.patch
+++ b/kernel/patches/igkboard-imx6ull/linux-imx-lf-6.1.36-2.1.0.patch
@@ -812,10 +812,10 @@
 +
 diff --git a/arch/arm/boot/dts/igkboard-imx6ull/lcd.dts b/arch/arm/boot/dts/igkboard-imx6ull/lcd.dts
 new file mode 100644
-index 000000000..ef1c479bf
+index 000000000..061cc612b
 --- /dev/null
 +++ b/arch/arm/boot/dts/igkboard-imx6ull/lcd.dts
-@@ -0,0 +1,82 @@
+@@ -0,0 +1,83 @@
 +/*
 + * Copyright (C) 2022 LingYun IoT System Studio
 + * Author:  Guo Wenxue<guowenxue@gmail.com>
@@ -839,6 +839,7 @@
 +	};
 +};
 +
++/* CONFIG_DRM_MXSFB use DRM driver: drivers/gpu/drm/mxsfb/mxsfb_drv.c */
 +&lcdif {
 +	assigned-clocks = <&clks IMX6UL_CLK_LCDIF_PRE_SEL>;
 +	assigned-clock-parents = <&clks IMX6UL_CLK_PLL5_VIDEO_DIV>;
@@ -898,7 +899,6 @@
 +		>;
 +	};
 +};
-\ No newline at end of file
 diff --git a/arch/arm/boot/dts/igkboard-imx6ull/nbiot-4g.dts b/arch/arm/boot/dts/igkboard-imx6ull/nbiot-4g.dts
 new file mode 100644
 index 000000000..07e278e7e
@@ -1222,10 +1222,10 @@
 +
 diff --git a/arch/arm/configs/igkboard-imx6ull_defconfig b/arch/arm/configs/igkboard-imx6ull_defconfig
 new file mode 100644
-index 000000000..84a721bc4
+index 000000000..87fd9dcfe
 --- /dev/null
 +++ b/arch/arm/configs/igkboard-imx6ull_defconfig
-@@ -0,0 +1,604 @@
+@@ -0,0 +1,574 @@
 +CONFIG_KERNEL_LZO=y
 +CONFIG_SYSVIPC=y
 +CONFIG_POSIX_MQUEUE=y
@@ -1247,8 +1247,6 @@
 +CONFIG_EXPERT=y
 +CONFIG_KALLSYMS_ALL=y
 +CONFIG_PERF_EVENTS=y
-+# CONFIG_SLUB_DEBUG is not set
-+# CONFIG_COMPAT_BRK is not set
 +CONFIG_ARCH_MXC=y
 +CONFIG_SOC_IMX6Q=y
 +CONFIG_SOC_IMX6SL=y
@@ -1261,7 +1259,6 @@
 +CONFIG_VMSPLIT_2G=y
 +CONFIG_ARM_PSCI=y
 +CONFIG_HIGHMEM=y
-+CONFIG_FORCE_MAX_ZONEORDER=14
 +CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
 +CONFIG_KEXEC=y
 +CONFIG_CPU_FREQ=y
@@ -1286,10 +1283,13 @@
 +CONFIG_MODVERSIONS=y
 +CONFIG_MODULE_SRCVERSION_ALL=y
 +CONFIG_BINFMT_MISC=m
++# CONFIG_COMPAT_BRK is not set
 +CONFIG_CMA=y
 +CONFIG_NET=y
 +CONFIG_PACKET=y
 +CONFIG_UNIX=y
++CONFIG_TLS=y
++CONFIG_TLS_DEVICE=y
 +CONFIG_INET=y
 +CONFIG_IP_MULTICAST=y
 +CONFIG_IP_PNP=y
@@ -1298,7 +1298,6 @@
 +CONFIG_VLAN_8021Q=m
 +CONFIG_LLC2=y
 +CONFIG_CAN=y
-+CONFIG_CAN_FLEXCAN=y
 +CONFIG_BT=y
 +CONFIG_BT_RFCOMM=y
 +CONFIG_BT_RFCOMM_TTY=y
@@ -1391,6 +1390,7 @@
 +# CONFIG_NET_VENDOR_STMICRO is not set
 +CONFIG_MICREL_PHY=y
 +CONFIG_AT803X_PHY=y
++CONFIG_CAN_FLEXCAN=y
 +CONFIG_USB_PEGASUS=m
 +CONFIG_USB_RTL8150=m
 +CONFIG_USB_RTL8152=y
@@ -1462,14 +1462,17 @@
 +CONFIG_SPI_SLAVE_TIME=y
 +CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
 +CONFIG_GPIO_SYSFS=y
++CONFIG_GPIO_IMX_RPMSG=y
 +CONFIG_GPIO_MXC=y
 +CONFIG_GPIO_SIOX=m
-+CONFIG_GPIO_IMX_RPMSG=y
 +CONFIG_GPIO_MAX732X=y
 +CONFIG_GPIO_PCA953X=y
 +CONFIG_GPIO_PCF857X=y
 +CONFIG_GPIO_STMPE=y
 +CONFIG_GPIO_74X164=y
++CONFIG_W1=y
++CONFIG_W1_MASTER_GPIO=y
++CONFIG_W1_SLAVE_THERM=y
 +CONFIG_POWER_RESET=y
 +CONFIG_POWER_RESET_SYSCON=y
 +CONFIG_POWER_RESET_SYSCON_POWEROFF=y
@@ -1497,6 +1500,7 @@
 +CONFIG_MFD_DA9063=y
 +CONFIG_MFD_MC13XXX_SPI=y
 +CONFIG_MFD_MC13XXX_I2C=y
++CONFIG_MFD_MXC_HDMI=y
 +CONFIG_MFD_MAX17135=y
 +CONFIG_MFD_RN5T618=y
 +CONFIG_MFD_SI476X_CORE=y
@@ -1523,9 +1527,9 @@
 +CONFIG_USB_VIDEO_CLASS=m
 +CONFIG_RADIO_SI476X=y
 +CONFIG_V4L_PLATFORM_DRIVERS=y
++CONFIG_V4L_MEM2MEM_DRIVERS=y
 +CONFIG_VIDEO_MUX=y
 +CONFIG_VIDEO_MXC_CAPTURE=m
-+CONFIG_VIDEO_MXC_OUTPUT=y
 +CONFIG_VIDEO_MXC_CSI_CAMERA=m
 +CONFIG_MXC_VADC=m
 +CONFIG_MXC_MIPI_CSI=m
@@ -1535,40 +1539,29 @@
 +CONFIG_MXC_CAMERA_OV5640_MIPI_V2=m
 +CONFIG_MXC_TVIN_ADV7180=m
 +CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
++CONFIG_VIDEO_MXC_OUTPUT=y
 +CONFIG_VIDEO_MXC_IPU_OUTPUT=y
 +CONFIG_VIDEO_MXC_PXP_V4L2=y
-+CONFIG_V4L_MEM2MEM_DRIVERS=y
 +CONFIG_VIDEO_CODA=m
 +CONFIG_VIDEO_IMX_PXP=y
-+CONFIG_VIDEO_ADV7180=m
 +CONFIG_VIDEO_OV2680=m
 +CONFIG_VIDEO_OV5645=m
++CONFIG_VIDEO_ADV7180=m
 +CONFIG_DRM=y
 +CONFIG_DRM_PANEL_LVDS=y
 +CONFIG_DRM_PANEL_SIMPLE=y
 +CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
 +CONFIG_DRM_TI_TFP410=y
++CONFIG_DRM_MXSFB=y
 +CONFIG_FB=y
-+CONFIG_FB_MXS=y
++# CONFIG_FB_MX3 is not set
 +CONFIG_FB_MXC_SYNC_PANEL=y
 +CONFIG_FB_MXC_OVERLAY=y
-+CONFIG_FB_MXC_MIPI_DSI_NORTHWEST=y
-+CONFIG_FB_MXC_ADV7535=y
-+CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y
-+CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
-+CONFIG_FB_MXC_RK_PANEL_RK055AHD042=y
-+CONFIG_FB_MXC_RK_PANEL_RK055IQH042=y
-+CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
-+CONFIG_FB_MXC_MIPI_DSI=y
-+CONFIG_FB_MXC_LDB=y
-+CONFIG_FB_MXC_EINK_PANEL=y
-+CONFIG_FB_MXC_EINK_V2_PANEL=y
-+CONFIG_FB_MXC_HDMI=y
-+CONFIG_FB_MXS_SII902X=y
-+CONFIG_FB_MXC_DCIC=y
++# CONFIG_FB_MXC_EDID is not set
 +CONFIG_LCD_CLASS_DEVICE=y
 +CONFIG_LCD_L4F00242T03=y
 +CONFIG_LCD_PLATFORM=y
++CONFIG_BACKLIGHT_CLASS_DEVICE=y
 +CONFIG_BACKLIGHT_PWM=y
 +CONFIG_BACKLIGHT_GPIO=y
 +CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -1710,7 +1703,6 @@
 +CONFIG_MXC_SIMv2=y
 +CONFIG_MXC_MLB150=y
 +CONFIG_MXC_IPU_V3_PRE=y
-+CONFIG_MXC_HDMI_CEC=y
 +CONFIG_MXC_MIPI_CSI2=y
 +CONFIG_EXT2_FS=y
 +CONFIG_EXT2_FS_XATTR=y
@@ -1747,30 +1739,13 @@
 +CONFIG_NLS_ISO8859_1=y
 +CONFIG_NLS_ISO8859_15=m
 +CONFIG_NLS_UTF8=y
++CONFIG_TRUSTED_KEYS=m
++# CONFIG_TRUSTED_KEYS_TEE is not set
++# CONFIG_TRUSTED_KEYS_CAAM is not set
 +CONFIG_SECURITYFS=y
 +CONFIG_CRYPTO_USER=y
 +CONFIG_CRYPTO_TEST=m
-+CONFIG_CRYPTO_ECHAINIV=m
-+CONFIG_CRYPTO_TLS=m
-+CONFIG_CRYPTO_CFB=m
-+CONFIG_CRYPTO_CTS=m
-+CONFIG_CRYPTO_LRW=m
-+CONFIG_CRYPTO_OFB=m
-+CONFIG_CRYPTO_PCBC=m
-+CONFIG_CRYPTO_XCBC=m
-+CONFIG_CRYPTO_VMAC=m
-+CONFIG_CRYPTO_XXHASH=m
-+CONFIG_CRYPTO_BLAKE2B=m
-+CONFIG_CRYPTO_BLAKE2S=m
-+CONFIG_CRYPTO_MD4=m
-+CONFIG_CRYPTO_MD5=m
-+CONFIG_CRYPTO_RMD160=m
-+CONFIG_CRYPTO_SHA3=m
-+CONFIG_CRYPTO_SM3=m
-+CONFIG_CRYPTO_STREEBOG=m
-+CONFIG_CRYPTO_WP512=m
 +CONFIG_CRYPTO_ANUBIS=m
-+CONFIG_CRYPTO_ARC4=m
 +CONFIG_CRYPTO_BLOWFISH=m
 +CONFIG_CRYPTO_CAMELLIA=m
 +CONFIG_CRYPTO_CAST5=m
@@ -1780,17 +1755,36 @@
 +CONFIG_CRYPTO_KHAZAD=m
 +CONFIG_CRYPTO_SEED=m
 +CONFIG_CRYPTO_SERPENT=m
-+CONFIG_CRYPTO_SM4=m
 +CONFIG_CRYPTO_TEA=m
 +CONFIG_CRYPTO_TWOFISH=m
++CONFIG_CRYPTO_ARC4=m
++CONFIG_CRYPTO_CFB=m
++CONFIG_CRYPTO_CTS=m
++CONFIG_CRYPTO_LRW=m
++CONFIG_CRYPTO_OFB=m
++CONFIG_CRYPTO_PCBC=m
++CONFIG_CRYPTO_ECHAINIV=m
++CONFIG_CRYPTO_TLS=m
++CONFIG_CRYPTO_BLAKE2B=m
++CONFIG_CRYPTO_MD4=m
++CONFIG_CRYPTO_MD5=m
++CONFIG_CRYPTO_RMD160=m
++CONFIG_CRYPTO_SHA3=m
++CONFIG_CRYPTO_STREEBOG=m
++CONFIG_CRYPTO_VMAC=m
++CONFIG_CRYPTO_WP512=m
++CONFIG_CRYPTO_XCBC=m
++CONFIG_CRYPTO_XXHASH=m
 +CONFIG_CRYPTO_ANSI_CPRNG=m
++CONFIG_CRYPTO_USER_API_HASH=m
++CONFIG_CRYPTO_USER_API_SKCIPHER=m
 +CONFIG_CRYPTO_USER_API_RNG=m
++CONFIG_CRYPTO_USER_API_AEAD=m
 +CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=m
 +CONFIG_CRYPTO_DEV_FSL_CAAM=m
 +CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m
 +CONFIG_CRYPTO_DEV_SAHARA=y
 +CONFIG_CRYPTO_DEV_MXS_DCP=y
-+CONFIG_CRC_CCITT=m
 +CONFIG_CRC_T10DIF=y
 +CONFIG_CRC7=m
 +CONFIG_LIBCRC32C=m
@@ -1802,36 +1796,12 @@
 +# CONFIG_DEBUG_BUGVERBOSE is not set
 +CONFIG_MAGIC_SYSRQ=y
 +CONFIG_DEBUG_FS=y
++# CONFIG_SLUB_DEBUG is not set
 +# CONFIG_SCHED_DEBUG is not set
 +# CONFIG_DEBUG_PREEMPT is not set
 +# CONFIG_FTRACE is not set
-+
-+# enable AF_ALG
-+CONFIG_CRYPTO_USER_API_HASH=m
-+CONFIG_CRYPTO_USER_API_SKCIPHER=m
-+CONFIG_CRYPTO_USER_API_AEAD=m
-+
-+# enable KTLS
-+CONFIG_TLS=y
-+CONFIG_TLS_DEVICE=y
-+
-+#enable trust based hardware key
-+CONFIG_TRUSTED_KEYS=m
-+CONFIG_TRUSTED_KEYS_TPM=n
-+CONFIG_TRUSTED_KEYS_TEE=n
-+CONFIG_TRUSTED_KEYS_CAAM=n
-+CONFIG_TRUSTED_KEYS_DCP=y
-+
-+# Custom Addition of Linke
-+# enable one wire device driver
-+CONFIG_W1=y
-+CONFIG_W1_MASTER_GPIO=y
-+CONFIG_W1_SLAVE_THERM=y
-+
-+# enable drm to realize fb
-+CONFIG_DRM_MXSFB=y
 diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
-index 582db321e..7444c06e4 100644
+index 582db321e..40891eef4 100644
 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
 +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
 @@ -370,7 +370,7 @@ static int mxsfb_probe(struct platform_device *pdev)
@@ -1843,17 +1813,8 @@
  
  	return 0;
  
-@@ -426,7 +426,7 @@ static struct platform_driver mxsfb_platform_driver = {
- 	.remove		= mxsfb_remove,
- 	.shutdown	= mxsfb_shutdown,
- 	.driver	= {
--		.name		= "mxsfb",
-+		.name		= "mxsfb-drm",
- 		.of_match_table	= mxsfb_dt_ids,
- 		.pm		= &mxsfb_pm_ops,
- 	},
 diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
-index 009e3e96c..3b158fd50 100644
+index 009e3e96c..670e30b8d 100644
 --- a/drivers/gpu/drm/panel/panel-simple.c
 +++ b/drivers/gpu/drm/panel/panel-simple.c
 @@ -4024,8 +4024,33 @@ static const struct panel_desc arm_rtsm = {
@@ -1861,24 +1822,24 @@
  };
  
 +static const struct drm_display_mode igkboard_6ull_panel_mode[] = {
-+    {    
++    {
 +        .clock = 30000,
-+        .hdisplay = 800, 
++        .hdisplay = 800,
 +        .hsync_start = 800 + 40,
 +        .hsync_end = 800 + 40 + 48,
 +        .htotal = 800 + 40 + 48 + 88,
-+        .vdisplay = 480, 
++        .vdisplay = 480,
 +        .vsync_start = 480 + 13,
-+        .vsync_end = 480 + 13 + 3, 
++        .vsync_end = 480 + 13 + 3,
 +        .vtotal = 480 + 13 + 3 + 32,
 +        .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
-+    },   
++    },
 +};
 +
 +static const struct panel_desc igkboard_6ull_panel = {
 +    .modes = igkboard_6ull_panel_mode,
-+    .num_modes = 1, 
-+    .bpc = 8, 
++    .num_modes = 1,
++    .bpc = 8,
 +    .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
 +};
 +
@@ -1890,28 +1851,15 @@
  		.compatible = "ampire,am-1280800n3tzqw-t00h",
  		.data = &ampire_am_1280800n3tzqw_t00h,
  	}, {
-diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
-index b28ac814a..12143bbea 100644
---- a/drivers/video/backlight/pwm_bl.c
-+++ b/drivers/video/backlight/pwm_bl.c
-@@ -53,7 +53,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb)
- 	if (err < 0)
- 		dev_err(pb->dev, "failed to enable power supply\n");
- 
--	state.enabled = true;
-+	state.enabled = true; /* enalbe backlight as default */
- 	pwm_apply_state(pb->pwm, &state);
- 
- 	if (pb->post_pwm_on_delay)
 diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
-index fa205be94..8bb25f64f 100644
+index fa205be94..5b8cdb642 100644
 --- a/drivers/video/fbdev/core/fbcon.c
 +++ b/drivers/video/fbdev/core/fbcon.c
 @@ -345,6 +345,7 @@ static int get_color(struct vc_data *vc, struct fb_info *info,
  	return color;
  }
  
-+#if 0 /* comment by guowenxue */
++#if 0 /* comment by guowenxue to remove cursor */
  static void fb_flashcursor(struct work_struct *work)
  {
  	struct fbcon_ops *ops = container_of(work, struct fbcon_ops, cursor_work.work);
@@ -1929,7 +1877,7 @@
  		ops->clear_margins(vc, info, margin_color, bottom_only);
  }
  
-+#if 0 /* comment by guowenxue */
++#if 0 /* comment by guowenxue to remove cursor */
  static void fbcon_cursor(struct vc_data *vc, int mode)
  {
  	struct fb_info *info = fbcon_info_from_console(vc->vc_num);
@@ -1943,16 +1891,3 @@
  
  static int scrollback_phys_max = 0;
  static int scrollback_max = 0;
-diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
-index 862278022..ce647f570 100644
---- a/drivers/video/fbdev/mxsfb.c
-+++ b/drivers/video/fbdev/mxsfb.c
-@@ -1586,7 +1586,7 @@ MODULE_DEVICE_TABLE(platform, mxsfb_devtype);
- 
- static const struct of_device_id mxsfb_dt_ids[] = {
- 	{ .compatible = "fsl,imx23-lcdif", .data = &mxsfb_devtype[0], },
--	{ .compatible = "fsl,imx28-lcdif", .data = &mxsfb_devtype[1], },
-+	//{ .compatible = "fsl,imx28-lcdif", .data = &mxsfb_devtype[1], }, /* Use DRM driver as default */
- 	{ .compatible = "fsl,imx7ulp-lcdif", .data = &mxsfb_devtype[2], },
- 	{ /* sentinel */ }
- };

--
Gitblit v1.9.1