nand: enable 8 copies bl2 for axg by default[3/3]
authorYonghui Yu <yonghui.yu@amlogic.com>
Mon, 5 Jun 2017 04:45:41 +0000 (12:45 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 7 Jun 2017 03:45:39 +0000 (20:45 -0700)
PD#145459: nand: write 8 copies info-page for axg by default

Change-Id: Id53907f6219678a73581ac9725721d5795993051
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
drivers/amlogic/mtd/boot.c

index 347e726..8fa0d4d 100644 (file)
@@ -229,7 +229,8 @@ int m3_nand_boot_read_page_hwecc(struct mtd_info *mtd,
        if (aml_chip->support_new_nand == 1)
                en_slc = ((type < 10) && type) ? 1:0;
        if (aml_chip->bl_mode)
-               boot_num = 4;
+               boot_num =
+                       (get_cpu_type() < MESON_CPU_MAJOR_ID_AXG) ? 4 : 8;
        else
                boot_num = (!aml_chip->boot_copy_num) ?
                        1 : aml_chip->boot_copy_num;
@@ -404,7 +405,8 @@ int m3_nand_boot_write_page_hwecc(struct mtd_info *mtd,
        int each_boot_pages, boot_num;
 
        if (aml_chip->bl_mode)
-               boot_num = 4;
+               boot_num =
+                       (get_cpu_type() < MESON_CPU_MAJOR_ID_AXG) ? 4 : 8;
        else
                boot_num = (!aml_chip->boot_copy_num) ?
                        1 : aml_chip->boot_copy_num;
@@ -471,8 +473,10 @@ int m3_nand_boot_write_page(struct mtd_info *mtd, struct nand_chip *chip,
 
        new_nand_info = &aml_chip->new_nand_info;
        slc_program_info = &new_nand_info->slc_program_info;
+       /* check cpuid, */
        if (aml_chip->bl_mode)
-               boot_num = 4;
+               boot_num =
+                       (get_cpu_type() < MESON_CPU_MAJOR_ID_AXG) ? 4 : 8;
        else
                boot_num = (!aml_chip->boot_copy_num) ?
                        1 : aml_chip->boot_copy_num;