1 /*- 2 * Copyright (c) 2013 Ian Lepore <ian@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $FreeBSD$ 27 */ 28 29 #ifndef IMX6_ANATOPREG_H 30 #define IMX6_ANATOPREG_H 31 32 #define IMX6_ANALOG_CCM_PLL_ARM 0x000 33 #define IMX6_ANALOG_CCM_PLL_ARM_SET 0x004 34 #define IMX6_ANALOG_CCM_PLL_ARM_CLR 0x008 35 #define IMX6_ANALOG_CCM_PLL_ARM_TOG 0x00C 36 #define IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK 0x7F 37 #define IMX6_ANALOG_CCM_PLL_ARM_LOCK (1U << 31) 38 #define IMX6_ANALOG_CCM_PLL_ARM_BYPASS (1 << 16) 39 #define IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK (0x03 << 16) 40 #define IMX6_ANALOG_CCM_PLL_USB1 0x010 41 #define IMX6_ANALOG_CCM_PLL_USB1_SET 0x014 42 #define IMX6_ANALOG_CCM_PLL_USB1_CLR 0x018 43 #define IMX6_ANALOG_CCM_PLL_USB1_TOG 0x01C 44 #define IMX6_ANALOG_CCM_PLL_USB_LOCK (1U << 31) 45 #define IMX6_ANALOG_CCM_PLL_USB_BYPASS (1 << 16) 46 #define IMX6_ANALOG_CCM_PLL_USB_ENABLE (1 << 13) 47 #define IMX6_ANALOG_CCM_PLL_USB_POWER (1 << 12) 48 #define IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS (1 << 6) 49 #define IMX6_ANALOG_CCM_PLL_USB2 0x020 50 #define IMX6_ANALOG_CCM_PLL_USB2_SET 0x024 51 #define IMX6_ANALOG_CCM_PLL_USB2_CLR 0x028 52 #define IMX6_ANALOG_CCM_PLL_USB2_TOG 0x02C 53 #define IMX6_ANALOG_CCM_PLL_SYS 0x030 54 #define IMX6_ANALOG_CCM_PLL_SYS_SET 0x034 55 #define IMX6_ANALOG_CCM_PLL_SYS_CLR 0x038 56 #define IMX6_ANALOG_CCM_PLL_SYS_TOG 0x03C 57 #define IMX6_ANALOG_CCM_PLL_SYS_SS 0x040 58 #define IMX6_ANALOG_CCM_PLL_SYS_NUM 0x050 59 #define IMX6_ANALOG_CCM_PLL_SYS_DENOM 0x060 60 #define IMX6_ANALOG_CCM_PLL_AUDIO 0x070 61 #define IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE (1 << 13) 62 #define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT 0 63 #define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK 0x7f 64 #define IMX6_ANALOG_CCM_PLL_AUDIO_SET 0x074 65 #define IMX6_ANALOG_CCM_PLL_AUDIO_CLR 0x078 66 #define IMX6_ANALOG_CCM_PLL_AUDIO_TOG 0x07C 67 #define IMX6_ANALOG_CCM_PLL_AUDIO_NUM 0x080 68 #define IMX6_ANALOG_CCM_PLL_AUDIO_DENOM 0x090 69 #define IMX6_ANALOG_CCM_PLL_VIDEO 0x0A0 70 #define IMX6_ANALOG_CCM_PLL_VIDEO_SET 0x0A4 71 #define IMX6_ANALOG_CCM_PLL_VIDEO_CLR 0x0A8 72 #define IMX6_ANALOG_CCM_PLL_VIDEO_TOG 0x0AC 73 #define IMX6_ANALOG_CCM_PLL_VIDEO_NUM 0x0B0 74 #define IMX6_ANALOG_CCM_PLL_VIDEO_DENOM 0x0C0 75 #define IMX6_ANALOG_CCM_PLL_MLB 0x0D0 76 #define IMX6_ANALOG_CCM_PLL_MLB_SET 0x0D4 77 #define IMX6_ANALOG_CCM_PLL_MLB_CLR 0x0D8 78 #define IMX6_ANALOG_CCM_PLL_MLB_TOG 0x0DC 79 #define IMX6_ANALOG_CCM_PLL_ENET 0x0E0 80 #define IMX6_ANALOG_CCM_PLL_ENET_SET 0x0E4 81 #define IMX6_ANALOG_CCM_PLL_ENET_CLR 0x0E8 82 #define IMX6_ANALOG_CCM_PLL_ENET_TOG 0x0EC 83 #define IMX6_ANALOG_CCM_PFD_480 0x0F0 84 #define IMX6_ANALOG_CCM_PFD_480_SET 0x0F4 85 #define IMX6_ANALOG_CCM_PFD_480_CLR 0x0F8 86 #define IMX6_ANALOG_CCM_PFD_480_TOG 0x0FC 87 #define IMX6_ANALOG_CCM_PFD_528 0x100 88 #define IMX6_ANALOG_CCM_PFD_528_SET 0x104 89 #define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 90 #define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C 91 92 #define IMX6_ANALOG_PMU_REG_CORE 0x140 93 #define IMX6_ANALOG_PMU_REG2_TARG_SHIFT 18 94 #define IMX6_ANALOG_PMU_REG2_TARG_MASK \ 95 (0x1f << IMX6_ANALOG_PMU_REG2_TARG_SHIFT) 96 #define IMX6_ANALOG_PMU_REG1_TARG_SHIFT 9 97 #define IMX6_ANALOG_PMU_REG1_TARG_MASK \ 98 (0x1f << IMX6_ANALOG_PMU_REG1_TARG_SHIFT) 99 #define IMX6_ANALOG_PMU_REG0_TARG_SHIFT 0 100 #define IMX6_ANALOG_PMU_REG0_TARG_MASK \ 101 (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT) 102 103 #define IMX6_ANALOG_PMU_MISC0 0x150 104 #define IMX6_ANALOG_PMU_MISC0_SET 0x154 105 #define IMX6_ANALOG_PMU_MISC0_CLR 0x158 106 #define IMX6_ANALOG_PMU_MISC0_TOG 0x15C 107 #define IMX6_ANALOG_PMU_MISC0_SELFBIASOFF (1 << 3) 108 109 #define IMX6_ANALOG_PMU_MISC1 0x160 110 #define IMX6_ANALOG_PMU_MISC1_SET 0x164 111 #define IMX6_ANALOG_PMU_MISC1_CLR 0x168 112 #define IMX6_ANALOG_PMU_MISC1_TOG 0x16C 113 #define IMX6_ANALOG_PMU_MISC1_IRQ_TEMPSENSE (1 << 29) 114 115 #define IMX6_ANALOG_PMU_MISC2 0x170 116 #define IMX6_ANALOG_PMU_MISC2_SET 0x174 117 #define IMX6_ANALOG_PMU_MISC2_CLR 0x178 118 #define IMX6_ANALOG_PMU_MISC2_TOG 0x17C 119 120 /* 121 * Note that the ANALOG_CCM_MISCn registers are the same as the PMU_MISCn 122 * registers; some bits conceptually belong to the PMU and some to the CCM. 123 */ 124 #define IMX6_ANALOG_CCM_MISC0 IMX6_ANALOG_PMU_MISC0 125 #define IMX6_ANALOG_CCM_MISC0_SET IMX6_ANALOG_PMU_MISC0_SET 126 #define IMX6_ANALOG_CCM_MISC0_CLR IMX6_ANALOG_PMU_MISC0_CLR 127 #define IMX6_ANALOG_CCM_MISC0_TOG IMX6_ANALOG_PMU_MISC0_TOG 128 129 #define IMX6_ANALOG_CCM_MISC2 IMX6_ANALOG_PMU_MISC2 130 #define IMX6_ANALOG_CCM_MISC2_SET IMX6_ANALOG_PMU_MISC2_SET 131 #define IMX6_ANALOG_CCM_MISC2_CLR IMX6_ANALOG_PMU_MISC2_CLR 132 #define IMX6_ANALOG_CCM_MISC2_TOG IMX6_ANALOG_PMU_MISC2_TOG 133 134 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0 0x180 135 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET 0x184 136 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR 0x188 137 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C 138 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C 139 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT 20 140 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK \ 141 (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT) 142 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT 8 143 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK \ 144 (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT) 145 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID 0x4 146 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE 0x2 147 #define IMX6_ANALOG_TEMPMON_TEMPSENSE0_POWER_DOWN 0x1 148 149 #define IMX6_ANALOG_TEMPMON_TEMPSENSE1 0x190 150 #define IMX6_ANALOG_TEMPMON_TEMPSENSE1_SET 0x194 151 #define IMX6_ANALOG_TEMPMON_TEMPSENSE1_CLR 0x198 152 #define IMX6_ANALOG_TEMPMON_TEMPSENSE1_TOG 0x19C 153 154 #define IMX6_ANALOG_USB1_VBUS_DETECT 0x1A0 155 #define IMX6_ANALOG_USB1_VBUS_DETECT_SET 0x1A4 156 #define IMX6_ANALOG_USB1_VBUS_DETECT_CLR 0x1A8 157 #define IMX6_ANALOG_USB1_VBUS_DETECT_TOG 0x1AC 158 #define IMX6_ANALOG_USB1_CHRG_DETECT 0x1B0 159 #define IMX6_ANALOG_USB1_CHRG_DETECT_SET 0x1B4 160 #define IMX6_ANALOG_USB1_CHRG_DETECT_CLR 0x1B8 161 #define IMX6_ANALOG_USB1_CHRG_DETECT_TOG 0x1BC 162 #define IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE (1 << 20) /* EN_B */ 163 #define IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG (1 << 19) /* CHK_CHRG_B */ 164 #define IMX6_ANALOG_USB_CHRG_DETECT_CHK_CONTACT (1 << 18) 165 #define IMX6_ANALOG_USB1_VBUS_DETECT_STAT 0x1C0 166 #define IMX6_ANALOG_USB1_CHRG_DETECT_STAT 0x1D0 167 #define IMX6_ANALOG_USB1_MISC 0x1F0 168 #define IMX6_ANALOG_USB1_MISC_SET 0x1F4 169 #define IMX6_ANALOG_USB1_MISC_CLR 0x1F8 170 #define IMX6_ANALOG_USB1_MISC_TOG 0x1FC 171 #define IMX6_ANALOG_USB2_VBUS_DETECT 0x200 172 #define IMX6_ANALOG_USB2_VBUS_DETECT_SET 0x204 173 #define IMX6_ANALOG_USB2_VBUS_DETECT_CLR 0x208 174 #define IMX6_ANALOG_USB2_VBUS_DETECT_TOG 0x20C 175 #define IMX6_ANALOG_USB2_CHRG_DETECT 0x210 176 #define IMX6_ANALOG_USB2_CHRG_DETECT_SET 0x214 177 #define IMX6_ANALOG_USB2_CHRG_DETECT_CLR 0x218 178 #define IMX6_ANALOG_USB2_CHRG_DETECT_TOG 0x21C 179 #define IMX6_ANALOG_USB2_VBUS_DETECT_STAT 0x220 180 #define IMX6_ANALOG_USB2_CHRG_DETECT_STAT 0x230 181 #define IMX6_ANALOG_USB2_MISC 0x250 182 #define IMX6_ANALOG_USB2_MISC_SET 0x254 183 #define IMX6_ANALOG_USB2_MISC_CLR 0x258 184 #define IMX6_ANALOG_USB2_MISC_TOG 0x25C 185 #define IMX6_ANALOG_DIGPROG 0x260 186 #define IMX6_ANALOG_DIGPROG_SL 0x280 187 #define IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT 16 188 #define IMX6_ANALOG_DIGPROG_SOCTYPE_MASK \ 189 (0xff << IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) 190 191 #endif 192