blob: 7e19cfeed4494701d817c51775e67e6359106a83 [file] [log] [blame]
Sergey Kubushyne8f39122007-08-10 20:26:18 +02001/*
2 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Sergey Kubushyne8f39122007-08-10 20:26:18 +02005 */
6#ifndef _EMIF_DEFS_H_
7#define _EMIF_DEFS_H_
8
9#include <asm/arch/hardware.h>
10
Cyril Chemparathyc4e72242010-03-17 10:03:10 -040011struct davinci_emif_regs {
12 u_int32_t ercsr;
13 u_int32_t awccr;
14 u_int32_t sdbcr;
15 u_int32_t sdrcr;
16 u_int32_t ab1cr;
17 u_int32_t ab2cr;
18 u_int32_t ab3cr;
19 u_int32_t ab4cr;
20 u_int32_t sdtimr;
21 u_int32_t ddrsr;
22 u_int32_t ddrphycr;
23 u_int32_t ddrphysr;
24 u_int32_t totar;
25 u_int32_t totactr;
26 u_int32_t ddrphyid_rev;
27 u_int32_t sdsretr;
28 u_int32_t eirr;
29 u_int32_t eimr;
30 u_int32_t eimsr;
31 u_int32_t eimcr;
32 u_int32_t ioctrlr;
33 u_int32_t iostatr;
34 u_int8_t rsvd0[8];
35 u_int32_t nandfcr;
36 u_int32_t nandfsr;
37 u_int8_t rsvd1[8];
38 u_int32_t nandfecc[4];
39 u_int8_t rsvd2[60];
40 u_int32_t nand4biteccload;
41 u_int32_t nand4bitecc[4];
42 u_int32_t nanderradd1;
43 u_int32_t nanderradd2;
44 u_int32_t nanderrval1;
45 u_int32_t nanderrval2;
46};
Nick Thompson789c8872009-12-12 12:12:26 -050047
Nick Thompson3917cf12010-02-08 11:34:58 -050048#define davinci_emif_regs \
49 ((struct davinci_emif_regs *)DAVINCI_ASYNC_EMIF_CNTRL_BASE)
50
Nick Thompsonff641522009-12-12 12:13:10 -050051#define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2))
Nick Thompson789c8872009-12-12 12:12:26 -050052#define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4)
53#define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4)
Nick Thompson789c8872009-12-12 12:12:26 -050054#define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2)))
Nick Thompson789c8872009-12-12 12:12:26 -050055#define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12)
56#define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13)
Heiko Schocher34061e82011-11-15 10:00:02 -050057#define DAVINCI_NANDFCR_CS2NAND (1 << 0)
Nick Thompson789c8872009-12-12 12:12:26 -050058
Nick Thompson3917cf12010-02-08 11:34:58 -050059/* Chip Select setup */
60#define DAVINCI_ABCR_STROBE_SELECT (1 << 31)
61#define DAVINCI_ABCR_EXT_WAIT (1 << 30)
62#define DAVINCI_ABCR_WSETUP(n) (n << 26)
63#define DAVINCI_ABCR_WSTROBE(n) (n << 20)
64#define DAVINCI_ABCR_WHOLD(n) (n << 17)
65#define DAVINCI_ABCR_RSETUP(n) (n << 13)
66#define DAVINCI_ABCR_RSTROBE(n) (n << 7)
67#define DAVINCI_ABCR_RHOLD(n) (n << 4)
68#define DAVINCI_ABCR_TA(n) (n << 2)
69#define DAVINCI_ABCR_ASIZE_16BIT 1
70#define DAVINCI_ABCR_ASIZE_8BIT 0
71
Sergey Kubushyne8f39122007-08-10 20:26:18 +020072#endif