xref: /rk3399_rockchip-uboot/board/armltd/integrator/arm-ebi.h (revision 3765b3e7bd0f8e46914d417f29cbcb0c72b1acf7)
1701ed16eSLinus Walleij /*
2701ed16eSLinus Walleij  * (C) Copyright 2011
3701ed16eSLinus Walleij  * Linaro
4701ed16eSLinus Walleij  * Linus Walleij <linus.walleij@linaro.org>
5701ed16eSLinus Walleij  * Register definitions for the External Bus Interface (EBI)
6701ed16eSLinus Walleij  * found in the ARM Integrator AP and CP reference designs
7701ed16eSLinus Walleij  *
8*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
9701ed16eSLinus Walleij  */
10701ed16eSLinus Walleij 
11701ed16eSLinus Walleij #ifndef __ARM_EBI_H
12701ed16eSLinus Walleij #define __ARM_EBI_H
13701ed16eSLinus Walleij 
14701ed16eSLinus Walleij #define EBI_BASE		0x12000000
15701ed16eSLinus Walleij 
16701ed16eSLinus Walleij #define EBI_CSR0_REG		0x00 /* CS0 = Boot ROM */
17701ed16eSLinus Walleij #define EBI_CSR1_REG		0x04 /* CS1 = Flash */
18701ed16eSLinus Walleij #define EBI_CSR2_REG		0x08 /* CS2 = SSRAM */
19701ed16eSLinus Walleij #define EBI_CSR3_REG		0x0C /* CS3 = Expansion memory */
20701ed16eSLinus Walleij /*
21701ed16eSLinus Walleij  * The four upper bits are the waitstates for each chip select
22701ed16eSLinus Walleij  * 0x00 = 2 cycles, 0x10 = 3 cycles, ... 0xe0 = 16 cycles, 0xf0 = 16 cycles
23701ed16eSLinus Walleij  */
24701ed16eSLinus Walleij #define EBI_CSR_WAIT_MASK	0xF0
25701ed16eSLinus Walleij /* Whether memory is synchronous or asynchronous */
26701ed16eSLinus Walleij #define EBI_CSR_SYNC_MASK	0xF7
27701ed16eSLinus Walleij #define EBI_CSR_ASYNC		0x00
28701ed16eSLinus Walleij #define EBI_CSR_SYNC		0x08
29701ed16eSLinus Walleij /* Whether memory is write enabled or not */
30701ed16eSLinus Walleij #define EBI_CSR_WREN_MASK	0xFB
31701ed16eSLinus Walleij #define EBI_CSR_WREN_DISABLE	0x00
32701ed16eSLinus Walleij #define EBI_CSR_WREN_ENABLE	0x04
33701ed16eSLinus Walleij /* Memory bit width for each chip select */
34701ed16eSLinus Walleij #define EBI_CSR_MEMSIZE_MASK	0xFC
35701ed16eSLinus Walleij #define EBI_CSR_MEMSIZE_8BIT	0x00
36701ed16eSLinus Walleij #define EBI_CSR_MEMSIZE_16BIT	0x01
37701ed16eSLinus Walleij #define EBI_CSR_MEMSIZE_32BIT	0x02
38701ed16eSLinus Walleij 
39701ed16eSLinus Walleij /*
40701ed16eSLinus Walleij  * The lock register need to be written with 0xa05f before anything in the
41701ed16eSLinus Walleij  * EBI can be changed.
42701ed16eSLinus Walleij  */
43701ed16eSLinus Walleij #define EBI_LOCK_REG		0x20
44701ed16eSLinus Walleij #define EBI_UNLOCK_MAGIC	0xA05F
45701ed16eSLinus Walleij 
46701ed16eSLinus Walleij #endif
47