From 45fb23aa0a58507bf6729c32abc283ccf9faaae8 Mon Sep 17 00:00:00 2001 From: yiguo Date: Fri, 31 May 2024 17:23:52 +0800 Subject: [PATCH 042/219] fix:adapt linux6.6 Changelogs: 1. add dma-noncoherent; in dts. 2. add func of start repeatly. 3. add hdcp1x enable/disable. --- arch/riscv/boot/dts/eswin/eswin-win2030-die0-soc.dtsi | 1 + arch/riscv/boot/dts/eswin/eswin-win2030-die1-soc.dtsi | 1 + drivers/gpu/drm/eswin/dw_hdmi_hdcp2.c | 7 +++---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/riscv/boot/dts/eswin/eswin-win2030-die0-soc.dtsi b/arch/riscv/boot/dts/eswin/eswin-win2030-die0-soc.dtsi index fb5920315be4..3db50303c303 100644 --- a/arch/riscv/boot/dts/eswin/eswin-win2030-die0-soc.dtsi +++ b/arch/riscv/boot/dts/eswin/eswin-win2030-die0-soc.dtsi @@ -1905,6 +1905,7 @@ dw_hdmi_hdcp2: hdmi-hdcp2@50290000 { clocks = <&d0_clock WIN2030_CLK_VO_CFG_CLK>, <&d0_clock WIN2030_CLK_VO_HDMI_IESMCLK>; clock-names ="pclk_hdcp2", "hdcp2_clk_hdmi"; + dma-noncoherent; }; d0_usbdrd3_0: usb0@50480000 { diff --git a/arch/riscv/boot/dts/eswin/eswin-win2030-die1-soc.dtsi b/arch/riscv/boot/dts/eswin/eswin-win2030-die1-soc.dtsi index bbb403cf4776..48a042d05e8e 100644 --- a/arch/riscv/boot/dts/eswin/eswin-win2030-die1-soc.dtsi +++ b/arch/riscv/boot/dts/eswin/eswin-win2030-die1-soc.dtsi @@ -1836,6 +1836,7 @@ d1_dw_hdmi_hdcp2: hdmi-hdcp2@70290000 { clocks = <&d1_clock WIN2030_CLK_VO_CFG_CLK>, <&d1_clock WIN2030_CLK_VO_HDMI_IESMCLK>; clock-names ="pclk_hdcp2", "hdcp2_clk_hdmi"; + dma-noncoherent; }; d1_wdt0: watchdog@0x70800000 { diff --git a/drivers/gpu/drm/eswin/dw_hdmi_hdcp2.c b/drivers/gpu/drm/eswin/dw_hdmi_hdcp2.c index 63ce0ae4fde3..e387f079eb89 100644 --- a/drivers/gpu/drm/eswin/dw_hdmi_hdcp2.c +++ b/drivers/gpu/drm/eswin/dw_hdmi_hdcp2.c @@ -61,6 +61,7 @@ */ #define MAX_HL_DEVICES 16 +#define TROOT_GRIFFIN static bool randomize_mem = false; module_param(randomize_mem, bool, 0); @@ -344,7 +345,6 @@ static int alloc_dma_areas(hl_device *hl_dev, hl_dev->code_base = info->code_base; hl_dev->code = phys_to_virt(hl_dev->code_base); } else { - dma_set_mask_and_coherent(g_dw_hdcp2->dev, DMA_BIT_MASK(32)); hl_dev->code = dma_alloc_coherent(g_dw_hdcp2->dev, hl_dev->code_size, &hl_dev->code_base, GFP_KERNEL); @@ -387,7 +387,6 @@ static long init(struct file *f, void __user *arg) if (copy_from_user(&info, arg, sizeof info) != 0) return -EFAULT; - hl_dev = alloc_hl_dev_slot(&info); if (!hl_dev) return -EMFILE; @@ -528,9 +527,8 @@ static long hld_ioctl(struct file *f, unsigned int cmd, unsigned long arg) static const struct file_operations hld_file_operations = { #ifdef CONFIG_COMPAT .compat_ioctl = hld_ioctl, -#else - .unlocked_ioctl = hld_ioctl, #endif + .unlocked_ioctl = hld_ioctl, .owner = THIS_MODULE, }; @@ -708,6 +706,7 @@ static int eswin_hdmi_hdcp2_probe(struct platform_device *pdev) g_dw_hdcp2->start = dw_hdcp2_start; hld_init(); dw_hdmi2_hdcp2_clk_enable(hdcp2_dev); + dma_set_mask_and_coherent(hdcp2_dev, DMA_BIT_MASK(32)); dw_hdmi_hdcp2_init(g_dw_hdcp2); dw_hdmi_hdcp2_start(3); -- 2.47.0