summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-30 21:38:53 -0600
committerTom Rini <trini@konsulko.com>2021-02-02 15:33:42 -0500
commit401d1c4f5d2d29c4bc4beaec95402ca23eb63295 (patch)
tree0122abb2a3f1ea9837eaccc6150d2dae9570388e /include
parentfdcb93e1709ab1a2ebb562455621617c29e2099c (diff)
downloadu-boot-401d1c4f5d2d29c4bc4beaec95402ca23eb63295.tar.gz
u-boot-401d1c4f5d2d29c4bc4beaec95402ca23eb63295.tar.bz2
u-boot-401d1c4f5d2d29c4bc4beaec95402ca23eb63295.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/audio_codec.h2
-rw-r--r--include/axi.h2
-rw-r--r--include/backlight.h2
-rw-r--r--include/bootcount.h1
-rw-r--r--include/cache.h2
-rw-r--r--include/common.h1
-rw-r--r--include/cpu.h2
-rw-r--r--include/dm/acpi.h1
-rw-r--r--include/dm/ofnode.h2
-rw-r--r--include/dm/read.h1
-rw-r--r--include/dma.h2
-rw-r--r--include/exports.h1
-rw-r--r--include/ext_common.h2
-rw-r--r--include/fsl_qe.h2
-rw-r--r--include/image-sparse.h1
-rw-r--r--include/init.h8
-rw-r--r--include/initcall.h1
-rw-r--r--include/led.h2
-rw-r--r--include/misc.h2
-rw-r--r--include/netdev.h2
-rw-r--r--include/power/as3722.h2
-rw-r--r--include/power/regulator.h2
-rw-r--r--include/pwm.h2
-rw-r--r--include/ram.h2
-rw-r--r--include/scsi.h2
-rw-r--r--include/soc.h2
-rw-r--r--include/sysinfo.h2
-rw-r--r--include/sysreset.h2
-rw-r--r--include/tee.h2
-rw-r--r--include/tpm-common.h2
-rw-r--r--include/tpm-v1.h2
-rw-r--r--include/tpm-v2.h2
-rw-r--r--include/tps6586x.h2
-rw-r--r--include/ufs.h3
34 files changed, 63 insertions, 5 deletions
diff --git a/include/audio_codec.h b/include/audio_codec.h
index 2587099546..2ea4ff096e 100644
--- a/include/audio_codec.h
+++ b/include/audio_codec.h
@@ -7,6 +7,8 @@
#ifndef __AUDIO_CODEC_H__
#define __AUDIO_CODEC_H__
+struct udevice;
+
/*
* An audio codec turns digital data into sound with various parameters to
* control its operation.
diff --git a/include/axi.h b/include/axi.h
index 3e40692cdf..59fb0b2e45 100644
--- a/include/axi.h
+++ b/include/axi.h
@@ -7,6 +7,8 @@
#ifndef _AXI_H_
#define _AXI_H_
+struct udevice;
+
/**
* enum axi_size_t - Determine size of AXI transfer
* @AXI_SIZE_8: AXI sransfer is 8-bit wide
diff --git a/include/backlight.h b/include/backlight.h
index ac59eb293b..b44da50bc3 100644
--- a/include/backlight.h
+++ b/include/backlight.h
@@ -7,6 +7,8 @@
#ifndef _BACKLIGHT_H
#define _BACKLIGHT_H
+struct udevice;
+
enum {
BACKLIGHT_MAX = 100,
BACKLIGHT_MIN = 0,
diff --git a/include/bootcount.h b/include/bootcount.h
index b1d1fe53d1..796b237c8f 100644
--- a/include/bootcount.h
+++ b/include/bootcount.h
@@ -7,6 +7,7 @@
#define _BOOTCOUNT_H__
#include <common.h>
+#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <env.h>
diff --git a/include/cache.h b/include/cache.h
index 32f59fd8f7..ecb7956efd 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -6,6 +6,8 @@
#ifndef __CACHE_H
#define __CACHE_H
+struct udevice;
+
/*
* Structure for the cache controller
*/
diff --git a/include/common.h b/include/common.h
index f0679ac705..71df59bca0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <linux/kernel.h>
#include <asm/u-boot.h> /* boot information for Linux kernel */
-#include <asm/global_data.h> /* global data used for startup functions */
#include <display_options.h>
#include <vsprintf.h>
#endif /* __ASSEMBLY__ */
diff --git a/include/cpu.h b/include/cpu.h
index 5831bfa742..be02a16712 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -7,6 +7,8 @@
#ifndef __CPU_H
#define __CPU_H
+struct udevice;
+
/**
* struct cpu_plat - platform data for a CPU
* @cpu_id: Platform-specific way of identifying the CPU.
diff --git a/include/dm/acpi.h b/include/dm/acpi.h
index e6951b6a25..7f1f2ef2cb 100644
--- a/include/dm/acpi.h
+++ b/include/dm/acpi.h
@@ -28,6 +28,7 @@
#if !defined(__ACPI__)
struct nhlt;
+struct udevice;
/** enum acpi_dump_option - selects what ACPI information to dump */
enum acpi_dump_option {
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 5b088650d3..5318d65035 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -379,6 +379,8 @@ bool ofnode_read_bool(ofnode node, const char *propname);
ofnode ofnode_find_subnode(ofnode node, const char *subnode_name);
#if CONFIG_IS_ENABLED(DM_INLINE_OFNODE)
+#include <asm/global_data.h>
+
static inline bool ofnode_is_enabled(ofnode node)
{
if (ofnode_is_np(node)) {
diff --git a/include/dm/read.h b/include/dm/read.h
index 03ba98232a..97575bcad0 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -695,6 +695,7 @@ int dev_decode_display_timing(const struct udevice *dev, int index,
struct display_timing *config);
#else /* CONFIG_DM_DEV_READ_INLINE is enabled */
+#include <asm/global_data.h>
static inline int dev_read_u32(const struct udevice *dev,
const char *propname, u32 *outp)
diff --git a/include/dma.h b/include/dma.h
index 6ff591977b..a64580a61f 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -13,6 +13,8 @@
#include <linux/errno.h>
#include <linux/types.h>
+struct udevice;
+
/*
* enum dma_direction - dma transfer direction indicator
* @DMA_MEM_TO_MEM: Memcpy mode
diff --git a/include/exports.h b/include/exports.h
index faf0f59244..99436e4132 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -2,6 +2,7 @@
#define __EXPORTS_H__
#include <irq_func.h>
+#include <asm/global_data.h>
#include <linux/delay.h>
#ifndef __ASSEMBLY__
diff --git a/include/ext_common.h b/include/ext_common.h
index bc3324172a..30a0c24841 100644
--- a/include/ext_common.h
+++ b/include/ext_common.h
@@ -20,6 +20,8 @@
#ifndef __EXT_COMMON__
#define __EXT_COMMON__
+#include <compiler.h>
+
struct cmd_tbl;
#define SECTOR_SIZE 0x200
diff --git a/include/fsl_qe.h b/include/fsl_qe.h
index 1c6941347f..cd8fca95b4 100644
--- a/include/fsl_qe.h
+++ b/include/fsl_qe.h
@@ -20,6 +20,8 @@
#define QE_DATAONLY_BASE 0
#define QE_DATAONLY_SIZE (QE_MURAM_SIZE - QE_DATAONLY_BASE)
+struct udevice;
+
/* QE threads SNUM
*/
typedef enum qe_snum_state {
diff --git a/include/image-sparse.h b/include/image-sparse.h
index 234c237b84..0572dbd0a2 100644
--- a/include/image-sparse.h
+++ b/include/image-sparse.h
@@ -3,6 +3,7 @@
* Copyright 2014 Broadcom Corporation.
*/
+#include <compiler.h>
#include <part.h>
#include <sparse_format.h>
diff --git a/include/init.h b/include/init.h
index 980be27993..f8f69a54e0 100644
--- a/include/init.h
+++ b/include/init.h
@@ -10,16 +10,16 @@
#ifndef __INIT_H_
#define __INIT_H_ 1
-#include <linux/types.h>
-
-struct global_data;
-
#ifndef __ASSEMBLY__ /* put C only stuff in this section */
+#include <linux/types.h>
+
/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */
#ifdef CONFIG_EFI_STUB
#define ll_boot_init() false
#else
+#include <asm/global_data.h>
+
#define ll_boot_init() (!(gd->flags & GD_FLG_SKIP_LL_INIT))
#endif
diff --git a/include/initcall.h b/include/initcall.h
index 41b74dc52d..69ce268070 100644
--- a/include/initcall.h
+++ b/include/initcall.h
@@ -12,6 +12,7 @@ typedef int (*init_fnc_t)(void);
#ifdef CONFIG_EFI_APP
#include <efi.h>
#endif
+#include <asm/global_data.h>
/*
* To enable debugging. add #define DEBUG at the top of the including file.
diff --git a/include/led.h b/include/led.h
index 7bfdddfd6f..02766fa56f 100644
--- a/include/led.h
+++ b/include/led.h
@@ -7,6 +7,8 @@
#ifndef __LED_H
#define __LED_H
+struct udevice;
+
/**
* struct led_uc_plat - Platform data the uclass stores about each device
*
diff --git a/include/misc.h b/include/misc.h
index 12d1325ee2..82ec2ce793 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -6,6 +6,8 @@
#ifndef _MISC_H_
#define _MISC_H_
+struct udevice;
+
/**
* misc_read() - Read the device to buffer, optional.
* @dev: the device
diff --git a/include/netdev.h b/include/netdev.h
index b1eb5fc104..0ad9f8dc3a 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -12,6 +12,8 @@
#define _NETDEV_H_
#include <phy_interface.h>
+struct udevice;
+
/*
* Board and CPU-specific initialization functions
* board_eth_init() has highest priority. cpu_eth_init() only
diff --git a/include/power/as3722.h b/include/power/as3722.h
index 2782857055..f5398123f2 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -6,6 +6,8 @@
#ifndef __POWER_AS3722_H__
#define __POWER_AS3722_H__
+struct udevice;
+
#define AS3722_GPIO_OUTPUT_VDDH (1 << 0)
#define AS3722_GPIO_INVERT (1 << 1)
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 19a3b7b502..da9a065bdd 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -7,6 +7,8 @@
#ifndef _INCLUDE_REGULATOR_H_
#define _INCLUDE_REGULATOR_H_
+struct udevice;
+
/**
* U-Boot Voltage/Current Regulator
* ================================
diff --git a/include/pwm.h b/include/pwm.h
index 54ae3e64c3..f9959706ce 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -10,6 +10,8 @@
#ifndef _pwm_h_
#define _pwm_h_
+struct udevice;
+
/* struct pwm_ops: Operations for the PWM uclass */
struct pwm_ops {
/**
diff --git a/include/ram.h b/include/ram.h
index 67e22d76c9..273d415394 100644
--- a/include/ram.h
+++ b/include/ram.h
@@ -7,6 +7,8 @@
#ifndef __RAM_H
#define __RAM_H
+struct udevice;
+
struct ram_info {
phys_addr_t base;
size_t size;
diff --git a/include/scsi.h b/include/scsi.h
index 90cec99e32..0a475a8ca4 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -9,6 +9,8 @@
#include <asm/cache.h>
#include <linux/dma-direction.h>
+struct udevice;
+
struct scsi_cmd {
unsigned char cmd[16]; /* command */
/* for request sense */
diff --git a/include/soc.h b/include/soc.h
index a55eb1b572..a52a300a84 100644
--- a/include/soc.h
+++ b/include/soc.h
@@ -9,6 +9,8 @@
#define SOC_MAX_STR_SIZE 128
+struct udevice;
+
/**
* struct soc_attr - Contains SoC identify information to be used in
* SoC matching. An array of these structs
diff --git a/include/sysinfo.h b/include/sysinfo.h
index c045d316b0..c0da4932d4 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -4,6 +4,8 @@
* Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
*/
+struct udevice;
+
/*
* This uclass encapsulates hardware methods to gather information about a
* sysinfo or a specific device such as hard-wired GPIOs on GPIO expanders,
diff --git a/include/sysreset.h b/include/sysreset.h
index 61295e3fcb..8bb094d463 100644
--- a/include/sysreset.h
+++ b/include/sysreset.h
@@ -7,6 +7,8 @@
#ifndef __SYSRESET_H
#define __SYSRESET_H
+struct udevice;
+
enum sysreset_t {
SYSRESET_WARM, /* Reset CPU, keep GPIOs active */
SYSRESET_COLD, /* Reset CPU and GPIOs */
diff --git a/include/tee.h b/include/tee.h
index 8207d0c02a..99367b258e 100644
--- a/include/tee.h
+++ b/include/tee.h
@@ -7,6 +7,8 @@
#define __TEE_H
#include <linux/bitops.h>
+#include <linux/list.h>
+
#define TEE_UUID_LEN 16
#define TEE_GEN_CAP_GP BIT(0) /* GlobalPlatform compliant TEE */
diff --git a/include/tpm-common.h b/include/tpm-common.h
index e29b10b176..c1309a2735 100644
--- a/include/tpm-common.h
+++ b/include/tpm-common.h
@@ -9,6 +9,8 @@
#include <command.h>
+struct udevice;
+
enum tpm_duration {
TPM_SHORT = 0,
TPM_MEDIUM = 1,
diff --git a/include/tpm-v1.h b/include/tpm-v1.h
index 59ad4aecf4..8f6cc28a9e 100644
--- a/include/tpm-v1.h
+++ b/include/tpm-v1.h
@@ -10,6 +10,8 @@
#include <tpm-common.h>
#include <linux/bitops.h>
+struct udevice;
+
/* Useful constants */
enum {
TPM_REQUEST_HEADER_LENGTH = 10,
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index fab6b86ca2..56eaa65815 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -16,6 +16,8 @@
#include <tpm-common.h>
+struct udevice;
+
#define TPM2_DIGEST_LEN 32
#define TPM2_SHA1_DIGEST_SIZE 20
diff --git a/include/tps6586x.h b/include/tps6586x.h
index 785eb39229..aa4270c65e 100644
--- a/include/tps6586x.h
+++ b/include/tps6586x.h
@@ -7,6 +7,8 @@
#ifndef _TPS6586X_H_
#define _TPS6586X_H_
+struct udevice;
+
enum {
/* SM0-2 PWM/PFM Mode Selection */
TPS6586X_PWM_SM0 = 1 << 0,
diff --git a/include/ufs.h b/include/ufs.h
index 0592a763dd..bda135cf18 100644
--- a/include/ufs.h
+++ b/include/ufs.h
@@ -1,6 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0+ */
#ifndef _UFS_H
#define _UFS_H
+
+struct udevice;
+
/**
* ufs_probe() - initialize all devices in the UFS uclass
*