On Thu, 2015-07-23 at 14:33 +0200, Piotr Zierhoffer wrote:
> +int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest)
> +{
> +     void *current_dest;
> +     uint32_t count;
> +     uint32_t current_count;
> +     uint32_t ecc_errors = 0;
> +
> +     memset(dest, 0x0, size); /* clean destination memory */
> +     for (current_dest = dest;
> +                     current_dest < (dest + size);
> +                     current_dest += CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE) {
> +             nand_read_page(offs, offs
> +                             < CONFIG_NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END,
> +                            &ecc_errors);
> +             count = current_dest - dest;
> +
> +             if (size - count > CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE)
> +                     current_count = CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE;
> +             else
> +                     current_count = size - count;
> +
> +             memcpy(current_dest,
> +                    temp_buf,
> +                    current_count);
> +             offs += CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE;
> +     }
> +     return ecc_errors ? -1 : 0;
> +}

No bad block marker handling?

-Scott

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to