[U-Boot] [PATCH] Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTR

Tom Rini trini at konsulko.com
Wed Apr 18 17:50:47 UTC 2018


We have a large number of places where while we historically referenced
gd in the code we no longer do, as well as cases where the code added
that line "just in case" during development and never dropped it.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 api/api_net.c                                     | 2 --
 arch/arm/cpu/arm1136/mx31/timer.c                 | 2 --
 arch/arm/cpu/arm1136/mx35/timer.c                 | 2 --
 arch/arm/cpu/armv8/fsl-layerscape/soc.c           | 2 --
 arch/arm/cpu/armv8/s32v234/cpu.c                  | 2 --
 arch/arm/cpu/pxa/timer.c                          | 2 --
 arch/arm/include/asm/arch-omap4/sys_proto.h       | 2 --
 arch/arm/include/asm/arch-omap5/sys_proto.h       | 2 --
 arch/arm/lib/cmd_boot.c                           | 2 --
 arch/arm/mach-at91/spl_atmel.c                    | 2 --
 arch/arm/mach-davinci/spl.c                       | 2 --
 arch/arm/mach-exynos/clock_init_exynos5.c         | 2 --
 arch/arm/mach-exynos/mmu-arm64.c                  | 2 --
 arch/arm/mach-imx/cmd_dek.c                       | 2 --
 arch/arm/mach-imx/mx7ulp/pcc.c                    | 2 --
 arch/arm/mach-imx/mx7ulp/scg.c                    | 2 --
 arch/arm/mach-imx/mx8m/clock.c                    | 2 --
 arch/arm/mach-imx/mx8m/clock_slice.c              | 2 --
 arch/arm/mach-imx/timer.c                         | 2 --
 arch/arm/mach-mvebu/armada3700/cpu.c              | 2 --
 arch/arm/mach-mvebu/armada8k/cpu.c                | 2 --
 arch/arm/mach-mvebu/sata.c                        | 2 --
 arch/arm/mach-mvebu/timer.c                       | 2 --
 arch/arm/mach-omap2/omap3/board.c                 | 2 --
 arch/arm/mach-omap2/omap4/hwinit.c                | 2 --
 arch/arm/mach-omap2/omap5/hwinit.c                | 2 --
 arch/arm/mach-rockchip/rk3036-board-spl.c         | 2 --
 arch/arm/mach-rockchip/rk3188-board.c             | 2 --
 arch/arm/mach-rockchip/rk322x-board-spl.c         | 2 --
 arch/arm/mach-rockchip/rk3288-board-tpl.c         | 2 --
 arch/arm/mach-rockchip/rk3368-board-spl.c         | 2 --
 arch/arm/mach-rockchip/rk3368-board-tpl.c         | 2 --
 arch/arm/mach-rockchip/rk3399-board-spl.c         | 2 --
 arch/arm/mach-socfpga/clock_manager_arria10.c     | 2 --
 arch/arm/mach-socfpga/clock_manager_gen5.c        | 2 --
 arch/arm/mach-socfpga/fpga_manager.c              | 2 --
 arch/arm/mach-socfpga/freeze_controller.c         | 2 --
 arch/arm/mach-socfpga/misc_arria10.c              | 2 --
 arch/arm/mach-socfpga/reset_manager.c             | 2 --
 arch/arm/mach-socfpga/reset_manager_gen5.c        | 2 --
 arch/arm/mach-socfpga/scan_manager.c              | 2 --
 arch/arm/mach-socfpga/system_manager_gen5.c       | 2 --
 arch/arm/mach-sunxi/board.c                       | 1 -
 arch/arm/mach-sunxi/dram_sun9i.c                  | 2 --
 arch/arm/mach-tegra/board186.c                    | 2 --
 arch/arm/mach-tegra/tegra186/nvtboot_board.c      | 2 --
 arch/arm/mach-zynq/ddrc.c                         | 2 --
 arch/arm/mach-zynq/spl.c                          | 2 --
 arch/microblaze/cpu/spl.c                         | 2 --
 arch/microblaze/lib/bootm.c                       | 2 --
 arch/mips/mach-ath79/ar933x/ddr.c                 | 2 --
 arch/mips/mach-ath79/qca953x/ddr.c                | 2 --
 arch/nds32/lib/boot.c                             | 2 --
 arch/powerpc/cpu/mpc85xx/cpu_init.c               | 2 --
 arch/powerpc/cpu/mpc86xx/fdt.c                    | 2 --
 arch/powerpc/lib/extable.c                        | 2 --
 arch/powerpc/lib/spl.c                            | 2 --
 arch/riscv/lib/boot.c                             | 2 --
 arch/sandbox/lib/bootm.c                          | 2 --
 arch/x86/cpu/pci.c                                | 2 --
 arch/x86/cpu/qemu/cpu.c                           | 2 --
 arch/x86/cpu/tangier/tangier.c                    | 2 --
 arch/x86/cpu/x86_64/cpu.c                         | 2 --
 arch/x86/lib/lpc-uclass.c                         | 2 --
 arch/x86/lib/zimage.c                             | 2 --
 board/armadeus/opos6uldev/board.c                 | 2 --
 board/astro/mcf5373l/fpga.c                       | 2 --
 board/bachmann/ot1200/ot1200_spl.c                | 2 --
 board/barco/platinum/spl_picon.c                  | 2 --
 board/barco/platinum/spl_titanium.c               | 2 --
 board/cavium/thunderx/atf.c                       | 2 --
 board/cei/cei-tk1-som/cei-tk1-som.c               | 2 --
 board/compulab/cm_fx6/common.c                    | 2 --
 board/compulab/cm_fx6/spl.c                       | 2 --
 board/compulab/cm_t43/spl.c                       | 2 --
 board/compulab/common/omap3_display.c             | 2 --
 board/dhelectronics/dh_imx6/dh_imx6_spl.c         | 2 --
 board/engicam/common/spl.c                        | 2 --
 board/engicam/imx6q/imx6q.c                       | 2 --
 board/engicam/imx6ul/imx6ul.c                     | 2 --
 board/esd/vme8349/pci.c                           | 2 --
 board/freescale/bsc9131rdb/ddr.c                  | 2 --
 board/freescale/bsc9132qds/ddr.c                  | 2 --
 board/freescale/common/vid.c                      | 2 --
 board/freescale/ls1021aqds/ls1021aqds.c           | 2 --
 board/freescale/ls1088a/eth_ls1088ardb.c          | 2 --
 board/freescale/m5329evb/nand.c                   | 2 --
 board/freescale/m5373evb/nand.c                   | 2 --
 board/freescale/mpc8308rdb/mpc8308rdb.c           | 2 --
 board/freescale/mpc832xemds/pci.c                 | 2 --
 board/freescale/mpc8349emds/pci.c                 | 2 --
 board/freescale/mpc8349itx/pci.c                  | 2 --
 board/freescale/p1022ds/p1022ds.c                 | 2 --
 board/freescale/p1023rdb/ddr.c                    | 2 --
 board/gateworks/gw_ventana/gw_ventana_spl.c       | 2 --
 board/gdsys/mpc8308/hrcon.c                       | 2 --
 board/gdsys/mpc8308/strider.c                     | 2 --
 board/gdsys/p1022/controlcenterd.c                | 2 --
 board/geekbuying/geekbox/geekbox.c                | 2 --
 board/intel/edison/edison.c                       | 2 --
 board/keymile/kmp204x/kmp204x.c                   | 2 --
 board/kosagi/novena/novena_spl.c                  | 2 --
 board/liebherr/mccmon6/spl.c                      | 2 --
 board/mpc8308_p1m/mpc8308_p1m.c                   | 2 --
 board/nvidia/jetson-tk1/jetson-tk1.c              | 2 --
 board/overo/overo.c                               | 2 --
 board/qca/ap121/ap121.c                           | 2 --
 board/qca/ap143/ap143.c                           | 2 --
 board/rockchip/evb_rk3036/evb_rk3036.c            | 2 --
 board/rockchip/evb_rk3229/evb_rk3229.c            | 1 -
 board/rockchip/evb_rk3399/evb-rk3399.c            | 2 --
 board/rockchip/kylin_rk3036/kylin_rk3036.c        | 2 --
 board/rockchip/sheep_rk3368/sheep_rk3368.c        | 2 --
 board/samsung/espresso7420/espresso7420.c         | 2 --
 board/samsung/origen/origen.c                     | 2 --
 board/samsung/trats/trats.c                       | 2 --
 board/samsung/trats2/trats2.c                     | 2 --
 board/sbc8349/pci.c                               | 2 --
 board/sbc8548/sbc8548.c                           | 2 --
 board/siemens/draco/board.c                       | 2 --
 board/siemens/pxm2/board.c                        | 2 --
 board/siemens/rut/board.c                         | 2 --
 board/theobroma-systems/lion_rk3368/lion_rk3368.c | 2 --
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 2 --
 board/ti/ks2_evm/board_k2e.c                      | 2 --
 board/ti/ks2_evm/board_k2hk.c                     | 2 --
 board/ti/ks2_evm/board_k2l.c                      | 2 --
 board/toradex/colibri_vf/dcu.c                    | 2 --
 board/tplink/wdr4300/wdr4300.c                    | 2 --
 board/tqc/tqm834x/pci.c                           | 2 --
 board/tqc/tqma6/tqma6_mba6.c                      | 2 --
 board/udoo/udoo_spl.c                             | 2 --
 board/varisys/cyrus/cyrus.c                       | 2 --
 board/wandboard/spl.c                             | 2 --
 board/xes/xpedite537x/xpedite537x.c               | 2 --
 board/xes/xpedite550x/xpedite550x.c               | 2 --
 cmd/aes.c                                         | 2 --
 cmd/blob.c                                        | 2 --
 cmd/booti.c                                       | 2 --
 cmd/cros_ec.c                                     | 2 --
 cmd/i2c.c                                         | 2 --
 common/cros_ec.c                                  | 2 --
 common/lynxkdi.c                                  | 2 --
 common/main.c                                     | 2 --
 common/spl/spl_mmc.c                              | 2 --
 common/spl/spl_net.c                              | 2 --
 common/spl/spl_sata.c                             | 2 --
 common/spl/spl_sdp.c                              | 2 --
 common/spl/spl_usb.c                              | 2 --
 common/usb_hub.c                                  | 2 --
 disk/part.c                                       | 2 --
 drivers/adc/adc-uclass.c                          | 2 --
 drivers/ata/dwc_ahci.c                            | 2 --
 drivers/clk/at91/clk-plladiv.c                    | 2 --
 drivers/clk/at91/clk-utmi.c                       | 2 --
 drivers/clk/at91/sckc.c                           | 2 --
 drivers/clk/clk-hsdk-cgu.c                        | 2 --
 drivers/clk/clk_stm32h7.c                         | 2 --
 drivers/clk/clk_zynqmp.c                          | 2 --
 drivers/clk/exynos/clk-exynos7420.c               | 2 --
 drivers/clk/rockchip/clk_rk3036.c                 | 2 --
 drivers/clk/rockchip/clk_rk3128.c                 | 2 --
 drivers/clk/rockchip/clk_rk3188.c                 | 2 --
 drivers/clk/rockchip/clk_rk322x.c                 | 2 --
 drivers/clk/rockchip/clk_rk3328.c                 | 2 --
 drivers/clk/rockchip/clk_rk3368.c                 | 2 --
 drivers/clk/rockchip/clk_rk3399.c                 | 2 --
 drivers/clk/rockchip/clk_rv1108.c                 | 2 --
 drivers/cpu/cpu-uclass.c                          | 2 --
 drivers/ddr/altera/sdram.c                        | 2 --
 drivers/ddr/fsl/main.c                            | 2 --
 drivers/dma/dma-uclass.c                          | 2 --
 drivers/fpga/socfpga.c                            | 2 --
 drivers/fpga/socfpga_arria10.c                    | 2 --
 drivers/fpga/socfpga_gen5.c                       | 2 --
 drivers/gpio/hsdk-creg-gpio.c                     | 2 --
 drivers/gpio/imx_rgpio2p.c                        | 2 --
 drivers/gpio/mvebu_gpio.c                         | 2 --
 drivers/gpio/mxc_gpio.c                           | 2 --
 drivers/gpio/pm8916_gpio.c                        | 2 --
 drivers/gpio/sandbox.c                            | 2 --
 drivers/gpio/sunxi_gpio.c                         | 2 --
 drivers/gpio/tegra186_gpio.c                      | 2 --
 drivers/gpio/tegra_gpio.c                         | 2 --
 drivers/i2c/ast_i2c.c                             | 2 --
 drivers/i2c/i2c-cdns.c                            | 2 --
 drivers/i2c/imx_lpi2c.c                           | 1 -
 drivers/i2c/omap24xx_i2c.c                        | 2 --
 drivers/i2c/rk_i2c.c                              | 2 --
 drivers/i2c/sandbox_i2c.c                         | 2 --
 drivers/i2c/stm32f7_i2c.c                         | 2 --
 drivers/i2c/tegra_i2c.c                           | 2 --
 drivers/input/cros_ec_keyb.c                      | 2 --
 drivers/input/tegra-kbc.c                         | 2 --
 drivers/led/led_gpio.c                            | 2 --
 drivers/mailbox/mailbox-uclass.c                  | 2 --
 drivers/mailbox/tegra-hsp.c                       | 2 --
 drivers/misc/cros_ec.c                            | 2 --
 drivers/misc/cros_ec_sandbox.c                    | 2 --
 drivers/misc/cros_ec_spi.c                        | 2 --
 drivers/misc/i2c_eeprom_emul.c                    | 2 --
 drivers/misc/spltest_sandbox.c                    | 2 --
 drivers/misc/syscon_sandbox.c                     | 2 --
 drivers/mmc/arm_pl180_mmci.c                      | 2 --
 drivers/mmc/bcm2835_sdhost.c                      | 2 --
 drivers/mmc/gen_atmel_mci.c                       | 2 --
 drivers/mmc/mmc-uclass.c                          | 2 --
 drivers/mmc/rockchip_dw_mmc.c                     | 2 --
 drivers/mmc/rockchip_sdhci.c                      | 1 -
 drivers/mmc/sandbox_mmc.c                         | 2 --
 drivers/mmc/stm32_sdmmc2.c                        | 2 --
 drivers/mmc/tegra_mmc.c                           | 2 --
 drivers/mtd/nand/nand.c                           | 2 --
 drivers/mtd/spi/sandbox.c                         | 2 --
 drivers/mtd/spi/spi_flash.c                       | 2 --
 drivers/net/designware.c                          | 2 --
 drivers/net/fsl_mcdmafec.c                        | 2 --
 drivers/net/gmac_rockchip.c                       | 2 --
 drivers/net/lpc32xx_eth.c                         | 2 --
 drivers/net/mcffec.c                              | 2 --
 drivers/net/netconsole.c                          | 2 --
 drivers/net/phy/micrel_ksz8xxx.c                  | 2 --
 drivers/net/phy/micrel_ksz90x1.c                  | 2 --
 drivers/pch/pch-uclass.c                          | 2 --
 drivers/pci/pci-aardvark.c                        | 2 --
 drivers/pci/pci-emul-uclass.c                     | 2 --
 drivers/pci/pci_sandbox.c                         | 2 --
 drivers/pci/pci_tegra.c                           | 2 --
 drivers/phy/meson-gxl-usb2.c                      | 2 --
 drivers/phy/meson-gxl-usb3.c                      | 2 --
 drivers/phy/phy-uclass.c                          | 2 --
 drivers/phy/sandbox-phy.c                         | 2 --
 drivers/pinctrl/aspeed/pinctrl_ast2500.c          | 2 --
 drivers/pinctrl/exynos/pinctrl-exynos7420.c       | 2 --
 drivers/pinctrl/renesas/pfc.c                     | 2 --
 drivers/pinctrl/rockchip/pinctrl_rk3036.c         | 2 --
 drivers/pinctrl/rockchip/pinctrl_rk3328.c         | 2 --
 drivers/pinctrl/rockchip/pinctrl_rk3368.c         | 2 --
 drivers/pinctrl/rockchip/pinctrl_rk3399.c         | 2 --
 drivers/pinctrl/rockchip/pinctrl_rv1108.c         | 2 --
 drivers/power/domain/power-domain-uclass.c        | 2 --
 drivers/power/pmic/act8846.c                      | 2 --
 drivers/power/pmic/i2c_pmic_emul.c                | 2 --
 drivers/power/pmic/lp873x.c                       | 2 --
 drivers/power/pmic/lp87565.c                      | 2 --
 drivers/power/pmic/max77686.c                     | 2 --
 drivers/power/pmic/max8997.c                      | 2 --
 drivers/power/pmic/max8998.c                      | 2 --
 drivers/power/pmic/palmas.c                       | 2 --
 drivers/power/pmic/pfuze100.c                     | 2 --
 drivers/power/pmic/pm8916.c                       | 2 --
 drivers/power/pmic/pmic-uclass.c                  | 2 --
 drivers/power/pmic/pmic_tps65910_dm.c             | 2 --
 drivers/power/pmic/rk8xx.c                        | 2 --
 drivers/power/pmic/s2mps11.c                      | 2 --
 drivers/power/pmic/s5m8767.c                      | 2 --
 drivers/power/pmic/sandbox.c                      | 2 --
 drivers/power/pmic/tps65090.c                     | 2 --
 drivers/power/regulator/fixed.c                   | 2 --
 drivers/power/regulator/lp873x_regulator.c        | 2 --
 drivers/power/regulator/lp87565_regulator.c       | 2 --
 drivers/power/regulator/max77686.c                | 2 --
 drivers/power/regulator/palmas_regulator.c        | 2 --
 drivers/power/regulator/pbias_regulator.c         | 2 --
 drivers/power/regulator/regulator-uclass.c        | 2 --
 drivers/power/regulator/s2mps11_regulator.c       | 2 --
 drivers/power/regulator/s5m8767.c                 | 2 --
 drivers/power/regulator/sandbox.c                 | 2 --
 drivers/pwm/exynos_pwm.c                          | 2 --
 drivers/pwm/rk_pwm.c                              | 2 --
 drivers/pwm/sandbox_pwm.c                         | 2 --
 drivers/pwm/tegra_pwm.c                           | 2 --
 drivers/ram/rockchip/dmc-rk3368.c                 | 2 --
 drivers/ram/rockchip/sdram_rk3128.c               | 1 -
 drivers/ram/rockchip/sdram_rk3188.c               | 2 --
 drivers/ram/rockchip/sdram_rk3288.c               | 2 --
 drivers/ram/rockchip/sdram_rk3328.c               | 1 -
 drivers/ram/rockchip/sdram_rk3399.c               | 1 -
 drivers/ram/stm32_sdram.c                         | 2 --
 drivers/ram/stm32mp1/stm32mp1_ram.c               | 2 --
 drivers/reset/ast2500-reset.c                     | 2 --
 drivers/reset/reset-uclass.c                      | 2 --
 drivers/rtc/i2c_rtc_emul.c                        | 2 --
 drivers/serial/altera_jtag_uart.c                 | 2 --
 drivers/serial/lpc32xx_hsuart.c                   | 2 --
 drivers/serial/serial_meson.c                     | 2 --
 drivers/serial/serial_stm32.c                     | 2 --
 drivers/serial/serial_xuartlite.c                 | 2 --
 drivers/serial/serial_zynq.c                      | 2 --
 drivers/spi/altera_spi.c                          | 2 --
 drivers/spi/atmel_spi.c                           | 2 --
 drivers/spi/rk_spi.c                              | 2 --
 drivers/spi/sandbox_spi.c                         | 2 --
 drivers/spi/tegra114_spi.c                        | 2 --
 drivers/spmi/spmi-sandbox.c                       | 2 --
 drivers/spmi/spmi-uclass.c                        | 2 --
 drivers/sysreset/sysreset_sandbox.c               | 2 --
 drivers/timer/ag101p_timer.c                      | 2 --
 drivers/timer/altera_timer.c                      | 2 --
 drivers/timer/ast_timer.c                         | 2 --
 drivers/timer/atcpit100_timer.c                   | 2 --
 drivers/timer/omap-timer.c                        | 2 --
 drivers/tpm/tpm_tis_infineon.c                    | 2 --
 drivers/usb/emul/sandbox_flash.c                  | 2 --
 drivers/usb/emul/sandbox_hub.c                    | 2 --
 drivers/usb/emul/sandbox_keyb.c                   | 2 --
 drivers/usb/emul/usb-emul-uclass.c                | 2 --
 drivers/usb/host/dwc2.c                           | 2 --
 drivers/usb/host/dwc3-of-simple.c                 | 2 --
 drivers/usb/host/ehci-atmel.c                     | 2 --
 drivers/usb/host/ehci-tegra.c                     | 2 --
 drivers/usb/host/usb-sandbox.c                    | 2 --
 drivers/usb/host/usb-uclass.c                     | 2 --
 drivers/usb/host/xhci-dwc3.c                      | 2 --
 drivers/usb/host/xhci-fsl.c                       | 2 --
 drivers/usb/host/xhci-mvebu.c                     | 2 --
 drivers/usb/host/xhci-omap.c                      | 2 --
 drivers/usb/host/xhci-rockchip.c                  | 2 --
 drivers/usb/host/xhci-zynqmp.c                    | 2 --
 drivers/video/backlight_gpio.c                    | 2 --
 drivers/video/bridge/anx6345.c                    | 2 --
 drivers/video/exynos/exynos_dp_lowlevel.c         | 2 --
 drivers/video/mx3fb.c                             | 2 --
 drivers/video/pwm_backlight.c                     | 2 --
 drivers/video/rockchip/rk3288_mipi.c              | 2 --
 drivers/video/rockchip/rk3399_mipi.c              | 2 --
 drivers/video/rockchip/rk_edp.c                   | 2 --
 drivers/video/simple_panel.c                      | 2 --
 drivers/video/tegra124/display.c                  | 2 --
 drivers/video/tegra124/dp.c                       | 2 --
 drivers/video/tegra124/sor.c                      | 2 --
 drivers/watchdog/ast_wdt.c                        | 2 --
 drivers/watchdog/mpc8xx_wdt.c                     | 2 --
 drivers/watchdog/sandbox_wdt.c                    | 2 --
 drivers/watchdog/ulp_wdog.c                       | 2 --
 drivers/watchdog/wdt-uclass.c                     | 2 --
 env/ext4.c                                        | 2 --
 env/fat.c                                         | 2 --
 env/sata.c                                        | 2 --
 lib/efi/efi.c                                     | 2 --
 lib/efi/efi_stub.c                                | 2 --
 lib/efi_loader/efi_image_loader.c                 | 2 --
 lib/efi_loader/efi_net.c                          | 2 --
 lib/of_live.c                                     | 2 --
 lib/smbios.c                                      | 2 --
 net/net.c                                         | 2 --
 post/lib_powerpc/cpu.c                            | 2 --
 test/dm/adc.c                                     | 2 --
 test/dm/eth.c                                     | 2 --
 test/dm/gpio.c                                    | 2 --
 test/dm/led.c                                     | 2 --
 test/dm/mmc.c                                     | 2 --
 test/dm/phy.c                                     | 2 --
 test/dm/pmic.c                                    | 2 --
 test/dm/pwm.c                                     | 2 --
 test/dm/regmap.c                                  | 2 --
 test/dm/regulator.c                               | 2 --
 test/dm/spmi.c                                    | 2 --
 test/dm/syscon.c                                  | 2 --
 test/dm/timer.c                                   | 2 --
 test/dm/usb.c                                     | 2 --
 test/dm/video.c                                   | 2 --
 362 files changed, 717 deletions(-)

