]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/omap_gpmc.h
6ce5e65a8abb19835c6cb34c82fe3feb33a90ab5
[karo-tx-uboot.git] / arch / arm / include / asm / omap_gpmc.h
1 /*
2  * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
3  * Rohit Choraria <rohitkc@ti.com>
4  *
5  * (C) Copyright 2013 Andreas Bießmann <andreas.devel@googlemail.com>
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9 #ifndef __ASM_OMAP_GPMC_H
10 #define __ASM_OMAP_GPMC_H
11
12 #include <asm/arch/omap_gpmc.h>
13
14 #define GPMC_BUF_EMPTY  0
15 #define GPMC_BUF_FULL   1
16
17 /* Generic ECC Layouts */
18 /* Large Page x8 NAND device Layout */
19 #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
20 #define GPMC_NAND_HW_ECC_LAYOUT {\
21         .eccbytes = 12,\
22         .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
23                 9, 10, 11, 12},\
24         .oobfree = {\
25                 {.offset = 13,\
26                  .length = 51 } } \
27 }
28 #endif
29
30 /* Large Page x16 NAND device Layout */
31 #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
32 #define GPMC_NAND_HW_ECC_LAYOUT {\
33         .eccbytes = 12,\
34         .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
35                 10, 11, 12, 13},\
36         .oobfree = {\
37                 {.offset = 14,\
38                  .length = 50 } } \
39 }
40 #endif
41
42 /* Small Page x8 NAND device Layout */
43 #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
44 #define GPMC_NAND_HW_ECC_LAYOUT {\
45         .eccbytes = 3,\
46         .eccpos = {1, 2, 3},\
47         .oobfree = {\
48                 {.offset = 4,\
49                  .length = 12 } } \
50 }
51 #endif
52
53 /* Small Page x16 NAND device Layout */
54 #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
55 #define GPMC_NAND_HW_ECC_LAYOUT {\
56         .eccbytes = 3,\
57         .eccpos = {2, 3, 4},\
58         .oobfree = {\
59                 {.offset = 5,\
60                  .length = 11 } } \
61 }
62 #endif
63
64 enum omap_ecc {
65         /* 1-bit  ECC calculation by Software, Error detection by Software */
66         OMAP_ECC_HAM1_CODE_SW = 1, /* avoid un-initialized int can be 0x0 */
67         /* 1-bit  ECC calculation by GPMC, Error detection by Software */
68         /* ECC layout compatible to legacy ROMCODE. */
69         OMAP_ECC_HAM1_CODE_HW,
70         /* 4-bit  ECC calculation by GPMC, Error detection by Software */
71         OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
72         /* 4-bit  ECC calculation by GPMC, Error detection by ELM */
73         OMAP_ECC_BCH4_CODE_HW,
74         /* 8-bit  ECC calculation by GPMC, Error detection by Software */
75         OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
76         /* 8-bit  ECC calculation by GPMC, Error detection by ELM */
77         OMAP_ECC_BCH8_CODE_HW,
78 };
79
80 #endif /* __ASM_OMAP_GPMC_H */