]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/arch-davinci/emif_defs.h
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / arm / include / asm / arch-davinci / emif_defs.h
1 /*
2  * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 #ifndef _EMIF_DEFS_H_
7 #define _EMIF_DEFS_H_
8
9 #include <asm/arch/hardware.h>
10
11 struct davinci_emif_regs {
12         u_int32_t       ercsr;
13         u_int32_t       awccr;
14         u_int32_t       sdbcr;
15         u_int32_t       sdrcr;
16         u_int32_t       ab1cr;
17         u_int32_t       ab2cr;
18         u_int32_t       ab3cr;
19         u_int32_t       ab4cr;
20         u_int32_t       sdtimr;
21         u_int32_t       ddrsr;
22         u_int32_t       ddrphycr;
23         u_int32_t       ddrphysr;
24         u_int32_t       totar;
25         u_int32_t       totactr;
26         u_int32_t       ddrphyid_rev;
27         u_int32_t       sdsretr;
28         u_int32_t       eirr;
29         u_int32_t       eimr;
30         u_int32_t       eimsr;
31         u_int32_t       eimcr;
32         u_int32_t       ioctrlr;
33         u_int32_t       iostatr;
34         u_int8_t        rsvd0[8];
35         u_int32_t       nandfcr;
36         u_int32_t       nandfsr;
37         u_int8_t        rsvd1[8];
38         u_int32_t       nandfecc[4];
39         u_int8_t        rsvd2[60];
40         u_int32_t       nand4biteccload;
41         u_int32_t       nand4bitecc[4];
42         u_int32_t       nanderradd1;
43         u_int32_t       nanderradd2;
44         u_int32_t       nanderrval1;
45         u_int32_t       nanderrval2;
46 };
47
48 #define davinci_emif_regs \
49         ((struct davinci_emif_regs *)DAVINCI_ASYNC_EMIF_CNTRL_BASE)
50
51 #define DAVINCI_NANDFCR_NAND_ENABLE(n)                  (1 << (n-2))
52 #define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK               (3 << 4)
53 #define DAVINCI_NANDFCR_4BIT_ECC_SEL(n)                 ((n-2) << 4)
54 #define DAVINCI_NANDFCR_1BIT_ECC_START(n)               (1 << (8 + (n-2)))
55 #define DAVINCI_NANDFCR_4BIT_ECC_START                  (1 << 12)
56 #define DAVINCI_NANDFCR_4BIT_CALC_START                 (1 << 13)
57 #define DAVINCI_NANDFCR_CS2NAND                         (1 << 0)
58
59 /* Chip Select setup */
60 #define DAVINCI_ABCR_STROBE_SELECT                      (1 << 31)
61 #define DAVINCI_ABCR_EXT_WAIT                           (1 << 30)
62 #define DAVINCI_ABCR_WSETUP(n)                          (n << 26)
63 #define DAVINCI_ABCR_WSTROBE(n)                         (n << 20)
64 #define DAVINCI_ABCR_WHOLD(n)                           (n << 17)
65 #define DAVINCI_ABCR_RSETUP(n)                          (n << 13)
66 #define DAVINCI_ABCR_RSTROBE(n)                         (n << 7)
67 #define DAVINCI_ABCR_RHOLD(n)                           (n << 4)
68 #define DAVINCI_ABCR_TA(n)                              (n << 2)
69 #define DAVINCI_ABCR_ASIZE_16BIT                        1
70 #define DAVINCI_ABCR_ASIZE_8BIT                         0
71
72 #endif