diff options
author | pekon gupta <pekon@ti.com> | 2014-04-11 12:55:31 +0530 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-06 17:45:50 -0400 |
commit | 0439d752c5ad6cb95b1c8e1f922d74eee73d79a9 (patch) | |
tree | ae1bb30686d09be80f61857c4395ab75493a2430 /include/linux/mtd/omap_elm.h | |
parent | 41bbe4dd49a3825e024e874ee19c6527860a3f16 (diff) | |
download | u-boot-imx-0439d752c5ad6cb95b1c8e1f922d74eee73d79a9.zip u-boot-imx-0439d752c5ad6cb95b1c8e1f922d74eee73d79a9.tar.gz u-boot-imx-0439d752c5ad6cb95b1c8e1f922d74eee73d79a9.tar.bz2 |
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>
Diffstat (limited to 'include/linux/mtd/omap_elm.h')
-rw-r--r-- | include/linux/mtd/omap_elm.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/mtd/omap_elm.h b/include/linux/mtd/omap_elm.h index a6e9591..b8096b0 100644 --- a/include/linux/mtd/omap_elm.h +++ b/include/linux/mtd/omap_elm.h @@ -24,6 +24,9 @@ #define ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK (0x100) #define ELM_LOCATION_STATUS_ECC_NB_ERRORS_MASK (0x1F) +#define ELM_MAX_CHANNELS 8 +#define ELM_MAX_ERROR_COUNT 16 + #ifndef __ASSEMBLY__ enum bch_level { @@ -43,7 +46,7 @@ struct syndrome { struct location { u32 location_status; /* 0x800 */ u8 res1[124]; /* 0x804 */ - u32 error_location_x[16]; /* 0x880.... */ + u32 error_location_x[ELM_MAX_ERROR_COUNT]; /* 0x880, 0x980, .. */ u8 res2[64]; /* 0x8c0 */ }; @@ -63,9 +66,9 @@ struct elm { u8 res2[92]; /* 0x024 */ u32 page_ctrl; /* 0x080 */ u8 res3[892]; /* 0x084 */ - struct syndrome syndrome_fragments[8]; /* 0x400 */ + struct syndrome syndrome_fragments[ELM_MAX_CHANNELS]; /* 0x400,0x420 */ u8 res4[512]; /* 0x600 */ - struct location error_location[8]; /* 0x800 */ + struct location error_location[ELM_MAX_CHANNELS]; /* 0x800,0x900 ... */ }; int elm_check_error(u8 *syndrome, enum bch_level bch_type, u32 *error_count, |