]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/arch-am33xx/omap_gpmc.h
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / arch / arm / include / asm / arch-am33xx / omap_gpmc.h
1 /*
2  * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
3  * Rohit Choraria <rohitkc@ti.com>
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23 #ifndef __ASM_ARCH_OMAP_GPMC_H
24 #define __ASM_ARCH_OMAP_GPMC_H
25
26 #define GPMC_BUF_EMPTY  0
27 #define GPMC_BUF_FULL   1
28
29 #define ECCCLEAR        (0x1 << 8)
30 #define ECCRESULTREG1   (0x1 << 0)
31 #define ECCSIZE512BYTE  0xFF
32 #define ECCSIZE1        (ECCSIZE512BYTE << 22)
33 #define ECCSIZE0        (ECCSIZE512BYTE << 12)
34 #define ECCSIZE0SEL     (0x000 << 0)
35
36 /* Generic ECC Layouts */
37 /* Large Page x8 NAND device Layout */
38 #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
39 #define GPMC_NAND_HW_ECC_LAYOUT {\
40         .eccbytes = 12,\
41         .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
42                 9, 10, 11, 12},\
43         .oobfree = {\
44                 {.offset = 13,\
45                  .length = 51 } } \
46 }
47 #endif
48
49 /* Large Page x16 NAND device Layout */
50 #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
51 #define GPMC_NAND_HW_ECC_LAYOUT {\
52         .eccbytes = 12,\
53         .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
54                 10, 11, 12, 13},\
55         .oobfree = {\
56                 {.offset = 14,\
57                  .length = 50 } } \
58 }
59 #endif
60
61 /* Small Page x8 NAND device Layout */
62 #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
63 #define GPMC_NAND_HW_ECC_LAYOUT {\
64         .eccbytes = 3,\
65         .eccpos = {1, 2, 3},\
66         .oobfree = {\
67                 {.offset = 4,\
68                  .length = 12 } } \
69 }
70 #endif
71
72 /* Small Page x16 NAND device Layout */
73 #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
74 #define GPMC_NAND_HW_ECC_LAYOUT {\
75         .eccbytes = 3,\
76         .eccpos = {2, 3, 4},\
77         .oobfree = {\
78                 {.offset = 5,\
79                  .length = 11 } } \
80 }
81 #endif
82
83 #define GPMC_NAND_HW_BCH4_ECC_LAYOUT {\
84         .eccbytes = 32,\
85         .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
86                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
87                                 28, 29, 30, 31, 32, 33},\
88         .oobfree = {\
89                 {.offset = 34,\
90                  .length = 30 } } \
91 }
92
93 #define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
94         .eccbytes = 56,\
95         .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
96                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
97                                 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
98                                 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
99                                 52, 53, 54, 55, 56, 57},\
100         .oobfree = {\
101                 {.offset = 58,\
102                  .length = 6 } } \
103 }
104
105 #define GPMC_NAND_HW_BCH16_ECC_LAYOUT {\
106         .eccbytes = 104,\
107         .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
108                                 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
109                                 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
110                                 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
111                                 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\
112                                 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
113                                 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
114                                 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
115                                 100, 101, 102, 103, 104, 105},\
116         .oobfree = {\
117                 {.offset = 106,\
118                  .length = 8 } } \
119 }
120 #endif /* __ASM_ARCH_OMAP_GPMC_H */