blob: e43116e064bdf6ca16fa172a0fd7ee13abfc1ce7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09002/*
3 * UniPhier SC (System Control) block registers
4 *
Masahiro Yamada85ab6072016-07-22 20:20:11 +09005 * Copyright (C) 2011-2015 Panasonic Corporation
6 * Copyright (C) 2015-2016 Socionext Inc.
7 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09008 */
9
10#ifndef ARCH_SC_REGS_H
11#define ARCH_SC_REGS_H
12
Masahiro Yamadac84024c2019-07-10 20:07:41 +090013#ifndef __ASSEMBLY__
14#include <linux/compiler.h>
15#define sc_base ((void __iomem *)SC_BASE)
16#endif
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090017
Masahiro Yamadac84024c2019-07-10 20:07:41 +090018#define SC_BASE 0x61840000
19
20#define SC_DPLLCTRL 0x1200
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090021#define SC_DPLLCTRL_SSC_EN (0x1 << 31)
22#define SC_DPLLCTRL_FOUTMODE_MASK (0xf << 16)
23#define SC_DPLLCTRL_SSC_RATE (0x1 << 15)
24
Masahiro Yamadac84024c2019-07-10 20:07:41 +090025#define SC_DPLLCTRL2 0x1204
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090026#define SC_DPLLCTRL2_NRSTDS (0x1 << 28)
27
Masahiro Yamadac84024c2019-07-10 20:07:41 +090028#define SC_DPLLCTRL3 0x1208
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090029#define SC_DPLLCTRL3_LPFSEL_COEF2 (0x0 << 31)
30#define SC_DPLLCTRL3_LPFSEL_COEF3 (0x1 << 31)
31
Masahiro Yamadac84024c2019-07-10 20:07:41 +090032#define SC_UPLLCTRL 0x1210
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090033
Masahiro Yamadac84024c2019-07-10 20:07:41 +090034#define SC_VPLL27ACTRL 0x1270
35#define SC_VPLL27ACTRL2 0x1274
36#define SC_VPLL27ACTRL3 0x1278
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090037
Masahiro Yamadac84024c2019-07-10 20:07:41 +090038#define SC_VPLL27BCTRL 0x1290
39#define SC_VPLL27BCTRL2 0x1294
40#define SC_VPLL27BCTRL3 0x1298
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090041
Masahiro Yamadac84024c2019-07-10 20:07:41 +090042#define SC_RSTCTRL 0x2000
Masahiro Yamada046d8fd2015-02-27 02:26:58 +090043#define SC_RSTCTRL_NRST_USB3B0 (0x1 << 17) /* USB3 #0 bus */
44#define SC_RSTCTRL_NRST_USB3C0 (0x1 << 16) /* USB3 #0 core */
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090045#define SC_RSTCTRL_NRST_ETHER (0x1 << 12)
Masahiro Yamada046d8fd2015-02-27 02:26:58 +090046#define SC_RSTCTRL_NRST_GIO (0x1 << 6)
Masahiro Yamadad5167d52015-09-22 00:27:40 +090047/* Pro4 or older */
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090048#define SC_RSTCTRL_NRST_UMC1 (0x1 << 5)
49#define SC_RSTCTRL_NRST_UMC0 (0x1 << 4)
50#define SC_RSTCTRL_NRST_NAND (0x1 << 2)
51
Masahiro Yamadac84024c2019-07-10 20:07:41 +090052#define SC_RSTCTRL2 0x2004
Masahiro Yamada046d8fd2015-02-27 02:26:58 +090053#define SC_RSTCTRL2_NRST_USB3B1 (0x1 << 17) /* USB3 #1 bus */
54#define SC_RSTCTRL2_NRST_USB3C1 (0x1 << 16) /* USB3 #1 core */
55
Masahiro Yamadac84024c2019-07-10 20:07:41 +090056#define SC_RSTCTRL3 0x2008
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090057
Masahiro Yamadad5167d52015-09-22 00:27:40 +090058/* Pro5 or newer */
Masahiro Yamadac84024c2019-07-10 20:07:41 +090059#define SC_RSTCTRL4 0x200c
Masahiro Yamadad5167d52015-09-22 00:27:40 +090060#define SC_RSTCTRL4_NRST_UMCSB (0x1 << 12) /* UMC system bus */
61#define SC_RSTCTRL4_NRST_UMCA2 (0x1 << 10) /* UMC ch2 standby */
62#define SC_RSTCTRL4_NRST_UMCA1 (0x1 << 9) /* UMC ch1 standby */
63#define SC_RSTCTRL4_NRST_UMCA0 (0x1 << 8) /* UMC ch0 standby */
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090064#define SC_RSTCTRL4_NRST_UMC32 (0x1 << 6) /* UMC ch2 */
Masahiro Yamadad5167d52015-09-22 00:27:40 +090065#define SC_RSTCTRL4_NRST_UMC31 (0x1 << 5) /* UMC ch1 */
66#define SC_RSTCTRL4_NRST_UMC30 (0x1 << 4) /* UMC ch0 */
67
Masahiro Yamadac84024c2019-07-10 20:07:41 +090068#define SC_RSTCTRL5 0x2010
Masahiro Yamada85ab6072016-07-22 20:20:11 +090069
Masahiro Yamadac84024c2019-07-10 20:07:41 +090070#define SC_RSTCTRL6 0x2014
Masahiro Yamada85ab6072016-07-22 20:20:11 +090071
Masahiro Yamadac84024c2019-07-10 20:07:41 +090072#define SC_CLKCTRL 0x2104
Masahiro Yamada046d8fd2015-02-27 02:26:58 +090073#define SC_CLKCTRL_CEN_USB31 (0x1 << 17) /* USB3 #1 */
74#define SC_CLKCTRL_CEN_USB30 (0x1 << 16) /* USB3 #0 */
Masahiro Yamada40adf0a2015-02-27 02:26:50 +090075#define SC_CLKCTRL_CEN_ETHER (0x1 << 12)
Masahiro Yamada046d8fd2015-02-27 02:26:58 +090076#define SC_CLKCTRL_CEN_GIO (0x1 << 6)
Masahiro Yamadad5167d52015-09-22 00:27:40 +090077/* Pro4 or older */
Masahiro Yamada40adf0a2015-02-27 02:26:50 +090078#define SC_CLKCTRL_CEN_UMC (0x1 << 4)
79#define SC_CLKCTRL_CEN_NAND (0x1 << 2)
80#define SC_CLKCTRL_CEN_SBC (0x1 << 1)
81#define SC_CLKCTRL_CEN_PERI (0x1 << 0)
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090082
Masahiro Yamadad5167d52015-09-22 00:27:40 +090083/* Pro5 or newer */
Masahiro Yamadac84024c2019-07-10 20:07:41 +090084#define SC_CLKCTRL4 0x210c
Masahiro Yamadad5167d52015-09-22 00:27:40 +090085#define SC_CLKCTRL4_CEN_UMCSB (0x1 << 12) /* UMC system bus */
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090086#define SC_CLKCTRL4_CEN_UMC2 (0x1 << 2) /* UMC ch2 */
Masahiro Yamadad5167d52015-09-22 00:27:40 +090087#define SC_CLKCTRL4_CEN_UMC1 (0x1 << 1) /* UMC ch1 */
88#define SC_CLKCTRL4_CEN_UMC0 (0x1 << 0) /* UMC ch0 */
89
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090090/* System reset control register */
Masahiro Yamadac84024c2019-07-10 20:07:41 +090091#define SC_IRQTIMSET 0x3000
92#define SC_SLFRSTSEL 0x3010
93#define SC_SLFRSTCTL 0x3014
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090094
95#endif /* ARCH_SC_REGS_H */