]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
nand/spl: Assuming a static nand page size to reduce code size
authorMatthew McClintock <msm@freescale.com>
Tue, 5 Apr 2011 19:39:34 +0000 (14:39 -0500)
committerScott Wood <scottwood@freescale.com>
Fri, 15 Apr 2011 20:53:11 +0000 (15:53 -0500)
Change variables to const to reduce code size, these values are
hardcoded via defines anyways so we might as well assume they
are constants

Signed-off-by: Matthew McClintock <msm@freescale.com>
cc: Scott Wood <scottwood@freescale.com>

nand_spl/nand_boot_fsl_elbc.c

index 9547d44238885fbd36e23eda1403f5c79f5d6b79..502605b1d5cc00ddf13c6763282b83783cc47222 100644 (file)
@@ -51,11 +51,11 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
 {
        fsl_lbc_t *regs = LBC_BASE_ADDR;
        uchar *buf = (uchar *)CONFIG_SYS_NAND_BASE;
-       int large = in_be32(&regs->bank[0].or) & OR_FCM_PGS;
-       int block_shift = large ? 17 : 14;
-       int block_size = 1 << block_shift;
-       int page_size = large ? 2048 : 512;
-       int bad_marker = large ? page_size + 0 : page_size + 5;
+       const int large = CONFIG_SYS_NAND_OR_PRELIM & OR_FCM_PGS;
+       const int block_shift = large ? 17 : 14;
+       const int block_size = 1 << block_shift;
+       const int page_size = large ? 2048 : 512;
+       const int bad_marker = large ? page_size + 0 : page_size + 5;
        int fmr = (15 << FMR_CWTO_SHIFT) | (2 << FMR_AL_SHIFT) | 2;
        int pos = 0;