Commit 0439d752c5ad6cb95b1c8e1f922d74eee73d79a9

Authored by pekon gupta
Committed by Tom Rini
1 parent 41bbe4dd49

mtd: nand: omap_elm: use macros for register definitions

This patch adds macros for following parameters of ELM Hardware engine
 - ELM_MAX_CHANNELS: ELM can process 8 data streams simultaneously
 - ELM_MAX_ERRORS: ELM can detect upto 16 ECC error when using BCH16 scheme

Signed-off-by: Pekon Gupta <pekon@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>

Showing 1 changed file with 6 additions and 3 deletions Side-by-side Diff

include/linux/mtd/omap_elm.h
... ... @@ -24,6 +24,9 @@
24 24 #define ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK (0x100)
25 25 #define ELM_LOCATION_STATUS_ECC_NB_ERRORS_MASK (0x1F)
26 26  
  27 +#define ELM_MAX_CHANNELS 8
  28 +#define ELM_MAX_ERROR_COUNT 16
  29 +
27 30 #ifndef __ASSEMBLY__
28 31  
29 32 enum bch_level {
... ... @@ -43,7 +46,7 @@
43 46 struct location {
44 47 u32 location_status; /* 0x800 */
45 48 u8 res1[124]; /* 0x804 */
46   - u32 error_location_x[16]; /* 0x880.... */
  49 + u32 error_location_x[ELM_MAX_ERROR_COUNT]; /* 0x880, 0x980, .. */
47 50 u8 res2[64]; /* 0x8c0 */
48 51 };
49 52  
50 53  
... ... @@ -63,9 +66,9 @@
63 66 u8 res2[92]; /* 0x024 */
64 67 u32 page_ctrl; /* 0x080 */
65 68 u8 res3[892]; /* 0x084 */
66   - struct syndrome syndrome_fragments[8]; /* 0x400 */
  69 + struct syndrome syndrome_fragments[ELM_MAX_CHANNELS]; /* 0x400,0x420 */
67 70 u8 res4[512]; /* 0x600 */
68   - struct location error_location[8]; /* 0x800 */
  71 + struct location error_location[ELM_MAX_CHANNELS]; /* 0x800,0x900 ... */
69 72 };
70 73  
71 74 int elm_check_error(u8 *syndrome, enum bch_level bch_type, u32 *error_count,