Lines Matching +full:sys +full:- +full:syscon

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
28 #include <sys/param.h>
29 #include <sys/systm.h>
30 #include <sys/bus.h>
32 #include <sys/kernel.h>
33 #include <sys/module.h>
34 #include <sys/rman.h>
35 #include <sys/lock.h>
36 #include <sys/mutex.h>
44 #include <dev/syscon/syscon.h>
60 static const char *clk_parents_0[] = {"cp110-pll0-0"};
61 static const char *clk_parents_1[] = {"cp110-pll0-1"};
77 static const char *core_parents_0[] = {"cp110-x2core-0"};
78 static const char *core_parents_1[] = {"cp110-x2core-1"};
97 CCU_GATE(CP110_GATE_AUDIO, "cp110-gate-audio", 0)
98 CCU_GATE(CP110_GATE_COMM_UNIT, "cp110-gate-comm_unit", 1)
99 /* CCU_GATE(CP110_GATE_NAND, "cp110-gate-nand", 2) */
100 CCU_GATE(CP110_GATE_PPV2, "cp110-gate-ppv2", 3)
101 CCU_GATE(CP110_GATE_SDIO, "cp110-gate-sdio", 4)
102 CCU_GATE(CP110_GATE_MG, "cp110-gate-mg", 5)
103 CCU_GATE(CP110_GATE_MG_CORE, "cp110-gate-mg_core", 6)
104 CCU_GATE(CP110_GATE_XOR1, "cp110-gate-xor1", 7)
105 CCU_GATE(CP110_GATE_XOR0, "cp110-gate-xor0", 8)
106 CCU_GATE(CP110_GATE_GOP_DP, "cp110-gate-gop_dp", 9)
107 CCU_GATE(CP110_GATE_PCIE_X1_0, "cp110-gate-pcie_x10", 11)
108 CCU_GATE(CP110_GATE_PCIE_X1_1, "cp110-gate-pcie_x11", 12)
109 CCU_GATE(CP110_GATE_PCIE_X4, "cp110-gate-pcie_x4", 13)
110 CCU_GATE(CP110_GATE_PCIE_XOR, "cp110-gate-pcie_xor", 14)
111 CCU_GATE(CP110_GATE_SATA, "cp110-gate-sata", 15)
112 CCU_GATE(CP110_GATE_SATA_USB, "cp110-gate-sata_usb", 16)
113 CCU_GATE(CP110_GATE_MAIN, "cp110-gate-main", 17)
114 CCU_GATE(CP110_GATE_SDMMC_GOP, "cp110-gate-sdmmc_gop", 18)
115 CCU_GATE(CP110_GATE_SLOW_IO, "cp110-gate-slow_io", 21)
116 CCU_GATE(CP110_GATE_USB3H0, "cp110-gate-usb3h0", 22)
117 CCU_GATE(CP110_GATE_USB3H1, "cp110-gate-usb3h1", 23)
118 CCU_GATE(CP110_GATE_USB3DEV, "cp110-gate-usb3dev", 24)
119 CCU_GATE(CP110_GATE_EIP150, "cp110-gate-eip150", 25)
120 CCU_GATE(CP110_GATE_EIP197, "cp110-gate-eip197", 26)
125 struct syscon *syscon; member
130 {"marvell,cp110-clock", 1},
134 #define RD4(sc, reg) SYSCON_READ_4((sc)->syscon, (reg))
135 #define WR4(sc, reg, val) SYSCON_WRITE_4((sc)->syscon, (reg), (val))
144 if (asprintf(&clkname, M_DEVBUF, "%s-%d", name, unit) <= 0) in mv_cp110_clock_name()
156 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in mv_cp110_clock_probe()
191 sc->dev = dev; in mv_cp110_clock_attach()
193 if (SYSCON_GET_HANDLE(sc->dev, &sc->syscon) != 0 || in mv_cp110_clock_attach()
194 sc->syscon == NULL) { in mv_cp110_clock_attach()
195 device_printf(dev, "cannot get syscon for device\n"); in mv_cp110_clock_attach()
201 device_printf(dev, "Bogus cp110-system-controller unit %d\n", unit); in mv_cp110_clock_attach()
205 mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); in mv_cp110_clock_attach()
210 pll0_name = mv_cp110_clock_name(dev, "cp110-pll0"); in mv_cp110_clock_attach()
214 cp110_clk_ppv2_core.clkdef.name = mv_cp110_clock_name(dev, "cp110-ppv2"); in mv_cp110_clock_attach()
218 cp110_clk_x2core.clkdef.name = mv_cp110_clock_name(dev, "cp110-x2core"); in mv_cp110_clock_attach()
222 cp110_clk_core.clkdef.name = mv_cp110_clock_name(dev, "cp110-core"); in mv_cp110_clock_attach()
228 cp110_clk_sdio.clkdef.name = mv_cp110_clock_name(dev, "cp110-sdio"); in mv_cp110_clock_attach()
328 mtx_lock(&sc->mtx); in mv_cp110_clock_device_lock()
337 mtx_unlock(&sc->mtx); in mv_cp110_clock_device_unlock()