diff options
Diffstat (limited to 'drivers/mtd/nand/s3c2410.c')
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index a2d1c70c5227..daa4af918205 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -819,6 +819,21 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
819 | 819 | ||
820 | if (set->disable_ecc) | 820 | if (set->disable_ecc) |
821 | chip->ecc.mode = NAND_ECC_NONE; | 821 | chip->ecc.mode = NAND_ECC_NONE; |
822 | |||
823 | switch (chip->ecc.mode) { | ||
824 | case NAND_ECC_NONE: | ||
825 | dev_info(info->device, "NAND ECC disabled\n"); | ||
826 | break; | ||
827 | case NAND_ECC_SOFT: | ||
828 | dev_info(info->device, "NAND soft ECC\n"); | ||
829 | break; | ||
830 | case NAND_ECC_HW: | ||
831 | dev_info(info->device, "NAND hardware ECC\n"); | ||
832 | break; | ||
833 | default: | ||
834 | dev_info(info->device, "NAND ECC UNKNOWN\n"); | ||
835 | break; | ||
836 | } | ||
822 | } | 837 | } |
823 | 838 | ||
824 | /** | 839 | /** |
@@ -840,18 +855,19 @@ static void s3c2410_nand_update_chip(struct s3c2410_nand_info *info, | |||
840 | dev_dbg(info->device, "chip %p => page shift %d\n", | 855 | dev_dbg(info->device, "chip %p => page shift %d\n", |
841 | chip, chip->page_shift); | 856 | chip, chip->page_shift); |
842 | 857 | ||
843 | if (hardware_ecc) { | 858 | if (chip->ecc.mode != NAND_ECC_HW) |
859 | return; | ||
860 | |||
844 | /* change the behaviour depending on wether we are using | 861 | /* change the behaviour depending on wether we are using |
845 | * the large or small page nand device */ | 862 | * the large or small page nand device */ |
846 | 863 | ||
847 | if (chip->page_shift > 10) { | 864 | if (chip->page_shift > 10) { |
848 | chip->ecc.size = 256; | 865 | chip->ecc.size = 256; |
849 | chip->ecc.bytes = 3; | 866 | chip->ecc.bytes = 3; |
850 | } else { | 867 | } else { |
851 | chip->ecc.size = 512; | 868 | chip->ecc.size = 512; |
852 | chip->ecc.bytes = 3; | 869 | chip->ecc.bytes = 3; |
853 | chip->ecc.layout = &nand_hw_eccoob; | 870 | chip->ecc.layout = &nand_hw_eccoob; |
854 | } | ||
855 | } | 871 | } |
856 | } | 872 | } |
857 | 873 | ||