12c14736cSHeiko Stübner /*
22c14736cSHeiko Stübner  * Copyright (c) 2014 MundoReader S.L.
32c14736cSHeiko Stübner  * Author: Heiko Stuebner <heiko@sntech.de>
42c14736cSHeiko Stübner  *
52c14736cSHeiko Stübner  * This program is free software; you can redistribute it and/or modify
62c14736cSHeiko Stübner  * it under the terms of the GNU General Public License as published by
72c14736cSHeiko Stübner  * the Free Software Foundation; either version 2 of the License, or
82c14736cSHeiko Stübner  * (at your option) any later version.
92c14736cSHeiko Stübner  *
102c14736cSHeiko Stübner  * This program is distributed in the hope that it will be useful,
112c14736cSHeiko Stübner  * but WITHOUT ANY WARRANTY; without even the implied warranty of
122c14736cSHeiko Stübner  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
132c14736cSHeiko Stübner  * GNU General Public License for more details.
142c14736cSHeiko Stübner  */
152c14736cSHeiko Stübner 
162c14736cSHeiko Stübner /* core clocks from */
172c14736cSHeiko Stübner #define PLL_APLL		1
182c14736cSHeiko Stübner #define PLL_DPLL		2
192c14736cSHeiko Stübner #define PLL_CPLL		3
202c14736cSHeiko Stübner #define PLL_GPLL		4
212c14736cSHeiko Stübner #define CORE_PERI		5
222c14736cSHeiko Stübner #define CORE_L2C		6
234d742e62SHeiko Stuebner #define ARMCLK			7
242c14736cSHeiko Stübner 
252c14736cSHeiko Stübner /* sclk gates (special clocks) */
262c14736cSHeiko Stübner #define SCLK_UART0		64
272c14736cSHeiko Stübner #define SCLK_UART1		65
282c14736cSHeiko Stübner #define SCLK_UART2		66
292c14736cSHeiko Stübner #define SCLK_UART3		67
302c14736cSHeiko Stübner #define SCLK_MAC		68
312c14736cSHeiko Stübner #define SCLK_SPI0		69
322c14736cSHeiko Stübner #define SCLK_SPI1		70
332c14736cSHeiko Stübner #define SCLK_SARADC		71
342c14736cSHeiko Stübner #define SCLK_SDMMC		72
352c14736cSHeiko Stübner #define SCLK_SDIO		73
362c14736cSHeiko Stübner #define SCLK_EMMC		74
372c14736cSHeiko Stübner #define SCLK_I2S0		75
382c14736cSHeiko Stübner #define SCLK_I2S1		76
392c14736cSHeiko Stübner #define SCLK_I2S2		77
402c14736cSHeiko Stübner #define SCLK_SPDIF		78
412c14736cSHeiko Stübner #define SCLK_CIF0		79
422c14736cSHeiko Stübner #define SCLK_CIF1		80
432c14736cSHeiko Stübner #define SCLK_OTGPHY0		81
442c14736cSHeiko Stübner #define SCLK_OTGPHY1		82
452c14736cSHeiko Stübner #define SCLK_HSADC		83
462c14736cSHeiko Stübner #define SCLK_TIMER0		84
472c14736cSHeiko Stübner #define SCLK_TIMER1		85
482c14736cSHeiko Stübner #define SCLK_TIMER2		86
492c14736cSHeiko Stübner #define SCLK_TIMER3		87
502c14736cSHeiko Stübner #define SCLK_TIMER4		88
512c14736cSHeiko Stübner #define SCLK_TIMER5		89
522c14736cSHeiko Stübner #define SCLK_TIMER6		90
532c14736cSHeiko Stübner #define SCLK_JTAG		91
542c14736cSHeiko Stübner #define SCLK_SMC		92
552c14736cSHeiko Stübner 
562c14736cSHeiko Stübner #define DCLK_LCDC0		190
572c14736cSHeiko Stübner #define DCLK_LCDC1		191
582c14736cSHeiko Stübner 
592c14736cSHeiko Stübner /* aclk gates */
602c14736cSHeiko Stübner #define ACLK_DMA1		192
612c14736cSHeiko Stübner #define ACLK_DMA2		193
622c14736cSHeiko Stübner #define ACLK_GPS		194
632c14736cSHeiko Stübner #define ACLK_LCDC0		195
642c14736cSHeiko Stübner #define ACLK_LCDC1		196
652c14736cSHeiko Stübner #define ACLK_GPU		197
662c14736cSHeiko Stübner #define ACLK_SMC		198
672c14736cSHeiko Stübner #define ACLK_CIF		199
682c14736cSHeiko Stübner #define ACLK_IPP		200
692c14736cSHeiko Stübner #define ACLK_RGA		201
702c14736cSHeiko Stübner #define ACLK_CIF0		202
712c14736cSHeiko Stübner 
722c14736cSHeiko Stübner /* pclk gates */
732c14736cSHeiko Stübner #define PCLK_GRF		320
742c14736cSHeiko Stübner #define PCLK_PMU		321
752c14736cSHeiko Stübner #define PCLK_TIMER0		322
762c14736cSHeiko Stübner #define PCLK_TIMER1		323
772c14736cSHeiko Stübner #define PCLK_TIMER2		324
782c14736cSHeiko Stübner #define PCLK_TIMER3		325
792c14736cSHeiko Stübner #define PCLK_PWM01		326
802c14736cSHeiko Stübner #define PCLK_PWM23		327
812c14736cSHeiko Stübner #define PCLK_SPI0		328
822c14736cSHeiko Stübner #define PCLK_SPI1		329
832c14736cSHeiko Stübner #define PCLK_SARADC		330
842c14736cSHeiko Stübner #define PCLK_WDT		331
852c14736cSHeiko Stübner #define PCLK_UART0		332
862c14736cSHeiko Stübner #define PCLK_UART1		333
872c14736cSHeiko Stübner #define PCLK_UART2		334
882c14736cSHeiko Stübner #define PCLK_UART3		335
892c14736cSHeiko Stübner #define PCLK_I2C0		336
902c14736cSHeiko Stübner #define PCLK_I2C1		337
912c14736cSHeiko Stübner #define PCLK_I2C2		338
922c14736cSHeiko Stübner #define PCLK_I2C3		339
932c14736cSHeiko Stübner #define PCLK_I2C4		340
942c14736cSHeiko Stübner #define PCLK_GPIO0		341
952c14736cSHeiko Stübner #define PCLK_GPIO1		342
962c14736cSHeiko Stübner #define PCLK_GPIO2		343
972c14736cSHeiko Stübner #define PCLK_GPIO3		344
982c14736cSHeiko Stübner #define PCLK_GPIO4		345
992c14736cSHeiko Stübner #define PCLK_GPIO6		346
1002c14736cSHeiko Stübner #define PCLK_EFUSE		347
1012c14736cSHeiko Stübner #define PCLK_TZPC		348
1022c14736cSHeiko Stübner #define PCLK_TSADC		349
1032c14736cSHeiko Stübner 
1042c14736cSHeiko Stübner /* hclk gates */
1052c14736cSHeiko Stübner #define HCLK_SDMMC		448
1062c14736cSHeiko Stübner #define HCLK_SDIO		449
1072c14736cSHeiko Stübner #define HCLK_EMMC		450
1082c14736cSHeiko Stübner #define HCLK_OTG0		451
1092c14736cSHeiko Stübner #define HCLK_EMAC		452
1102c14736cSHeiko Stübner #define HCLK_SPDIF		453
1112c14736cSHeiko Stübner #define HCLK_I2S0		454
1122c14736cSHeiko Stübner #define HCLK_I2S1		455
1132c14736cSHeiko Stübner #define HCLK_I2S2		456
1142c14736cSHeiko Stübner #define HCLK_OTG1		457
1152c14736cSHeiko Stübner #define HCLK_HSIC		458
1162c14736cSHeiko Stübner #define HCLK_HSADC		459
1172c14736cSHeiko Stübner #define HCLK_PIDF		460
1182c14736cSHeiko Stübner #define HCLK_LCDC0		461
1192c14736cSHeiko Stübner #define HCLK_LCDC1		462
1202c14736cSHeiko Stübner #define HCLK_ROM		463
1212c14736cSHeiko Stübner #define HCLK_CIF0		464
1222c14736cSHeiko Stübner #define HCLK_IPP		465
1232c14736cSHeiko Stübner #define HCLK_RGA		466
1242c14736cSHeiko Stübner #define HCLK_NANDC0		467
1252c14736cSHeiko Stübner 
1262c14736cSHeiko Stübner #define CLK_NR_CLKS		(HCLK_NANDC0 + 1)
1272c14736cSHeiko Stübner 
1282c14736cSHeiko Stübner /* soft-reset indices */
1292c14736cSHeiko Stübner #define SRST_MCORE		2
1302c14736cSHeiko Stübner #define SRST_CORE0		3
1312c14736cSHeiko Stübner #define SRST_CORE1		4
1322c14736cSHeiko Stübner #define SRST_MCORE_DBG		7
1332c14736cSHeiko Stübner #define SRST_CORE0_DBG		8
1342c14736cSHeiko Stübner #define SRST_CORE1_DBG		9
1352c14736cSHeiko Stübner #define SRST_CORE0_WDT		12
1362c14736cSHeiko Stübner #define SRST_CORE1_WDT		13
1372c14736cSHeiko Stübner #define SRST_STRC_SYS		14
1382c14736cSHeiko Stübner #define SRST_L2C		15
1392c14736cSHeiko Stübner 
1402c14736cSHeiko Stübner #define SRST_CPU_AHB		17
1412c14736cSHeiko Stübner #define SRST_AHB2APB		19
1422c14736cSHeiko Stübner #define SRST_DMA1		20
1432c14736cSHeiko Stübner #define SRST_INTMEM		21
1442c14736cSHeiko Stübner #define SRST_ROM		22
1452c14736cSHeiko Stübner #define SRST_SPDIF		26
1462c14736cSHeiko Stübner #define SRST_TIMER0		27
1472c14736cSHeiko Stübner #define SRST_TIMER1		28
1482c14736cSHeiko Stübner #define SRST_EFUSE		30
1492c14736cSHeiko Stübner 
1502c14736cSHeiko Stübner #define SRST_GPIO0		32
1512c14736cSHeiko Stübner #define SRST_GPIO1		33
1522c14736cSHeiko Stübner #define SRST_GPIO2		34
1532c14736cSHeiko Stübner #define SRST_GPIO3		35
1542c14736cSHeiko Stübner 
1552c14736cSHeiko Stübner #define SRST_UART0		39
1562c14736cSHeiko Stübner #define SRST_UART1		40
1572c14736cSHeiko Stübner #define SRST_UART2		41
1582c14736cSHeiko Stübner #define SRST_UART3		42
1592c14736cSHeiko Stübner #define SRST_I2C0		43
1602c14736cSHeiko Stübner #define SRST_I2C1		44
1612c14736cSHeiko Stübner #define SRST_I2C2		45
1622c14736cSHeiko Stübner #define SRST_I2C3		46
1632c14736cSHeiko Stübner #define SRST_I2C4		47
1642c14736cSHeiko Stübner 
1652c14736cSHeiko Stübner #define SRST_PWM0		48
1662c14736cSHeiko Stübner #define SRST_PWM1		49
1672c14736cSHeiko Stübner #define SRST_DAP_PO		50
1682c14736cSHeiko Stübner #define SRST_DAP		51
1692c14736cSHeiko Stübner #define SRST_DAP_SYS		52
1702c14736cSHeiko Stübner #define SRST_TPIU_ATB		53
1712c14736cSHeiko Stübner #define SRST_PMU_APB		54
1722c14736cSHeiko Stübner #define SRST_GRF		55
1732c14736cSHeiko Stübner #define SRST_PMU		56
1742c14736cSHeiko Stübner #define SRST_PERI_AXI		57
1752c14736cSHeiko Stübner #define SRST_PERI_AHB		58
1762c14736cSHeiko Stübner #define SRST_PERI_APB		59
1772c14736cSHeiko Stübner #define SRST_PERI_NIU		60
1782c14736cSHeiko Stübner #define SRST_CPU_PERI		61
1792c14736cSHeiko Stübner #define SRST_EMEM_PERI		62
1802c14736cSHeiko Stübner #define SRST_USB_PERI		63
1812c14736cSHeiko Stübner 
1822c14736cSHeiko Stübner #define SRST_DMA2		64
1832c14736cSHeiko Stübner #define SRST_SMC		65
1842c14736cSHeiko Stübner #define SRST_MAC		66
1852c14736cSHeiko Stübner #define SRST_NANC0		68
1862c14736cSHeiko Stübner #define SRST_USBOTG0		69
1872c14736cSHeiko Stübner #define SRST_USBPHY0		70
1882c14736cSHeiko Stübner #define SRST_OTGC0		71
1892c14736cSHeiko Stübner #define SRST_USBOTG1		72
1902c14736cSHeiko Stübner #define SRST_USBPHY1		73
1912c14736cSHeiko Stübner #define SRST_OTGC1		74
1922c14736cSHeiko Stübner #define SRST_HSADC		76
1932c14736cSHeiko Stübner #define SRST_PIDFILTER		77
1942c14736cSHeiko Stübner #define SRST_DDR_MSCH		79
1952c14736cSHeiko Stübner 
1962c14736cSHeiko Stübner #define SRST_TZPC		80
1972c14736cSHeiko Stübner #define SRST_SDMMC		81
1982c14736cSHeiko Stübner #define SRST_SDIO		82
1992c14736cSHeiko Stübner #define SRST_EMMC		83
2002c14736cSHeiko Stübner #define SRST_SPI0		84
2012c14736cSHeiko Stübner #define SRST_SPI1		85
2022c14736cSHeiko Stübner #define SRST_WDT		86
2032c14736cSHeiko Stübner #define SRST_SARADC		87
2042c14736cSHeiko Stübner #define SRST_DDRPHY		88
2052c14736cSHeiko Stübner #define SRST_DDRPHY_APB		89
2062c14736cSHeiko Stübner #define SRST_DDRCTL		90
2072c14736cSHeiko Stübner #define SRST_DDRCTL_APB		91
2082c14736cSHeiko Stübner #define SRST_DDRPUB		93
2092c14736cSHeiko Stübner 
2102c14736cSHeiko Stübner #define SRST_VIO0_AXI		98
2112c14736cSHeiko Stübner #define SRST_VIO0_AHB		99
2122c14736cSHeiko Stübner #define SRST_LCDC0_AXI		100
2132c14736cSHeiko Stübner #define SRST_LCDC0_AHB		101
2142c14736cSHeiko Stübner #define SRST_LCDC0_DCLK		102
2152c14736cSHeiko Stübner #define SRST_LCDC1_AXI		103
2162c14736cSHeiko Stübner #define SRST_LCDC1_AHB		104
2172c14736cSHeiko Stübner #define SRST_LCDC1_DCLK		105
2182c14736cSHeiko Stübner #define SRST_IPP_AXI		106
2192c14736cSHeiko Stübner #define SRST_IPP_AHB		107
2202c14736cSHeiko Stübner #define SRST_RGA_AXI		108
2212c14736cSHeiko Stübner #define SRST_RGA_AHB		109
2222c14736cSHeiko Stübner #define SRST_CIF0		110
2232c14736cSHeiko Stübner 
2242c14736cSHeiko Stübner #define SRST_VCODEC_AXI		112
2252c14736cSHeiko Stübner #define SRST_VCODEC_AHB		113
2262c14736cSHeiko Stübner #define SRST_VIO1_AXI		114
2272c14736cSHeiko Stübner #define SRST_VCODEC_CPU		115
2282c14736cSHeiko Stübner #define SRST_VCODEC_NIU		116
2292c14736cSHeiko Stübner #define SRST_GPU		120
2302c14736cSHeiko Stübner #define SRST_GPU_NIU		122
2312c14736cSHeiko Stübner #define SRST_TFUN_ATB		125
2322c14736cSHeiko Stübner #define SRST_TFUN_APB		126
2332c14736cSHeiko Stübner #define SRST_CTI4_APB		127
2342c14736cSHeiko Stübner 
2352c14736cSHeiko Stübner #define SRST_TPIU_APB		128
2362c14736cSHeiko Stübner #define SRST_TRACE		129
2372c14736cSHeiko Stübner #define SRST_CORE_DBG		130
2382c14736cSHeiko Stübner #define SRST_DBG_APB		131
2392c14736cSHeiko Stübner #define SRST_CTI0		132
2402c14736cSHeiko Stübner #define SRST_CTI0_APB		133
2412c14736cSHeiko Stübner #define SRST_CTI1		134
2422c14736cSHeiko Stübner #define SRST_CTI1_APB		135
2432c14736cSHeiko Stübner #define SRST_PTM_CORE0		136
2442c14736cSHeiko Stübner #define SRST_PTM_CORE1		137
2452c14736cSHeiko Stübner #define SRST_PTM0		138
2462c14736cSHeiko Stübner #define SRST_PTM0_ATB		139
2472c14736cSHeiko Stübner #define SRST_PTM1		140
2482c14736cSHeiko Stübner #define SRST_PTM1_ATB		141
2492c14736cSHeiko Stübner #define SRST_CTM		142
2502c14736cSHeiko Stübner #define SRST_TS			143
251