a10_clk.h revision 266337
159290Sjlemon/*-
272969Sjlemon * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org>
359290Sjlemon * All rights reserved.
459290Sjlemon *
559290Sjlemon * Redistribution and use in source and binary forms, with or without
659290Sjlemon * modification, are permitted provided that the following conditions
759290Sjlemon * are met:
859290Sjlemon * 1. Redistributions of source code must retain the above copyright
959290Sjlemon *    notice, this list of conditions and the following disclaimer.
1059290Sjlemon * 2. Redistributions in binary form must reproduce the above copyright
1159290Sjlemon *    notice, this list of conditions and the following disclaimer in the
1259290Sjlemon *    documentation and/or other materials provided with the distribution.
1359290Sjlemon *
1459290Sjlemon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1559290Sjlemon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1659290Sjlemon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1759290Sjlemon * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1859290Sjlemon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1959290Sjlemon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2059290Sjlemon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION
2159290Sjlemon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2259290Sjlemon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY
2359290Sjlemon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2459290Sjlemon * SUCH DAMAGE.
2559290Sjlemon *
2699090Sbde * $FreeBSD: stable/10/sys/arm/allwinner/a10_clk.h 266337 2014-05-17 18:53:36Z ian $
2759290Sjlemon */
2859290Sjlemon
2959290Sjlemon#ifndef _A10_CLK_H_
3059290Sjlemon#define _A10_CLK_H_
3159290Sjlemon
32156767Sphk#define CCMU_BASE		0xe1c20000
33156767Sphk
3459290Sjlemon#define CCM_PLL1_CFG		0x0000
3559290Sjlemon#define CCM_PLL1_TUN		0x0004
3659290Sjlemon#define CCM_PLL2_CFG		0x0008
3759290Sjlemon#define CCM_PLL2_TUN		0x000c
3859290Sjlemon#define CCM_PLL3_CFG		0x0010
3959290Sjlemon#define CCM_PLL3_TUN		0x0014
4079989Sjlemon#define CCM_PLL4_CFG		0x0018
41201350Sbrooks#define CCM_PLL4_TUN		0x001c
42131562Salfred#define CCM_PLL5_CFG		0x0020
43151262Sambrisko#define CCM_PLL5_TUN		0x0024
44197241Ssson#define CCM_PLL6_CFG		0x0028
45197241Ssson#define CCM_PLL6_TUN		0x002c
4659290Sjlemon#define CCM_PLL7_CFG		0x0030
47336200Sdab#define CCM_PLL7_TUN		0x0034
48336200Sdab#define CCM_PLL1_TUN2		0x0038
49336200Sdab#define CCM_PLL5_TUN2		0x003c
50336200Sdab#define CCM_PLL_LOCK_DBG	0x004c
51336200Sdab#define CCM_OSC24M_CFG		0x0050
52336200Sdab#define CCM_CPU_AHB_APB0_CFG	0x0054
53336200Sdab#define CCM_APB1_CLK_DIV	0x0058
54336200Sdab#define CCM_AXI_GATING		0x005c
55336200Sdab#define CCM_AHB_GATING0		0x0060
56336200Sdab#define CCM_AHB_GATING1		0x0064
57336200Sdab#define CCM_APB0_GATING		0x0068
58336200Sdab#define CCM_APB1_GATING		0x006c
59336200Sdab#define CCM_NAND_SCLK_CFG	0x0080
60336200Sdab#define CCM_MS_SCLK_CFG		0x0084
61336200Sdab#define CCM_MMC0_SCLK_CFG	0x0088
62110241Snectar#define CCM_MMC1_SCLK_CFG	0x008c
63110241Snectar#define CCM_MMC2_SCLK_CFG	0x0090
6472969Sjlemon#define CCM_MMC3_SCLK_CFG	0x0094
6572969Sjlemon#define CCM_TS_CLK		0x0098
6672969Sjlemon#define CCM_SS_CLK		0x009c
6772969Sjlemon#define CCM_SPI0_CLK		0x00a0
6872969Sjlemon#define CCM_SPI1_CLK		0x00a4
6972969Sjlemon#define CCM_SPI2_CLK		0x00a8
7072969Sjlemon#define CCM_PATA_CLK		0x00ac
71336200Sdab#define CCM_IR0_CLK		0x00b0
7272969Sjlemon#define CCM_IR1_CLK		0x00b4
7359290Sjlemon#define CCM_IIS_CLK		0x00b8
7459309Sjlemon#define CCM_AC97_CLK		0x00bc
7559290Sjlemon#define CCM_SPDIF_CLK		0x00c0
76336647Sdab#define CCM_KEYPAD_CLK		0x00c4
77336647Sdab#define CCM_SATA_CLK		0x00c8
78336647Sdab#define CCM_USB_CLK		0x00cc
7959290Sjlemon#define CCM_GPS_CLK		0x00d0
8059290Sjlemon#define CCM_SPI3_CLK		0x00d4
8159290Sjlemon#define CCM_DRAM_CLK		0x0100
8259290Sjlemon#define CCM_BE0_SCLK		0x0104
8359290Sjlemon#define CCM_BE1_SCLK		0x0108
8459290Sjlemon#define CCM_FE0_CLK		0x010c
8559290Sjlemon#define CCM_FE1_CLK		0x0110
8659290Sjlemon#define CCM_MP_CLK		0x0114
8759290Sjlemon#define CCM_LCD0_CH0_CLK	0x0118
8859290Sjlemon#define CCM_LCD1_CH0_CLK	0x011c
8959290Sjlemon#define CCM_CSI_ISP_CLK		0x0120
9059290Sjlemon#define CCM_TVD_CLK		0x0128
91197243Ssson#define CCM_LCD0_CH1_CLK	0x012c
92197242Ssson#define CCM_LCD1_CH1_CLK	0x0130
9359290Sjlemon#define CCM_CS0_CLK		0x0134
9459290Sjlemon#define CCM_CS1_CLK		0x0138
95254072Sjhb#define CCM_VE_CLK		0x013c
9659290Sjlemon#define CCM_AUDIO_CODEC_CLK	0x0140
97297977Svangyzen#define CCM_AVS_CLK		0x0144
9859290Sjlemon#define CCM_ACE_CLK		0x0148
9959290Sjlemon#define CCM_LVDS_CLK		0x014c
10059290Sjlemon#define CCM_HDMI_CLK		0x0150
10159290Sjlemon#define CCM_MALI400_CLK		0x0154
10259290Sjlemon
103197241Ssson#define CCM_AHB_GATING_USB0	(1 << 0)
104197241Ssson#define CCM_AHB_GATING_EHCI0	(1 << 1)
105197241Ssson#define CCM_AHB_GATING_EHCI1	(1 << 3)
106197241Ssson#define CCM_AHB_GATING_EMAC	(1 << 17)
107197241Ssson
108197241Ssson#define CCM_USB_PHY		(1 << 8)
109197241Ssson#define CCM_USB0_RESET		(1 << 0)
110197241Ssson#define CCM_USB1_RESET		(1 << 1)
111197241Ssson#define CCM_USB2_RESET		(1 << 2)
112197241Ssson
113197241Sssonint a10_clk_usb_activate(void);
114197241Sssonint a10_clk_usb_deactivate(void);
115197241Sssonint a10_clk_emac_activate(void);
116197241Ssson
117197241Ssson#endif /* _A10_CLK_H_ */
118197241Ssson