blob: b9e78a5dbdc5f15b4cc7709be8cdf068a704e02e [file] [log] [blame]
Sergey Kubushyne8f39122007-08-10 20:26:18 +02001/*
2 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22#ifndef _EMIF_DEFS_H_
23#define _EMIF_DEFS_H_
24
25#include <asm/arch/hardware.h>
26
Cyril Chemparathyc4e72242010-03-17 10:03:10 -040027struct davinci_emif_regs {
28 u_int32_t ercsr;
29 u_int32_t awccr;
30 u_int32_t sdbcr;
31 u_int32_t sdrcr;
32 u_int32_t ab1cr;
33 u_int32_t ab2cr;
34 u_int32_t ab3cr;
35 u_int32_t ab4cr;
36 u_int32_t sdtimr;
37 u_int32_t ddrsr;
38 u_int32_t ddrphycr;
39 u_int32_t ddrphysr;
40 u_int32_t totar;
41 u_int32_t totactr;
42 u_int32_t ddrphyid_rev;
43 u_int32_t sdsretr;
44 u_int32_t eirr;
45 u_int32_t eimr;
46 u_int32_t eimsr;
47 u_int32_t eimcr;
48 u_int32_t ioctrlr;
49 u_int32_t iostatr;
50 u_int8_t rsvd0[8];
51 u_int32_t nandfcr;
52 u_int32_t nandfsr;
53 u_int8_t rsvd1[8];
54 u_int32_t nandfecc[4];
55 u_int8_t rsvd2[60];
56 u_int32_t nand4biteccload;
57 u_int32_t nand4bitecc[4];
58 u_int32_t nanderradd1;
59 u_int32_t nanderradd2;
60 u_int32_t nanderrval1;
61 u_int32_t nanderrval2;
62};
Nick Thompson789c8872009-12-12 12:12:26 -050063
Nick Thompson3917cf12010-02-08 11:34:58 -050064#define davinci_emif_regs \
65 ((struct davinci_emif_regs *)DAVINCI_ASYNC_EMIF_CNTRL_BASE)
66
Nick Thompsonff641522009-12-12 12:13:10 -050067#define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2))
Nick Thompson789c8872009-12-12 12:12:26 -050068#define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4)
69#define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4)
Nick Thompson789c8872009-12-12 12:12:26 -050070#define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2)))
Nick Thompson789c8872009-12-12 12:12:26 -050071#define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12)
72#define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13)
Heiko Schocher34061e82011-11-15 10:00:02 -050073#define DAVINCI_NANDFCR_CS2NAND (1 << 0)
Nick Thompson789c8872009-12-12 12:12:26 -050074
Nick Thompson3917cf12010-02-08 11:34:58 -050075/* Chip Select setup */
76#define DAVINCI_ABCR_STROBE_SELECT (1 << 31)
77#define DAVINCI_ABCR_EXT_WAIT (1 << 30)
78#define DAVINCI_ABCR_WSETUP(n) (n << 26)
79#define DAVINCI_ABCR_WSTROBE(n) (n << 20)
80#define DAVINCI_ABCR_WHOLD(n) (n << 17)
81#define DAVINCI_ABCR_RSETUP(n) (n << 13)
82#define DAVINCI_ABCR_RSTROBE(n) (n << 7)
83#define DAVINCI_ABCR_RHOLD(n) (n << 4)
84#define DAVINCI_ABCR_TA(n) (n << 2)
85#define DAVINCI_ABCR_ASIZE_16BIT 1
86#define DAVINCI_ABCR_ASIZE_8BIT 0
87
Sergey Kubushyne8f39122007-08-10 20:26:18 +020088#endif