1a7fa939bSIan Lepore /*- 2a7fa939bSIan Lepore * Copyright (c) 2014 Ian Lepore <ian@freebsd.org> 3a7fa939bSIan Lepore * All rights reserved. 4a7fa939bSIan Lepore * 5a7fa939bSIan Lepore * Redistribution and use in source and binary forms, with or without 6a7fa939bSIan Lepore * modification, are permitted provided that the following conditions 7a7fa939bSIan Lepore * are met: 8a7fa939bSIan Lepore * 1. Redistributions of source code must retain the above copyright 9a7fa939bSIan Lepore * notice, this list of conditions and the following disclaimer. 10a7fa939bSIan Lepore * 2. Redistributions in binary form must reproduce the above copyright 11a7fa939bSIan Lepore * notice, this list of conditions and the following disclaimer in the 12a7fa939bSIan Lepore * documentation and/or other materials provided with the distribution. 13a7fa939bSIan Lepore * 14a7fa939bSIan Lepore * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15a7fa939bSIan Lepore * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16a7fa939bSIan Lepore * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17a7fa939bSIan Lepore * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18a7fa939bSIan Lepore * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19a7fa939bSIan Lepore * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20a7fa939bSIan Lepore * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21a7fa939bSIan Lepore * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22a7fa939bSIan Lepore * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23a7fa939bSIan Lepore * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24a7fa939bSIan Lepore * SUCH DAMAGE. 25a7fa939bSIan Lepore * 26a7fa939bSIan Lepore * $FreeBSD$ 27a7fa939bSIan Lepore */ 28a7fa939bSIan Lepore 29a7fa939bSIan Lepore #ifndef IMX_CCMVAR_H 30a7fa939bSIan Lepore #define IMX_CCMVAR_H 31a7fa939bSIan Lepore 32a7fa939bSIan Lepore /* 33a7fa939bSIan Lepore * We need a clock management system that works across unrelated SoCs and 34a7fa939bSIan Lepore * devices. For now, to keep imx development moving, define some barebones 35a7fa939bSIan Lepore * functionality that can be shared within the imx family by having each SoC 36a7fa939bSIan Lepore * implement functions with a common name. 37a7fa939bSIan Lepore * 38a7fa939bSIan Lepore * The usb enable functions are best-effort. They turn on the usb otg, host, 39a7fa939bSIan Lepore * and phy clocks in a SoC-specific manner, but it may take a lot more than that 40a7fa939bSIan Lepore * to make usb work on a given board. In particular, it can require specific 41a7fa939bSIan Lepore * pinmux setup of gpio pins connected to external phy parts, voltage regulators 42a7fa939bSIan Lepore * and overcurrent detectors, and so on. On such boards, u-boot or other early 43a7fa939bSIan Lepore * board setup code has to handle those things. 44a7fa939bSIan Lepore */ 45a7fa939bSIan Lepore 46a0fd2339SIan Lepore uint32_t imx_ccm_ecspi_hz(void); 47a7fa939bSIan Lepore uint32_t imx_ccm_ipg_hz(void); 48a7fa939bSIan Lepore uint32_t imx_ccm_perclk_hz(void); 49a7fa939bSIan Lepore uint32_t imx_ccm_sdhci_hz(void); 50a7fa939bSIan Lepore uint32_t imx_ccm_uart_hz(void); 51f14514a3SIan Lepore uint32_t imx_ccm_ahb_hz(void); 52*da21a623SOleksandr Tymoshenko uint32_t imx_ccm_ipu_hz(void); 53a7fa939bSIan Lepore 54a7fa939bSIan Lepore void imx_ccm_usb_enable(device_t _usbdev); 55a7fa939bSIan Lepore void imx_ccm_usbphy_enable(device_t _phydev); 56f0583578SRuslan Bukin void imx_ccm_ssi_configure(device_t _ssidev); 57*da21a623SOleksandr Tymoshenko int imx_ccm_pll_video_enable(void); 58c0f3a6c2SOleksandr Tymoshenko void imx_ccm_hdmi_enable(void); 59c0f3a6c2SOleksandr Tymoshenko void imx_ccm_ipu_enable(int ipu); 60854519fdSIan Lepore int imx6_ccm_sata_enable(void); 61a7fa939bSIan Lepore 62955691feSIan Lepore /* Routines to get and set the arm clock root divisor register. */ 63955691feSIan Lepore uint32_t imx_ccm_get_cacrr(void); 64955691feSIan Lepore void imx_ccm_set_cacrr(uint32_t _divisor); 65955691feSIan Lepore 66a7fa939bSIan Lepore #endif 67