diff --git a/api/api_net.c b/api/api_net.c
index 67c291682a65..80658b5bdb17 100644
--- a/api/api_net.c
+++ b/api/api_net.c
@@ -12,8 +12,6 @@
 #include <linux/types.h>
 #include <api_public.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DEBUG
 #undef DEBUG
 
diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c
index 3a81ce427ca6..ea9eca1dbff2 100644
--- a/arch/arm/cpu/arm1136/mx31/timer.c
+++ b/arch/arm/cpu/arm1136/mx31/timer.c
@@ -23,8 +23,6 @@
 #define GPTCR_CLKSOURCE_32	(4 << 6)	/* Clock source		*/
 #define GPTCR_TEN		1		/* Timer enable		*/
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* The 32768Hz 32-bit timer overruns in 131072 seconds */
 int timer_init(void)
 {
diff --git a/arch/arm/cpu/arm1136/mx35/timer.c b/arch/arm/cpu/arm1136/mx35/timer.c
index 4edf533e2a27..c396e15ec099 100644
--- a/arch/arm/cpu/arm1136/mx35/timer.c
+++ b/arch/arm/cpu/arm1136/mx35/timer.c
@@ -12,8 +12,6 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/crm_regs.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* General purpose timers bitfields */
 #define GPTCR_SWR       (1<<15)	/* Software reset */
 #define GPTCR_FRR       (1<<9)	/* Freerun / restart */
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 18fb937a3a4c..2fdc0eb8d15a 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -26,8 +26,6 @@
 #endif
 #include <fsl_immap.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 bool soc_has_dp_ddr(void)
 {
 	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
diff --git a/arch/arm/cpu/armv8/s32v234/cpu.c b/arch/arm/cpu/armv8/s32v234/cpu.c
index 5c97e0eee434..282cd02f5908 100644
--- a/arch/arm/cpu/armv8/s32v234/cpu.c
+++ b/arch/arm/cpu/armv8/s32v234/cpu.c
@@ -12,8 +12,6 @@
 #include <asm/arch/mc_me_regs.h>
 #include "cpu.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 u32 cpu_mask(void)
 {
 	return readl(MC_ME_CS);
diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index 7c25e67fea74..ba332716e863 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/arch/arm/cpu/pxa/timer.c
@@ -9,8 +9,6 @@
 #include <common.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int timer_init(void)
 {
 	writel(0, CONFIG_SYS_TIMER_COUNTER);
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
index c9f0b3a14b56..c8298c57e11b 100644
--- a/arch/arm/include/asm/arch-omap4/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -16,8 +16,6 @@
 #include <asm/arch/mux_omap4.h>
 #include <asm/ti-common/sys_proto.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
 extern const struct emif_regs emif_regs_elpida_200_mhz_2cs;
 extern const struct emif_regs emif_regs_elpida_380_mhz_1cs;
diff --git a/arch/arm/include/asm/arch-omap5/sys_proto.h b/arch/arm/include/asm/arch-omap5/sys_proto.h
index d43cd7f2e72e..e99bf77e8398 100644
--- a/arch/arm/include/asm/arch-omap5/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap5/sys_proto.h
@@ -16,8 +16,6 @@
 #include <asm/arch/clock.h>
 #include <asm/ti-common/sys_proto.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Structure for Iodelay configuration registers.
  * Theoretical max for g_delay is 21560 ps.
diff --git a/arch/arm/lib/cmd_boot.c b/arch/arm/lib/cmd_boot.c
index 37bb6a567e88..781a6eaf52df 100644
--- a/arch/arm/lib/cmd_boot.c
+++ b/arch/arm/lib/cmd_boot.c
@@ -21,8 +21,6 @@
 #include <common.h>
 #include <command.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * ARMv7M does not support ARM instruction mode. However, the
  * interworking BLX and BX instructions do encode the ARM/Thumb
diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c
index ce16ef3bdb71..ae008d5501e2 100644
--- a/arch/arm/mach-at91/spl_atmel.c
+++ b/arch/arm/mach-at91/spl_atmel.c
@@ -15,8 +15,6 @@
 #include <asm/arch/clk.h>
 #include <spl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static void switch_to_main_crystal_osc(void)
 {
 	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
diff --git a/arch/arm/mach-davinci/spl.c b/arch/arm/mach-davinci/spl.c
index 4c74db9ed03c..f4553160027e 100644
--- a/arch/arm/mach-davinci/spl.c
+++ b/arch/arm/mach-davinci/spl.c
@@ -16,8 +16,6 @@
 #include <spi_flash.h>
 #include <mmc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
 void puts(const char *str)
 {
diff --git a/arch/arm/mach-exynos/clock_init_exynos5.c b/arch/arm/mach-exynos/clock_init_exynos5.c
index 1b7498d9d5f6..2c55e4031f58 100644
--- a/arch/arm/mach-exynos/clock_init_exynos5.c
+++ b/arch/arm/mach-exynos/clock_init_exynos5.c
@@ -21,8 +21,6 @@
 #define FSYS1_MMC0_DIV_MASK	0xff0f
 #define FSYS1_MMC0_DIV_VAL	0x0701
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct arm_clk_ratios arm_clk_ratios[] = {
 #ifdef CONFIG_EXYNOS5420
 	{
diff --git a/arch/arm/mach-exynos/mmu-arm64.c b/arch/arm/mach-exynos/mmu-arm64.c
index 23814222d82d..e0dd94ce24e8 100644
--- a/arch/arm/mach-exynos/mmu-arm64.c
+++ b/arch/arm/mach-exynos/mmu-arm64.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <asm/armv8/mmu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_EXYNOS7420
 static struct mm_region exynos7420_mem_map[] = {
 	{
diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
index ada8adf2f4f0..62cd56e096e9 100644
--- a/arch/arm/mach-imx/cmd_dek.c
+++ b/arch/arm/mach-imx/cmd_dek.c
@@ -16,8 +16,6 @@
 #include <asm/arch/clock.h>
 #include <mapmem.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
 * blob_dek() - Encapsulate the DEK as a blob using CAM's Key
 * @src: - Address of data to be encapsulated
diff --git a/arch/arm/mach-imx/mx7ulp/pcc.c b/arch/arm/mach-imx/mx7ulp/pcc.c
index edd84e51b981..1d39c5b1ee0e 100644
--- a/arch/arm/mach-imx/mx7ulp/pcc.c
+++ b/arch/arm/mach-imx/mx7ulp/pcc.c
@@ -12,8 +12,6 @@
 #include <asm/arch/pcc.h>
 #include <asm/arch/sys_proto.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define PCC_CLKSRC_TYPES 2
 #define PCC_CLKSRC_NUM 7
 
diff --git a/arch/arm/mach-imx/mx7ulp/scg.c b/arch/arm/mach-imx/mx7ulp/scg.c
index c117af0a0ecd..341f8cc119af 100644
--- a/arch/arm/mach-imx/mx7ulp/scg.c
+++ b/arch/arm/mach-imx/mx7ulp/scg.c
@@ -12,8 +12,6 @@
 #include <asm/arch/pcc.h>
 #include <asm/arch/sys_proto.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 scg_p scg1_regs = (scg_p)SCG1_RBASE;
 
 static u32 scg_src_get_rate(enum scg_clk clksrc)
diff --git a/arch/arm/mach-imx/mx8m/clock.c b/arch/arm/mach-imx/mx8m/clock.c
index c56ba99d5c63..04811173432b 100644
--- a/arch/arm/mach-imx/mx8m/clock.c
+++ b/arch/arm/mach-imx/mx8m/clock.c
@@ -14,8 +14,6 @@
 #include <errno.h>
 #include <linux/iopoll.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct anamix_pll *ana_pll = (struct anamix_pll *)ANATOP_BASE_ADDR;
 
 static u32 decode_frac_pll(enum clk_root_src frac_pll)
diff --git a/arch/arm/mach-imx/mx8m/clock_slice.c b/arch/arm/mach-imx/mx8m/clock_slice.c
index e734498b9472..b851d59c1317 100644
--- a/arch/arm/mach-imx/mx8m/clock_slice.c
+++ b/arch/arm/mach-imx/mx8m/clock_slice.c
@@ -12,8 +12,6 @@
 #include <asm/io.h>
 #include <errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct ccm_reg *ccm_reg = (struct ccm_reg *)CCM_BASE_ADDR;
 
 static struct clk_root_map root_array[] = {
diff --git a/arch/arm/mach-imx/timer.c b/arch/arm/mach-imx/timer.c
index 69dbf3c2cebf..60f706fbe3b6 100644
--- a/arch/arm/mach-imx/timer.c
+++ b/arch/arm/mach-imx/timer.c
@@ -38,8 +38,6 @@ static struct mxc_gpt *cur_gpt = (struct mxc_gpt *)GPT1_BASE_ADDR;
 #define GPTPR_PRESCALER24M_SHIFT 12
 #define GPTPR_PRESCALER24M_MASK (0xF << GPTPR_PRESCALER24M_SHIFT)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline int gpt_has_clk_source_osc(void)
 {
 #if defined(CONFIG_MX6)
diff --git a/arch/arm/mach-mvebu/armada3700/cpu.c b/arch/arm/mach-mvebu/armada3700/cpu.c
index ab4164cbe00d..37ef13484c94 100644
--- a/arch/arm/mach-mvebu/armada3700/cpu.c
+++ b/arch/arm/mach-mvebu/armada3700/cpu.c
@@ -14,8 +14,6 @@
 #include <asm/arch/soc.h>
 #include <asm/armv8/mmu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Armada 3700 */
 #define MVEBU_GPIO_NB_REG_BASE		(MVEBU_REGISTER(0x13800))
 
diff --git a/arch/arm/mach-mvebu/armada8k/cpu.c b/arch/arm/mach-mvebu/armada8k/cpu.c
index ce7e913b708c..2b3419be0385 100644
--- a/arch/arm/mach-mvebu/armada8k/cpu.c
+++ b/arch/arm/mach-mvebu/armada8k/cpu.c
@@ -14,8 +14,6 @@
 #include <asm/arch/soc.h>
 #include <asm/armv8/mmu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Armada 7k/8k */
 #define MVEBU_RFU_BASE			(MVEBU_REGISTER(0x6f0000))
 #define RFU_GLOBAL_SW_RST		(MVEBU_RFU_BASE + 0x84)
diff --git a/arch/arm/mach-mvebu/sata.c b/arch/arm/mach-mvebu/sata.c
index 5d8032bd8944..526c4a61ef97 100644
--- a/arch/arm/mach-mvebu/sata.c
+++ b/arch/arm/mach-mvebu/sata.c
@@ -8,8 +8,6 @@
 #include <ahci.h>
 #include <dm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Dummy implementation that can be overwritten by a board
  * specific function
diff --git a/arch/arm/mach-mvebu/timer.c b/arch/arm/mach-mvebu/timer.c
index f5c2eaa808a3..a86128e871c6 100644
--- a/arch/arm/mach-mvebu/timer.c
+++ b/arch/arm/mach-mvebu/timer.c
@@ -11,8 +11,6 @@
 #include <asm/io.h>
 #include <asm/arch/soc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define TIMER_LOAD_VAL			0xffffffff
 
 static int init_done __attribute__((section(".data"))) = 0;
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index a61b9331450e..b4c9af1290bd 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -28,8 +28,6 @@
 #include <asm/omap_common.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 #ifndef CONFIG_SYS_L2CACHE_OFF
diff --git a/arch/arm/mach-omap2/omap4/hwinit.c b/arch/arm/mach-omap2/omap4/hwinit.c
index 67ab1ccd75b3..4bda162903b8 100644
--- a/arch/arm/mach-omap2/omap4/hwinit.c
+++ b/arch/arm/mach-omap2/omap4/hwinit.c
@@ -21,8 +21,6 @@
 #include <asm/arch/gpio.h>
 #include <asm/omap_common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
 
 static const struct gpio_bank gpio_bank_44xx[6] = {
diff --git a/arch/arm/mach-omap2/omap5/hwinit.c b/arch/arm/mach-omap2/omap5/hwinit.c
index 57f2a8664c88..e7a3f57b67e6 100644
--- a/arch/arm/mach-omap2/omap5/hwinit.c
+++ b/arch/arm/mach-omap2/omap5/hwinit.c
@@ -24,8 +24,6 @@
 #include <asm/emif.h>
 #include <asm/omap_common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
 
 #ifndef CONFIG_DM_GPIO
diff --git a/arch/arm/mach-rockchip/rk3036-board-spl.c b/arch/arm/mach-rockchip/rk3036-board-spl.c
index 550e3a152142..4501cd17e339 100644
--- a/arch/arm/mach-rockchip/rk3036-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3036-board-spl.c
@@ -14,8 +14,6 @@
 #include <asm/arch/timer.h>
 #include <asm/arch/uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define GRF_BASE	0x20008000
 
 #define DEBUG_UART_BASE	0x20068000
diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
index 916d18fc3292..9005705db108 100644
--- a/arch/arm/mach-rockchip/rk3188-board.c
+++ b/arch/arm/mach-rockchip/rk3188-board.c
@@ -18,8 +18,6 @@
 #include <asm/gpio.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_late_init(void)
 {
 	struct rk3188_grf *grf;
diff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c
index 206abfafcd97..cb54ff517424 100644
--- a/arch/arm/mach-rockchip/rk322x-board-spl.c
+++ b/arch/arm/mach-rockchip/rk322x-board-spl.c
@@ -21,8 +21,6 @@ u32 spl_boot_device(void)
 {
 	return BOOT_DEVICE_MMC1;
 }
-DECLARE_GLOBAL_DATA_PTR;
-
 #define GRF_BASE	0x11000000
 #define SGRF_BASE	0x10140000
 
diff --git a/arch/arm/mach-rockchip/rk3288-board-tpl.c b/arch/arm/mach-rockchip/rk3288-board-tpl.c
index 150beea02e1c..6f7097dbdbbe 100644
--- a/arch/arm/mach-rockchip/rk3288-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-tpl.c
@@ -19,8 +19,6 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define GRF_BASE		0xff770000
 void board_init_f(ulong dummy)
 {
diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c b/arch/arm/mach-rockchip/rk3368-board-spl.c
index 8055ae538f18..a1d504bbd277 100644
--- a/arch/arm/mach-rockchip/rk3368-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-spl.c
@@ -17,8 +17,6 @@
 #include <asm/arch/periph.h>
 #include <asm/arch/timer.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void board_debug_uart_init(void)
 {
 }
diff --git a/arch/arm/mach-rockchip/rk3368-board-tpl.c b/arch/arm/mach-rockchip/rk3368-board-tpl.c
index 60d5aeade99e..f5bc0d4cd537 100644
--- a/arch/arm/mach-rockchip/rk3368-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-tpl.c
@@ -18,8 +18,6 @@
 #include <asm/arch/timer.h>
 #include <syscon.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * The SPL (and also the full U-Boot stage on the RK3368) will run in
  * secure mode (i.e. EL3) and an ATF will eventually be booted before
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index d35990efd651..4eb7f01c15ee 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -19,8 +19,6 @@
 #include <spl.h>
 #include <syscon.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void board_return_to_bootrom(void)
 {
 	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
diff --git a/arch/arm/mach-socfpga/clock_manager_arria10.c b/arch/arm/mach-socfpga/clock_manager_arria10.c
index 623a266f80f0..4bc4acb9bfe2 100644
--- a/arch/arm/mach-socfpga/clock_manager_arria10.c
+++ b/arch/arm/mach-socfpga/clock_manager_arria10.c
@@ -10,8 +10,6 @@
 #include <dm.h>
 #include <asm/arch/clock_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static u32 eosc1_hz;
 static u32 cb_intosc_hz;
 static u32 f2s_free_hz;
diff --git a/arch/arm/mach-socfpga/clock_manager_gen5.c b/arch/arm/mach-socfpga/clock_manager_gen5.c
index 4e5b6d169371..1b3914ba7dcc 100644
--- a/arch/arm/mach-socfpga/clock_manager_gen5.c
+++ b/arch/arm/mach-socfpga/clock_manager_gen5.c
@@ -10,8 +10,6 @@
 #include <asm/arch/clock_manager.h>
 #include <wait_bit.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_clock_manager *clock_manager_base =
 	(struct socfpga_clock_manager *)SOCFPGA_CLKMGR_ADDRESS;
 
diff --git a/arch/arm/mach-socfpga/fpga_manager.c b/arch/arm/mach-socfpga/fpga_manager.c
index f9095739b0f0..16e4a7821b3e 100644
--- a/arch/arm/mach-socfpga/fpga_manager.c
+++ b/arch/arm/mach-socfpga/fpga_manager.c
@@ -15,8 +15,6 @@
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Timeout count */
 #define FPGA_TIMEOUT_CNT		0x1000000
 
diff --git a/arch/arm/mach-socfpga/freeze_controller.c b/arch/arm/mach-socfpga/freeze_controller.c
index 71d5d99e9c10..62fa854082e7 100644
--- a/arch/arm/mach-socfpga/freeze_controller.c
+++ b/arch/arm/mach-socfpga/freeze_controller.c
@@ -11,8 +11,6 @@
 #include <asm/arch/freeze_controller.h>
 #include <linux/errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_freeze_controller *freeze_controller_base =
 		(void *)(SOCFPGA_SYSMGR_ADDRESS + SYSMGR_FRZCTRL_ADDRESS);
 
diff --git a/arch/arm/mach-socfpga/misc_arria10.c b/arch/arm/mach-socfpga/misc_arria10.c
index 9d751f6b2f22..475fd59a45bd 100644
--- a/arch/arm/mach-socfpga/misc_arria10.c
+++ b/arch/arm/mach-socfpga/misc_arria10.c
@@ -28,8 +28,6 @@
 #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q3_7	0x78
 #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q4_3	0x98
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_SPL_BUILD)
 static struct pl310_regs *const pl310 =
 	(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
diff --git a/arch/arm/mach-socfpga/reset_manager.c b/arch/arm/mach-socfpga/reset_manager.c
index 29438ed533d8..484b295cd3ff 100644
--- a/arch/arm/mach-socfpga/reset_manager.c
+++ b/arch/arm/mach-socfpga/reset_manager.c
@@ -9,8 +9,6 @@
 #include <asm/io.h>
 #include <asm/arch/reset_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_reset_manager *reset_manager_base =
 		(void *)SOCFPGA_RSTMGR_ADDRESS;
 
diff --git a/arch/arm/mach-socfpga/reset_manager_gen5.c b/arch/arm/mach-socfpga/reset_manager_gen5.c
index aa88adb4147e..c59127456ce0 100644
--- a/arch/arm/mach-socfpga/reset_manager_gen5.c
+++ b/arch/arm/mach-socfpga/reset_manager_gen5.c
@@ -11,8 +11,6 @@
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_reset_manager *reset_manager_base =
 		(void *)SOCFPGA_RSTMGR_ADDRESS;
 static const struct socfpga_system_manager *sysmgr_regs =
diff --git a/arch/arm/mach-socfpga/scan_manager.c b/arch/arm/mach-socfpga/scan_manager.c
index 566b33f2b6a0..8b271b1f4541 100644
--- a/arch/arm/mach-socfpga/scan_manager.c
+++ b/arch/arm/mach-socfpga/scan_manager.c
@@ -28,8 +28,6 @@
 #define SCANMGR_STAT_ACTIVE		(1 << 31)
 #define SCANMGR_STAT_WFIFOCNT_MASK	0x70000000
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_scan_manager *scan_manager_base =
 		(void *)(SOCFPGA_SCANMGR_ADDRESS);
 static const struct socfpga_freeze_controller *freeze_controller_base =
diff --git a/arch/arm/mach-socfpga/system_manager_gen5.c b/arch/arm/mach-socfpga/system_manager_gen5.c
index 3588a570a7f3..e0af7753b0ec 100644
--- a/arch/arm/mach-socfpga/system_manager_gen5.c
+++ b/arch/arm/mach-socfpga/system_manager_gen5.c
@@ -9,8 +9,6 @@
 #include <asm/arch/system_manager.h>
 #include <asm/arch/fpga_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct socfpga_system_manager *sysmgr_regs =
 	(struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
 
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 1753faec1d9b..ac456ca0c69a 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -209,7 +209,6 @@ void s_init(void)
 }
 
 #ifdef CONFIG_SPL_BUILD
-DECLARE_GLOBAL_DATA_PTR;
 #endif
 
 /* The sunxi internal brom will try to loader external bootloader
diff --git a/arch/arm/mach-sunxi/dram_sun9i.c b/arch/arm/mach-sunxi/dram_sun9i.c
index 8c681f354132..e7d423f861eb 100644
--- a/arch/arm/mach-sunxi/dram_sun9i.c
+++ b/arch/arm/mach-sunxi/dram_sun9i.c
@@ -20,8 +20,6 @@
 #include <asm/arch/dram.h>
 #include <asm/arch/sys_proto.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DRAM_CLK (CONFIG_DRAM_CLK * 1000000)
 
 /*
diff --git a/arch/arm/mach-tegra/board186.c b/arch/arm/mach-tegra/board186.c
index 691c3fd98dab..9e95123c55c8 100644
--- a/arch/arm/mach-tegra/board186.c
+++ b/arch/arm/mach-tegra/board186.c
@@ -7,8 +7,6 @@
 #include <common.h>
 #include <asm/arch/tegra.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_early_init_f(void)
 {
 	return 0;
diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_board.c b/arch/arm/mach-tegra/tegra186/nvtboot_board.c
index 8ecb45444349..bef3ce8fc834 100644
--- a/arch/arm/mach-tegra/tegra186/nvtboot_board.c
+++ b/arch/arm/mach-tegra/tegra186/nvtboot_board.c
@@ -11,8 +11,6 @@
 #include <asm/arch/tegra.h>
 #include <asm/armv8/mmu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 extern unsigned long nvtboot_boot_x0;
 
 /*
diff --git a/arch/arm/mach-zynq/ddrc.c b/arch/arm/mach-zynq/ddrc.c
index 047a7b4d9c2f..795e2bd003fd 100644
--- a/arch/arm/mach-zynq/ddrc.c
+++ b/arch/arm/mach-zynq/ddrc.c
@@ -10,8 +10,6 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/hardware.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_ZYNQ_DDRC_INIT
 void zynq_ddrc_init(void) {}
 #else
diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c
index 0a303f41ebdf..d1e61aab116f 100644
--- a/arch/arm/mach-zynq/spl.c
+++ b/arch/arm/mach-zynq/spl.c
@@ -13,8 +13,6 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/ps7_init_gpl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void board_init_f(ulong dummy)
 {
 	ps7_init();
diff --git a/arch/microblaze/cpu/spl.c b/arch/microblaze/cpu/spl.c
index 3d57a5a8593c..3407e36c5cf7 100644
--- a/arch/microblaze/cpu/spl.c
+++ b/arch/microblaze/cpu/spl.c
@@ -12,8 +12,6 @@
 #include <asm/io.h>
 #include <asm/u-boot.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 bool boot_linux;
 
 u32 spl_boot_device(void)
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index 154671d4802e..0be72f543345 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -15,8 +15,6 @@
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int do_bootm_linux(int flag, int argc, char * const argv[],
 		   bootm_headers_t *images)
 {
diff --git a/arch/mips/mach-ath79/ar933x/ddr.c b/arch/mips/mach-ath79/ar933x/ddr.c
index 2a25e23869ec..eeaf4aec4d72 100644
--- a/arch/mips/mach-ath79/ar933x/ddr.c
+++ b/arch/mips/mach-ath79/ar933x/ddr.c
@@ -12,8 +12,6 @@
 #include <mach/ar71xx_regs.h>
 #include <mach/ath79.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DDR_CTRL_UPD_EMR3S      BIT(5)
 #define DDR_CTRL_UPD_EMR2S      BIT(4)
 #define DDR_CTRL_PRECHARGE      BIT(3)
diff --git a/arch/mips/mach-ath79/qca953x/ddr.c b/arch/mips/mach-ath79/qca953x/ddr.c
index c6049d8958a4..92d591c2a681 100644
--- a/arch/mips/mach-ath79/qca953x/ddr.c
+++ b/arch/mips/mach-ath79/qca953x/ddr.c
@@ -12,8 +12,6 @@
 #include <mach/ar71xx_regs.h>
 #include <mach/ath79.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DDR_CTRL_UPD_EMR3S      BIT(5)
 #define DDR_CTRL_UPD_EMR2S      BIT(4)
 #define DDR_CTRL_PRECHARGE      BIT(3)
diff --git a/arch/nds32/lib/boot.c b/arch/nds32/lib/boot.c
index f9c1c6b3ff63..1313506ed557 100644
--- a/arch/nds32/lib/boot.c
+++ b/arch/nds32/lib/boot.c
@@ -9,8 +9,6 @@
 #include <common.h>
 #include <command.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned long do_go_exec(ulong (*entry)(int, char * const []),
 			 int argc, char * const argv[])
 {
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index b350bfeb0656..99abb6786c7b 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -54,8 +54,6 @@
 #include <fsl_qe.h>
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
 /*
  * For deriving usb clock from 100MHz sysclk, reference divisor is set
diff --git a/arch/powerpc/cpu/mpc86xx/fdt.c b/arch/powerpc/cpu/mpc86xx/fdt.c
index 948ad8fa1cac..4bd36b688603 100644
--- a/arch/powerpc/cpu/mpc86xx/fdt.c
+++ b/arch/powerpc/cpu/mpc86xx/fdt.c
@@ -9,8 +9,6 @@
 #include <fdt_support.h>
 #include <asm/mp.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 extern void ft_fixup_num_cores(void *blob);
 extern void ft_srio_setup(void *blob);
 
diff --git a/arch/powerpc/lib/extable.c b/arch/powerpc/lib/extable.c
index ed047da452b5..2f8b9326f920 100644
--- a/arch/powerpc/lib/extable.c
+++ b/arch/powerpc/lib/extable.c
@@ -21,8 +21,6 @@
  * on our cache or tlb entries.
  */
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct exception_table_entry
 {
 	unsigned long insn, fixup;
diff --git a/arch/powerpc/lib/spl.c b/arch/powerpc/lib/spl.c
index b93197030e3f..bc477175afb0 100644
--- a/arch/powerpc/lib/spl.c
+++ b/arch/powerpc/lib/spl.c
@@ -9,8 +9,6 @@
 #include <image.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * This function jumps to an image with argument. Normally an FDT or ATAGS
  * image.
diff --git a/arch/riscv/lib/boot.c b/arch/riscv/lib/boot.c
index 39ba9b49ff69..ffad66d68320 100644
--- a/arch/riscv/lib/boot.c
+++ b/arch/riscv/lib/boot.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <command.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned long do_go_exec(ulong (*entry)(int, char * const []),
 			 int argc, char * const argv[])
 {
diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c
index 0c9a7979d231..c7226ff30d3c 100644
--- a/arch/sandbox/lib/bootm.c
+++ b/arch/sandbox/lib/bootm.c
@@ -7,8 +7,6 @@
 #include <common.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define	LINUX_ARM_ZIMAGE_MAGIC	0x016f2818
 
 struct arm_z_header {
diff --git a/arch/x86/cpu/pci.c b/arch/x86/cpu/pci.c
index c9c7637fa7d7..2728c00227d2 100644
--- a/arch/x86/cpu/pci.c
+++ b/arch/x86/cpu/pci.c
@@ -17,8 +17,6 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
 			ulong *valuep, enum pci_size_t size)
 {
diff --git a/arch/x86/cpu/qemu/cpu.c b/arch/x86/cpu/qemu/cpu.c
index b1a965e7156d..b53630b099f4 100644
--- a/arch/x86/cpu/qemu/cpu.c
+++ b/arch/x86/cpu/qemu/cpu.c
@@ -11,8 +11,6 @@
 #include <qfw.h>
 #include <asm/cpu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int cpu_qemu_get_desc(struct udevice *dev, char *buf, int size)
 {
 	if (size < CPU_MAX_NAME_LEN)
diff --git a/arch/x86/cpu/tangier/tangier.c b/arch/x86/cpu/tangier/tangier.c
index 20d6c6039b61..ac8733c75e92 100644
--- a/arch/x86/cpu/tangier/tangier.c
+++ b/arch/x86/cpu/tangier/tangier.c
@@ -8,8 +8,6 @@
 #include <asm/scu.h>
 #include <asm/u-boot-x86.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Miscellaneous platform dependent initializations
  */
diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
index cafae15af0c6..693d1a31f3d5 100644
--- a/arch/x86/cpu/x86_64/cpu.c
+++ b/arch/x86/cpu/x86_64/cpu.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <debug_uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Global declaration of gd */
 struct global_data *global_data_ptr;
 
diff --git a/arch/x86/lib/lpc-uclass.c b/arch/x86/lib/lpc-uclass.c
index eb033e6b3f63..37b0c216c2c9 100644
--- a/arch/x86/lib/lpc-uclass.c
+++ b/arch/x86/lib/lpc-uclass.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <dm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 UCLASS_DRIVER(lpc) = {
 	.id		= UCLASS_LPC,
 	.name		= "lpc",
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 6af1bf46783b..9932ee69a0c4 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -28,8 +28,6 @@
 #include <linux/compiler.h>
 #include <linux/libfdt.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Memory lay-out:
  *
diff --git a/board/armadeus/opos6uldev/board.c b/board/armadeus/opos6uldev/board.c
index 646094aef4ca..02d8940355ab 100644
--- a/board/armadeus/opos6uldev/board.c
+++ b/board/armadeus/opos6uldev/board.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_VIDEO_MXS
 #define LCD_PAD_CTRL ( \
 	PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \
diff --git a/board/astro/mcf5373l/fpga.c b/board/astro/mcf5373l/fpga.c
index 53e00728c3d8..72b93ac1e58a 100644
--- a/board/astro/mcf5373l/fpga.c
+++ b/board/astro/mcf5373l/fpga.c
@@ -25,8 +25,6 @@
 #include <asm/io.h>
 #include "fpga.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int altera_pre_fn(int cookie)
 {
 	gpio_t *gpiop = (gpio_t *)MMAP_GPIO;
diff --git a/board/bachmann/ot1200/ot1200_spl.c b/board/bachmann/ot1200/ot1200_spl.c
index f3dff95710aa..dd1ade787798 100644
--- a/board/bachmann/ot1200/ot1200_spl.c
+++ b/board/bachmann/ot1200/ot1200_spl.c
@@ -8,8 +8,6 @@
 #include <spl.h>
 #include <asm/arch/mx6-ddr.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Configure MX6Q/DUAL mmdc DDR io registers */
 static struct mx6dq_iomux_ddr_regs ot1200_ddr_ioregs = {
 	/* SDCLK[0:1], CAS, RAS, Reset: Differential input, 48ohm */
diff --git a/board/barco/platinum/spl_picon.c b/board/barco/platinum/spl_picon.c
index f49adf032967..0f6ff3a38f72 100644
--- a/board/barco/platinum/spl_picon.c
+++ b/board/barco/platinum/spl_picon.c
@@ -21,8 +21,6 @@
 
 #include "platinum.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #undef RTT_NOM_120OHM	/* use 120ohm Rtt_nom vs 60ohm (lower power) */
 
 /* Configure MX6Q/DUAL mmdc DDR io registers */
diff --git a/board/barco/platinum/spl_titanium.c b/board/barco/platinum/spl_titanium.c
index c27fb4836a15..7af890a902e4 100644
--- a/board/barco/platinum/spl_titanium.c
+++ b/board/barco/platinum/spl_titanium.c
@@ -21,8 +21,6 @@
 
 #include "platinum.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #undef RTT_NOM_120OHM	/* use 120ohm Rtt_nom vs 60ohm (lower power) */
 
 /* Configure MX6Q/DUAL mmdc DDR io registers */
diff --git a/board/cavium/thunderx/atf.c b/board/cavium/thunderx/atf.c
index 6ab9de944f22..51b4a9fa2777 100644
--- a/board/cavium/thunderx/atf.c
+++ b/board/cavium/thunderx/atf.c
@@ -16,8 +16,6 @@
 
 #include <malloc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 ssize_t atf_read_mmc(uintptr_t offset, void *buffer, size_t size)
 {
 	struct pt_regs regs;
diff --git a/board/cei/cei-tk1-som/cei-tk1-som.c b/board/cei/cei-tk1-som/cei-tk1-som.c
index 7c87bd1eb11e..c2e27b7b675a 100644
--- a/board/cei/cei-tk1-som/cei-tk1-som.c
+++ b/board/cei/cei-tk1-som/cei-tk1-som.c
@@ -13,8 +13,6 @@
 
 #include "pinmux-config-cei-tk1-som.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Routine: pinmux_init
  * Description: Do individual peripheral pinmux configs
diff --git a/board/compulab/cm_fx6/common.c b/board/compulab/cm_fx6/common.c
index 19fa5d3cf70b..796931dc9918 100644
--- a/board/compulab/cm_fx6/common.c
+++ b/board/compulab/cm_fx6/common.c
@@ -15,8 +15,6 @@
 #include <fsl_esdhc.h>
 #include "common.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_FSL_ESDHC
 #define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |			\
 	PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm |			\
diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c
index 16e5bf8dfa23..924f5d79df72 100644
--- a/board/compulab/cm_fx6/spl.c
+++ b/board/compulab/cm_fx6/spl.c
@@ -20,8 +20,6 @@
 #include <fsl_esdhc.h>
 #include "common.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum ddr_config {
 	DDR_16BIT_256MB,
 	DDR_32BIT_512MB,
diff --git a/board/compulab/cm_t43/spl.c b/board/compulab/cm_t43/spl.c
index b7d118eb9ceb..ccdf6b3e3425 100644
--- a/board/compulab/cm_t43/spl.c
+++ b/board/compulab/cm_t43/spl.c
@@ -14,8 +14,6 @@
 #include <power/tps65218.h>
 #include "board.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 const struct dpll_params dpll_mpu  = { 800,  24, 1,  -1, -1, -1, -1 };
 const struct dpll_params dpll_core = { 1000, 24, -1, -1, 10,  8,  4 };
 const struct dpll_params dpll_per  = { 960,  24, 5,  -1, -1, -1, -1 };
diff --git a/board/compulab/common/omap3_display.c b/board/compulab/common/omap3_display.c
index ed2077e36179..e19fbb91613f 100644
--- a/board/compulab/common/omap3_display.c
+++ b/board/compulab/common/omap3_display.c
@@ -17,8 +17,6 @@
 #include <scf0403_lcd.h>
 #include <asm/arch-omap3/dss.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum display_type {
 	NONE,
 	DVI,
diff --git a/board/dhelectronics/dh_imx6/dh_imx6_spl.c b/board/dhelectronics/dh_imx6/dh_imx6_spl.c
index 57ae7f15ce8e..c4b81a9f92f7 100644
--- a/board/dhelectronics/dh_imx6/dh_imx6_spl.c
+++ b/board/dhelectronics/dh_imx6/dh_imx6_spl.c
@@ -45,8 +45,6 @@
 	(PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm |	\
 	 PAD_CTL_SRE_FAST | PAD_CTL_HYS)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct mx6dq_iomux_ddr_regs dhcom6dq_ddr_ioregs = {
 	.dram_sdclk_0	= 0x00020030,
 	.dram_sdclk_1	= 0x00020030,
diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c
index 6e2389dd4b42..6d4f8c34267f 100644
--- a/board/engicam/common/spl.c
+++ b/board/engicam/common/spl.c
@@ -23,8 +23,6 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/video.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define UART_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |             \
         PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \
         PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
diff --git a/board/engicam/imx6q/imx6q.c b/board/engicam/imx6q/imx6q.c
index fe37088b4911..1c57358d1671 100644
--- a/board/engicam/imx6q/imx6q.c
+++ b/board/engicam/imx6q/imx6q.c
@@ -22,8 +22,6 @@
 
 #include "../common/board.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_NAND_MXS
 #define GPMI_PAD_CTRL0	(PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
 #define GPMI_PAD_CTRL1	(PAD_CTL_DSE_40ohm | PAD_CTL_SPEED_MED | \
diff --git a/board/engicam/imx6ul/imx6ul.c b/board/engicam/imx6ul/imx6ul.c
index a903a3603ba7..26c6354c3778 100644
--- a/board/engicam/imx6ul/imx6ul.c
+++ b/board/engicam/imx6ul/imx6ul.c
@@ -22,8 +22,6 @@
 
 #include "../common/board.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_NAND_MXS
 
 #define GPMI_PAD_CTRL0		(PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
diff --git a/board/esd/vme8349/pci.c b/board/esd/vme8349/pci.c
index 4d3b21ddff4e..f1cfa23b42b8 100644
--- a/board/esd/vme8349/pci.c
+++ b/board/esd/vme8349/pci.c
@@ -20,8 +20,6 @@
 #include <asm/fsl_i2c.h>
 #include "vme8349pin.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/freescale/bsc9131rdb/ddr.c b/board/freescale/bsc9131rdb/ddr.c
index 339c57625638..2a5e61e23049 100644
--- a/board/freescale/bsc9131rdb/ddr.c
+++ b/board/freescale/bsc9131rdb/ddr.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/fsl_law.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_SYS_DDR_RAW_TIMING
 #define CONFIG_SYS_DRAM_SIZE	1024
 
diff --git a/board/freescale/bsc9132qds/ddr.c b/board/freescale/bsc9132qds/ddr.c
index 43f163a2c621..49b6b8fe586f 100644
--- a/board/freescale/bsc9132qds/ddr.c
+++ b/board/freescale/bsc9132qds/ddr.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/fsl_law.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_SYS_DDR_RAW_TIMING
 
 fsl_ddr_cfg_regs_t ddr_cfg_regs_800 = {
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index a9451c5c6ee5..eb25f5e23f81 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -17,8 +17,6 @@
 #endif
 #include "vid.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int __weak i2c_multiplexer_select_vid_channel(u8 channel)
 {
 	return 0;
diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c
index 8b3f4ad78d8e..99c103239bda 100644
--- a/board/freescale/ls1021aqds/ls1021aqds.c
+++ b/board/freescale/ls1021aqds/ls1021aqds.c
@@ -38,8 +38,6 @@
 
 #define SET_SDHC_MUX_SEL(reg, value)	((reg & 0x0f) | value)
 #define SET_EC_MUX_SEL(reg, value)	((reg & 0xf0) | value)
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	MUX_TYPE_CAN,
 	MUX_TYPE_IIC2,
diff --git a/board/freescale/ls1088a/eth_ls1088ardb.c b/board/freescale/ls1088a/eth_ls1088ardb.c
index 97accc90fd7c..fa86118acc88 100644
--- a/board/freescale/ls1088a/eth_ls1088ardb.c
+++ b/board/freescale/ls1088a/eth_ls1088ardb.c
@@ -18,8 +18,6 @@
 #include <fsl-mc/fsl_mc.h>
 #include <fsl-mc/ldpaa_wriop.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_eth_init(bd_t *bis)
 {
 #if defined(CONFIG_FSL_MC_ENET)
diff --git a/board/freescale/m5329evb/nand.c b/board/freescale/m5329evb/nand.c
index 88496812bf8a..291346d612b8 100644
--- a/board/freescale/m5329evb/nand.c
+++ b/board/freescale/m5329evb/nand.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/immap.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_CMD_NAND)
 #include <nand.h>
 #include <linux/mtd/mtd.h>
diff --git a/board/freescale/m5373evb/nand.c b/board/freescale/m5373evb/nand.c
index a96a59991f52..4b0354029d41 100644
--- a/board/freescale/m5373evb/nand.c
+++ b/board/freescale/m5373evb/nand.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/immap.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_CMD_NAND)
 #include <nand.h>
 #include <linux/mtd/mtd.h>
diff --git a/board/freescale/mpc8308rdb/mpc8308rdb.c b/board/freescale/mpc8308rdb/mpc8308rdb.c
index 93c7200509c2..0cf1c08f29ee 100644
--- a/board/freescale/mpc8308rdb/mpc8308rdb.c
+++ b/board/freescale/mpc8308rdb/mpc8308rdb.c
@@ -20,8 +20,6 @@
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_mpc83xx_serdes.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * The following are used to control the SPI chip selects for the SPI command.
  */
diff --git a/board/freescale/mpc832xemds/pci.c b/board/freescale/mpc832xemds/pci.c
index e8b2b11d88b0..274bf9384ef7 100644
--- a/board/freescale/mpc832xemds/pci.c
+++ b/board/freescale/mpc832xemds/pci.c
@@ -16,8 +16,6 @@
 #include <asm/fsl_i2c.h>
 #include "../common/pq-mds-pib.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/freescale/mpc8349emds/pci.c b/board/freescale/mpc8349emds/pci.c
index 9f7324feddfe..311517f75ba2 100644
--- a/board/freescale/mpc8349emds/pci.c
+++ b/board/freescale/mpc8349emds/pci.c
@@ -12,8 +12,6 @@
 #include <i2c.h>
 #include <asm/fsl_i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/freescale/mpc8349itx/pci.c b/board/freescale/mpc8349itx/pci.c
index afc9df0923b7..adb0ed808174 100644
--- a/board/freescale/mpc8349itx/pci.c
+++ b/board/freescale/mpc8349itx/pci.c
@@ -13,8 +13,6 @@
 #include <i2c.h>
 #include <asm/fsl_i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c
index 4e3c824e7500..89acea33d110 100644
--- a/board/freescale/p1022ds/p1022ds.c
+++ b/board/freescale/p1022ds/p1022ds.c
@@ -28,8 +28,6 @@
 
 #include "../common/ngpixis.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_early_init_f(void)
 {
 	ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
diff --git a/board/freescale/p1023rdb/ddr.c b/board/freescale/p1023rdb/ddr.c
index d587df527ab1..191a82441107 100644
--- a/board/freescale/p1023rdb/ddr.c
+++ b/board/freescale/p1023rdb/ddr.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/fsl_law.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* CONFIG_SYS_DDR_RAW_TIMING */
 /*
  * Hynix H5TQ1G83TFR-H9C
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index bdbe5e70270e..ee93e545ded2 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -21,8 +21,6 @@
 #include "gsc.h"
 #include "common.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define RTT_NOM_120OHM /* use 120ohm Rtt_nom vs 60ohm (lower power) */
 #define GSC_EEPROM_DDR_SIZE	0x2B	/* enum (512,1024,2048) MB */
 #define GSC_EEPROM_DDR_WIDTH	0x2D	/* enum (32,64) bit */
diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c
index ed5cb332794e..d1ed273a0831 100644
--- a/board/gdsys/mpc8308/hrcon.c
+++ b/board/gdsys/mpc8308/hrcon.c
@@ -33,8 +33,6 @@
 
 #include <miiphy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MAX_MUX_CHANNELS 2
 
 enum {
diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c
index c8ea8a4ae0a8..c3b09b29d592 100644
--- a/board/gdsys/mpc8308/strider.c
+++ b/board/gdsys/mpc8308/strider.c
@@ -36,8 +36,6 @@
 
 #include <miiphy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MAX_MUX_CHANNELS 2
 
 enum {
diff --git a/board/gdsys/p1022/controlcenterd.c b/board/gdsys/p1022/controlcenterd.c
index b5f445a943df..7bdc924a89d5 100644
--- a/board/gdsys/p1022/controlcenterd.c
+++ b/board/gdsys/p1022/controlcenterd.c
@@ -44,8 +44,6 @@
 #include "../common/dp501.h"
 #include "controlcenterd-id.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	HWVER_100 = 0,
 	HWVER_110 = 1,
diff --git a/board/geekbuying/geekbox/geekbox.c b/board/geekbuying/geekbox/geekbox.c
index 88b67f9d5f31..b638186e8f5a 100644
--- a/board/geekbuying/geekbox/geekbox.c
+++ b/board/geekbuying/geekbox/geekbox.c
@@ -6,8 +6,6 @@
 
 #include <common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_init(void)
 {
 	return 0;
diff --git a/board/intel/edison/edison.c b/board/intel/edison/edison.c
index 4b1e6d0f471f..e3334f843878 100644
--- a/board/intel/edison/edison.c
+++ b/board/intel/edison/edison.c
@@ -17,8 +17,6 @@
 #include <asm/scu.h>
 #include <asm/u-boot-x86.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct dwc3_device dwc3_device_data = {
 	.maximum_speed = USB_SPEED_HIGH,
 	.base = CONFIG_SYS_USB_OTG_BASE,
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index d70b1d1393c3..bc229e872fa7 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -24,8 +24,6 @@
 #include "../common/common.h"
 #include "kmp204x.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
 
 int checkboard(void)
diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c
index b4a68da88f23..0dd0b6eec24b 100644
--- a/board/kosagi/novena/novena_spl.c
+++ b/board/kosagi/novena/novena_spl.c
@@ -27,8 +27,6 @@
 
 #include "novena.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define UART_PAD_CTRL						\
 	(PAD_CTL_PKE | PAD_CTL_PUE |				\
 	PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |		\
diff --git a/board/liebherr/mccmon6/spl.c b/board/liebherr/mccmon6/spl.c
index 196da46df9a0..61d12ba239b4 100644
--- a/board/liebherr/mccmon6/spl.c
+++ b/board/liebherr/mccmon6/spl.c
@@ -20,8 +20,6 @@
 #include <asm/arch/sys_proto.h>
 #include <spl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_SPL_BUILD)
 #include <asm/arch/mx6-ddr.h>
 /*
diff --git a/board/mpc8308_p1m/mpc8308_p1m.c b/board/mpc8308_p1m/mpc8308_p1m.c
index e96645f82dc5..a5a036f9cff4 100644
--- a/board/mpc8308_p1m/mpc8308_p1m.c
+++ b/board/mpc8308_p1m/mpc8308_p1m.c
@@ -16,8 +16,6 @@
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_mpc83xx_serdes.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int checkboard(void)
 {
 	printf("Board: MPC8308 P1M\n");
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c
index c20da29a98ad..31695d4a0fc4 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -15,8 +15,6 @@
 
 #include "pinmux-config-jetson-tk1.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Routine: pinmux_init
  * Description: Do individual peripheral pinmux configs
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 7b44a37103b3..102f9805fa2b 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -32,8 +32,6 @@
 #include <asm/ehci-omap.h>
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define TWL4030_I2C_BUS			0
 #define EXPANSION_EEPROM_I2C_BUS	2
 #define EXPANSION_EEPROM_I2C_ADDRESS	0x51
diff --git a/board/qca/ap121/ap121.c b/board/qca/ap121/ap121.c
index ac9be35dd9b9..56ae8e1ea4d0 100644
--- a/board/qca/ap121/ap121.c
+++ b/board/qca/ap121/ap121.c
@@ -13,8 +13,6 @@
 #include <mach/ath79.h>
 #include <debug_uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
diff --git a/board/qca/ap143/ap143.c b/board/qca/ap143/ap143.c
index 19b55acbf2d0..1ebd36225659 100644
--- a/board/qca/ap143/ap143.c
+++ b/board/qca/ap143/ap143.c
@@ -13,8 +13,6 @@
 #include <mach/ath79.h>
 #include <debug_uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
diff --git a/board/rockchip/evb_rk3036/evb_rk3036.c b/board/rockchip/evb_rk3036/evb_rk3036.c
index 288370a80b13..86187e37c2d8 100644
--- a/board/rockchip/evb_rk3036/evb_rk3036.c
+++ b/board/rockchip/evb_rk3036/evb_rk3036.c
@@ -10,8 +10,6 @@
 #include <asm/arch/uart.h>
 #include <asm/arch/sdram_rk3036.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void get_ddr_config(struct rk3036_ddr_config *config)
 {
 	/* K4B4G1646Q config */
diff --git a/board/rockchip/evb_rk3229/evb_rk3229.c b/board/rockchip/evb_rk3229/evb_rk3229.c
index a9a3a40ce820..5fe1868f61e4 100644
--- a/board/rockchip/evb_rk3229/evb_rk3229.c
+++ b/board/rockchip/evb_rk3229/evb_rk3229.c
@@ -9,4 +9,3 @@
 #include <asm/io.h>
 #include <asm/arch/uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index 502dec325fc1..0f9267b68e41 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -12,8 +12,6 @@
 #include <power/regulator.h>
 #include <spl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_init(void)
 {
 	struct udevice *pinctrl, *regulator;
diff --git a/board/rockchip/kylin_rk3036/kylin_rk3036.c b/board/rockchip/kylin_rk3036/kylin_rk3036.c
index 91349948740b..e1af124e3258 100644
--- a/board/rockchip/kylin_rk3036/kylin_rk3036.c
+++ b/board/rockchip/kylin_rk3036/kylin_rk3036.c
@@ -11,8 +11,6 @@
 #include <asm/arch/sdram_rk3036.h>
 #include <asm/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void get_ddr_config(struct rk3036_ddr_config *config)
 {
 	/* K4B4G1646Q config */
diff --git a/board/rockchip/sheep_rk3368/sheep_rk3368.c b/board/rockchip/sheep_rk3368/sheep_rk3368.c
index 17adb02469de..348818cbf0f1 100644
--- a/board/rockchip/sheep_rk3368/sheep_rk3368.c
+++ b/board/rockchip/sheep_rk3368/sheep_rk3368.c
@@ -9,8 +9,6 @@
 #include <asm/arch/grf_rk3368.h>
 #include <syscon.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int mach_cpu_init(void)
 {
 	return 0;
diff --git a/board/samsung/espresso7420/espresso7420.c b/board/samsung/espresso7420/espresso7420.c
index 04a83bc07d79..1ed868001008 100644
--- a/board/samsung/espresso7420/espresso7420.c
+++ b/board/samsung/espresso7420/espresso7420.c
@@ -8,8 +8,6 @@
 
 #include <common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int exynos_init(void)
 {
 	return 0;
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 99a2facd1ee7..3d27a9433bf0 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -13,8 +13,6 @@
 #include <asm/arch/pinmux.h>
 #include <usb.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 u32 get_board_rev(void)
 {
 	return 0;
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index f0913383b97b..781b57996755 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -30,8 +30,6 @@
 
 #include "setup.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned int board_rev;
 
 #ifdef CONFIG_REVISION_TAG
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index f9acbd357121..6abafeb1b3ed 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -24,8 +24,6 @@
 #include <usb/dwc2_udc.h>
 #include <usb_mass_storage.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static unsigned int board_rev = -1;
 
 static inline u32 get_model_rev(void);
diff --git a/board/sbc8349/pci.c b/board/sbc8349/pci.c
index e792fe313d08..9b1560bd7777 100644
--- a/board/sbc8349/pci.c
+++ b/board/sbc8349/pci.c
@@ -16,8 +16,6 @@
 #include <i2c.h>
 #include <asm/fsl_i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/sbc8548/sbc8548.c b/board/sbc8548/sbc8548.c
index 1a48a6c89f24..566777cf7fb6 100644
--- a/board/sbc8548/sbc8548.c
+++ b/board/sbc8548/sbc8548.c
@@ -24,8 +24,6 @@
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void local_bus_init(void);
 
 int board_early_init_f (void)
diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c
index c705b5ab0f6f..c7a6a7aaa385 100644
--- a/board/siemens/draco/board.c
+++ b/board/siemens/draco/board.c
@@ -36,8 +36,6 @@
 #include "../common/factoryset.h"
 #include <nand.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SPL_BUILD
 static struct draco_baseboard_id __attribute__((section(".data"))) settings;
 
diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c
index ab54e58861a4..7339135050fc 100644
--- a/board/siemens/pxm2/board.c
+++ b/board/siemens/pxm2/board.c
@@ -39,8 +39,6 @@
 #include <nand.h>
 #include <bmp_layout.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SPL_BUILD
 static void board_init_ddr(void)
 {
diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c
index 2a97414bafa5..ed5cde3a0b7f 100644
--- a/board/siemens/rut/board.c
+++ b/board/siemens/rut/board.c
@@ -35,8 +35,6 @@
 #include "../common/factoryset.h"
 #include "../../../drivers/video/da8xx-fb.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Read header information from EEPROM into global structure.
  */
diff --git a/board/theobroma-systems/lion_rk3368/lion_rk3368.c b/board/theobroma-systems/lion_rk3368/lion_rk3368.c
index 73b14883c317..c8fe4d5678a1 100644
--- a/board/theobroma-systems/lion_rk3368/lion_rk3368.c
+++ b/board/theobroma-systems/lion_rk3368/lion_rk3368.c
@@ -12,8 +12,6 @@
 #include <asm/arch/timer.h>
 #include <syscon.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int mach_cpu_init(void)
 {
 	return 0;
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 1d8b605b693e..a5371fc0783e 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -24,8 +24,6 @@
 #include <power/regulator.h>
 #include <u-boot/sha256.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int board_init(void)
 {
 	int ret;
diff --git a/board/ti/ks2_evm/board_k2e.c b/board/ti/ks2_evm/board_k2e.c
index 6c77d915e5b9..e96636b6ecb5 100644
--- a/board/ti/ks2_evm/board_k2e.c
+++ b/board/ti/ks2_evm/board_k2e.c
@@ -12,8 +12,6 @@
 #include <asm/arch/hardware.h>
 #include <asm/ti-common/keystone_net.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned int get_external_clk(u32 clk)
 {
 	unsigned int clk_freq;
diff --git a/board/ti/ks2_evm/board_k2hk.c b/board/ti/ks2_evm/board_k2hk.c
index e99e6355b477..d61f72921ae4 100644
--- a/board/ti/ks2_evm/board_k2hk.c
+++ b/board/ti/ks2_evm/board_k2hk.c
@@ -12,8 +12,6 @@
 #include <asm/arch/hardware.h>
 #include <asm/ti-common/keystone_net.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned int external_clk[ext_clk_count] = {
 	[sys_clk]	=	122880000,
 	[alt_core_clk]	=	125000000,
diff --git a/board/ti/ks2_evm/board_k2l.c b/board/ti/ks2_evm/board_k2l.c
index c65f33131da0..b114c246905a 100644
--- a/board/ti/ks2_evm/board_k2l.c
+++ b/board/ti/ks2_evm/board_k2l.c
@@ -12,8 +12,6 @@
 #include <asm/arch/hardware.h>
 #include <asm/ti-common/keystone_net.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned int get_external_clk(u32 clk)
 {
 	unsigned int clk_freq;
diff --git a/board/toradex/colibri_vf/dcu.c b/board/toradex/colibri_vf/dcu.c
index 3fa6a763d819..c0add005eb1b 100644
--- a/board/toradex/colibri_vf/dcu.c
+++ b/board/toradex/colibri_vf/dcu.c
@@ -11,8 +11,6 @@
 #include <fsl_dcu_fb.h>
 #include "div64.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 {
 	struct ccm_reg *ccm = (struct ccm_reg *)CCM_BASE_ADDR;
diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
index 0f59648b1fed..ac265579e831 100644
--- a/board/tplink/wdr4300/wdr4300.c
+++ b/board/tplink/wdr4300/wdr4300.c
@@ -13,8 +13,6 @@
 #include <mach/ddr.h>
 #include <debug_uart.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_USB
 static void wdr4300_usb_start(void)
 {
diff --git a/board/tqc/tqm834x/pci.c b/board/tqc/tqm834x/pci.c
index 1acec849683d..43ecdf149541 100644
--- a/board/tqc/tqm834x/pci.c
+++ b/board/tqc/tqm834x/pci.c
@@ -14,8 +14,6 @@
 #include <i2c.h>
 #include <asm/fsl_i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct pci_region pci1_regions[] = {
 	{
 		bus_start: CONFIG_SYS_PCI1_MEM_BASE,
diff --git a/board/tqc/tqma6/tqma6_mba6.c b/board/tqc/tqma6/tqma6_mba6.c
index be4c132fbe0d..37ad916853d2 100644
--- a/board/tqc/tqma6/tqma6_mba6.c
+++ b/board/tqc/tqma6/tqma6_mba6.c
@@ -30,8 +30,6 @@
 
 #include "tqma6_bb.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
 	PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
 
diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c
index 694055bd2e51..c862ed15d9f8 100644
--- a/board/udoo/udoo_spl.c
+++ b/board/udoo/udoo_spl.c
@@ -21,8 +21,6 @@
 #include <asm/arch/sys_proto.h>
 #include <spl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_SPL_BUILD)
 #include <asm/arch/mx6-ddr.h>
 
diff --git a/board/varisys/cyrus/cyrus.c b/board/varisys/cyrus/cyrus.c
index f4586272b1f2..1daea066a324 100644
--- a/board/varisys/cyrus/cyrus.c
+++ b/board/varisys/cyrus/cyrus.c
@@ -22,8 +22,6 @@
 #include "cyrus.h"
 #include "../common/eeprom.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define GPIO_OPENDRAIN 0x30000000
 #define GPIO_DIR       0x3c000004
 #define GPIO_INITIAL   0x30000000
diff --git a/board/wandboard/spl.c b/board/wandboard/spl.c
index 5b9622e75ec4..d03ab4394227 100644
--- a/board/wandboard/spl.c
+++ b/board/wandboard/spl.c
@@ -20,8 +20,6 @@
 #include <asm/arch/sys_proto.h>
 #include <spl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_SPL_BUILD)
 #include <asm/arch/mx6-ddr.h>
 /*
diff --git a/board/xes/xpedite537x/xpedite537x.c b/board/xes/xpedite537x/xpedite537x.c
index ae606f5ba708..785533d7f2c4 100644
--- a/board/xes/xpedite537x/xpedite537x.c
+++ b/board/xes/xpedite537x/xpedite537x.c
@@ -16,8 +16,6 @@
 #include <fdt_support.h>
 #include <pca953x.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 extern void ft_board_pci_setup(void *blob, bd_t *bd);
 
 static void flash_cs_fixup(void)
diff --git a/board/xes/xpedite550x/xpedite550x.c b/board/xes/xpedite550x/xpedite550x.c
index c90bb89dae0c..080197c1c6d5 100644
--- a/board/xes/xpedite550x/xpedite550x.c
+++ b/board/xes/xpedite550x/xpedite550x.c
@@ -16,8 +16,6 @@
 #include <fdt_support.h>
 #include <pca953x.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 extern void ft_board_pci_setup(void *blob, bd_t *bd);
 
 static void flash_cs_fixup(void)
diff --git a/cmd/aes.c b/cmd/aes.c
index 9d1a740beead..23bc88038f58 100644
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -14,8 +14,6 @@
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * do_aes() - Handle the "aes" command-line command
  * @cmdtp:	Command data struct pointer
diff --git a/cmd/blob.c b/cmd/blob.c
index bdd4cfda0b30..ae06ba70aed4 100644
--- a/cmd/blob.c
+++ b/cmd/blob.c
@@ -12,8 +12,6 @@
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * blob_decap() - Decapsulate the data as a blob
  * @key_mod:	- Pointer to key modifier/key
diff --git a/cmd/booti.c b/cmd/booti.c
index fff936976355..f1e607ae0ddf 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -14,8 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/sizes.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Image booting support
  */
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index af0b4eee7838..c1e28508875c 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -17,8 +17,6 @@
 /* Note: depends on enum ec_current_image */
 static const char * const ec_current_image_name[] = {"unknown", "RO", "RW"};
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * Decode a flash region parameter
  *
diff --git a/cmd/i2c.c b/cmd/i2c.c
index bfddf8be1b98..8eca6fffaad4 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -79,8 +79,6 @@
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
diff --git a/common/cros_ec.c b/common/cros_ec.c
index 7a4f785bc836..1a0caf80dde0 100644
--- a/common/cros_ec.c
+++ b/common/cros_ec.c
@@ -13,8 +13,6 @@
 #include <dm.h>
 #include <errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct cros_ec_dev *board_get_cros_ec_dev(void)
 {
 	struct udevice *dev;
diff --git a/common/lynxkdi.c b/common/lynxkdi.c
index f2b95ac8d37d..1c8e122c3290 100644
--- a/common/lynxkdi.c
+++ b/common/lynxkdi.c
@@ -20,6 +20,4 @@
 
 #include <lynxkdi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #error "Lynx KDI support not implemented for configured CPU"
diff --git a/common/main.c b/common/main.c
index 6a1159879edc..66a03a156eb6 100644
--- a/common/main.c
+++ b/common/main.c
@@ -13,8 +13,6 @@
 #include <console.h>
 #include <version.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Board-specific Platform code can reimplement show_boot_progress () if needed
  */
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 4aa0b2caf390..e780b82fd2bf 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -16,8 +16,6 @@
 #include <mmc.h>
 #include <image.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int mmc_load_legacy(struct spl_image_info *spl_image, struct mmc *mmc,
 			   ulong sector, struct image_header *header)
 {
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
index 50d02478d519..33f3b74a9709 100644
--- a/common/spl/spl_net.c
+++ b/common/spl/spl_net.c
@@ -13,8 +13,6 @@
 #include <net.h>
 #include <linux/libfdt.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USB_ETHER)
 static ulong spl_net_load_read(struct spl_load_info *load, ulong sector,
 			       ulong count, void *buf)
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index bac11f64f13c..357f8e5bd960 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -18,8 +18,6 @@
 #include <fat.h>
 #include <image.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int spl_sata_load_image(struct spl_image_info *spl_image,
 			       struct spl_boot_device *bootdev)
 {
diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
index 0c4603a3db3b..69390edcbaeb 100644
--- a/common/spl/spl_sdp.c
+++ b/common/spl/spl_sdp.c
@@ -11,8 +11,6 @@
 #include <g_dnl.h>
 #include <sdp.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int spl_sdp_load_image(struct spl_image_info *spl_image,
 			      struct spl_boot_device *bootdev)
 {
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 567a4505056a..5aac10bd573c 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -16,8 +16,6 @@
 #include <usb.h>
 #include <fat.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_USB_STORAGE
 static int usb_stor_curr_dev = -1; /* current device */
 #endif
diff --git a/common/usb_hub.c b/common/usb_hub.c
index b46dfa16ccf1..0729a20df483 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -37,8 +37,6 @@
 #endif
 #include <asm/unaligned.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #include <usb.h>
 
 #define USB_BUFSIZ	512
diff --git a/disk/part.c b/disk/part.c
index 44ef14dc54f0..e31aca4877fb 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -24,8 +24,6 @@
 /* Check all partition types */
 #define PART_TYPE_ALL		-1
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct part_driver *part_driver_lookup_type(struct blk_desc *dev_desc)
 {
 	struct part_driver *drv =
diff --git a/drivers/adc/adc-uclass.c b/drivers/adc/adc-uclass.c
index a4c20f4d3520..7e9ad85c3c09 100644
--- a/drivers/adc/adc-uclass.c
+++ b/drivers/adc/adc-uclass.c
@@ -14,8 +14,6 @@
 #include <adc.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define ADC_UCLASS_PLATDATA_SIZE	sizeof(struct adc_uclass_platdata)
 #define CHECK_NUMBER			true
 #define CHECK_MASK			(!CHECK_NUMBER)
diff --git a/drivers/ata/dwc_ahci.c b/drivers/ata/dwc_ahci.c
index 6c7371e3eddd..bb45214fc243 100644
--- a/drivers/ata/dwc_ahci.c
+++ b/drivers/ata/dwc_ahci.c
@@ -18,8 +18,6 @@
 #include <asm/io.h>
 #include <generic-phy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct dwc_ahci_priv {
 	void *base;
 	void *wrapper_base;
diff --git a/drivers/clk/at91/clk-plladiv.c b/drivers/clk/at91/clk-plladiv.c
index 0599d2893b5a..520fd13f63a4 100644
--- a/drivers/clk/at91/clk-plladiv.c
+++ b/drivers/clk/at91/clk-plladiv.c
@@ -12,8 +12,6 @@
 #include <mach/at91_pmc.h>
 #include "pmc.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int at91_plladiv_clk_enable(struct clk *clk)
 {
 	return 0;
diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c
index 875bf293f9cd..54970b949fac 100644
--- a/drivers/clk/at91/clk-utmi.c
+++ b/drivers/clk/at91/clk-utmi.c
@@ -14,8 +14,6 @@
 #include <mach/sama5_sfr.h>
 #include "pmc.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * The purpose of this clock is to generate a 480 MHz signal. A different
  * rate can't be configured.
diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 0c0881237cba..de8013e40a0d 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <dm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct udevice_id at91_sckc_match[] = {
 	{ .compatible = "atmel,at91sam9x5-sckc" },
 	{}
diff --git a/drivers/clk/clk-hsdk-cgu.c b/drivers/clk/clk-hsdk-cgu.c
index 4362d583cb4f..56ef08c032b9 100644
--- a/drivers/clk/clk-hsdk-cgu.c
+++ b/drivers/clk/clk-hsdk-cgu.c
@@ -59,8 +59,6 @@
  *                     |---------------------------->
  */
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define CGU_ARC_IDIV		0x080
 #define CGU_TUN_IDIV_TUN	0x380
 #define CGU_TUN_IDIV_ROM	0x390
diff --git a/drivers/clk/clk_stm32h7.c b/drivers/clk/clk_stm32h7.c
index 9ee2e2e999a2..5516b486003a 100644
--- a/drivers/clk/clk_stm32h7.c
+++ b/drivers/clk/clk_stm32h7.c
@@ -15,8 +15,6 @@
 
 #include <dt-bindings/clock/stm32h7-clks.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* RCC CR specific definitions */
 #define RCC_CR_HSION			BIT(0)
 #define RCC_CR_HSIRDY			BIT(2)
diff --git a/drivers/clk/clk_zynqmp.c b/drivers/clk/clk_zynqmp.c
index d0d6c898bc58..3f249752fb6b 100644
--- a/drivers/clk/clk_zynqmp.c
+++ b/drivers/clk/clk_zynqmp.c
@@ -13,8 +13,6 @@
 #include <asm/arch/sys_proto.h>
 #include <dm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const resource_size_t zynqmp_crf_apb_clkc_base = 0xfd1a0020;
 static const resource_size_t zynqmp_crl_apb_clkc_base = 0xff5e0020;
 
diff --git a/drivers/clk/exynos/clk-exynos7420.c b/drivers/clk/exynos/clk-exynos7420.c
index e34945dbbcc0..832b2d8765eb 100644
--- a/drivers/clk/exynos/clk-exynos7420.c
+++ b/drivers/clk/exynos/clk-exynos7420.c
@@ -14,8 +14,6 @@
 #include <dt-bindings/clock/exynos7420-clk.h>
 #include "clk-pll.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DIVIDER(reg, shift, mask)	\
 	(((readl(reg) >> shift) & mask) + 1)
 
diff --git a/drivers/clk/rockchip/clk_rk3036.c b/drivers/clk/rockchip/clk_rk3036.c
index 560222b96c44..0594ee6e8941 100644
--- a/drivers/clk/rockchip/clk_rk3036.c
+++ b/drivers/clk/rockchip/clk_rk3036.c
@@ -17,8 +17,6 @@
 #include <dt-bindings/clock/rk3036-cru.h>
 #include <linux/log2.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	VCO_MAX_HZ	= 2400U * 1000000,
 	VCO_MIN_HZ	= 600 * 1000000,
diff --git a/drivers/clk/rockchip/clk_rk3128.c b/drivers/clk/rockchip/clk_rk3128.c
index 132d50dda387..3382acaab93e 100644
--- a/drivers/clk/rockchip/clk_rk3128.c
+++ b/drivers/clk/rockchip/clk_rk3128.c
@@ -18,8 +18,6 @@
 #include <dt-bindings/clock/rk3128-cru.h>
 #include <linux/log2.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	VCO_MAX_HZ	= 2400U * 1000000,
 	VCO_MIN_HZ	= 600 * 1000000,
diff --git a/drivers/clk/rockchip/clk_rk3188.c b/drivers/clk/rockchip/clk_rk3188.c
index cfe6abe47010..e6bf04423663 100644
--- a/drivers/clk/rockchip/clk_rk3188.c
+++ b/drivers/clk/rockchip/clk_rk3188.c
@@ -23,8 +23,6 @@
 #include <dm/uclass-internal.h>
 #include <linux/log2.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum rk3188_clk_type {
 	RK3188_CRU,
 	RK3188A_CRU,
diff --git a/drivers/clk/rockchip/clk_rk322x.c b/drivers/clk/rockchip/clk_rk322x.c
index ebcab73002d8..91f5208aa4f7 100644
--- a/drivers/clk/rockchip/clk_rk322x.c
+++ b/drivers/clk/rockchip/clk_rk322x.c
@@ -17,8 +17,6 @@
 #include <dt-bindings/clock/rk3228-cru.h>
 #include <linux/log2.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	VCO_MAX_HZ	= 3200U * 1000000,
 	VCO_MIN_HZ	= 800 * 1000000,
diff --git a/drivers/clk/rockchip/clk_rk3328.c b/drivers/clk/rockchip/clk_rk3328.c
index 046b4e4c2ff6..f9a1e969a859 100644
--- a/drivers/clk/rockchip/clk_rk3328.c
+++ b/drivers/clk/rockchip/clk_rk3328.c
@@ -18,8 +18,6 @@
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3328-cru.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct pll_div {
 	u32 refdiv;
 	u32 fbdiv;
diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c
index ea00f1fc9ccc..e5a14ba47294 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -20,8 +20,6 @@
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3368-cru.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
 struct rk3368_clk_plat {
 	struct dtd_rockchip_rk3368_cru dtd;
diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index fb74c441ff9f..86d8ca55bf93 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -20,8 +20,6 @@
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3399-cru.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
 struct rk3399_clk_plat {
 	struct dtd_rockchip_rk3399_cru dtd;
diff --git a/drivers/clk/rockchip/clk_rv1108.c b/drivers/clk/rockchip/clk_rv1108.c
index 958fc7859264..8ffe23e91d1b 100644
--- a/drivers/clk/rockchip/clk_rv1108.c
+++ b/drivers/clk/rockchip/clk_rv1108.c
@@ -17,8 +17,6 @@
 #include <dm/lists.h>
 #include <dt-bindings/clock/rv1108-cru.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	VCO_MAX_HZ	= 2400U * 1000000,
 	VCO_MIN_HZ	= 600 * 1000000,
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c
index 73e4853939e0..e47377a0fe7e 100644
--- a/drivers/cpu/cpu-uclass.c
+++ b/drivers/cpu/cpu-uclass.c
@@ -12,8 +12,6 @@
 #include <dm/lists.h>
 #include <dm/root.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int cpu_get_desc(struct udevice *dev, char *buf, int size)
 {
 	struct cpu_ops *ops = cpu_get_ops(dev);
diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
index e74c5b039ece..0f688f9bcf7e 100644
--- a/drivers/ddr/altera/sdram.c
+++ b/drivers/ddr/altera/sdram.c
@@ -12,8 +12,6 @@
 #include <asm/arch/system_manager.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sdram_prot_rule {
 	u32	sdram_start;	/* SDRAM start address */
 	u32	sdram_end;	/* SDRAM end address */
diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c
index d0a7b3f10763..61bbce92d46f 100644
--- a/drivers/ddr/fsl/main.c
+++ b/drivers/ddr/fsl/main.c
@@ -15,8 +15,6 @@
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY is the physical address from the view
  * of DDR controllers. It is the same as CONFIG_SYS_DDR_SDRAM_BASE for
diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c
index 3d0ce22fbc21..7f92d24bc188 100644
--- a/drivers/dma/dma-uclass.c
+++ b/drivers/dma/dma-uclass.c
@@ -16,8 +16,6 @@
 #include <dm/device-internal.h>
 #include <errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int dma_get_device(u32 transfer_type, struct udevice **devp)
 {
 	struct udevice *dev;
diff --git a/drivers/fpga/socfpga.c b/drivers/fpga/socfpga.c
index 6e14ebd26d5b..aef796c741ca 100644
--- a/drivers/fpga/socfpga.c
+++ b/drivers/fpga/socfpga.c
@@ -12,8 +12,6 @@
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Timeout count */
 #define FPGA_TIMEOUT_CNT		0x1000000
 
diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c
index d5763965ddc2..ed25752af728 100644
--- a/drivers/fpga/socfpga_arria10.c
+++ b/drivers/fpga/socfpga_arria10.c
@@ -23,8 +23,6 @@
 #define FPGA_TIMEOUT_MSEC	1000  /* timeout in ms */
 #define FPGA_TIMEOUT_CNT	0x1000000
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct socfpga_fpga_manager *fpga_manager_base =
 		(void *)SOCFPGA_FPGAMGRREGS_ADDRESS;
 
diff --git a/drivers/fpga/socfpga_gen5.c b/drivers/fpga/socfpga_gen5.c
index 3dfb0303d36d..88ae035e29d9 100644
--- a/drivers/fpga/socfpga_gen5.c
+++ b/drivers/fpga/socfpga_gen5.c
@@ -12,8 +12,6 @@
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define FPGA_TIMEOUT_CNT	0x1000000
 
 static struct socfpga_fpga_manager *fpgamgr_regs =
diff --git a/drivers/gpio/hsdk-creg-gpio.c b/drivers/gpio/hsdk-creg-gpio.c
index 8ca807a18f47..084a2da65224 100644
--- a/drivers/gpio/hsdk-creg-gpio.c
+++ b/drivers/gpio/hsdk-creg-gpio.c
@@ -16,8 +16,6 @@
 #include <errno.h>
 #include <linux/printk.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define HSDK_CREG_MAX_GPIO	8
 
 #define GPIO_ACTIVATE		0x2
diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c
index 7825714e8003..0de74cb67d96 100644
--- a/drivers/gpio/imx_rgpio2p.c
+++ b/drivers/gpio/imx_rgpio2p.c
@@ -14,8 +14,6 @@
 #include <asm/io.h>
 #include <malloc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum imx_rgpio2p_direction {
 	IMX_RGPIO2P_DIRECTION_IN,
 	IMX_RGPIO2P_DIRECTION_OUT,
diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c
index 85dea14c519b..79942ff76a36 100644
--- a/drivers/gpio/mvebu_gpio.c
+++ b/drivers/gpio/mvebu_gpio.c
@@ -10,8 +10,6 @@
 #include <asm/io.h>
 #include <errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MVEBU_GPIOS_PER_BANK	32
 
 struct mvebu_gpio_regs {
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index d0e365a54b01..c6427d7252bf 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -158,8 +158,6 @@ int gpio_direction_output(unsigned gpio, int value)
 
 #ifdef CONFIG_DM_GPIO
 #include <fdtdec.h>
-DECLARE_GLOBAL_DATA_PTR;
-
 static int mxc_gpio_is_output(struct gpio_regs *regs, int offset)
 {
 	u32 val;
diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/pm8916_gpio.c
index 42f068ecb651..3b6de9d71524 100644
--- a/drivers/gpio/pm8916_gpio.c
+++ b/drivers/gpio/pm8916_gpio.c
@@ -14,8 +14,6 @@
 #include <asm/gpio.h>
 #include <linux/bitops.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Register offset for each gpio */
 #define REG_OFFSET(x)          ((x) * 0x100)
 
diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 2a18f328576a..02f2a245b8ea 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -11,8 +11,6 @@
 #include <dm/of.h>
 #include <dt-bindings/gpio/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Flags for each GPIO */
 #define GPIOF_OUTPUT	(1 << 0)	/* Currently set as an output */
 #define GPIOF_HIGH	(1 << 1)	/* Currently set high */
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index ea6f3593b9e0..706afce993b4 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -21,8 +21,6 @@
 #include <dm/device-internal.h>
 #include <dt-bindings/gpio/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define SUNXI_GPIOS_PER_BANK	SUNXI_GPIO_A_NR
 
 struct sunxi_gpio_platdata {
diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c
index deb59e8b3202..6d610ef118d6 100644
--- a/drivers/gpio/tegra186_gpio.c
+++ b/drivers/gpio/tegra186_gpio.c
@@ -17,8 +17,6 @@
 #include <dt-bindings/gpio/gpio.h>
 #include "tegra186_gpio_priv.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct tegra186_gpio_port_data {
 	const char *name;
 	uint32_t offset;
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 496558315856..faf950e2d3f2 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -23,8 +23,6 @@
 #include <dm/device-internal.h>
 #include <dt-bindings/gpio/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const int CONFIG_SFIO = 0;
 static const int CONFIG_GPIO = 1;
 static const int DIRECTION_INPUT = 0;
diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c
index 7ed0c10f72ee..d6329715db71 100644
--- a/drivers/i2c/ast_i2c.c
+++ b/drivers/i2c/ast_i2c.c
@@ -22,8 +22,6 @@
 
 #define HIGHSPEED_TTIMEOUT		3
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Device private data
  */
diff --git a/drivers/i2c/i2c-cdns.c b/drivers/i2c/i2c-cdns.c
index 8265ce32106b..a977a7fcbd37 100644
--- a/drivers/i2c/i2c-cdns.c
+++ b/drivers/i2c/i2c-cdns.c
@@ -19,8 +19,6 @@
 #include <mapmem.h>
 #include <wait_bit.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* i2c register set */
 struct cdns_i2c_regs {
 	u32 control;
diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index 32d7809dba65..937410fa2c2c 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -15,7 +15,6 @@
 #include <fdtdec.h>
 #include <i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
 #define LPI2C_FIFO_SIZE 4
 #define LPI2C_TIMEOUT_MS 100
 
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 5d3381514621..0759585c9e1a 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -47,8 +47,6 @@
 
 #include "omap24xx_i2c.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define I2C_TIMEOUT	1000
 
 /* Absolutely safe for status update at 100 kHz I2C: */
diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c
index 332280c220e7..a09adcdc1506 100644
--- a/drivers/i2c/rk_i2c.c
+++ b/drivers/i2c/rk_i2c.c
@@ -19,8 +19,6 @@
 #include <dm/pinctrl.h>
 #include <linux/sizes.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* i2c timerout */
 #define I2C_TIMEOUT_MS		100
 #define I2C_RETRY_COUNT		3
diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c
index f5978fda29b1..6e02dac2ec17 100644
--- a/drivers/i2c/sandbox_i2c.c
+++ b/drivers/i2c/sandbox_i2c.c
@@ -14,8 +14,6 @@
 #include <dm/lists.h>
 #include <dm/device-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_i2c_priv {
 	bool test_mode;
 };
diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c
index 81f061aecd8d..5ca0b7d49710 100644
--- a/drivers/i2c/stm32f7_i2c.c
+++ b/drivers/i2c/stm32f7_i2c.c
@@ -244,8 +244,6 @@ static struct stm32_i2c_setup stm32f7_setup = {
 	.analog_filter = STM32_I2C_ANALOG_FILTER_ENABLE,
 };
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int stm32_i2c_check_device_busy(struct stm32_i2c_priv *i2c_priv)
 {
 	struct stm32_i2c_regs *regs = i2c_priv->regs;
diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c
index 7d23e51b69d2..2d6cd0286e1a 100644
--- a/drivers/i2c/tegra_i2c.c
+++ b/drivers/i2c/tegra_i2c.c
@@ -20,8 +20,6 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch-tegra/tegra_i2c.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum i2c_type {
 	TYPE_114,
 	TYPE_STD,
diff --git a/drivers/input/cros_ec_keyb.c b/drivers/input/cros_ec_keyb.c
index 6fa35a63ddcf..f0bf139ae190 100644
--- a/drivers/input/cros_ec_keyb.c
+++ b/drivers/input/cros_ec_keyb.c
@@ -15,8 +15,6 @@
 #include <key_matrix.h>
 #include <stdio_dev.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	KBC_MAX_KEYS		= 8,	/* Maximum keys held down at once */
 	KBC_REPEAT_RATE_MS	= 30,
diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c
index cb5695784e90..1c2768345a82 100644
--- a/drivers/input/tegra-kbc.c
+++ b/drivers/input/tegra-kbc.c
@@ -19,8 +19,6 @@
 #include <asm/arch-tegra/timer.h>
 #include <linux/input.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	KBC_MAX_GPIO		= 24,
 	KBC_MAX_KPENT		= 8,	/* size of keypress entry queue */
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index 997663588718..5e0c524aecf7 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -12,8 +12,6 @@
 #include <asm/gpio.h>
 #include <dm/lists.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct led_gpio_priv {
 	struct gpio_desc gpio;
 };
diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c
index 822ae5b45e55..d053db031dd9 100644
--- a/drivers/mailbox/mailbox-uclass.c
+++ b/drivers/mailbox/mailbox-uclass.c
@@ -9,8 +9,6 @@
 #include <mailbox.h>
 #include <mailbox-uclass.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline struct mbox_ops *mbox_dev_ops(struct udevice *dev)
 {
 	return (struct mbox_ops *)dev->driver->ops;
diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
index bd2ec411c758..8d1df20bf9ce 100644
--- a/drivers/mailbox/tegra-hsp.c
+++ b/drivers/mailbox/tegra-hsp.c
@@ -36,8 +36,6 @@ struct tegra_hsp {
 	uint32_t db_base;
 };
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static uint32_t *tegra_hsp_reg(struct tegra_hsp *thsp, uint32_t db_id,
 			       uint32_t reg)
 {
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index eefaaa53ad41..bed80dc4554b 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -42,8 +42,6 @@ enum {
 	CROS_EC_CMD_HASH_TIMEOUT_MS = 2000,
 };
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void cros_ec_dump_data(const char *name, int cmd, const uint8_t *data, int len)
 {
 #ifdef DEBUG
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c
index 5924adee4085..1f1e23e6d1c5 100644
--- a/drivers/misc/cros_ec_sandbox.c
+++ b/drivers/misc/cros_ec_sandbox.c
@@ -51,8 +51,6 @@
  * the EC image in with U-Boot (Vic has demonstrated a prototype for this).
  */
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define KEYBOARD_ROWS	8
 #define KEYBOARD_COLS	13
 
diff --git a/drivers/misc/cros_ec_spi.c b/drivers/misc/cros_ec_spi.c
index 253d91a5537d..51714a471c84 100644
--- a/drivers/misc/cros_ec_spi.c
+++ b/drivers/misc/cros_ec_spi.c
@@ -19,8 +19,6 @@
 #include <errno.h>
 #include <spi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int cros_ec_spi_packet(struct udevice *udev, int out_bytes, int in_bytes)
 {
 	struct cros_ec_dev *dev = dev_get_uclass_priv(udev);
diff --git a/drivers/misc/i2c_eeprom_emul.c b/drivers/misc/i2c_eeprom_emul.c
index 52aa7d69e96c..6f84e815e823 100644
--- a/drivers/misc/i2c_eeprom_emul.c
+++ b/drivers/misc/i2c_eeprom_emul.c
@@ -19,8 +19,6 @@
 #define debug_buffer(x, ...)
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_i2c_flash_plat_data {
 	enum sandbox_i2c_eeprom_test_mode test_mode;
 	const char *filename;
diff --git a/drivers/misc/spltest_sandbox.c b/drivers/misc/spltest_sandbox.c
index 1fef8252ab83..24aba78882ac 100644
--- a/drivers/misc/spltest_sandbox.c
+++ b/drivers/misc/spltest_sandbox.c
@@ -9,8 +9,6 @@
 #include <dm.h>
 #include <dt-structs.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int sandbox_spl_probe(struct udevice *dev)
 {
 	struct dtd_sandbox_spl_test *plat = dev_get_platdata(dev);
diff --git a/drivers/misc/syscon_sandbox.c b/drivers/misc/syscon_sandbox.c
index ccfab3ef987d..e78b6e476eb1 100644
--- a/drivers/misc/syscon_sandbox.c
+++ b/drivers/misc/syscon_sandbox.c
@@ -12,8 +12,6 @@
 #include <asm/test.h>
 #include <dm/lists.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct udevice_id sandbox_syscon_ids[] = {
 	{ .compatible = "sandbox,syscon0", .data = SYSCON0 },
 	{ .compatible = "sandbox,syscon1", .data = SYSCON1 },
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index 89a7c1924244..8664a373a10f 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -25,8 +25,6 @@
 
 #ifdef CONFIG_DM_MMC
 #include <dm.h>
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MMC_CLOCK_MAX	48000000
 #define MMC_CLOCK_MIN	400000
 
diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c
index bccd182e50c2..752c660ea733 100644
--- a/drivers/mmc/bcm2835_sdhost.c
+++ b/drivers/mmc/bcm2835_sdhost.c
@@ -44,8 +44,6 @@
 #include <mach/gpio.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define msleep(a) udelay(a * 1000)
 
 #define SDCMD  0x00 /* Command to SD card              - 16 R/W */
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
index 1c108b5470dc..186b3d7dbf1a 100644
--- a/drivers/mmc/gen_atmel_mci.c
+++ b/drivers/mmc/gen_atmel_mci.c
@@ -22,8 +22,6 @@
 #include <asm/arch/hardware.h>
 #include "atmel_mci.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_SYS_MMC_CLK_OD
 # define CONFIG_SYS_MMC_CLK_OD	150000
 #endif
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index a3536b15ae67..0481e276c0f1 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -12,8 +12,6 @@
 #include <dm/lists.h>
 #include "mmc_private.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int dm_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 		    struct mmc_data *data)
 {
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index 807dc9e72f66..4ba1436159d8 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -18,8 +18,6 @@
 #include <asm/arch/periph.h>
 #include <linux/err.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct rockchip_mmc_plat {
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
 	struct dtd_rockchip_rk3288_dw_mshc dtplat;
diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index ab89be47644e..8868f341f337 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -15,7 +15,6 @@
 #include <sdhci.h>
 #include <clk.h>
 
-DECLARE_GLOBAL_DATA_PTR;
 /* 400KHz is max freq for card ID etc. Use that as min */
 #define EMMC_MIN_FREQ	400000
 
diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c
index 8a5d256c1151..0945beb368ae 100644
--- a/drivers/mmc/sandbox_mmc.c
+++ b/drivers/mmc/sandbox_mmc.c
@@ -12,8 +12,6 @@
 #include <mmc.h>
 #include <asm/test.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_mmc_plat {
 	struct mmc_config cfg;
 	struct mmc mmc;
diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
index f5b21dd097d6..47afa263ea02 100644
--- a/drivers/mmc/stm32_sdmmc2.c
+++ b/drivers/mmc/stm32_sdmmc2.c
@@ -189,8 +189,6 @@ struct stm32_sdmmc2_ctx {
 
 #define SDMMC_CMD_TIMEOUT		0xFFFFFFFF
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static void stm32_sdmmc2_start_data(struct stm32_sdmmc2_priv *priv,
 				    struct mmc_data *data,
 				    struct stm32_sdmmc2_ctx *ctx)
diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
index 74745296b47e..ee63166e5535 100644
--- a/drivers/mmc/tegra_mmc.c
+++ b/drivers/mmc/tegra_mmc.c
@@ -16,8 +16,6 @@
 #include <asm/io.h>
 #include <asm/arch-tegra/tegra_mmc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct tegra_mmc_plat {
 	struct mmc_config cfg;
 	struct mmc mmc;
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 6aa909fdd975..e4225852bd1e 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -15,8 +15,6 @@
 #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int nand_curr_device = -1;
 
 static struct mtd_info *nand_info[CONFIG_SYS_MAX_NAND_DEVICE];
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 1ba68152322b..7893efee12aa 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -24,8 +24,6 @@
 #include <dm/lists.h>
 #include <dm/uclass-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * The different states that our SPI flash transitions between.
  * We need to keep track of this across multiple xfer calls since
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 2e61685d3ea4..30ded3e081ba 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -20,8 +20,6 @@
 
 #include "sf_internal.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static void spi_flash_addr(u32 addr, u8 *cmd)
 {
 	/* cmd[0] is actual command */
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 43670a7d0c91..765e35664504 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -23,8 +23,6 @@
 #include <power/regulator.h>
 #include "designware.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int dw_mdio_read(struct mii_dev *bus, int addr, int devad, int reg)
 {
 #ifdef CONFIG_DM_ETH
diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c
index 00d905c299de..ad7e051722de 100644
--- a/drivers/net/fsl_mcdmafec.c
+++ b/drivers/net/fsl_mcdmafec.c
@@ -38,8 +38,6 @@
 
 #include "MCD_dma.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct fec_info_dma fec_info[] = {
 #ifdef CONFIG_SYS_FEC0_IOBASE
 	{
diff --git a/drivers/net/gmac_rockchip.c b/drivers/net/gmac_rockchip.c
index 683e820108f9..5ed3049fa682 100644
--- a/drivers/net/gmac_rockchip.c
+++ b/drivers/net/gmac_rockchip.c
@@ -25,8 +25,6 @@
 #include <dt-bindings/clock/rk3288-cru.h>
 #include "designware.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Platform data for the gmac
  *
diff --git a/drivers/net/lpc32xx_eth.c b/drivers/net/lpc32xx_eth.c
index cbef3359abe0..1efe625c5fb1 100644
--- a/drivers/net/lpc32xx_eth.c
+++ b/drivers/net/lpc32xx_eth.c
@@ -218,8 +218,6 @@ struct lpc32xx_eth_device {
 
 #define MII_MAX_PHY (MADR_PHY_MASK >> MADR_PHY_OFFSET)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_PHYLIB) || defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 /*
  * mii_reg_read - miiphy_read callback function.
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 505a2d1bee8e..82838c62f248 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -33,8 +33,6 @@
 #define BD_ENET_RX_W_E		(BD_ENET_RX_WRAP | BD_ENET_RX_EMPTY)
 #define BD_ENET_TX_RDY_LST	(BD_ENET_TX_READY | BD_ENET_TX_LAST)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct fec_info_s fec_info[] = {
 #ifdef CONFIG_SYS_FEC0_IOBASE
 	{
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 028fca966391..11dbf5375b11 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -10,8 +10,6 @@
 #include <stdio_dev.h>
 #include <net.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_NETCONSOLE_BUFFER_SIZE
 #define CONFIG_NETCONSOLE_BUFFER_SIZE 512
 #endif
diff --git a/drivers/net/phy/micrel_ksz8xxx.c b/drivers/net/phy/micrel_ksz8xxx.c
index ec628bb27ad5..62a443117503 100644
--- a/drivers/net/phy/micrel_ksz8xxx.c
+++ b/drivers/net/phy/micrel_ksz8xxx.c
@@ -15,8 +15,6 @@
 #include <micrel.h>
 #include <phy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct phy_driver KSZ804_driver = {
 	.name = "Micrel KSZ804",
 	.uid = 0x221510,
diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index b350a61aa64b..eb83cebbac08 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -17,8 +17,6 @@
 #include <micrel.h>
 #include <phy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * KSZ9021 - KSZ9031 common
  */
diff --git a/drivers/pch/pch-uclass.c b/drivers/pch/pch-uclass.c
index af794eb5a128..0d3ce7f77c3c 100644
--- a/drivers/pch/pch-uclass.c
+++ b/drivers/pch/pch-uclass.c
@@ -9,8 +9,6 @@
 #include <dm.h>
 #include <pch.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int pch_get_spi_base(struct udevice *dev, ulong *sbasep)
 {
 	struct pch_ops *ops = pch_get_ops(dev);
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index 69a4d81c2e5f..864ac16f572b 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -131,8 +131,6 @@
 #define CFG_RD_UR_VAL			0xFFFFFFFF
 #define CFG_RD_CRS_VAL			0xFFFF0001
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * struct pcie_advk - Advk PCIe controller state
  *
diff --git a/drivers/pci/pci-emul-uclass.c b/drivers/pci/pci-emul-uclass.c
index dcea1924182d..f89acd41dcbe 100644
--- a/drivers/pci/pci-emul-uclass.c
+++ b/drivers/pci/pci-emul-uclass.c
@@ -12,8 +12,6 @@
 #include <pci.h>
 #include <dm/lists.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_pci_priv {
 	int dev_count;
 };
diff --git a/drivers/pci/pci_sandbox.c b/drivers/pci/pci_sandbox.c
index 6a84ee386d79..cd7ed0069acc 100644
--- a/drivers/pci/pci_sandbox.c
+++ b/drivers/pci/pci_sandbox.c
@@ -11,8 +11,6 @@
 #include <inttypes.h>
 #include <pci.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int sandbox_pci_write_config(struct udevice *bus, pci_dev_t devfn,
 				    uint offset, ulong value,
 				    enum pci_size_t size)
diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index b5bd25ec563a..2829b963b0e9 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -43,8 +43,6 @@
  * use the new standard APIs, with no ifdefs.
  */
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define AFI_AXI_BAR0_SZ	0x00
 #define AFI_AXI_BAR1_SZ	0x04
 #define AFI_AXI_BAR2_SZ	0x08
diff --git a/drivers/phy/meson-gxl-usb2.c b/drivers/phy/meson-gxl-usb2.c
index 15c9c89fd9e0..de5a6ee82ab9 100644
--- a/drivers/phy/meson-gxl-usb2.c
+++ b/drivers/phy/meson-gxl-usb2.c
@@ -21,8 +21,6 @@
 #include <linux/bitops.h>
 #include <linux/compat.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* bits [31:27] are read-only */
 #define U2P_R0							0x0
 	#define U2P_R0_BYPASS_SEL				BIT(0)
diff --git a/drivers/phy/meson-gxl-usb3.c b/drivers/phy/meson-gxl-usb3.c
index a385fbdf126c..a85d747eed5b 100644
--- a/drivers/phy/meson-gxl-usb3.c
+++ b/drivers/phy/meson-gxl-usb3.c
@@ -21,8 +21,6 @@
 #include <linux/compat.h>
 #include <linux/bitfield.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define USB_R0							0x00
 	#define USB_R0_P30_FSEL_MASK				GENMASK(5, 0)
 	#define USB_R0_P30_PHY_RESET				BIT(6)
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c
index 68e518fc7900..bdca4c0238ac 100644
--- a/drivers/phy/phy-uclass.c
+++ b/drivers/phy/phy-uclass.c
@@ -9,8 +9,6 @@
 #include <dm.h>
 #include <generic-phy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline struct phy_ops *phy_dev_ops(struct udevice *dev)
 {
 	return (struct phy_ops *)dev->driver->ops;
diff --git a/drivers/phy/sandbox-phy.c b/drivers/phy/sandbox-phy.c
index 867c6fe7043b..3ed6837e64a2 100644
--- a/drivers/phy/sandbox-phy.c
+++ b/drivers/phy/sandbox-phy.c
@@ -9,8 +9,6 @@
 #include <dm.h>
 #include <generic-phy.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_phy_priv {
 	bool initialized;
 	bool on;
diff --git a/drivers/pinctrl/aspeed/pinctrl_ast2500.c b/drivers/pinctrl/aspeed/pinctrl_ast2500.c
index 01f97c1b48d1..877f24b63fd7 100644
--- a/drivers/pinctrl/aspeed/pinctrl_ast2500.c
+++ b/drivers/pinctrl/aspeed/pinctrl_ast2500.c
@@ -12,8 +12,6 @@
 #include <asm/arch/scu_ast2500.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * This driver works with very simple configuration that has the same name
  * for group and function. This way it is compatible with the Linux Kernel
diff --git a/drivers/pinctrl/exynos/pinctrl-exynos7420.c b/drivers/pinctrl/exynos/pinctrl-exynos7420.c
index 8ae5ce776a44..bcbe1a0529e9 100644
--- a/drivers/pinctrl/exynos/pinctrl-exynos7420.c
+++ b/drivers/pinctrl/exynos/pinctrl-exynos7420.c
@@ -16,8 +16,6 @@
 #include <asm/arch/pinmux.h>
 #include "pinctrl-exynos.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define	GPD1_OFFSET	0xc0
 
 static struct exynos_pinctrl_config_data serial2_conf[] = {
diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c
index 6194e6522e73..7d2e3261488e 100644
--- a/drivers/pinctrl/renesas/pfc.c
+++ b/drivers/pinctrl/renesas/pfc.c
@@ -21,8 +21,6 @@
 
 #include "sh_pfc.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum sh_pfc_model {
 	SH_PFC_R8A7790 = 0,
 	SH_PFC_R8A7791,
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3036.c b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
index 7e93d85dbb9d..e66ee9902ad2 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3036.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
@@ -16,8 +16,6 @@
 #include <asm/arch/periph.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* GRF_GPIO0A_IOMUX */
 enum {
 	GPIO0A3_SHIFT		= 6,
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3328.c b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
index fa2356a7a1aa..0a478a8a99a0 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3328.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
@@ -15,8 +15,6 @@
 #include <asm/io.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	/* GPIO0A_IOMUX */
 	GPIO0A5_SEL_SHIFT	= 10,
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3368.c b/drivers/pinctrl/rockchip/pinctrl_rk3368.c
index 25249e377a64..a03827af2c4b 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3368.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3368.c
@@ -17,8 +17,6 @@
 #include <asm/arch/periph.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* PMUGRF_GPIO0B_IOMUX */
 enum {
 	GPIO0B5_SHIFT           = 10,
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
index c7052257aa4a..929035e6757f 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
@@ -15,8 +15,6 @@
 #include <asm/arch/clock.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct rk3399_pinctrl_priv {
 	struct rk3399_grf_regs *grf;
 	struct rk3399_pmugrf_regs *pmugrf;
diff --git a/drivers/pinctrl/rockchip/pinctrl_rv1108.c b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
index 035f01a61cf7..4c81bec15b85 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rv1108.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
@@ -14,8 +14,6 @@
 #include <asm/arch/periph.h>
 #include <dm/pinctrl.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct rv1108_pinctrl_priv {
 	struct rv1108_grf *grf;
 };
diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c
index 1847a492a37a..36a374a1b638 100644
--- a/drivers/power/domain/power-domain-uclass.c
+++ b/drivers/power/domain/power-domain-uclass.c
@@ -9,8 +9,6 @@
 #include <power-domain.h>
 #include <power-domain-uclass.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline struct power_domain_ops *power_domain_dev_ops(struct udevice *dev)
 {
 	return (struct power_domain_ops *)dev->driver->ops;
diff --git a/drivers/power/pmic/act8846.c b/drivers/power/pmic/act8846.c
index 7d107f4427e8..c233ac08b154 100644
--- a/drivers/power/pmic/act8846.c
+++ b/drivers/power/pmic/act8846.c
@@ -13,8 +13,6 @@
 #include <power/act8846_pmic.h>
 #include <power/pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "REG", .driver = "act8846_reg"},
 	{ },
diff --git a/drivers/power/pmic/i2c_pmic_emul.c b/drivers/power/pmic/i2c_pmic_emul.c
index 38a2a04f1776..c58ebb8825ef 100644
--- a/drivers/power/pmic/i2c_pmic_emul.c
+++ b/drivers/power/pmic/i2c_pmic_emul.c
@@ -12,8 +12,6 @@
 #include <power/pmic.h>
 #include <power/sandbox_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * struct sandbox_i2c_pmic_plat_data - platform data for the PMIC
  *
diff --git a/drivers/power/pmic/lp873x.c b/drivers/power/pmic/lp873x.c
index 95c2b7e8c74c..ec7b9bf29fd9 100644
--- a/drivers/power/pmic/lp873x.c
+++ b/drivers/power/pmic/lp873x.c
@@ -15,8 +15,6 @@
 #include <power/lp873x.h>
 #include <dm/device.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "ldo", .driver = LP873X_LDO_DRIVER },
 	{ .prefix = "buck", .driver = LP873X_BUCK_DRIVER },
diff --git a/drivers/power/pmic/lp87565.c b/drivers/power/pmic/lp87565.c
index 506769e36267..7c02f38ed867 100644
--- a/drivers/power/pmic/lp87565.c
+++ b/drivers/power/pmic/lp87565.c
@@ -15,8 +15,6 @@
 #include <power/lp87565.h>
 #include <dm/device.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "buck", .driver = LP87565_BUCK_DRIVER },
 	{ },
diff --git a/drivers/power/pmic/max77686.c b/drivers/power/pmic/max77686.c
index b3ed84992ff8..f4e0f7034d91 100644
--- a/drivers/power/pmic/max77686.c
+++ b/drivers/power/pmic/max77686.c
@@ -14,8 +14,6 @@
 #include <power/regulator.h>
 #include <power/max77686_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "LDO", .driver = MAX77686_LDO_DRIVER },
 	{ .prefix = "BUCK", .driver = MAX77686_BUCK_DRIVER },
diff --git a/drivers/power/pmic/max8997.c b/drivers/power/pmic/max8997.c
index 5ebeb8a316be..66c1c15a2d3d 100644
--- a/drivers/power/pmic/max8997.c
+++ b/drivers/power/pmic/max8997.c
@@ -12,8 +12,6 @@
 #include <power/max8997_pmic.h>
 #include <errno.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int max8997_reg_count(struct udevice *dev)
 {
 	return PMIC_NUM_OF_REGS;
diff --git a/drivers/power/pmic/max8998.c b/drivers/power/pmic/max8998.c
index a7e04699e8ba..8dd7e4886a6d 100644
--- a/drivers/power/pmic/max8998.c
+++ b/drivers/power/pmic/max8998.c
@@ -12,8 +12,6 @@
 #include <power/pmic.h>
 #include <power/max8998_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int max8998_reg_count(struct udevice *dev)
 {
 	return PMIC_NUM_OF_REGS;
diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c
index 1e1ecb382e3a..7e3b25d2c7fe 100644
--- a/drivers/power/pmic/palmas.c
+++ b/drivers/power/pmic/palmas.c
@@ -15,8 +15,6 @@
 #include <power/palmas.h>
 #include <dm/device.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "ldo", .driver = PALMAS_LDO_DRIVER },
 	{ .prefix = "smps", .driver = PALMAS_SMPS_DRIVER },
diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c
index a06cbc07d491..32b8f71c3e4a 100644
--- a/drivers/power/pmic/pfuze100.c
+++ b/drivers/power/pmic/pfuze100.c
@@ -14,8 +14,6 @@
 #include <power/regulator.h>
 #include <power/pfuze100_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	/* sw[x], swbst */
 	{ .prefix = "s", .driver = PFUZE100_REGULATOR_DRIVER },
diff --git a/drivers/power/pmic/pm8916.c b/drivers/power/pmic/pm8916.c
index a048bbe7ce1d..cd7c90614815 100644
--- a/drivers/power/pmic/pm8916.c
+++ b/drivers/power/pmic/pm8916.c
@@ -10,8 +10,6 @@
 #include <power/pmic.h>
 #include <spmi/spmi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define PID_SHIFT 8
 #define PID_MASK (0xFF << PID_SHIFT)
 #define REG_MASK 0xFF
diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
index 9347b4068897..5e8f6d619046 100644
--- a/drivers/power/pmic/pmic-uclass.c
+++ b/drivers/power/pmic/pmic-uclass.c
@@ -16,8 +16,6 @@
 #include <power/pmic.h>
 #include <linux/ctype.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if CONFIG_IS_ENABLED(PMIC_CHILDREN)
 int pmic_bind_children(struct udevice *pmic, ofnode parent,
 		       const struct pmic_child_info *child_info)
diff --git a/drivers/power/pmic/pmic_tps65910_dm.c b/drivers/power/pmic/pmic_tps65910_dm.c
index c65f38f107f2..b0d0c5e94461 100644
--- a/drivers/power/pmic/pmic_tps65910_dm.c
+++ b/drivers/power/pmic/pmic_tps65910_dm.c
@@ -11,8 +11,6 @@
 #include <power/regulator.h>
 #include <power/tps65910_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "ldo_", .driver = TPS65910_LDO_DRIVER },
 	{ .prefix = "buck_", .driver = TPS65910_BUCK_DRIVER },
diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index 735046dc43d8..c83c8cf7bb38 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -11,8 +11,6 @@
 #include <power/rk8xx_pmic.h>
 #include <power/pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "DCDC_REG", .driver = "rk8xx_buck"},
 	{ .prefix = "LDO_REG", .driver = "rk8xx_ldo"},
diff --git a/drivers/power/pmic/s2mps11.c b/drivers/power/pmic/s2mps11.c
index 3f9525b67d6b..13b3f908a497 100644
--- a/drivers/power/pmic/s2mps11.c
+++ b/drivers/power/pmic/s2mps11.c
@@ -13,8 +13,6 @@
 #include <power/pmic.h>
 #include <power/s2mps11.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = S2MPS11_OF_LDO_PREFIX, .driver = S2MPS11_LDO_DRIVER },
 	{ .prefix = S2MPS11_OF_BUCK_PREFIX, .driver = S2MPS11_BUCK_DRIVER },
diff --git a/drivers/power/pmic/s5m8767.c b/drivers/power/pmic/s5m8767.c
index 3812e240ab08..e3bf3a638fbf 100644
--- a/drivers/power/pmic/s5m8767.c
+++ b/drivers/power/pmic/s5m8767.c
@@ -13,8 +13,6 @@
 #include <power/regulator.h>
 #include <power/s5m8767.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "LDO", .driver = S5M8767_LDO_DRIVER },
 	{ .prefix = "BUCK", .driver = S5M8767_BUCK_DRIVER },
diff --git a/drivers/power/pmic/sandbox.c b/drivers/power/pmic/sandbox.c
index e8d6faca160c..80209d3d918f 100644
--- a/drivers/power/pmic/sandbox.c
+++ b/drivers/power/pmic/sandbox.c
@@ -14,8 +14,6 @@
 #include <power/regulator.h>
 #include <power/sandbox_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = SANDBOX_OF_LDO_PREFIX, .driver = SANDBOX_LDO_DRIVER },
 	{ .prefix = SANDBOX_OF_BUCK_PREFIX, .driver = SANDBOX_BUCK_DRIVER },
diff --git a/drivers/power/pmic/tps65090.c b/drivers/power/pmic/tps65090.c
index ee5358bcedc8..1b0fd991fad2 100644
--- a/drivers/power/pmic/tps65090.c
+++ b/drivers/power/pmic/tps65090.c
@@ -13,8 +13,6 @@
 #include <power/pmic.h>
 #include <power/tps65090.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct pmic_child_info pmic_children_info[] = {
 	{ .prefix = "fet", .driver = TPS65090_FET_DRIVER },
 	{ },
diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
index 97b4a98bf0b6..eec1914c1da4 100644
--- a/drivers/power/regulator/fixed.c
+++ b/drivers/power/regulator/fixed.c
@@ -14,8 +14,6 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct fixed_regulator_platdata {
 	struct gpio_desc gpio; /* GPIO for regulator enable control */
 	unsigned int startup_delay_us;
diff --git a/drivers/power/regulator/lp873x_regulator.c b/drivers/power/regulator/lp873x_regulator.c
index 11371a7b8baa..ba2dbd71d18e 100644
--- a/drivers/power/regulator/lp873x_regulator.c
+++ b/drivers/power/regulator/lp873x_regulator.c
@@ -16,8 +16,6 @@
 #include <power/regulator.h>
 #include <power/lp873x.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const char lp873x_buck_ctrl[LP873X_BUCK_NUM] = {0x2, 0x4};
 static const char lp873x_buck_volt[LP873X_BUCK_NUM] = {0x6, 0x7};
 static const char lp873x_ldo_ctrl[LP873X_LDO_NUM] = {0x8, 0x9};
diff --git a/drivers/power/regulator/lp87565_regulator.c b/drivers/power/regulator/lp87565_regulator.c
index d908f6d1fb2c..94f09f5994e8 100644
--- a/drivers/power/regulator/lp87565_regulator.c
+++ b/drivers/power/regulator/lp87565_regulator.c
@@ -16,8 +16,6 @@
 #include <power/regulator.h>
 #include <power/lp87565.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const char lp87565_buck_ctrl1[LP87565_BUCK_NUM] = {0x2, 0x4, 0x6, 0x8, 0x2, 0x6};
 static const char lp87565_buck_vout[LP87565_BUCK_NUM] = {0xA, 0xC, 0xE, 0x10, 0xA, 0xE };
 
diff --git a/drivers/power/regulator/max77686.c b/drivers/power/regulator/max77686.c
index 2212d36ed6a9..6e4ac02036e4 100644
--- a/drivers/power/regulator/max77686.c
+++ b/drivers/power/regulator/max77686.c
@@ -16,8 +16,6 @@
 #include <power/regulator.h>
 #include <power/max77686_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MODE(_id, _val, _name) { \
 	.id = _id, \
 	.register_value = _val, \
diff --git a/drivers/power/regulator/palmas_regulator.c b/drivers/power/regulator/palmas_regulator.c
index 24a797723632..45c006c5b7de 100644
--- a/drivers/power/regulator/palmas_regulator.c
+++ b/drivers/power/regulator/palmas_regulator.c
@@ -16,8 +16,6 @@
 #include <power/regulator.h>
 #include <power/palmas.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define	REGULATOR_ON		0x1
 #define	REGULATOR_OFF		0x0
 
diff --git a/drivers/power/regulator/pbias_regulator.c b/drivers/power/regulator/pbias_regulator.c
index adf589b22496..1e042ad71241 100644
--- a/drivers/power/regulator/pbias_regulator.c
+++ b/drivers/power/regulator/pbias_regulator.c
@@ -16,8 +16,6 @@
 #include <linux/ioport.h>
 #include <dm/read.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct pbias_reg_info {
 	u32 enable;
 	u32 enable_mask;
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 426a933d66d6..b9e2d20e3292 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -12,8 +12,6 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep)
 {
 	struct dm_regulator_uclass_platdata *uc_pdata;
diff --git a/drivers/power/regulator/s2mps11_regulator.c b/drivers/power/regulator/s2mps11_regulator.c
index 3af20e60dd0f..477f0f6225ca 100644
--- a/drivers/power/regulator/s2mps11_regulator.c
+++ b/drivers/power/regulator/s2mps11_regulator.c
@@ -14,8 +14,6 @@
 #include <power/regulator.h>
 #include <power/s2mps11.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MODE(_id, _val, _name) { \
 	.id = _id, \
 	.register_value = _val, \
diff --git a/drivers/power/regulator/s5m8767.c b/drivers/power/regulator/s5m8767.c
index 871da122b448..89ad587610bc 100644
--- a/drivers/power/regulator/s5m8767.c
+++ b/drivers/power/regulator/s5m8767.c
@@ -13,8 +13,6 @@
 #include <power/regulator.h>
 #include <power/s5m8767.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const struct sec_voltage_desc buck_v1 = {
 	.max = 2225000,
 	.min =  650000,
diff --git a/drivers/power/regulator/sandbox.c b/drivers/power/regulator/sandbox.c
index f980a17389eb..ab30c50fcc52 100644
--- a/drivers/power/regulator/sandbox.c
+++ b/drivers/power/regulator/sandbox.c
@@ -14,8 +14,6 @@
 #include <power/regulator.h>
 #include <power/sandbox_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MODE(_id, _val, _name) [_id] = {  \
 	.id = _id,                \
 	.register_value = _val,   \
diff --git a/drivers/pwm/exynos_pwm.c b/drivers/pwm/exynos_pwm.c
index 9520a14387d9..127575263ae9 100644
--- a/drivers/pwm/exynos_pwm.c
+++ b/drivers/pwm/exynos_pwm.c
@@ -12,8 +12,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/pwm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct exynos_pwm_priv {
 	struct s5p_timer *regs;
 };
diff --git a/drivers/pwm/rk_pwm.c b/drivers/pwm/rk_pwm.c
index 7d3e11d66741..4c1ee6739e6d 100644
--- a/drivers/pwm/rk_pwm.c
+++ b/drivers/pwm/rk_pwm.c
@@ -16,8 +16,6 @@
 #include <asm/arch/pwm.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct rk_pwm_priv {
 	struct rk3288_pwm *regs;
 	ulong freq;
diff --git a/drivers/pwm/sandbox_pwm.c b/drivers/pwm/sandbox_pwm.c
index fcb108455156..48f169842b3f 100644
--- a/drivers/pwm/sandbox_pwm.c
+++ b/drivers/pwm/sandbox_pwm.c
@@ -11,8 +11,6 @@
 #include <pwm.h>
 #include <asm/test.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	NUM_CHANNELS	= 3,
 };
diff --git a/drivers/pwm/tegra_pwm.c b/drivers/pwm/tegra_pwm.c
index b8acc1583f9d..2119e1d5689d 100644
--- a/drivers/pwm/tegra_pwm.c
+++ b/drivers/pwm/tegra_pwm.c
@@ -11,8 +11,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/pwm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct tegra_pwm_priv {
 	struct pwm_ctlr *regs;
 };
diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c
index bfcb1ddefe3d..6cd2f16cf274 100644
--- a/drivers/ram/rockchip/dmc-rk3368.c
+++ b/drivers/ram/rockchip/dmc-rk3368.c
@@ -20,8 +20,6 @@
 #include <asm/arch/sdram.h>
 #include <asm/arch/sdram_common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct dram_info {
 	struct ram_info info;
 	struct clk ddr_clk;
diff --git a/drivers/ram/rockchip/sdram_rk3128.c b/drivers/ram/rockchip/sdram_rk3128.c
index a33127f4b051..eec1ebaabe7f 100644
--- a/drivers/ram/rockchip/sdram_rk3128.c
+++ b/drivers/ram/rockchip/sdram_rk3128.c
@@ -12,7 +12,6 @@
 #include <asm/arch/grf_rk3128.h>
 #include <asm/arch/sdram_common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
 struct dram_info {
 	struct ram_info info;
 	struct rk3128_grf *grf;
diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c
index 365d00ef5424..0bc05ba9dce9 100644
--- a/drivers/ram/rockchip/sdram_rk3188.c
+++ b/drivers/ram/rockchip/sdram_rk3188.c
@@ -25,8 +25,6 @@
 #include <asm/arch/sdram_common.h>
 #include <linux/err.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct chan_info {
 	struct rk3288_ddr_pctl *pctl;
 	struct rk3288_ddr_publ *publ;
diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c
index 95efb117fc17..d99bf1247628 100644
--- a/drivers/ram/rockchip/sdram_rk3288.c
+++ b/drivers/ram/rockchip/sdram_rk3288.c
@@ -27,8 +27,6 @@
 #include <power/regulator.h>
 #include <power/rk8xx_pmic.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct chan_info {
 	struct rk3288_ddr_pctl *pctl;
 	struct rk3288_ddr_publ *publ;
diff --git a/drivers/ram/rockchip/sdram_rk3328.c b/drivers/ram/rockchip/sdram_rk3328.c
index 9637a35e2314..292903ae1f77 100644
--- a/drivers/ram/rockchip/sdram_rk3328.c
+++ b/drivers/ram/rockchip/sdram_rk3328.c
@@ -12,7 +12,6 @@
 #include <asm/arch/grf_rk3328.h>
 #include <asm/arch/sdram_common.h>
 
-DECLARE_GLOBAL_DATA_PTR;
 struct dram_info {
 	struct ram_info info;
 	struct rk3328_grf_regs *grf;
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 5cb470c209f2..65191c69b866 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -23,7 +23,6 @@
 #include <linux/err.h>
 #include <time.h>
 
-DECLARE_GLOBAL_DATA_PTR;
 struct chan_info {
 	struct rk3399_ddr_pctl_regs *pctl;
 	struct rk3399_ddr_pi_regs *pi;
diff --git a/drivers/ram/stm32_sdram.c b/drivers/ram/stm32_sdram.c
index ec2edd67dd19..62282c613860 100644
--- a/drivers/ram/stm32_sdram.c
+++ b/drivers/ram/stm32_sdram.c
@@ -14,8 +14,6 @@
 #define MEM_MODE_MASK	GENMASK(2, 0)
 #define NOT_FOUND	0xff
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct stm32_fmc_regs {
 	/* 0x0 */
 	u32 bcr1;	/* NOR/PSRAM Chip select control register 1 */
diff --git a/drivers/ram/stm32mp1/stm32mp1_ram.c b/drivers/ram/stm32mp1/stm32mp1_ram.c
index 9599444650af..4dc84d0e2917 100644
--- a/drivers/ram/stm32mp1/stm32mp1_ram.c
+++ b/drivers/ram/stm32mp1/stm32mp1_ram.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include "stm32mp1_ddr.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const char *const clkname[] = {
 	"ddrc1",
 	"ddrc2",
diff --git a/drivers/reset/ast2500-reset.c b/drivers/reset/ast2500-reset.c
index b2c89e1f1e29..36d32469addb 100644
--- a/drivers/reset/ast2500-reset.c
+++ b/drivers/reset/ast2500-reset.c
@@ -14,8 +14,6 @@
 #include <asm/arch/scu_ast2500.h>
 #include <asm/arch/wdt.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct ast2500_reset_priv {
 	/* WDT used to perform resets. */
 	struct udevice *wdt;
diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
index fa4f6538edd7..05879c6ada60 100644
--- a/drivers/reset/reset-uclass.c
+++ b/drivers/reset/reset-uclass.c
@@ -10,8 +10,6 @@
 #include <reset.h>
 #include <reset-uclass.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline struct reset_ops *reset_dev_ops(struct udevice *dev)
 {
 	return (struct reset_ops *)dev->driver->ops;
diff --git a/drivers/rtc/i2c_rtc_emul.c b/drivers/rtc/i2c_rtc_emul.c
index 0e06c97367a2..2e69a5b9572e 100644
--- a/drivers/rtc/i2c_rtc_emul.c
+++ b/drivers/rtc/i2c_rtc_emul.c
@@ -28,8 +28,6 @@
 #define debug_buffer(x, ...)
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * struct sandbox_i2c_rtc_plat_data - platform data for the RTC
  *
diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
index 4a6e60f87efe..b18300e61606 100644
--- a/drivers/serial/altera_jtag_uart.c
+++ b/drivers/serial/altera_jtag_uart.c
@@ -11,8 +11,6 @@
 #include <serial.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* data register */
 #define ALTERA_JTAG_RVALID	BIT(15)	/* Read valid */
 
diff --git a/drivers/serial/lpc32xx_hsuart.c b/drivers/serial/lpc32xx_hsuart.c
index b42537529de8..1d3e928bb1e9 100644
--- a/drivers/serial/lpc32xx_hsuart.c
+++ b/drivers/serial/lpc32xx_hsuart.c
@@ -12,8 +12,6 @@
 #include <asm/arch/uart.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct lpc32xx_hsuart_priv {
 	struct hsuart_regs *hsuart;
 };
diff --git a/drivers/serial/serial_meson.c b/drivers/serial/serial_meson.c
index 6412ca649636..a363cd9a1f48 100644
--- a/drivers/serial/serial_meson.c
+++ b/drivers/serial/serial_meson.c
@@ -11,8 +11,6 @@
 #include <linux/compiler.h>
 #include <serial.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct meson_uart {
 	u32 wfifo;
 	u32 rfifo;
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 286b954fdd74..dfef0d47e5f1 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -13,8 +13,6 @@
 #include <asm/arch/stm32.h>
 #include "serial_stm32.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int stm32_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c
index fedd2a9df599..ec828e6784de 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -15,8 +15,6 @@
 #include <linux/compiler.h>
 #include <serial.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define SR_TX_FIFO_FULL		BIT(3) /* transmit FIFO full */
 #define SR_TX_FIFO_EMPTY	BIT(2) /* transmit FIFO empty */
 #define SR_RX_FIFO_VALID_DATA	BIT(0) /* data in receive FIFO */
diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
index 4e86e5c2a1ab..68c5c8541d33 100644
--- a/drivers/serial/serial_zynq.c
+++ b/drivers/serial/serial_zynq.c
@@ -17,8 +17,6 @@
 #include <serial.h>
 #include <asm/arch/hardware.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define ZYNQ_UART_SR_TXEMPTY	(1 << 3) /* TX FIFO empty */
 #define ZYNQ_UART_SR_TXACTIVE	(1 << 11)  /* TX active */
 #define ZYNQ_UART_SR_RXEMPTY	0x00000002 /* RX FIFO empty */
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index c8dcb82150c1..f729347ee24a 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -15,8 +15,6 @@
 #include <spi.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
 #define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
 
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 3cdfd366ab8b..445d8652f903 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -24,8 +24,6 @@
 
 #include "atmel_spi.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_DM_SPI
 
 static int spi_has_wdrbt(struct atmel_spi_slave *slave)
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index 03d3fa6763da..71a665ecd415 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -22,8 +22,6 @@
 #include <dm/pinctrl.h>
 #include "rk_spi.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Change to 1 to output registers at the start of each transaction */
 #define DEBUG_RK_SPI	0
 
diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c
index 092b13b00bf6..75ba6a1ed7ef 100644
--- a/drivers/spi/sandbox_spi.c
+++ b/drivers/spi/sandbox_spi.c
@@ -20,8 +20,6 @@
 #include <asm/state.h>
 #include <dm/device-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_SPI_IDLE_VAL
 # define CONFIG_SPI_IDLE_VAL 0xFF
 #endif
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 04b4fce0612b..faf609bba5cb 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -14,8 +14,6 @@
 #include <spi.h>
 #include "tegra_spi.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* COMMAND1 */
 #define SPI_CMD1_GO			BIT(31)
 #define SPI_CMD1_M_S			BIT(30)
diff --git a/drivers/spmi/spmi-sandbox.c b/drivers/spmi/spmi-sandbox.c
index 980aff2063a5..a938e50d226e 100644
--- a/drivers/spmi/spmi-sandbox.c
+++ b/drivers/spmi/spmi-sandbox.c
@@ -15,8 +15,6 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define EMUL_GPIO_PID_START 0xC0
 #define EMUL_GPIO_PID_END   0xC3
 
diff --git a/drivers/spmi/spmi-uclass.c b/drivers/spmi/spmi-uclass.c
index 6edece23d82b..e74cd79961a3 100644
--- a/drivers/spmi/spmi-uclass.c
+++ b/drivers/spmi/spmi-uclass.c
@@ -12,8 +12,6 @@
 #include <spmi/spmi.h>
 #include <linux/ctype.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int spmi_reg_read(struct udevice *dev, int usid, int pid, int reg)
 {
 	const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c
index 12b3e5f86eb0..207cc282f155 100644
--- a/drivers/sysreset/sysreset_sandbox.c
+++ b/drivers/sysreset/sysreset_sandbox.c
@@ -12,8 +12,6 @@
 #include <asm/state.h>
 #include <asm/test.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int sandbox_warm_sysreset_request(struct udevice *dev,
 					 enum sysreset_t type)
 {
diff --git a/drivers/timer/ag101p_timer.c b/drivers/timer/ag101p_timer.c
index 8dc85c4183cc..f9ff5c15b41c 100644
--- a/drivers/timer/ag101p_timer.c
+++ b/drivers/timer/ag101p_timer.c
@@ -12,8 +12,6 @@
 #include <timer.h>
 #include <linux/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Timer Control Register
  */
diff --git a/drivers/timer/altera_timer.c b/drivers/timer/altera_timer.c
index 1ba85c439965..f80debb2d7f8 100644
--- a/drivers/timer/altera_timer.c
+++ b/drivers/timer/altera_timer.c
@@ -14,8 +14,6 @@
 #include <timer.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* control register */
 #define ALTERA_TIMER_CONT	BIT(1)	/* Continuous mode */
 #define ALTERA_TIMER_START	BIT(2)	/* Start timer */
diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c
index e194c50f4a76..ab1e4af79feb 100644
--- a/drivers/timer/ast_timer.c
+++ b/drivers/timer/ast_timer.c
@@ -11,8 +11,6 @@
 #include <asm/io.h>
 #include <asm/arch/timer.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define AST_TICK_TIMER  1
 #define AST_TMC_RELOAD_VAL  0xffffffff
 
diff --git a/drivers/timer/atcpit100_timer.c b/drivers/timer/atcpit100_timer.c
index 963f978d206f..4322921b71b4 100644
--- a/drivers/timer/atcpit100_timer.c
+++ b/drivers/timer/atcpit100_timer.c
@@ -12,8 +12,6 @@
 #include <timer.h>
 #include <linux/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define REG32_TMR(x)	(*(u32 *)	((plat->regs) + (x>>2)))
 
 /*
diff --git a/drivers/timer/omap-timer.c b/drivers/timer/omap-timer.c
index 4cc610550573..051c69081e85 100644
--- a/drivers/timer/omap-timer.c
+++ b/drivers/timer/omap-timer.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Timer register bits */
 #define TCLR_START			BIT(0)	/* Start=1 */
 #define TCLR_AUTO_RELOAD		BIT(1)	/* Auto reload */
diff --git a/drivers/tpm/tpm_tis_infineon.c b/drivers/tpm/tpm_tis_infineon.c
index 41b748e7a23e..f740c780525c 100644
--- a/drivers/tpm/tpm_tis_infineon.c
+++ b/drivers/tpm/tpm_tis_infineon.c
@@ -33,8 +33,6 @@
 #include "tpm_tis.h"
 #include "tpm_internal.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum i2c_chip_type {
 	SLB9635,
 	SLB9645,
diff --git a/drivers/usb/emul/sandbox_flash.c b/drivers/usb/emul/sandbox_flash.c
index 2f84b360ec6b..dbece6ecf297 100644
--- a/drivers/usb/emul/sandbox_flash.c
+++ b/drivers/usb/emul/sandbox_flash.c
@@ -11,8 +11,6 @@
 #include <scsi.h>
 #include <usb.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * This driver emulates a flash stick using the UFI command specification and
  * the BBB (bulk/bulk/bulk) protocol. It supports only a single logical unit
diff --git a/drivers/usb/emul/sandbox_hub.c b/drivers/usb/emul/sandbox_hub.c
index 9a0f47b81c4d..f5dda8123f2d 100644
--- a/drivers/usb/emul/sandbox_hub.c
+++ b/drivers/usb/emul/sandbox_hub.c
@@ -10,8 +10,6 @@
 #include <usb.h>
 #include <dm/device-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* We only support up to 8 */
 #define SANDBOX_NUM_PORTS	4
 
diff --git a/drivers/usb/emul/sandbox_keyb.c b/drivers/usb/emul/sandbox_keyb.c
index cff017668f2d..2fb67e7611db 100644
--- a/drivers/usb/emul/sandbox_keyb.c
+++ b/drivers/usb/emul/sandbox_keyb.c
@@ -11,8 +11,6 @@
 #include <scsi.h>
 #include <usb.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * This driver emulates a USB keyboard using the USB HID specification (boot
  * protocol)
diff --git a/drivers/usb/emul/usb-emul-uclass.c b/drivers/usb/emul/usb-emul-uclass.c
index fbe11f313537..01ae6dfce785 100644
--- a/drivers/usb/emul/usb-emul-uclass.c
+++ b/drivers/usb/emul/usb-emul-uclass.c
@@ -10,8 +10,6 @@
 #include <usb.h>
 #include <dm/device-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int copy_to_unicode(char *buff, int length, const char *str)
 {
 	int ptr;
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 4862ab0e7db5..b63a630d37c5 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -19,8 +19,6 @@
 
 #include "dwc2.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Use only HC channel 0. */
 #define DWC2_HC_CHANNEL			0
 
diff --git a/drivers/usb/host/dwc3-of-simple.c b/drivers/usb/host/dwc3-of-simple.c
index 54a5f60b5280..aa77d62c4933 100644
--- a/drivers/usb/host/dwc3-of-simple.c
+++ b/drivers/usb/host/dwc3-of-simple.c
@@ -17,8 +17,6 @@
 #include <reset.h>
 #include <clk.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct dwc3_of_simple {
 	struct clk_bulk		clks;
 	struct reset_ctl_bulk	resets;
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index f6c6b019caa8..f912510a21e5 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -15,8 +15,6 @@
 
 #include "ehci.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_DM_USB
 
 int ehci_hcd_init(int index, enum usb_init_type init,
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index f317cf00ea0a..f07a287dd452 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -20,8 +20,6 @@
 
 #include "ehci.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define USB1_ADDR_MASK	0xFFFF0000
 
 #define HOSTPC1_DEVLC	0x84
diff --git a/drivers/usb/host/usb-sandbox.c b/drivers/usb/host/usb-sandbox.c
index 15055b351a5a..1a35a00bffba 100644
--- a/drivers/usb/host/usb-sandbox.c
+++ b/drivers/usb/host/usb-sandbox.c
@@ -10,8 +10,6 @@
 #include <usb.h>
 #include <dm/root.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct sandbox_usb_ctrl {
 	int rootdev;
 };
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 4e40f4bc3d2c..fa7a4397e4d6 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -16,8 +16,6 @@
 #include <dm/lists.h>
 #include <dm/uclass-internal.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 extern bool usb_started; /* flag for the started/stopped USB status */
 static bool asynch_allowed;
 
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index c1007350b729..7f5e263f9c47 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -19,8 +19,6 @@
 #include <linux/usb/dwc3.h>
 #include <linux/usb/otg.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct xhci_dwc3_platdata {
 	struct phy *usb_phys;
 	int num_phys;
diff --git a/drivers/usb/host/xhci-fsl.c b/drivers/usb/host/xhci-fsl.c
index f77c78d42212..25b14a9a8db4 100644
--- a/drivers/usb/host/xhci-fsl.c
+++ b/drivers/usb/host/xhci-fsl.c
@@ -20,8 +20,6 @@
 #include <dm.h>
 
 /* Declare global data pointer */
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_DM_USB
 static struct fsl_xhci fsl_xhci;
 unsigned long ctr_addr[] = FSL_USB_XHCI_ADDR;
diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index dbdfce38da20..f51e67738640 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -15,8 +15,6 @@
 
 #include "xhci.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct mvebu_xhci_platdata {
 	fdt_addr_t hcd_base;
 };
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index b814500bdbb7..d05b30280731 100644
--- a/drivers/usb/host/xhci-omap.c
+++ b/drivers/usb/host/xhci-omap.c
@@ -23,8 +23,6 @@
 #include "xhci.h"
 
 /* Declare global data pointer */
-DECLARE_GLOBAL_DATA_PTR;
-
 static struct omap_xhci omap;
 
 static int omap_xhci_core_init(struct omap_xhci *omap)
diff --git a/drivers/usb/host/xhci-rockchip.c b/drivers/usb/host/xhci-rockchip.c
index b1f988427397..7f637d9237d3 100644
--- a/drivers/usb/host/xhci-rockchip.c
+++ b/drivers/usb/host/xhci-rockchip.c
@@ -16,8 +16,6 @@
 
 #include "xhci.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct rockchip_xhci_platdata {
 	fdt_addr_t hcd_base;
 	fdt_addr_t phy_base;
diff --git a/drivers/usb/host/xhci-zynqmp.c b/drivers/usb/host/xhci-zynqmp.c
index cec1bc46d0a8..c57e9abbaf4e 100644
--- a/drivers/usb/host/xhci-zynqmp.c
+++ b/drivers/usb/host/xhci-zynqmp.c
@@ -19,8 +19,6 @@
 #include "xhci.h"
 
 /* Declare global data pointer */
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Default to the ZYNQMP XHCI defines */
 #define USB3_PWRCTL_CLK_CMD_MASK	0x3FE000
 #define USB3_PWRCTL_CLK_FREQ_MASK	0xFFC
diff --git a/drivers/video/backlight_gpio.c b/drivers/video/backlight_gpio.c
index 772df5d3026d..acb6f1c1b83f 100644
--- a/drivers/video/backlight_gpio.c
+++ b/drivers/video/backlight_gpio.c
@@ -10,8 +10,6 @@
 #include <backlight.h>
 #include <asm/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct gpio_backlight_priv {
 	struct gpio_desc gpio;
 	bool def_value;
diff --git a/drivers/video/bridge/anx6345.c b/drivers/video/bridge/anx6345.c
index 0a94affb9f99..6f52d2f04165 100644
--- a/drivers/video/bridge/anx6345.c
+++ b/drivers/video/bridge/anx6345.c
@@ -16,8 +16,6 @@
 #define DP_MAX_LANE_COUNT		0x002
 #define DP_MAX_LANE_COUNT_MASK		0x1f
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct anx6345_priv {
 	u8 edid[EDID_SIZE];
 };
diff --git a/drivers/video/exynos/exynos_dp_lowlevel.c b/drivers/video/exynos/exynos_dp_lowlevel.c
index f84dd7097f69..3f9a0e12fcd6 100644
--- a/drivers/video/exynos/exynos_dp_lowlevel.c
+++ b/drivers/video/exynos/exynos_dp_lowlevel.c
@@ -17,8 +17,6 @@
 #include "exynos_dp_lowlevel.h"
 
 /* Declare global data pointer */
-DECLARE_GLOBAL_DATA_PTR;
-
 static void exynos_dp_enable_video_input(struct exynos_dp *dp_regs,
 					 unsigned int enable)
 {
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 78e595ea4a27..fad027f0647a 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -344,8 +344,6 @@ union chan_param_mem {
 	struct chan_param_mem_interleaved	ip;
 };
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* graphics setup */
 static GraphicDevice panel;
 static struct ctfb_res_modes *mode;
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index f40e57bb8e68..28565a1e2c09 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -12,8 +12,6 @@
 #include <asm/gpio.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct pwm_backlight_priv {
 	struct udevice *reg;
 	struct gpio_desc enable;
diff --git a/drivers/video/rockchip/rk3288_mipi.c b/drivers/video/rockchip/rk3288_mipi.c
index a7fa9c5110eb..0a6f7e6b6dbb 100644
--- a/drivers/video/rockchip/rk3288_mipi.c
+++ b/drivers/video/rockchip/rk3288_mipi.c
@@ -24,8 +24,6 @@
 #include <asm/arch/grf_rk3288.h>
 #include <asm/arch/rockchip_mipi_dsi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MHz 1000000
 
 /* Select mipi dsi source, big or little vop */
diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c
index b936fcec9ba8..c085d8b6a595 100644
--- a/drivers/video/rockchip/rk3399_mipi.c
+++ b/drivers/video/rockchip/rk3399_mipi.c
@@ -24,8 +24,6 @@
 #include <asm/arch/grf_rk3399.h>
 #include <asm/arch/rockchip_mipi_dsi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Select mipi dsi source, big or little vop */
 static int rk_mipi_dsi_source_select(struct udevice *dev)
 {
diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c
index 1527f96eca22..2ea7340e7f1e 100644
--- a/drivers/video/rockchip/rk_edp.c
+++ b/drivers/video/rockchip/rk_edp.c
@@ -20,8 +20,6 @@
 #include <asm/arch/grf_rk3288.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MAX_CR_LOOP 5
 #define MAX_EQ_LOOP 5
 #define DP_LINK_STATUS_SIZE 6
diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c
index c0ce199c6af0..8824f47e2ea7 100644
--- a/drivers/video/simple_panel.c
+++ b/drivers/video/simple_panel.c
@@ -12,8 +12,6 @@
 #include <asm/gpio.h>
 #include <power/regulator.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct simple_panel_priv {
 	struct udevice *reg;
 	struct udevice *backlight;
diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index 4164fa1bd96c..0c6882cc51bf 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -22,8 +22,6 @@
 #include <dm/uclass-internal.h>
 #include "displayport.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* return in 1000ths of a Hertz */
 static int tegra_dc_calc_refresh(const struct display_timing *timing)
 {
diff --git a/drivers/video/tegra124/dp.c b/drivers/video/tegra124/dp.c
index 95d743d0f43f..09e5aa75a279 100644
--- a/drivers/video/tegra124/dp.c
+++ b/drivers/video/tegra124/dp.c
@@ -18,8 +18,6 @@
 #include "sor.h"
 #include "displayport.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DO_FAST_LINK_TRAINING		1
 
 struct tegra_dp_plat {
diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c
index 700ab25d4678..a91643a21a03 100644
--- a/drivers/video/tegra124/sor.c
+++ b/drivers/video/tegra124/sor.c
@@ -17,8 +17,6 @@
 #include "displayport.h"
 #include "sor.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DEBUG_SOR 0
 
 #define APBDEV_PMC_DPD_SAMPLE				0x20
diff --git a/drivers/watchdog/ast_wdt.c b/drivers/watchdog/ast_wdt.c
index aab077e3d1eb..353984484087 100644
--- a/drivers/watchdog/ast_wdt.c
+++ b/drivers/watchdog/ast_wdt.c
@@ -14,8 +14,6 @@
 #define WDT_AST2500	2500
 #define WDT_AST2400	2400
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct ast_wdt_priv {
 	struct ast_wdt *regs;
 };
diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c
index ded80c4d6a99..5d2b624e0024 100644
--- a/drivers/watchdog/mpc8xx_wdt.c
+++ b/drivers/watchdog/mpc8xx_wdt.c
@@ -9,8 +9,6 @@
 #include <asm/cpm_8xx.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void hw_watchdog_reset(void)
 {
 	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
diff --git a/drivers/watchdog/sandbox_wdt.c b/drivers/watchdog/sandbox_wdt.c
index 02b57f39865c..5ec32b25d61e 100644
--- a/drivers/watchdog/sandbox_wdt.c
+++ b/drivers/watchdog/sandbox_wdt.c
@@ -9,8 +9,6 @@
 #include <wdt.h>
 #include <asm/state.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int sandbox_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
 {
 	struct sandbox_state *state = state_get_current();
diff --git a/drivers/watchdog/ulp_wdog.c b/drivers/watchdog/ulp_wdog.c
index 72ec694cdd46..17fe670ce4c9 100644
--- a/drivers/watchdog/ulp_wdog.c
+++ b/drivers/watchdog/ulp_wdog.c
@@ -40,8 +40,6 @@ struct wdog_regs {
 #define WDG_32KHZ_CLK                    (0x2)
 #define WDG_EXT_CLK                      (0x3)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 void hw_watchdog_set_timeout(u16 val)
 {
 	/* setting timeout value */
diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c
index 8a30f024fdbf..1eb5721d1a60 100644
--- a/drivers/watchdog/wdt-uclass.c
+++ b/drivers/watchdog/wdt-uclass.c
@@ -11,8 +11,6 @@
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
 	const struct wdt_ops *ops = device_get_ops(dev);
diff --git a/env/ext4.c b/env/ext4.c
index a2d32b9c8dea..f4cb28570c47 100644
--- a/env/ext4.c
+++ b/env/ext4.c
@@ -31,8 +31,6 @@
 #include <ext4fs.h>
 #include <mmc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_CMD_SAVEENV
 static int env_ext4_save(void)
 {
diff --git a/env/fat.c b/env/fat.c
index 884eeb8c5fc1..befbc1efdd31 100644
--- a/env/fat.c
+++ b/env/fat.c
@@ -31,8 +31,6 @@
 # endif
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CMD_SAVEENV
 static int env_fat_save(void)
 {
diff --git a/env/sata.c b/env/sata.c
index 4bfe0119df88..c3e530eb314f 100644
--- a/env/sata.c
+++ b/env/sata.c
@@ -24,8 +24,6 @@
 #error CONFIG_ENV_OFFSET or CONFIG_ENV_SIZE not defined
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 __weak int sata_get_env_dev(void)
 {
 	return CONFIG_SYS_SATA_ENV_DEV;
diff --git a/lib/efi/efi.c b/lib/efi/efi.c
index 81af27caab12..b1c7360ddcd5 100644
--- a/lib/efi/efi.c
+++ b/lib/efi/efi.c
@@ -17,8 +17,6 @@
 #include <efi.h>
 #include <efi_api.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Unfortunately we cannot access any code outside what is built especially
  * for the stub. lib/string.c is already being built for the U-Boot payload
diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c
index 205aa1994726..acf60beb4e18 100644
--- a/lib/efi/efi_stub.c
+++ b/lib/efi/efi_stub.c
@@ -21,8 +21,6 @@
 #include <linux/err.h>
 #include <linux/types.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_X86
 /*
  * Problem areas:
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index d5fbba313835..2ccd476e57a2 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -13,8 +13,6 @@
 #include <pe.h>
 #include <asm/global_data.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
 const efi_guid_t efi_guid_device_path = DEVICE_PATH_GUID;
 const efi_guid_t efi_guid_loaded_image = LOADED_IMAGE_GUID;
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 9afe76cdb31d..e3132e6c172e 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -12,8 +12,6 @@
 #include <lcd.h>
 #include <malloc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static const efi_guid_t efi_net_guid = EFI_SIMPLE_NETWORK_GUID;
 static const efi_guid_t efi_pxe_guid = EFI_PXE_GUID;
 static struct efi_pxe_packet *dhcp_ack;
diff --git a/lib/of_live.c b/lib/of_live.c
index 148865c9678d..e574ae8a396c 100644
--- a/lib/of_live.c
+++ b/lib/of_live.c
@@ -16,8 +16,6 @@
 #include <dm/of_access.h>
 #include <linux/err.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static void *unflatten_dt_alloc(void **mem, unsigned long size,
 				unsigned long align)
 {
diff --git a/lib/smbios.c b/lib/smbios.c
index 8f19ad89c121..00b521eca92b 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -16,8 +16,6 @@
 #include <dm/uclass-internal.h>
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * smbios_add_string() - add a string to the string area
  *
diff --git a/net/net.c b/net/net.c
index 8a9b69c6b0b0..d222c1f2bd42 100644
--- a/net/net.c
+++ b/net/net.c
@@ -108,8 +108,6 @@
 #include "sntp.h"
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /** BOOTP EXTENTIONS **/
 
 /* Our subnet mask (0=unknown) */
diff --git a/post/lib_powerpc/cpu.c b/post/lib_powerpc/cpu.c
index 915eb0a7648b..529f2fa65a2a 100644
--- a/post/lib_powerpc/cpu.c
+++ b/post/lib_powerpc/cpu.c
@@ -42,8 +42,6 @@ extern int cpu_post_test_multi (void);
 extern int cpu_post_test_string (void);
 extern int cpu_post_test_complex (void);
 
-DECLARE_GLOBAL_DATA_PTR;
-
 ulong cpu_post_makecr (long v)
 {
 	ulong cr = 0;
diff --git a/test/dm/adc.c b/test/dm/adc.c
index b0d4fe5b23c0..85535d9eabc7 100644
--- a/test/dm/adc.c
+++ b/test/dm/adc.c
@@ -20,8 +20,6 @@
 #include <sandbox-adc.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int dm_test_adc_bind(struct unit_test_state *uts)
 {
 	struct udevice *dev;
diff --git a/test/dm/eth.c b/test/dm/eth.c
index 67fd660ee4f5..4915baf07c35 100644
--- a/test/dm/eth.c
+++ b/test/dm/eth.c
@@ -18,8 +18,6 @@
 #include <asm/eth.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define DM_TEST_ETH_NUM		4
 
 static int dm_test_eth(struct unit_test_state *uts)
diff --git a/test/dm/gpio.c b/test/dm/gpio.c
index b99452340dfc..6b01dbd73c39 100644
--- a/test/dm/gpio.c
+++ b/test/dm/gpio.c
@@ -13,8 +13,6 @@
 #include <asm/gpio.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Test that sandbox GPIOs work correctly */
 static int dm_test_gpio(struct unit_test_state *uts)
 {
diff --git a/test/dm/led.c b/test/dm/led.c
index fde700be3864..e46b41674d90 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -11,8 +11,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Base test of the led uclass */
 static int dm_test_led_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/mmc.c b/test/dm/mmc.c
index 5bca4b79d597..c8c470c1b1f4 100644
--- a/test/dm/mmc.c
+++ b/test/dm/mmc.c
@@ -10,8 +10,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Basic test of the mmc uclass. We could expand this by implementing an MMC
  * stack for sandbox, or at least implementing the basic operation.
diff --git a/test/dm/phy.c b/test/dm/phy.c
index 65b33fe68d1e..b262531962b5 100644
--- a/test/dm/phy.c
+++ b/test/dm/phy.c
@@ -11,8 +11,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Base test of the phy uclass */
 static int dm_test_phy_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/pmic.c b/test/dm/pmic.c
index 422ea3e41685..0e5d6719248e 100644
--- a/test/dm/pmic.c
+++ b/test/dm/pmic.c
@@ -21,8 +21,6 @@
 #include <power/sandbox_pmic.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Test PMIC get method */
 static int dm_test_power_pmic_get(struct unit_test_state *uts)
 {
diff --git a/test/dm/pwm.c b/test/dm/pwm.c
index 6b2dedf6ccd6..cccd1ad16204 100644
--- a/test/dm/pwm.c
+++ b/test/dm/pwm.c
@@ -10,8 +10,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Basic test of the pwm uclass */
 static int dm_test_pwm_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/regmap.c b/test/dm/regmap.c
index 7f66058735e1..50af22006c2d 100644
--- a/test/dm/regmap.c
+++ b/test/dm/regmap.c
@@ -13,8 +13,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Base test of register maps */
 static int dm_test_regmap_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/regulator.c b/test/dm/regulator.c
index 395381d4bd2f..abd65221371f 100644
--- a/test/dm/regulator.c
+++ b/test/dm/regulator.c
@@ -22,8 +22,6 @@
 #include <power/sandbox_pmic.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
 	BUCK1,
 	BUCK2,
diff --git a/test/dm/spmi.c b/test/dm/spmi.c
index d519a9015e69..0ecf70259b9c 100644
--- a/test/dm/spmi.c
+++ b/test/dm/spmi.c
@@ -16,8 +16,6 @@
 #include <asm/gpio.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Test if bus childs got probed propperly*/
 static int dm_test_spmi_probe(struct unit_test_state *uts)
 {
diff --git a/test/dm/syscon.c b/test/dm/syscon.c
index c40f5fc09dd8..99bff962a9aa 100644
--- a/test/dm/syscon.c
+++ b/test/dm/syscon.c
@@ -11,8 +11,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Base test of system controllers */
 static int dm_test_syscon_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/timer.c b/test/dm/timer.c
index bf964c443a05..ba9bdc10caeb 100644
--- a/test/dm/timer.c
+++ b/test/dm/timer.c
@@ -10,8 +10,6 @@
 #include <dm/test.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Basic test of the timer uclass.
  */
diff --git a/test/dm/usb.c b/test/dm/usb.c
index 4fd249bf64e8..4e1c870408ac 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -16,8 +16,6 @@
 #include <dm/uclass-internal.h>
 #include <test/ut.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Test that sandbox USB works correctly */
 static int dm_test_usb_base(struct unit_test_state *uts)
 {
diff --git a/test/dm/video.c b/test/dm/video.c
index caca49690274..2f7df4e61150 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -24,8 +24,6 @@
  * in sandbox_sdl_sync() would also need to change to handle the different
  * surface depth.
  */
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Basic test of the video uclass */
 static int dm_test_video_base(struct unit_test_state *uts)
 {
-- 
2.7.4



More information about the U-Boot mailing list