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