xref: /rk3399_rockchip-uboot/board/armltd/integrator/integrator-sc.h (revision 3765b3e7bd0f8e46914d417f29cbcb0c72b1acf7)
10a20e534SLinus Walleij /*
20a20e534SLinus Walleij  * (C) Copyright 2011
30a20e534SLinus Walleij  * Linaro
40a20e534SLinus Walleij  * Linus Walleij <linus.walleij@linaro.org>
50a20e534SLinus Walleij  * Register definitions for the System Controller (SC) and
60a20e534SLinus Walleij  * the similar "CP Controller" found in the ARM Integrator/AP and
70a20e534SLinus Walleij  * Integrator/CP reference designs
80a20e534SLinus Walleij  *
9*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
100a20e534SLinus Walleij  */
110a20e534SLinus Walleij 
120a20e534SLinus Walleij #ifndef __ARM_SC_H
130a20e534SLinus Walleij #define __ARM_SC_H
140a20e534SLinus Walleij 
150a20e534SLinus Walleij #define SC_BASE			0x11000000
160a20e534SLinus Walleij 
170a20e534SLinus Walleij /*
180a20e534SLinus Walleij  * The system controller registers
190a20e534SLinus Walleij  */
200a20e534SLinus Walleij #define SC_ID_OFFSET		0x00
210a20e534SLinus Walleij #define SC_OSC_OFFSET		0x04
220a20e534SLinus Walleij /* Setting this bit switches to 25 MHz mode, clear means 33 MHz */
230a20e534SLinus Walleij #define SC_OSC_DIVXY		(1 << 8)
240a20e534SLinus Walleij #define SC_CTRLS_OFFSET		0x08
250a20e534SLinus Walleij #define SC_CTRLC_OFFSET		0x0C
260a20e534SLinus Walleij /* Set bits by writing CTRLS, clear bits by writing CTRLC */
270a20e534SLinus Walleij #define SC_CTRL_SOFTRESET	(1 << 0)
280a20e534SLinus Walleij #define SC_CTRL_FLASHVPP	(1 << 1)
290a20e534SLinus Walleij #define SC_CTRL_FLASHWP		(1 << 2)
300a20e534SLinus Walleij #define SC_CTRL_UART1DTR	(1 << 4)
310a20e534SLinus Walleij #define SC_CTRL_UART1RTS	(1 << 5)
320a20e534SLinus Walleij #define SC_CTRL_UART0DTR	(1 << 6)
330a20e534SLinus Walleij #define SC_CTRL_UART0RTS	(1 << 7)
340a20e534SLinus Walleij #define SC_DEC_OFFSET		0x10
350a20e534SLinus Walleij #define SC_ARB_OFFSET		0x14
360a20e534SLinus Walleij #define SC_PCI_OFFSET		0x18
370a20e534SLinus Walleij #define SC_PCI_PCIEN		(1 << 0)
380a20e534SLinus Walleij #define SC_PCI_PCIBINT_CLR	(1 << 1)
390a20e534SLinus Walleij #define SC_LOCK_OFFSET		0x1C
400a20e534SLinus Walleij #define SC_LBFADDR_OFFSET	0x20
410a20e534SLinus Walleij #define SC_LBFCODE_OFFSET	0x24
420a20e534SLinus Walleij 
430a20e534SLinus Walleij #define SC_ID (SC_BASE + SC_ID_OFFSET)
440a20e534SLinus Walleij #define SC_OSC (SC_BASE + SC_OSC_OFFSET)
450a20e534SLinus Walleij #define SC_CTRLS (SC_BASE + SC_CTRLS_OFFSET)
460a20e534SLinus Walleij #define SC_CTRLC (SC_BASE + SC_CTRLC_OFFSET)
470a20e534SLinus Walleij #define SC_DEC (SC_BASE + SC_DEC_OFFSET)
480a20e534SLinus Walleij #define SC_ARB (SC_BASE + SC_ARB_OFFSET)
490a20e534SLinus Walleij #define SC_PCI (SC_BASE + SC_PCI_OFFSET)
500a20e534SLinus Walleij #define SC_LOCK (SC_BASE + SC_LOCK_OFFSET)
510a20e534SLinus Walleij #define SC_LBFADDR (SC_BASE + SC_LBFADDR_OFFSET)
520a20e534SLinus Walleij #define SC_LBFCODE (SC_BASE + SC_LBFCODE_OFFSET)
530a20e534SLinus Walleij 
540a20e534SLinus Walleij /*
550a20e534SLinus Walleij  * The Integrator/CP as a smaller set of registers, at a different
560a20e534SLinus Walleij  * offset - probably not to disturb old software.
570a20e534SLinus Walleij  */
580a20e534SLinus Walleij 
590a20e534SLinus Walleij #define CP_BASE			0xCB000000
600a20e534SLinus Walleij 
610a20e534SLinus Walleij #define CP_IDFIELD_OFFSET	0x00
620a20e534SLinus Walleij #define CP_FLASHPROG_OFFSET	0x04
630a20e534SLinus Walleij #define CP_FLASHPROG_FLVPPEN	(1 << 0)
640a20e534SLinus Walleij #define CP_FLASHPROG_FLWREN	(1 << 1)
650a20e534SLinus Walleij #define CP_FLASHPROG_FLASHSIZE	(1 << 2)
660a20e534SLinus Walleij #define CP_FLASHPROG_EXTRABANK	(1 << 3)
670a20e534SLinus Walleij #define CP_INTREG_OFFSET	0x08
680a20e534SLinus Walleij #define CP_DECODE_OFFSET	0x0C
690a20e534SLinus Walleij 
700a20e534SLinus Walleij #define CP_IDFIELD (CP_BASE + CP_ID_OFFSET)
710a20e534SLinus Walleij #define CP_FLASHPROG (CP_BASE + CP_FLASHPROG_OFFSET)
720a20e534SLinus Walleij #define CP_INTREG (CP_BASE + CP_INTREG_OFFSET)
730a20e534SLinus Walleij #define CP_DECODE (CP_BASE + CP_DECODE_OFFSET)
740a20e534SLinus Walleij 
750a20e534SLinus Walleij #endif
76