blob: 2cfd5407423d97ebc351f991db636e8a38492924 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ian Campbell49aeca32014-05-05 11:52:23 +01002/*
3 * (C) Copyright 2007-2011
4 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5 * Tom Cubie <tangliang@allwinnertech.com>
Ian Campbell49aeca32014-05-05 11:52:23 +01006 */
7
8#ifndef _SUNXI_CLOCK_H
9#define _SUNXI_CLOCK_H
10
11#include <linux/types.h>
12
13#define CLK_GATE_OPEN 0x1
14#define CLK_GATE_CLOSE 0x0
15
16/* clock control module regs definition */
vishnupatekar39754b62015-11-29 01:07:24 +080017#if defined(CONFIG_MACH_SUN8I_A83T)
18#include <asm/arch/clock_sun8i_a83t.h>
Jernej Skrabecda8ae612021-01-11 21:11:34 +010019#elif defined(CONFIG_SUN50I_GEN_H6)
Icenowy Zhengd1fa87d2018-07-21 16:20:26 +080020#include <asm/arch/clock_sun50i_h6.h>
Siarhei Siamashka26c50fb2016-03-29 17:29:10 +020021#elif defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \
Icenowy Zheng015051d2022-01-29 10:23:03 -050022 defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUNIV)
Chen-Yu Tsai3a045422014-10-03 20:16:25 +080023#include <asm/arch/clock_sun6i.h>
Hans de Goede35e1a152015-01-14 17:30:22 +010024#elif defined(CONFIG_MACH_SUN9I)
25#include <asm/arch/clock_sun9i.h>
Chen-Yu Tsai3a045422014-10-03 20:16:25 +080026#else
Ian Campbell49aeca32014-05-05 11:52:23 +010027#include <asm/arch/clock_sun4i.h>
Chen-Yu Tsai3a045422014-10-03 20:16:25 +080028#endif
Ian Campbell49aeca32014-05-05 11:52:23 +010029
30#ifndef __ASSEMBLY__
31int clock_init(void);
32int clock_twi_onoff(int port, int state);
Hans de Goede70d7ab52014-11-08 14:07:27 +010033void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz);
Ian Campbell49aeca32014-05-05 11:52:23 +010034void clock_init_safe(void);
Chen-Yu Tsai6daddfe2016-01-06 15:13:07 +080035void clock_init_sec(void);
Ian Campbell49aeca32014-05-05 11:52:23 +010036void clock_init_uart(void);
37#endif
38
39#endif /* _SUNXI_CLOCK_H */