xref: /freebsd/sys/arm/mv/mv_cp110_clock.h (revision 95ee2897)
173450c4aSEmmanuel Vadot /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
373450c4aSEmmanuel Vadot  *
473450c4aSEmmanuel Vadot  * Copyright (c) 2018 Rubicon Communications, LLC (Netgate)
573450c4aSEmmanuel Vadot  *
673450c4aSEmmanuel Vadot  * Redistribution and use in source and binary forms, with or without
773450c4aSEmmanuel Vadot  * modification, are permitted provided that the following conditions
873450c4aSEmmanuel Vadot  * are met:
973450c4aSEmmanuel Vadot  * 1. Redistributions of source code must retain the above copyright
1073450c4aSEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer.
1173450c4aSEmmanuel Vadot  * 2. Redistributions in binary form must reproduce the above copyright
1273450c4aSEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer in the
1373450c4aSEmmanuel Vadot  *    documentation and/or other materials provided with the distribution.
1473450c4aSEmmanuel Vadot  *
1573450c4aSEmmanuel Vadot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1673450c4aSEmmanuel Vadot  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1773450c4aSEmmanuel Vadot  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1873450c4aSEmmanuel Vadot  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1973450c4aSEmmanuel Vadot  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2073450c4aSEmmanuel Vadot  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2173450c4aSEmmanuel Vadot  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2273450c4aSEmmanuel Vadot  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2373450c4aSEmmanuel Vadot  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2473450c4aSEmmanuel Vadot  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2573450c4aSEmmanuel Vadot  * SUCH DAMAGE.
2673450c4aSEmmanuel Vadot  */
2773450c4aSEmmanuel Vadot 
2873450c4aSEmmanuel Vadot #ifndef _MV_CP110_SYSCON_H_
2973450c4aSEmmanuel Vadot #define	_MV_CP110_SYSCON_H_
3073450c4aSEmmanuel Vadot 
3173450c4aSEmmanuel Vadot enum mv_cp110_clk_id {
3273450c4aSEmmanuel Vadot 	CP110_PLL_0 = 0,
3373450c4aSEmmanuel Vadot 	CP110_PPV2_CORE,
3473450c4aSEmmanuel Vadot 	CP110_X2CORE,
3573450c4aSEmmanuel Vadot 	CP110_CORE,
3673450c4aSEmmanuel Vadot 	CP110_NAND,
3773450c4aSEmmanuel Vadot 	CP110_SDIO,
3873450c4aSEmmanuel Vadot 	CP110_MAX_CLOCK
3973450c4aSEmmanuel Vadot };
4073450c4aSEmmanuel Vadot 
4173450c4aSEmmanuel Vadot /* Gates */
4273450c4aSEmmanuel Vadot #define	CP110_CLOCK_GATING_OFFSET	0x220
4373450c4aSEmmanuel Vadot 
4473450c4aSEmmanuel Vadot struct cp110_gate {
4573450c4aSEmmanuel Vadot 	const char	*name;
4673450c4aSEmmanuel Vadot 	uint32_t	shift;
4773450c4aSEmmanuel Vadot };
4873450c4aSEmmanuel Vadot 
4973450c4aSEmmanuel Vadot #define	CCU_GATE(idx, clkname, s)		\
5073450c4aSEmmanuel Vadot 	[idx] = {					\
5173450c4aSEmmanuel Vadot 		.name = clkname,			\
5273450c4aSEmmanuel Vadot 		.shift = s,				\
5373450c4aSEmmanuel Vadot 	},
5473450c4aSEmmanuel Vadot 
5573450c4aSEmmanuel Vadot #define	CP110_GATE_AUDIO		0
5673450c4aSEmmanuel Vadot #define	CP110_GATE_COMM_UNIT		1
5773450c4aSEmmanuel Vadot #define	CP110_GATE_NAND			2
5873450c4aSEmmanuel Vadot #define	CP110_GATE_PPV2			3
5973450c4aSEmmanuel Vadot #define	CP110_GATE_SDIO			4
6073450c4aSEmmanuel Vadot #define	CP110_GATE_MG			5
6173450c4aSEmmanuel Vadot #define	CP110_GATE_MG_CORE		6
6273450c4aSEmmanuel Vadot #define	CP110_GATE_XOR1			7
6373450c4aSEmmanuel Vadot #define	CP110_GATE_XOR0			8
6473450c4aSEmmanuel Vadot #define	CP110_GATE_GOP_DP		9
6573450c4aSEmmanuel Vadot #define	CP110_GATE_PCIE_X1_0		11
6673450c4aSEmmanuel Vadot #define	CP110_GATE_PCIE_X1_1		12
6773450c4aSEmmanuel Vadot #define	CP110_GATE_PCIE_X4		13
6873450c4aSEmmanuel Vadot #define	CP110_GATE_PCIE_XOR		14
6973450c4aSEmmanuel Vadot #define	CP110_GATE_SATA			15
7073450c4aSEmmanuel Vadot #define	CP110_GATE_SATA_USB		16
7173450c4aSEmmanuel Vadot #define	CP110_GATE_MAIN			17
7273450c4aSEmmanuel Vadot #define	CP110_GATE_SDMMC_GOP		18
7373450c4aSEmmanuel Vadot #define	CP110_GATE_SLOW_IO		21
7473450c4aSEmmanuel Vadot #define	CP110_GATE_USB3H0		22
7573450c4aSEmmanuel Vadot #define	CP110_GATE_USB3H1		23
7673450c4aSEmmanuel Vadot #define	CP110_GATE_USB3DEV		24
7773450c4aSEmmanuel Vadot #define	CP110_GATE_EIP150		25
7873450c4aSEmmanuel Vadot #define	CP110_GATE_EIP197		26
7973450c4aSEmmanuel Vadot 
8073450c4aSEmmanuel Vadot #endif
81