Lines Matching +full:clk +full:- +full:divider +full:- +full:mode
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2013-2014 Ruslan Bukin <br@bsdpad.com>
61 #define CCM_CSCDR1 0x14 /* Serial Clock Divider Register 1 */
62 #define CCM_CSCDR2 0x18 /* Serial Clock Divider Register 2 */
63 #define CCM_CSCDR3 0x1C /* Serial Clock Divider Register 3 */
153 struct clk { struct
165 static struct clk ipg_clk = { argument
178 PLL4 clock divider (before switching the clocks should be gated)
189 static struct clk pll4_clk = {
201 static struct clk sai3_clk = {
213 static struct clk cko1_clk = {
225 static struct clk esdhc0_clk = {
237 static struct clk esdhc1_clk = {
249 static struct clk qspi0_clk = {
261 static struct clk dcu0_clk = {
273 static struct clk enet_clk = {
285 static struct clk nand_clk = {
298 Divider to generate ESAI clock
305 static struct clk esai_clk = {
319 struct clk *clk; member
346 { -1, 0 }
356 if (!ofw_bus_is_compatible(dev, "fsl,mvf600-ccm")) in ccm_probe()
366 struct clk *clk; in set_clock() local
373 device_printf(sc->dev, "Configuring %s clk\n", name); in set_clock()
375 clk = clock_map[i].clk; in set_clock()
376 if (clk->sel_reg != 0) { in set_clock()
377 reg = READ4(sc, clk->sel_reg); in set_clock()
378 reg &= ~(clk->sel_mask << clk->sel_shift); in set_clock()
379 reg |= (clk->sel_val << clk->sel_shift); in set_clock()
380 WRITE4(sc, clk->sel_reg, reg); in set_clock()
383 reg = READ4(sc, clk->reg); in set_clock()
384 reg |= clk->enable_reg; in set_clock()
385 reg &= ~(clk->div_mask << clk->div_shift); in set_clock()
386 reg |= (clk->div_val << clk->div_shift); in set_clock()
387 WRITE4(sc, clk->reg, reg); in set_clock()
424 len -= strlen(name) + 1; in ccm_fdt_set()
447 sc->dev = dev; in ccm_attach()
449 if (bus_alloc_resources(dev, ccm_spec, sc->res)) { in ccm_attach()
455 sc->bst = rman_get_bustag(sc->res[0]); in ccm_attach()
456 sc->bsh = rman_get_bushandle(sc->res[0]); in ccm_attach()
466 device_printf(sc->dev, "On board oscillator is ready.\n"); in ccm_attach()
473 /* Clock is on during all modes, except stop mode. */ in ccm_attach()