162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2010 Samsung Electronics Co., Ltd. 462306a36Sopenharmony_ci * http://www.samsung.com/ 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * S5PV210 - Clock register definitions 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef __ASM_ARCH_REGS_CLOCK_H 1062306a36Sopenharmony_ci#define __ASM_ARCH_REGS_CLOCK_H __FILE__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#define S3C_ADDR_BASE 0xF6000000 1362306a36Sopenharmony_ci#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x)) 1462306a36Sopenharmony_ci#define S3C_VA_SYS S3C_ADDR(0x00100000) 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#define S5P_CLKREG(x) (S3C_VA_SYS + (x)) 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#define S5P_APLL_LOCK S5P_CLKREG(0x00) 1962306a36Sopenharmony_ci#define S5P_MPLL_LOCK S5P_CLKREG(0x08) 2062306a36Sopenharmony_ci#define S5P_EPLL_LOCK S5P_CLKREG(0x10) 2162306a36Sopenharmony_ci#define S5P_VPLL_LOCK S5P_CLKREG(0x20) 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#define S5P_APLL_CON S5P_CLKREG(0x100) 2462306a36Sopenharmony_ci#define S5P_MPLL_CON S5P_CLKREG(0x108) 2562306a36Sopenharmony_ci#define S5P_EPLL_CON S5P_CLKREG(0x110) 2662306a36Sopenharmony_ci#define S5P_EPLL_CON1 S5P_CLKREG(0x114) 2762306a36Sopenharmony_ci#define S5P_VPLL_CON S5P_CLKREG(0x120) 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci#define S5P_CLK_SRC0 S5P_CLKREG(0x200) 3062306a36Sopenharmony_ci#define S5P_CLK_SRC1 S5P_CLKREG(0x204) 3162306a36Sopenharmony_ci#define S5P_CLK_SRC2 S5P_CLKREG(0x208) 3262306a36Sopenharmony_ci#define S5P_CLK_SRC3 S5P_CLKREG(0x20C) 3362306a36Sopenharmony_ci#define S5P_CLK_SRC4 S5P_CLKREG(0x210) 3462306a36Sopenharmony_ci#define S5P_CLK_SRC5 S5P_CLKREG(0x214) 3562306a36Sopenharmony_ci#define S5P_CLK_SRC6 S5P_CLKREG(0x218) 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#define S5P_CLK_SRC_MASK0 S5P_CLKREG(0x280) 3862306a36Sopenharmony_ci#define S5P_CLK_SRC_MASK1 S5P_CLKREG(0x284) 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#define S5P_CLK_DIV0 S5P_CLKREG(0x300) 4162306a36Sopenharmony_ci#define S5P_CLK_DIV1 S5P_CLKREG(0x304) 4262306a36Sopenharmony_ci#define S5P_CLK_DIV2 S5P_CLKREG(0x308) 4362306a36Sopenharmony_ci#define S5P_CLK_DIV3 S5P_CLKREG(0x30C) 4462306a36Sopenharmony_ci#define S5P_CLK_DIV4 S5P_CLKREG(0x310) 4562306a36Sopenharmony_ci#define S5P_CLK_DIV5 S5P_CLKREG(0x314) 4662306a36Sopenharmony_ci#define S5P_CLK_DIV6 S5P_CLKREG(0x318) 4762306a36Sopenharmony_ci#define S5P_CLK_DIV7 S5P_CLKREG(0x31C) 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci#define S5P_CLKGATE_MAIN0 S5P_CLKREG(0x400) 5062306a36Sopenharmony_ci#define S5P_CLKGATE_MAIN1 S5P_CLKREG(0x404) 5162306a36Sopenharmony_ci#define S5P_CLKGATE_MAIN2 S5P_CLKREG(0x408) 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci#define S5P_CLKGATE_PERI0 S5P_CLKREG(0x420) 5462306a36Sopenharmony_ci#define S5P_CLKGATE_PERI1 S5P_CLKREG(0x424) 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#define S5P_CLKGATE_SCLK0 S5P_CLKREG(0x440) 5762306a36Sopenharmony_ci#define S5P_CLKGATE_SCLK1 S5P_CLKREG(0x444) 5862306a36Sopenharmony_ci#define S5P_CLKGATE_IP0 S5P_CLKREG(0x460) 5962306a36Sopenharmony_ci#define S5P_CLKGATE_IP1 S5P_CLKREG(0x464) 6062306a36Sopenharmony_ci#define S5P_CLKGATE_IP2 S5P_CLKREG(0x468) 6162306a36Sopenharmony_ci#define S5P_CLKGATE_IP3 S5P_CLKREG(0x46C) 6262306a36Sopenharmony_ci#define S5P_CLKGATE_IP4 S5P_CLKREG(0x470) 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define S5P_CLKGATE_BLOCK S5P_CLKREG(0x480) 6562306a36Sopenharmony_ci#define S5P_CLKGATE_BUS0 S5P_CLKREG(0x484) 6662306a36Sopenharmony_ci#define S5P_CLKGATE_BUS1 S5P_CLKREG(0x488) 6762306a36Sopenharmony_ci#define S5P_CLK_OUT S5P_CLKREG(0x500) 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* DIV/MUX STATUS */ 7062306a36Sopenharmony_ci#define S5P_CLKDIV_STAT0 S5P_CLKREG(0x1000) 7162306a36Sopenharmony_ci#define S5P_CLKDIV_STAT1 S5P_CLKREG(0x1004) 7262306a36Sopenharmony_ci#define S5P_CLKMUX_STAT0 S5P_CLKREG(0x1100) 7362306a36Sopenharmony_ci#define S5P_CLKMUX_STAT1 S5P_CLKREG(0x1104) 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci/* CLKSRC0 */ 7662306a36Sopenharmony_ci#define S5P_CLKSRC0_MUX200_SHIFT (16) 7762306a36Sopenharmony_ci#define S5P_CLKSRC0_MUX200_MASK (0x1 << S5P_CLKSRC0_MUX200_SHIFT) 7862306a36Sopenharmony_ci#define S5P_CLKSRC0_MUX166_MASK (0x1<<20) 7962306a36Sopenharmony_ci#define S5P_CLKSRC0_MUX133_MASK (0x1<<24) 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci/* CLKSRC2 */ 8262306a36Sopenharmony_ci#define S5P_CLKSRC2_G3D_SHIFT (0) 8362306a36Sopenharmony_ci#define S5P_CLKSRC2_G3D_MASK (0x3 << S5P_CLKSRC2_G3D_SHIFT) 8462306a36Sopenharmony_ci#define S5P_CLKSRC2_MFC_SHIFT (4) 8562306a36Sopenharmony_ci#define S5P_CLKSRC2_MFC_MASK (0x3 << S5P_CLKSRC2_MFC_SHIFT) 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci/* CLKSRC6*/ 8862306a36Sopenharmony_ci#define S5P_CLKSRC6_ONEDRAM_SHIFT (24) 8962306a36Sopenharmony_ci#define S5P_CLKSRC6_ONEDRAM_MASK (0x3 << S5P_CLKSRC6_ONEDRAM_SHIFT) 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci/* CLKDIV0 */ 9262306a36Sopenharmony_ci#define S5P_CLKDIV0_APLL_SHIFT (0) 9362306a36Sopenharmony_ci#define S5P_CLKDIV0_APLL_MASK (0x7 << S5P_CLKDIV0_APLL_SHIFT) 9462306a36Sopenharmony_ci#define S5P_CLKDIV0_A2M_SHIFT (4) 9562306a36Sopenharmony_ci#define S5P_CLKDIV0_A2M_MASK (0x7 << S5P_CLKDIV0_A2M_SHIFT) 9662306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK200_SHIFT (8) 9762306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK200_MASK (0x7 << S5P_CLKDIV0_HCLK200_SHIFT) 9862306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK100_SHIFT (12) 9962306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK100_MASK (0x7 << S5P_CLKDIV0_PCLK100_SHIFT) 10062306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK166_SHIFT (16) 10162306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK166_MASK (0xF << S5P_CLKDIV0_HCLK166_SHIFT) 10262306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK83_SHIFT (20) 10362306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK83_MASK (0x7 << S5P_CLKDIV0_PCLK83_SHIFT) 10462306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK133_SHIFT (24) 10562306a36Sopenharmony_ci#define S5P_CLKDIV0_HCLK133_MASK (0xF << S5P_CLKDIV0_HCLK133_SHIFT) 10662306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK66_SHIFT (28) 10762306a36Sopenharmony_ci#define S5P_CLKDIV0_PCLK66_MASK (0x7 << S5P_CLKDIV0_PCLK66_SHIFT) 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci/* CLKDIV2 */ 11062306a36Sopenharmony_ci#define S5P_CLKDIV2_G3D_SHIFT (0) 11162306a36Sopenharmony_ci#define S5P_CLKDIV2_G3D_MASK (0xF << S5P_CLKDIV2_G3D_SHIFT) 11262306a36Sopenharmony_ci#define S5P_CLKDIV2_MFC_SHIFT (4) 11362306a36Sopenharmony_ci#define S5P_CLKDIV2_MFC_MASK (0xF << S5P_CLKDIV2_MFC_SHIFT) 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ci/* CLKDIV6 */ 11662306a36Sopenharmony_ci#define S5P_CLKDIV6_ONEDRAM_SHIFT (28) 11762306a36Sopenharmony_ci#define S5P_CLKDIV6_ONEDRAM_MASK (0xF << S5P_CLKDIV6_ONEDRAM_SHIFT) 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci#define S5P_SWRESET S5P_CLKREG(0x2000) 12062306a36Sopenharmony_ci 12162306a36Sopenharmony_ci#define S5P_ARM_MCS_CON S5P_CLKREG(0x6100) 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci/* Registers related to power management */ 12462306a36Sopenharmony_ci#define S5P_PWR_CFG S5P_CLKREG(0xC000) 12562306a36Sopenharmony_ci#define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0xC004) 12662306a36Sopenharmony_ci#define S5P_WAKEUP_MASK S5P_CLKREG(0xC008) 12762306a36Sopenharmony_ci#define S5P_PWR_MODE S5P_CLKREG(0xC00C) 12862306a36Sopenharmony_ci#define S5P_NORMAL_CFG S5P_CLKREG(0xC010) 12962306a36Sopenharmony_ci#define S5P_IDLE_CFG S5P_CLKREG(0xC020) 13062306a36Sopenharmony_ci#define S5P_STOP_CFG S5P_CLKREG(0xC030) 13162306a36Sopenharmony_ci#define S5P_STOP_MEM_CFG S5P_CLKREG(0xC034) 13262306a36Sopenharmony_ci#define S5P_SLEEP_CFG S5P_CLKREG(0xC040) 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci#define S5P_OSC_FREQ S5P_CLKREG(0xC100) 13562306a36Sopenharmony_ci#define S5P_OSC_STABLE S5P_CLKREG(0xC104) 13662306a36Sopenharmony_ci#define S5P_PWR_STABLE S5P_CLKREG(0xC108) 13762306a36Sopenharmony_ci#define S5P_MTC_STABLE S5P_CLKREG(0xC110) 13862306a36Sopenharmony_ci#define S5P_CLAMP_STABLE S5P_CLKREG(0xC114) 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define S5P_WAKEUP_STAT S5P_CLKREG(0xC200) 14162306a36Sopenharmony_ci#define S5P_BLK_PWR_STAT S5P_CLKREG(0xC204) 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#define S5P_OTHERS S5P_CLKREG(0xE000) 14462306a36Sopenharmony_ci#define S5P_OM_STAT S5P_CLKREG(0xE100) 14562306a36Sopenharmony_ci#define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804) 14662306a36Sopenharmony_ci#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) 14762306a36Sopenharmony_ci#define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810) 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci#define S5P_INFORM0 S5P_CLKREG(0xF000) 15062306a36Sopenharmony_ci#define S5P_INFORM1 S5P_CLKREG(0xF004) 15162306a36Sopenharmony_ci#define S5P_INFORM2 S5P_CLKREG(0xF008) 15262306a36Sopenharmony_ci#define S5P_INFORM3 S5P_CLKREG(0xF00C) 15362306a36Sopenharmony_ci#define S5P_INFORM4 S5P_CLKREG(0xF010) 15462306a36Sopenharmony_ci#define S5P_INFORM5 S5P_CLKREG(0xF014) 15562306a36Sopenharmony_ci#define S5P_INFORM6 S5P_CLKREG(0xF018) 15662306a36Sopenharmony_ci#define S5P_INFORM7 S5P_CLKREG(0xF01C) 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci#define S5P_RST_STAT S5P_CLKREG(0xA000) 15962306a36Sopenharmony_ci#define S5P_OSC_CON S5P_CLKREG(0x8000) 16062306a36Sopenharmony_ci#define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 16162306a36Sopenharmony_ci#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 16262306a36Sopenharmony_ci#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci#define S5P_IDLE_CFG_TL_MASK (3 << 30) 16562306a36Sopenharmony_ci#define S5P_IDLE_CFG_TM_MASK (3 << 28) 16662306a36Sopenharmony_ci#define S5P_IDLE_CFG_TL_ON (2 << 30) 16762306a36Sopenharmony_ci#define S5P_IDLE_CFG_TM_ON (2 << 28) 16862306a36Sopenharmony_ci#define S5P_IDLE_CFG_DIDLE (1 << 0) 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci#define S5P_CFG_WFI_CLEAN (~(3 << 8)) 17162306a36Sopenharmony_ci#define S5P_CFG_WFI_IDLE (1 << 8) 17262306a36Sopenharmony_ci#define S5P_CFG_WFI_STOP (2 << 8) 17362306a36Sopenharmony_ci#define S5P_CFG_WFI_SLEEP (3 << 8) 17462306a36Sopenharmony_ci 17562306a36Sopenharmony_ci#define S5P_OTHER_SYS_INT 24 17662306a36Sopenharmony_ci#define S5P_OTHER_STA_TYPE 23 17762306a36Sopenharmony_ci#define S5P_OTHER_SYSC_INTOFF (1 << 0) 17862306a36Sopenharmony_ci#define STA_TYPE_EXPON 0 17962306a36Sopenharmony_ci#define STA_TYPE_SFR 1 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci#define S5P_PWR_STA_EXP_SCALE 0 18262306a36Sopenharmony_ci#define S5P_PWR_STA_CNT 4 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci#define S5P_PWR_STABLE_COUNT 85500 18562306a36Sopenharmony_ci 18662306a36Sopenharmony_ci#define S5P_SLEEP_CFG_OSC_EN (1 << 0) 18762306a36Sopenharmony_ci#define S5P_SLEEP_CFG_USBOSC_EN (1 << 1) 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci/* OTHERS Resgister */ 19062306a36Sopenharmony_ci#define S5P_OTHERS_USB_SIG_MASK (1 << 16) 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci/* S5P_DAC_CONTROL */ 19362306a36Sopenharmony_ci#define S5P_DAC_ENABLE (1) 19462306a36Sopenharmony_ci#define S5P_DAC_DISABLE (0) 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci#endif /* __ASM_ARCH_REGS_CLOCK_H */ 197