Lines Matching +full:pico +full:- +full:seconds
1 // SPDX-License-Identifier: GPL-2.0-or-later
17 #include <linux/fsl-diu-fb.h>
36 out_be32(&reset_module_base->rpr, 0x52535445); in mpc512x_restart()
38 out_be32(&reset_module_base->rcr, 0x2); in mpc512x_restart()
47 u8 gamma[0x300]; /* 32-bit aligned! */
48 struct diu_ad ad0; /* 32-bit aligned! */
54 /* receives a pixel clock spec in pico seconds, adjusts the DIU clock rate */
63 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu"); in mpc512x_set_pixel_clock()
71 clk_diu = clk_get_sys(np->name, "ipg"); in mpc512x_set_pixel_clock()
85 * determine the acceptable clock range for the monitor (+/- 5%), in mpc512x_set_pixel_clock()
88 pr_debug("DIU pixclock in ps - %u\n", pixclock); in mpc512x_set_pixel_clock()
90 pr_debug("DIU pixclock freq - %u\n", pixclock); in mpc512x_set_pixel_clock()
92 pr_debug("DIU deviation - %lu\n", epsilon); in mpc512x_set_pixel_clock()
93 minpixclock = pixclock - epsilon; in mpc512x_set_pixel_clock()
95 pr_debug("DIU minpixclock - %lu\n", minpixclock); in mpc512x_set_pixel_clock()
96 pr_debug("DIU maxpixclock - %lu\n", maxpixclock); in mpc512x_set_pixel_clock()
101 * - simply request the desired clock and see what the in mpc512x_set_pixel_clock()
104 * - try other candidate frequencies in the order of decreasing in mpc512x_set_pixel_clock()
108 * first match is found -- any potential subsequent match in mpc512x_set_pixel_clock()
113 * arbitrary choice -- it's simple to calculate, in the typical in mpc512x_set_pixel_clock()
123 want = pixclock - offset; in mpc512x_set_pixel_clock()
124 pr_debug("DIU checking clock - %lu\n", want); in mpc512x_set_pixel_clock()
127 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
133 pr_debug("DIU checking clock - %lu\n", want); in mpc512x_set_pixel_clock()
136 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
141 pr_debug("DIU clock accepted - %lu\n", want); in mpc512x_set_pixel_clock()
157 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
196 * Check if DIU was pre-initialized. If so, perform steps
212 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu"); in mpc512x_init_diu()
225 mode = in_be32(&diu_reg->diu_mode); in mpc512x_init_diu()
231 desc = in_be32(&diu_reg->desc[0]); in mpc512x_init_diu()
240 flush_dcache_range(dst, dst + sizeof(struct diu_ad) - 1); in mpc512x_init_diu()
242 res = in_be32(&diu_reg->disp_size); in mpc512x_init_diu()
250 desc = in_be32(&diu_reg->gamma); in mpc512x_init_diu()
260 flush_dcache_range(dst, dst + sizeof(diu_shared_fb.gamma) - 1); in mpc512x_init_diu()
263 out_be32(&diu_reg->gamma, virt_to_phys(&diu_shared_fb.gamma)); in mpc512x_init_diu()
264 out_be32(&diu_reg->desc[1], 0); in mpc512x_init_diu()
265 out_be32(&diu_reg->desc[2], 0); in mpc512x_init_diu()
266 out_be32(&diu_reg->desc[0], virt_to_phys(&diu_shared_fb.ad0)); in mpc512x_init_diu()
304 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-ipic"); in mpc512x_init_IRQ()
322 { .compatible = "fsl,mpc5121-immr", },
323 { .compatible = "fsl,mpc5121-localbus", },
324 { .compatible = "fsl,mpc5121-mbx", },
325 { .compatible = "fsl,mpc5121-nfc", },
326 { .compatible = "fsl,mpc5121-sram", },
327 { .compatible = "fsl,mpc5121-pci", },
328 { .compatible = "gpio-leds", },
344 return "fsl,mpc5121-psc"; in mpc512x_select_psc_compat()
347 return "fsl,mpc5125-psc"; in mpc512x_select_psc_compat()
355 return "fsl,mpc5121-reset"; in mpc512x_select_reset_compat()
358 return "fsl,mpc5125-reset"; in mpc512x_select_reset_compat()
398 tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); in mpc512x_psc_fifo_init()
399 rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); in mpc512x_psc_fifo_init()
429 out_be32(&FIFOC(psc)->txsz, (fifobase << 16) | tx_fifo_size); in mpc512x_psc_fifo_init()
431 out_be32(&FIFOC(psc)->rxsz, (fifobase << 16) | rx_fifo_size); in mpc512x_psc_fifo_init()
435 out_be32(&FIFOC(psc)->txcmd, 0x80); in mpc512x_psc_fifo_init()
436 out_be32(&FIFOC(psc)->txcmd, 0x01); in mpc512x_psc_fifo_init()
437 out_be32(&FIFOC(psc)->rxcmd, 0x80); in mpc512x_psc_fifo_init()
438 out_be32(&FIFOC(psc)->rxcmd, 0x01); in mpc512x_psc_fifo_init()
479 * mpc512x_cs_config - Setup chip select configuration
493 return -EINVAL; in mpc512x_cs_config()
496 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-lpc"); in mpc512x_cs_config()
500 return -ENOMEM; in mpc512x_cs_config()
503 out_be32(&lpc->cs_cfg[cs], val); in mpc512x_cs_config()