blob: 5cb1df179a7163b882ef024469ef0de32f750f66 [file] [log] [blame]
Andreas Bießmann5bf299b2013-04-02 06:05:54 +00001/*
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 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25#ifndef __ASM_OMAP_GPMC_H
26#define __ASM_OMAP_GPMC_H
27
28#include <asm/arch/omap_gpmc.h>
29
30#define GPMC_BUF_EMPTY 0
31#define GPMC_BUF_FULL 1
32
33#define ECCCLEAR (0x1 << 8)
34#define ECCRESULTREG1 (0x1 << 0)
35#define ECCSIZE512BYTE 0xFF
36#define ECCSIZE1 (ECCSIZE512BYTE << 22)
37#define ECCSIZE0 (ECCSIZE512BYTE << 12)
38#define ECCSIZE0SEL (0x000 << 0)
39
40/* Generic ECC Layouts */
41/* Large Page x8 NAND device Layout */
42#ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
43#define GPMC_NAND_HW_ECC_LAYOUT {\
44 .eccbytes = 12,\
45 .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
46 9, 10, 11, 12},\
47 .oobfree = {\
48 {.offset = 13,\
49 .length = 51 } } \
50}
51#endif
52
53/* Large Page x16 NAND device Layout */
54#ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
55#define GPMC_NAND_HW_ECC_LAYOUT {\
56 .eccbytes = 12,\
57 .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
58 10, 11, 12, 13},\
59 .oobfree = {\
60 {.offset = 14,\
61 .length = 50 } } \
62}
63#endif
64
65/* Small Page x8 NAND device Layout */
66#ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
67#define GPMC_NAND_HW_ECC_LAYOUT {\
68 .eccbytes = 3,\
69 .eccpos = {1, 2, 3},\
70 .oobfree = {\
71 {.offset = 4,\
72 .length = 12 } } \
73}
74#endif
75
76/* Small Page x16 NAND device Layout */
77#ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
78#define GPMC_NAND_HW_ECC_LAYOUT {\
79 .eccbytes = 3,\
80 .eccpos = {2, 3, 4},\
81 .oobfree = {\
82 {.offset = 5,\
83 .length = 11 } } \
84}
85#endif
86
87#endif /* __ASM_OMAP_GPMC_H */