blob: ad58e10e23d0b6ac7406163418ccb50185be8c61 [file] [log] [blame]
Masahiro Yamada5894ca02014-10-03 19:21:06 +09001/*
2 * UniPhier SC (System Control) block registers
3 *
Masahiro Yamada29d63a52016-07-22 20:20:11 +09004 * Copyright (C) 2011-2015 Panasonic Corporation
5 * Copyright (C) 2015-2016 Socionext Inc.
6 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada5894ca02014-10-03 19:21:06 +09007 *
8 * SPDX-License-Identifier: GPL-2.0+
9 */
10
11#ifndef ARCH_SC_REGS_H
12#define ARCH_SC_REGS_H
13
Masahiro Yamadaea65c982016-03-18 16:41:43 +090014#if defined(CONFIG_ARCH_UNIPHIER_SLD3)
Masahiro Yamada3365b4e2015-07-21 14:04:22 +090015#define SC_BASE_ADDR 0xf1840000
16#else
Masahiro Yamada5894ca02014-10-03 19:21:06 +090017#define SC_BASE_ADDR 0x61840000
Masahiro Yamada3365b4e2015-07-21 14:04:22 +090018#endif
Masahiro Yamada5894ca02014-10-03 19:21:06 +090019
Masahiro Yamada28f40d42015-09-22 00:27:40 +090020#define SC_DPLLOSCCTRL (SC_BASE_ADDR | 0x1110)
21#define SC_DPLLOSCCTRL_DPLLST (0x1 << 1)
22#define SC_DPLLOSCCTRL_DPLLEN (0x1 << 0)
23
Masahiro Yamada5894ca02014-10-03 19:21:06 +090024#define SC_DPLLCTRL (SC_BASE_ADDR | 0x1200)
25#define SC_DPLLCTRL_SSC_EN (0x1 << 31)
26#define SC_DPLLCTRL_FOUTMODE_MASK (0xf << 16)
27#define SC_DPLLCTRL_SSC_RATE (0x1 << 15)
28
29#define SC_DPLLCTRL2 (SC_BASE_ADDR | 0x1204)
30#define SC_DPLLCTRL2_NRSTDS (0x1 << 28)
31
32#define SC_DPLLCTRL3 (SC_BASE_ADDR | 0x1208)
33#define SC_DPLLCTRL3_LPFSEL_COEF2 (0x0 << 31)
34#define SC_DPLLCTRL3_LPFSEL_COEF3 (0x1 << 31)
35
36#define SC_UPLLCTRL (SC_BASE_ADDR | 0x1210)
37
38#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1270)
39#define SC_VPLL27ACTRL2 (SC_BASE_ADDR | 0x1274)
40#define SC_VPLL27ACTRL3 (SC_BASE_ADDR | 0x1278)
41
42#define SC_VPLL27BCTRL (SC_BASE_ADDR | 0x1290)
43#define SC_VPLL27BCTRL2 (SC_BASE_ADDR | 0x1294)
44#define SC_VPLL27BCTRL3 (SC_BASE_ADDR | 0x1298)
45
46#define SC_RSTCTRL (SC_BASE_ADDR | 0x2000)
Masahiro Yamada15351632015-02-27 02:26:58 +090047#define SC_RSTCTRL_NRST_USB3B0 (0x1 << 17) /* USB3 #0 bus */
48#define SC_RSTCTRL_NRST_USB3C0 (0x1 << 16) /* USB3 #0 core */
Masahiro Yamada5894ca02014-10-03 19:21:06 +090049#define SC_RSTCTRL_NRST_ETHER (0x1 << 12)
Masahiro Yamada42ca6982015-02-27 02:26:53 +090050#define SC_RSTCTRL_NRST_STDMAC (0x1 << 10)
Masahiro Yamada15351632015-02-27 02:26:58 +090051#define SC_RSTCTRL_NRST_GIO (0x1 << 6)
Masahiro Yamada28f40d42015-09-22 00:27:40 +090052/* Pro4 or older */
Masahiro Yamada5894ca02014-10-03 19:21:06 +090053#define SC_RSTCTRL_NRST_UMC1 (0x1 << 5)
54#define SC_RSTCTRL_NRST_UMC0 (0x1 << 4)
55#define SC_RSTCTRL_NRST_NAND (0x1 << 2)
56
57#define SC_RSTCTRL2 (SC_BASE_ADDR | 0x2004)
Masahiro Yamada15351632015-02-27 02:26:58 +090058#define SC_RSTCTRL2_NRST_USB3B1 (0x1 << 17) /* USB3 #1 bus */
59#define SC_RSTCTRL2_NRST_USB3C1 (0x1 << 16) /* USB3 #1 core */
60
Masahiro Yamada5894ca02014-10-03 19:21:06 +090061#define SC_RSTCTRL3 (SC_BASE_ADDR | 0x2008)
62
Masahiro Yamada28f40d42015-09-22 00:27:40 +090063/* Pro5 or newer */
64#define SC_RSTCTRL4 (SC_BASE_ADDR | 0x200c)
65#define SC_RSTCTRL4_NRST_UMCSB (0x1 << 12) /* UMC system bus */
66#define SC_RSTCTRL4_NRST_UMCA2 (0x1 << 10) /* UMC ch2 standby */
67#define SC_RSTCTRL4_NRST_UMCA1 (0x1 << 9) /* UMC ch1 standby */
68#define SC_RSTCTRL4_NRST_UMCA0 (0x1 << 8) /* UMC ch0 standby */
Masahiro Yamada019df872015-09-22 00:27:41 +090069#define SC_RSTCTRL4_NRST_UMC32 (0x1 << 6) /* UMC ch2 */
Masahiro Yamada28f40d42015-09-22 00:27:40 +090070#define SC_RSTCTRL4_NRST_UMC31 (0x1 << 5) /* UMC ch1 */
71#define SC_RSTCTRL4_NRST_UMC30 (0x1 << 4) /* UMC ch0 */
72
Masahiro Yamada29d63a52016-07-22 20:20:11 +090073#define SC_RSTCTRL5 (SC_BASE_ADDR | 0x2010)
74
75#define SC_RSTCTRL6 (SC_BASE_ADDR | 0x2014)
76
Masahiro Yamada5894ca02014-10-03 19:21:06 +090077#define SC_CLKCTRL (SC_BASE_ADDR | 0x2104)
Masahiro Yamada15351632015-02-27 02:26:58 +090078#define SC_CLKCTRL_CEN_USB31 (0x1 << 17) /* USB3 #1 */
79#define SC_CLKCTRL_CEN_USB30 (0x1 << 16) /* USB3 #0 */
Masahiro Yamadaf267b812015-02-27 02:26:50 +090080#define SC_CLKCTRL_CEN_ETHER (0x1 << 12)
81#define SC_CLKCTRL_CEN_MIO (0x1 << 11)
Masahiro Yamada42ca6982015-02-27 02:26:53 +090082#define SC_CLKCTRL_CEN_STDMAC (0x1 << 10)
Masahiro Yamada15351632015-02-27 02:26:58 +090083#define SC_CLKCTRL_CEN_GIO (0x1 << 6)
Masahiro Yamada28f40d42015-09-22 00:27:40 +090084/* Pro4 or older */
Masahiro Yamadaf267b812015-02-27 02:26:50 +090085#define SC_CLKCTRL_CEN_UMC (0x1 << 4)
86#define SC_CLKCTRL_CEN_NAND (0x1 << 2)
87#define SC_CLKCTRL_CEN_SBC (0x1 << 1)
88#define SC_CLKCTRL_CEN_PERI (0x1 << 0)
Masahiro Yamada5894ca02014-10-03 19:21:06 +090089
Masahiro Yamada28f40d42015-09-22 00:27:40 +090090/* Pro5 or newer */
91#define SC_CLKCTRL4 (SC_BASE_ADDR | 0x210c)
92#define SC_CLKCTRL4_CEN_UMCSB (0x1 << 12) /* UMC system bus */
Masahiro Yamada019df872015-09-22 00:27:41 +090093#define SC_CLKCTRL4_CEN_UMC2 (0x1 << 2) /* UMC ch2 */
Masahiro Yamada28f40d42015-09-22 00:27:40 +090094#define SC_CLKCTRL4_CEN_UMC1 (0x1 << 1) /* UMC ch1 */
95#define SC_CLKCTRL4_CEN_UMC0 (0x1 << 0) /* UMC ch0 */
96
Masahiro Yamada5894ca02014-10-03 19:21:06 +090097/* System reset control register */
98#define SC_IRQTIMSET (SC_BASE_ADDR | 0x3000)
99#define SC_SLFRSTSEL (SC_BASE_ADDR | 0x3010)
100#define SC_SLFRSTCTL (SC_BASE_ADDR | 0x3014)
101
102#endif /* ARCH_SC_REGS_H */