1 // SPDX-License-Identifier: GPL-2.0
3 * PSC clock descriptions for TI DaVinci DM646x
5 * Copyright (C) 2018 David Lechner <david@lechnology.com>
8 #include <linux/clk-provider.h>
9 #include <linux/clk/davinci.h>
10 #include <linux/clk.h>
11 #include <linux/clkdev.h>
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/types.h>
18 LPSC_CLKDEV1(ide_clkdev
, NULL
, "palm_bk3710");
19 LPSC_CLKDEV2(emac_clkdev
, NULL
, "davinci_emac.1",
20 "fck", "davinci_mdio.0");
21 LPSC_CLKDEV1(aemif_clkdev
, "aemif", NULL
);
22 LPSC_CLKDEV1(mcasp0_clkdev
, NULL
, "davinci-mcasp.0");
23 LPSC_CLKDEV1(mcasp1_clkdev
, NULL
, "davinci-mcasp.1");
24 LPSC_CLKDEV1(uart0_clkdev
, NULL
, "serial8250.0");
25 LPSC_CLKDEV1(uart1_clkdev
, NULL
, "serial8250.1");
26 LPSC_CLKDEV1(uart2_clkdev
, NULL
, "serial8250.2");
27 LPSC_CLKDEV1(i2c_clkdev
, NULL
, "i2c_davinci.1");
28 /* REVISIT: gpio-davinci.c should be modified to drop con_id */
29 LPSC_CLKDEV1(gpio_clkdev
, "gpio", NULL
);
30 LPSC_CLKDEV1(timer0_clkdev
, "timer0", NULL
);
32 static const struct davinci_lpsc_clk_info dm646x_psc_info
[] = {
33 LPSC(0, 0, arm
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
34 /* REVISIT how to disable? */
35 LPSC(1, 0, dsp
, pll1_sysclk1
, NULL
, LPSC_ALWAYS_ENABLED
),
36 LPSC(4, 0, edma_cc
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
37 LPSC(5, 0, edma_tc0
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
38 LPSC(6, 0, edma_tc1
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
39 LPSC(7, 0, edma_tc2
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
40 LPSC(8, 0, edma_tc3
, pll1_sysclk2
, NULL
, LPSC_ALWAYS_ENABLED
),
41 LPSC(10, 0, ide
, pll1_sysclk4
, ide_clkdev
, 0),
42 LPSC(14, 0, emac
, pll1_sysclk3
, emac_clkdev
, 0),
43 LPSC(16, 0, vpif0
, ref_clk
, NULL
, LPSC_ALWAYS_ENABLED
),
44 LPSC(17, 0, vpif1
, ref_clk
, NULL
, LPSC_ALWAYS_ENABLED
),
45 LPSC(21, 0, aemif
, pll1_sysclk3
, aemif_clkdev
, LPSC_ALWAYS_ENABLED
),
46 LPSC(22, 0, mcasp0
, pll1_sysclk3
, mcasp0_clkdev
, 0),
47 LPSC(23, 0, mcasp1
, pll1_sysclk3
, mcasp1_clkdev
, 0),
48 LPSC(26, 0, uart0
, aux_clkin
, uart0_clkdev
, 0),
49 LPSC(27, 0, uart1
, aux_clkin
, uart1_clkdev
, 0),
50 LPSC(28, 0, uart2
, aux_clkin
, uart2_clkdev
, 0),
51 /* REVIST: disabling hangs system */
52 LPSC(29, 0, pwm0
, pll1_sysclk3
, NULL
, LPSC_ALWAYS_ENABLED
),
53 /* REVIST: disabling hangs system */
54 LPSC(30, 0, pwm1
, pll1_sysclk3
, NULL
, LPSC_ALWAYS_ENABLED
),
55 LPSC(31, 0, i2c
, pll1_sysclk3
, i2c_clkdev
, 0),
56 LPSC(33, 0, gpio
, pll1_sysclk3
, gpio_clkdev
, 0),
57 LPSC(34, 0, timer0
, pll1_sysclk3
, timer0_clkdev
, LPSC_ALWAYS_ENABLED
),
58 LPSC(35, 0, timer1
, pll1_sysclk3
, NULL
, 0),
62 int dm646x_psc_init(struct device
*dev
, void __iomem
*base
)
64 return davinci_psc_register_clocks(dev
, dm646x_psc_info
, 46, base
);
67 static struct clk_bulk_data dm646x_psc_parent_clks
[] = {
69 { .id
= "aux_clkin" },
70 { .id
= "pll1_sysclk1" },
71 { .id
= "pll1_sysclk2" },
72 { .id
= "pll1_sysclk3" },
73 { .id
= "pll1_sysclk4" },
74 { .id
= "pll1_sysclk5" },
77 const struct davinci_psc_init_data dm646x_psc_init_data
= {
78 .parent_clks
= dm646x_psc_parent_clks
,
79 .num_parent_clks
= ARRAY_SIZE(dm646x_psc_parent_clks
),
80 .psc_init
= &dm646x_psc_init
,