Audit <flash.h> inclusion

A large number of files include <flash.h> as it used to be how various
SPI flash related functions were found, or for other reasons entirely.
In order to migrate some further CONFIG symbols to Kconfig we need to
not include flash.h in cases where we don't have a NOR flash of some
sort enabled.  Furthermore, in cases where we are in common code and it
doesn't make sense to try and further refactor the code itself in to new
files we need to guard this inclusion.

Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c
index c3e1734..86b4050 100644
--- a/board/atmel/at91sam9263ek/at91sam9263ek.c
+++ b/board/atmel/at91sam9263ek/at91sam9263ek.c
@@ -7,7 +7,6 @@
 
 #include <common.h>
 #include <debug_uart.h>
-#include <flash.h>
 #include <init.h>
 #include <net.h>
 #include <vsprintf.h>
@@ -140,7 +139,7 @@
 #include <version.h>
 
 #ifdef CONFIG_MTD_NOR_FLASH
-extern flash_info_t flash_info[];
+#include <flash.h>
 #endif
 
 void lcd_show_board_info(void)
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 738b6bc2..31d532b 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -12,7 +12,6 @@
 #include <command.h>
 #include <env.h>
 #include <env_internal.h>
-#include <flash.h>
 #include <init.h>
 #include <net.h>
 #include <malloc.h>
diff --git a/board/freescale/common/fsl_validate.c b/board/freescale/common/fsl_validate.c
index f1a0b0c..f56e4e8 100644
--- a/board/freescale/common/fsl_validate.c
+++ b/board/freescale/common/fsl_validate.c
@@ -6,7 +6,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <flash.h>
 #include <fsl_validate.h>
 #include <fsl_secboot_err.h>
 #include <fsl_sfp.h>
@@ -79,6 +78,8 @@
  * address
  */
 #if defined(CONFIG_MPC85xx)
+#include <flash.h>
+
 int get_csf_base_addr(u32 *csf_addr, u32 *flash_base_addr)
 {
 	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
diff --git a/board/gardena/smart-gateway-mt7688/board.c b/board/gardena/smart-gateway-mt7688/board.c
index aa833a0..0cfde91 100644
--- a/board/gardena/smart-gateway-mt7688/board.c
+++ b/board/gardena/smart-gateway-mt7688/board.c
@@ -7,7 +7,6 @@
 #include <command.h>
 #include <env.h>
 #include <env_internal.h>
-#include <flash.h>
 #include <init.h>
 #include <led.h>
 #include <log.h>
diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c
index 2379b52..559192e 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -15,7 +15,6 @@
 #include <init.h>
 #include <net.h>
 #include <ns16550.h>
-#include <flash.h>
 #include <nand.h>
 #include <i2c.h>
 #include <serial.h>
diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index dae064d..6c44afb 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -15,7 +15,6 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
-#include <flash.h>
 #include <init.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index 27aad4e..f9e1bc6 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -30,8 +30,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern flash_info_t flash_info[];	/* FLASH chips info */
-
 void local_bus_init (void);
 ulong flash_get_size (ulong base, int banknum);
 
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 7cf2dfa..22c67c6 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -14,7 +14,9 @@
 #include <cli.h>
 #include <console.h>
 #include <env.h>
+#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_NOR
 #include <flash.h>
+#endif
 #include <malloc.h>
 #include <mmc.h>
 #include <nand.h>