u-boot/drivers/mtd/nand
Maxime Ripard ea3f750c73 nand: sunxi: Fix modulo by zero error
When trying to autodetect the ECC and randomization configurations, the
driver starts with a randomization disabled and no seeds.

In this case, the number of seeds is obviously 0, and the randomize boolean
is set to false.

However, the logic that retrieves the seed for a given page offset will
blindly use the number of seeds, without testing if the randomization is
enabled, basically doing a modulo by 0.

As it turns out, the libgcc in the common toolchain returns 0 here, which
was our expected value in such a case, and why we would not detect it.
However, U-Boot's libgcc will for some reason return from the function
instead, resulting in an error to load the U-Boot binary in the SPL.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Scott Wood <oss@buserror.net>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-04-07 11:23:45 +05:30
..
am335x_spl_bch.c mtd: nand: Patch remaining places where nand_to_mtd() should be used 2016-06-19 19:28:38 -05:00
arasan_nfc.c nand: arasan_nfc: Clear ecc on bit while sending read command 2016-11-15 15:27:57 +01:00
atmel_nand.c Merge git://git.denx.de/u-boot-nand-flash 2016-06-20 05:15:52 -04:00
atmel_nand_ecc.h atmel_nand_ecc: update pmecc registers according to sama5d2 chip 2016-02-02 11:49:10 +01:00
bfin_nand.c Move console definitions into a new console.h file 2015-11-19 20:27:50 -07:00
davinci_nand.c NAND: davinci: add support for NAND chips with 16 bits bus 2016-12-03 13:21:15 -05:00
denali.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
denali.h mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
denali_spl.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
fsl_elbc_nand.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
fsl_elbc_spl.c Coding Style cleanup: replace leading SPACEs by TABs 2013-10-14 16:06:54 -04:00
fsl_ifc_nand.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
fsl_ifc_spl.c powerpc/mpc85xx: SECURE BOOT- Enable chain of trust in SPL 2016-07-21 11:09:23 -07:00
fsl_upm.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
fsmc_nand.c mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
kb9202_nand.c mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
Kconfig mtd: nand: build MXS driver for MX7 as well 2017-02-19 16:20:28 +01:00
kirkwood_nand.c mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
kmeter1_nand.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
lpc32xx_nand_mlc.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
lpc32xx_nand_slc.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
Makefile mtd: nand: zynq_nand: Add nand driver support for zynq 2016-11-15 15:27:50 +01:00
mpc5121_nfc.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
mxc_nand.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
mxc_nand.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
mxc_nand_spl.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
mxs_nand.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
mxs_nand_spl.c mtd: nand: mxs_nand_spl: Fix to remove twise 'NAND' print 2017-01-04 16:56:44 +01:00
nand.c mtd: nand: remove nand size print from nand_init function 2017-03-28 10:39:33 -07:00
nand_base.c Blackfin: Remove 2017-04-05 13:52:01 -04:00
nand_bbt.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
nand_bch.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
nand_ecc.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
nand_ids.c mtd: nand: add support for the TC58NVG2S0H chip 2016-11-28 15:10:30 -05:00
nand_plat.c mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
nand_spl_load.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
nand_spl_simple.c nand_spl_simple: Add a simple NAND read function 2016-07-22 09:52:59 -04:00
nand_timings.c nand: Sync with Linux v4.1 2015-08-25 22:53:57 -05:00
nand_util.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
ndfc.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
omap_elm.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
omap_gpmc.c omap-gpmc: use SECTOR_BYTES instead of hardcoded value 2017-01-14 16:47:18 -05:00
pxa3xx_nand.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
pxa3xx_nand.h mtd: nand: Add mvebu (PXA / AXP / A38x) NAND device driver 2015-08-25 22:53:58 -05:00
s3c2410_nand.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
sunxi_nand.c mtd: nand: Add the sunxi NAND controller driver 2016-07-24 20:36:28 -05:00
sunxi_nand_spl.c nand: sunxi: Fix modulo by zero error 2017-04-07 11:23:45 +05:30
tegra_nand.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
tegra_nand.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
vf610_nfc.c mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
zynq_nand.c mtd: nand: zynq_nand: Add nand driver support for zynq 2016-11-15 15:27:50 +01:00