Skip to content

Commit be0e9a3

Browse files
tokyovigilantewens
authored andcommitted
clk: sunxi-ng: ccu: add Display Engine 3.3 (DE33) support
The DE33 is a newer version of the Allwinner Display Engine IP block, found in the H616, H618, H700 and T507 SoCs. DE2 and DE3 are already supported by the mainline driver. The DE33 in the H616 has mixer0 and writeback units. The clocks and resets required are identical to the H3 and H5 respectively, so use those existing structs for the H616 description. There are two additional 32-bit registers (at offsets 0x24 and 0x28) which require clearing and setting respectively to bring up the hardware. The function of these registers is currently unknown, and the values are taken from the out-of-tree driver. Add the required clock description struct and compatible string to the DE2 driver. Signed-off-by: Ryan Walklin <ryan@testtoast.com> Link: https://patch.msgid.link/20250511104042.24249-9-ryan@testtoast.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent ab1a94b commit be0e9a3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/clk/sunxi-ng/ccu-sun8i-de2.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <linux/clk.h>
77
#include <linux/clk-provider.h>
8+
#include <linux/io.h>
89
#include <linux/module.h>
910
#include <linux/of.h>
1011
#include <linux/platform_device.h>
@@ -239,6 +240,16 @@ static const struct sunxi_ccu_desc sun50i_h5_de2_clk_desc = {
239240
.num_resets = ARRAY_SIZE(sun50i_h5_de2_resets),
240241
};
241242

243+
static const struct sunxi_ccu_desc sun50i_h616_de33_clk_desc = {
244+
.ccu_clks = sun8i_de2_ccu_clks,
245+
.num_ccu_clks = ARRAY_SIZE(sun8i_de2_ccu_clks),
246+
247+
.hw_clks = &sun8i_h3_de2_hw_clks,
248+
249+
.resets = sun50i_h5_de2_resets,
250+
.num_resets = ARRAY_SIZE(sun50i_h5_de2_resets),
251+
};
252+
242253
static int sunxi_de2_clk_probe(struct platform_device *pdev)
243254
{
244255
struct clk *bus_clk, *mod_clk;
@@ -291,6 +302,16 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
291302
goto err_disable_mod_clk;
292303
}
293304

305+
/*
306+
* The DE33 requires these additional (unknown) registers set
307+
* during initialisation.
308+
*/
309+
if (of_device_is_compatible(pdev->dev.of_node,
310+
"allwinner,sun50i-h616-de33-clk")) {
311+
writel(0, reg + 0x24);
312+
writel(0x0000a980, reg + 0x28);
313+
}
314+
294315
ret = devm_sunxi_ccu_probe(&pdev->dev, reg, ccu_desc);
295316
if (ret)
296317
goto err_assert_reset;
@@ -335,6 +356,10 @@ static const struct of_device_id sunxi_de2_clk_ids[] = {
335356
.compatible = "allwinner,sun50i-h6-de3-clk",
336357
.data = &sun50i_h5_de2_clk_desc,
337358
},
359+
{
360+
.compatible = "allwinner,sun50i-h616-de33-clk",
361+
.data = &sun50i_h616_de33_clk_desc,
362+
},
338363
{ }
339364
};
340365
MODULE_DEVICE_TABLE(of, sunxi_de2_clk_ids);

0 commit comments

Comments
 (0)