common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h
index 1b49cca..d5c8805 100644
--- a/arch/x86/include/asm/acpi_table.h
+++ b/arch/x86/include/asm/acpi_table.h
@@ -11,6 +11,8 @@
 
 #ifndef __ACPI__
 
+#include <pci.h>
+
 struct acpi_facs;
 struct acpi_fadt;
 struct acpi_global_nvs;
diff --git a/arch/x86/include/asm/arch-apollolake/systemagent.h b/arch/x86/include/asm/arch-apollolake/systemagent.h
index 788a63d..48e76c2 100644
--- a/arch/x86/include/asm/arch-apollolake/systemagent.h
+++ b/arch/x86/include/asm/arch-apollolake/systemagent.h
@@ -9,6 +9,9 @@
 
 /* Device 0:0.0 PCI configuration space */
 #include <linux/bitops.h>
+
+struct udevice;
+
 #define MCHBAR		0x48
 
 /* RAPL Package Power Limit register under MCHBAR */
diff --git a/arch/x86/include/asm/cpu_common.h b/arch/x86/include/asm/cpu_common.h
index 2a5779a..e41ceda 100644
--- a/arch/x86/include/asm/cpu_common.h
+++ b/arch/x86/include/asm/cpu_common.h
@@ -14,6 +14,7 @@
 };
 
 struct cpu_info;
+struct udevice;
 
 /**
  * cpu_common_init() - Set up common CPU init
diff --git a/arch/x86/include/asm/fast_spi.h b/arch/x86/include/asm/fast_spi.h
index 7a81d4f..82e3d8f 100644
--- a/arch/x86/include/asm/fast_spi.h
+++ b/arch/x86/include/asm/fast_spi.h
@@ -6,8 +6,10 @@
 #ifndef ASM_FAST_SPI_H
 #define ASM_FAST_SPI_H
 
-/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
+#include <pci.h>
 #include <linux/bitops.h>
+
+/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
 struct fast_spi_regs {
 	u32 bfp;
 	u32 hsfsts_ctl;
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index cf6c33c..83dc097 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -7,7 +7,7 @@
 #ifndef _ASM_IO_H
 #define _ASM_IO_H
 
-#include <linux/compiler.h>
+#include <compiler.h>
 
 /*
  * This file contains the definitions for the x86 IO instructions
diff --git a/arch/x86/include/asm/mp.h b/arch/x86/include/asm/mp.h
index 1e4e353..1a3ae8e 100644
--- a/arch/x86/include/asm/mp.h
+++ b/arch/x86/include/asm/mp.h
@@ -11,6 +11,8 @@
 #include <asm/atomic.h>
 #include <asm/cache.h>
 
+struct udevice;
+
 enum {
 	/* Indicates that the function should run on all CPUs */
 	MP_SELECT_ALL	= -1,
diff --git a/arch/x86/include/asm/mrccache.h b/arch/x86/include/asm/mrccache.h
index b60d117..8b104a2 100644
--- a/arch/x86/include/asm/mrccache.h
+++ b/arch/x86/include/asm/mrccache.h
@@ -7,6 +7,8 @@
 #ifndef _ASM_MRCCACHE_H
 #define _ASM_MRCCACHE_H
 
+#include <compiler.h>
+
 #define MRC_DATA_ALIGN		0x100
 #define MRC_DATA_SIGNATURE	(('M' << 0) | ('R' << 8) | \
 				 ('C' << 16) | ('D'<<24))