[PATCH 001/149] global: Make <asm/global_data.h> include <asm/u-boot.h>

Tony Dinh mibodhi at gmail.com
Wed May 1 08:33:01 CEST 2024


Hi Tom,

This patch does not apply cleanly on the master branch. Perhaps this
patch series has a dependency on another previous patch? Please see
below at arch/arm/lib/bdinfo.c.

On Tue, Apr 30, 2024 at 7:50 PM Tom Rini <trini at konsulko.com> wrote:
>
> This follows the example of RISC-V where <asm/global_data.h> includes
> <asm/u-boot.h> directly as "gd" includes a reference to bd_info already
> and so the first must include the second anyhow. We then remove
> <asm/u-boot.h> from all of the places which include references to "gd"
> an so have <asm/global_data.h> already.
>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
>  api/api_platform-arm.c                         | 1 -
>  api/api_platform-mips.c                        | 1 -
>  api/api_platform-powerpc.c                     | 1 -
>  arch/arc/include/asm/global_data.h             | 2 ++
>  arch/arm/include/asm/global_data.h             | 1 +
>  arch/arm/lib/bdinfo.c                          | 1 -
>  arch/arm/lib/cache-cp15.c                      | 1 -
>  arch/arm/mach-davinci/cpu.c                    | 1 -
>  arch/arm/mach-davinci/misc.c                   | 1 -
>  arch/arm/mach-davinci/spl.c                    | 1 -
>  arch/arm/mach-imx/ele_ahab.c                   | 1 -
>  arch/arm/mach-imx/mx5/mx53_dram.c              | 1 -
>  arch/arm/mach-mediatek/mt7622/init.c           | 1 -
>  arch/arm/mach-mediatek/mt7981/init.c           | 1 -
>  arch/arm/mach-mediatek/mt7986/init.c           | 1 -
>  arch/arm/mach-mediatek/mt7988/init.c           | 1 -
>  arch/arm/mach-mvebu/armada8k/dram.c            | 1 -
>  arch/arm/mach-mvebu/dram.c                     | 1 -
>  arch/arm/mach-omap2/omap-cache.c               | 1 -
>  arch/arm/mach-omap2/omap3/emif4.c              | 1 -
>  arch/arm/mach-omap2/omap3/sdrc.c               | 1 -
>  arch/arm/mach-owl/soc.c                        | 1 -
>  arch/arm/mach-renesas/memmap-gen3.c            | 1 -
>  arch/arm/mach-renesas/memmap-rzg2l.c           | 1 -
>  arch/arm/mach-socfpga/clock_manager.c          | 1 -
>  arch/arm/mach-socfpga/clock_manager_agilex5.c  | 1 -
>  arch/arm/mach-socfpga/spl_a10.c                | 1 -
>  arch/arm/mach-socfpga/spl_agilex.c             | 1 -
>  arch/arm/mach-socfpga/spl_gen5.c               | 1 -
>  arch/arm/mach-socfpga/spl_n5x.c                | 1 -
>  arch/arm/mach-socfpga/spl_s10.c                | 1 -
>  arch/arm/mach-uniphier/dram_init.c             | 1 -
>  arch/arm/mach-versal-net/clk.c                 | 1 -
>  arch/arm/mach-versal-net/cpu.c                 | 1 -
>  arch/arm/mach-versal/clk.c                     | 1 -
>  arch/arm/mach-versal/cpu.c                     | 1 -
>  arch/arm/mach-zynqmp/clk.c                     | 1 -
>  arch/arm/mach-zynqmp/cpu.c                     | 1 -
>  arch/m68k/include/asm/global_data.h            | 2 ++
>  arch/m68k/lib/bdinfo.c                         | 1 -
>  arch/microblaze/cpu/spl.c                      | 1 -
>  arch/microblaze/include/asm/global_data.h      | 1 +
>  arch/mips/include/asm/global_data.h            | 1 +
>  arch/mips/lib/traps.c                          | 1 -
>  arch/nios2/include/asm/global_data.h           | 1 +
>  arch/powerpc/cpu/mpc83xx/interrupts.c          | 1 -
>  arch/powerpc/cpu/mpc83xx/pcie.c                | 1 -
>  arch/powerpc/cpu/mpc83xx/spd_sdram.c           | 1 -
>  arch/powerpc/cpu/mpc83xx/speed.c               | 1 -
>  arch/powerpc/cpu/mpc85xx/b4860_ids.c           | 1 +
>  arch/powerpc/cpu/mpc85xx/cmd_errata.c          | 1 -
>  arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 1 -
>  arch/powerpc/cpu/mpc85xx/p2041_ids.c           | 3 ++-
>  arch/powerpc/cpu/mpc85xx/p2041_serdes.c        | 1 -
>  arch/powerpc/cpu/mpc85xx/p3041_ids.c           | 1 +
>  arch/powerpc/cpu/mpc85xx/p4080_ids.c           | 1 +
>  arch/powerpc/cpu/mpc85xx/p5040_ids.c           | 1 +
>  arch/powerpc/cpu/mpc85xx/speed.c               | 1 -
>  arch/powerpc/cpu/mpc85xx/spl_minimal.c         | 1 -
>  arch/powerpc/cpu/mpc85xx/t1024_ids.c           | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t1024_serdes.c        | 1 -
>  arch/powerpc/cpu/mpc85xx/t1040_ids.c           | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t1040_serdes.c        | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t2080_ids.c           | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t2080_serdes.c        | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t4240_ids.c           | 3 ++-
>  arch/powerpc/cpu/mpc85xx/t4240_serdes.c        | 1 -
>  arch/powerpc/cpu/mpc8xxx/fsl_lbc.c             | 1 -
>  arch/powerpc/cpu/mpc8xxx/fsl_pamu.c            | 4 +++-
>  arch/powerpc/cpu/mpc8xxx/law.c                 | 1 -
>  arch/powerpc/cpu/mpc8xxx/pamu_table.c          | 1 -
>  arch/powerpc/cpu/mpc8xxx/srio.c                | 3 ++-
>  arch/powerpc/include/asm/fsl_liodn.h           | 4 +++-
>  arch/powerpc/include/asm/fsl_portals.h         | 2 ++
>  arch/powerpc/include/asm/global_data.h         | 2 ++
>  arch/powerpc/lib/bdinfo.c                      | 1 -
>  arch/riscv/lib/boot.c                          | 3 ++-
>  arch/sandbox/include/asm/global_data.h         | 1 +
>  arch/sh/include/asm/global_data.h              | 2 ++
>  arch/x86/cpu/coreboot/sdram.c                  | 1 -
>  arch/x86/cpu/efi/payload.c                     | 1 -
>  arch/x86/cpu/efi/sdram.c                       | 1 -
>  arch/x86/cpu/ivybridge/sdram_nop.c             | 1 -
>  arch/x86/cpu/qemu/dram.c                       | 1 -
>  arch/x86/cpu/quark/dram.c                      | 1 -
>  arch/x86/cpu/tangier/sdram.c                   | 1 -
>  arch/x86/include/asm/global_data.h             | 1 +
>  arch/xtensa/include/asm/global_data.h          | 2 ++
>  board/keymile/kmcent2/tlb.c                    | 2 +-
>  board/phytium/pe2201/pe2201.c                  | 1 -
>  board/phytium/pomelo/pomelo.c                  | 1 -
>  board/renesas/falcon/falcon.c                  | 1 -
>  board/renesas/grpeach/grpeach.c                | 1 -
>  common/init/handoff.c                          | 1 -
>  common/spl/spl.c                               | 1 -
>  common/spl/spl_ext.c                           | 1 -
>  common/spl/spl_fat.c                           | 1 -
>  common/spl/spl_mmc.c                           | 1 -
>  common/spl/spl_sata.c                          | 1 -
>  common/spl/spl_usb.c                           | 1 -
>  common/spl/spl_ymodem.c                        | 1 -
>  drivers/clk/altera/clk-agilex5.c               | 1 -
>  include/dm/of.h                                | 1 -
>  include/fsl_errata.h                           | 2 +-
>  104 files changed, 48 insertions(+), 88 deletions(-)
>
> diff --git a/api/api_platform-arm.c b/api/api_platform-arm.c
> index 6cfd9e6cc20c..9afba66c2442 100644
> --- a/api/api_platform-arm.c
> +++ b/api/api_platform-arm.c
> @@ -12,7 +12,6 @@
>  #include <linux/types.h>
>  #include <api_public.h>
>
> -#include <asm/u-boot.h>
>  #include <asm/global_data.h>
>
>  #include "api_private.h"
> diff --git a/api/api_platform-mips.c b/api/api_platform-mips.c
> index e1509663af54..262b35a27779 100644
> --- a/api/api_platform-mips.c
> +++ b/api/api_platform-mips.c
> @@ -9,7 +9,6 @@
>  #include <linux/types.h>
>  #include <api_public.h>
>
> -#include <asm/u-boot.h>
>  #include <asm/global_data.h>
>
>  #include "api_private.h"
> diff --git a/api/api_platform-powerpc.c b/api/api_platform-powerpc.c
> index 847a4a3015b0..3a04a9f691c5 100644
> --- a/api/api_platform-powerpc.c
> +++ b/api/api_platform-powerpc.c
> @@ -12,7 +12,6 @@
>  #include <linux/types.h>
>  #include <api_public.h>
>
> -#include <asm/u-boot.h>
>  #include <asm/global_data.h>
>
>  #include "api_private.h"
> diff --git a/arch/arc/include/asm/global_data.h b/arch/arc/include/asm/global_data.h
> index e35a26f1eb14..fd9b7fb5f8db 100644
> --- a/arch/arc/include/asm/global_data.h
> +++ b/arch/arc/include/asm/global_data.h
> @@ -6,6 +6,8 @@
>  #ifndef        __ASM_ARC_GLOBAL_DATA_H
>  #define __ASM_ARC_GLOBAL_DATA_H
>
> +#include <asm/u-boot.h>
> +
>  #ifndef __ASSEMBLY__
>  /* Architecture-specific global data */
>  struct arch_global_data {
> diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
> index 452bcd1b8fd9..45401d5e3c8a 100644
> --- a/arch/arm/include/asm/global_data.h
> +++ b/arch/arm/include/asm/global_data.h
> @@ -12,6 +12,7 @@
>  #include <config.h>
>
>  #include <linux/types.h>
> +#include <asm/u-boot.h>
>
>  /* Architecture-specific global data */
>  struct arch_global_data {
> diff --git a/arch/arm/lib/bdinfo.c b/arch/arm/lib/bdinfo.c
> index 40255ace4051..7c49462c8eb4 100644
> --- a/arch/arm/lib/bdinfo.c
> +++ b/arch/arm/lib/bdinfo.c
> @@ -9,7 +9,6 @@
>  #include <config.h>
>  #include <init.h>
>  #include <asm/global_data.h>
> -#include <asm/u-boot.h>
>  #include <asm/mach-types.h>
>
>  DECLARE_GLOBAL_DATA_PTR;

Applying the patch spits out error right here, since currently on
master branch, arch/arm/lib/bdinfo.c include statements are:

#include <common.h>
#include <init.h>
#include <asm/global_data.h>
#include <asm/mach-types.h>

All the best,
Tony


More information about the U-Boot mailing list