Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 5 | */ |
| 6 | #ifndef _EMIF_DEFS_H_ |
| 7 | #define _EMIF_DEFS_H_ |
| 8 | |
| 9 | #include <asm/arch/hardware.h> |
| 10 | |
Cyril Chemparathy | c4e7224 | 2010-03-17 10:03:10 -0400 | [diff] [blame] | 11 | struct 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 Thompson | 789c887 | 2009-12-12 12:12:26 -0500 | [diff] [blame] | 47 | |
Nick Thompson | 3917cf1 | 2010-02-08 11:34:58 -0500 | [diff] [blame] | 48 | #define davinci_emif_regs \ |
| 49 | ((struct davinci_emif_regs *)DAVINCI_ASYNC_EMIF_CNTRL_BASE) |
| 50 | |
Nick Thompson | ff64152 | 2009-12-12 12:13:10 -0500 | [diff] [blame] | 51 | #define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2)) |
Nick Thompson | 789c887 | 2009-12-12 12:12:26 -0500 | [diff] [blame] | 52 | #define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4) |
| 53 | #define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4) |
Nick Thompson | 789c887 | 2009-12-12 12:12:26 -0500 | [diff] [blame] | 54 | #define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2))) |
Nick Thompson | 789c887 | 2009-12-12 12:12:26 -0500 | [diff] [blame] | 55 | #define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12) |
| 56 | #define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13) |
Heiko Schocher | 34061e8 | 2011-11-15 10:00:02 -0500 | [diff] [blame] | 57 | #define DAVINCI_NANDFCR_CS2NAND (1 << 0) |
Nick Thompson | 789c887 | 2009-12-12 12:12:26 -0500 | [diff] [blame] | 58 | |
Nick Thompson | 3917cf1 | 2010-02-08 11:34:58 -0500 | [diff] [blame] | 59 | /* 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 Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 72 | #endif |