Skip to content
Browse files

Beagle, Overo: Don't call nand/onenand functions unless the appropria…

…te CFG option is enabled
  • Loading branch information...
1 parent 3a7d82e commit af54caf9d9cdde3065589cd755c331df1ad498a4 @sakoman sakoman committed Sep 15, 2010
Showing with 9 additions and 2 deletions.
  1. +4 −1 board/omap3530beagle/omap3530beagle.c
  2. +5 −1 board/overo/overo.c
View
5 board/omap3530beagle/omap3530beagle.c
@@ -955,6 +955,7 @@ int nand_init(void)
__raw_writel(0 , GPMC_CONFIG7 + GPMC_CONFIG_CS0);
delay(1000);
+#ifdef CFG_NAND_K9F1G08R0A
if ((get_mem_type() == GPMC_NAND) || (get_mem_type() == MMC_NAND)) {
__raw_writel(M_NAND_GPMC_CONFIG1, GPMC_CONFIG1 + GPMC_CONFIG_CS0);
__raw_writel(M_NAND_GPMC_CONFIG2, GPMC_CONFIG2 + GPMC_CONFIG_CS0);
@@ -975,9 +976,10 @@ int nand_init(void)
#endif
return 1;
}
-
}
+#endif
+#ifdef CFG_ONENAND
if ((get_mem_type() == GPMC_ONENAND) || (get_mem_type() == MMC_ONENAND)) {
__raw_writel(ONENAND_GPMC_CONFIG1, GPMC_CONFIG1 + GPMC_CONFIG_CS0);
__raw_writel(ONENAND_GPMC_CONFIG2, GPMC_CONFIG2 + GPMC_CONFIG_CS0);
@@ -999,6 +1001,7 @@ int nand_init(void)
return 1;
}
}
+#endif
return 0;
}
View
6 board/overo/overo.c
@@ -1053,6 +1053,7 @@ int nand_init(void)
__raw_writel(0 , GPMC_CONFIG7 + GPMC_CONFIG_CS0);
delay(1000);
+#ifdef CFG_NAND_K9F1G08R0A
if ((get_mem_type() == GPMC_NAND) || (get_mem_type() == MMC_NAND)) {
__raw_writel(M_NAND_GPMC_CONFIG1, GPMC_CONFIG1 + GPMC_CONFIG_CS0);
__raw_writel(M_NAND_GPMC_CONFIG2, GPMC_CONFIG2 + GPMC_CONFIG_CS0);
@@ -1073,9 +1074,10 @@ int nand_init(void)
#endif
return 1;
}
-
}
+#endif
+#ifdef CFG_ONENAND
if ((get_mem_type() == GPMC_ONENAND) || (get_mem_type() == MMC_ONENAND)) {
__raw_writel(ONENAND_GPMC_CONFIG1, GPMC_CONFIG1 + GPMC_CONFIG_CS0);
__raw_writel(ONENAND_GPMC_CONFIG2, GPMC_CONFIG2 + GPMC_CONFIG_CS0);
@@ -1097,6 +1099,8 @@ int nand_init(void)
return 1;
}
}
+#endif
+
return 0;
}

0 comments on commit af54caf

Please sign in to comment.
Something went wrong with that request. Please try again.