[U-Boot] [PATCH 00/16] Clean up board_f sequence a little more

This series continues the effort to remove #ifdefs from the board_f init sequence. It follows on from the first series.
With both series applied the number of references to CONFIG in board_f.c drops from 178 to 137:
strings common/board_f.c |grep -c CONFIG
Simon Glass (16): board_f: Drop board_type parameter from initdram() board_f: Drop return value from initdram() board_f: Rename initdram() to dram_init() xtensa: Place relocated U-Boot in the normal place board_f: Use a single condition for reserve_logbuffer() board_f: Move the extra #ifdef condition into reserve_mmu() board_f: Put video memory reservation in one function board_f: Drop CONFIG_SPL_BUILD check board_f: Drop setup_dram_config() wrapper Move dram_init_banksize() to a common header board_f: Drop unused headers board_f: Move errno.h down to the bottom powerpc: Move setup_board_extra() into a PPC file board_f: Make init_helpers generic board_f: Make relocation functions generic board_f: powerpc: Drop unused headers
arch/arc/include/asm/init_helpers.h | 12 -- arch/arc/include/asm/relocate.h | 16 -- arch/arm/cpu/arm926ejs/armada100/dram.c | 4 +- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 6 +- arch/arm/include/asm/u-boot-arm.h | 1 - arch/arm/mach-davinci/misc.c | 4 +- arch/arm/mach-meson/board.c | 4 +- arch/arm/mach-mvebu/arm64-common.c | 8 +- arch/arm/mach-mvebu/dram.c | 4 +- arch/arm/mach-omap2/am33xx/emif4.c | 4 +- arch/arm/mach-omap2/omap3/emif4.c | 4 +- arch/arm/mach-omap2/omap3/sdrc.c | 4 +- arch/arm/mach-orion5x/dram.c | 4 +- arch/arm/mach-tegra/board2.c | 4 +- arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 4 +- arch/arm/mach-uniphier/dram_init.c | 4 +- arch/mips/mach-ath79/dram.c | 8 +- arch/mips/mach-pic32/cpu.c | 6 +- arch/mips/mach-pic32/include/mach/ddr.h | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 4 +- arch/powerpc/cpu/mpc85xx/cpu.c | 14 +- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c | 18 ++- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c | 10 +- arch/powerpc/cpu/ppc4xx/sdram.c | 18 ++- arch/powerpc/cpu/ppc4xx/spl_boot.c | 2 +- arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/setup.c | 32 ++++ arch/x86/cpu/broadwell/sdram.c | 4 +- arch/x86/cpu/coreboot/sdram.c | 4 +- arch/x86/cpu/efi/sdram.c | 4 +- arch/x86/cpu/ivybridge/sdram.c | 4 +- arch/x86/cpu/qemu/dram.c | 4 +- arch/x86/cpu/quark/dram.c | 4 +- arch/x86/include/asm/relocate.h | 17 --- arch/x86/include/asm/u-boot-x86.h | 1 - arch/x86/lib/efi/efi.c | 6 +- arch/x86/lib/fsp/fsp_dram.c | 4 +- arch/x86/lib/relocate.c | 2 +- arch/x86/lib/spl.c | 2 +- arch/xtensa/cpu/cpu.c | 5 + arch/xtensa/include/asm/relocate.h | 14 -- arch/xtensa/lib/relocate.c | 2 +- board/AndesTech/adp-ag101p/adp-ag101p.c | 4 +- board/Arcturus/ucp1020/spl.c | 2 +- board/BuS/eb_cpu5282/eb_cpu5282.c | 6 +- board/a3m071/a3m071.c | 6 +- board/a4m072/a4m072.c | 8 +- board/amcc/acadia/memory.c | 8 +- board/amcc/bamboo/bamboo.c | 8 +- board/amcc/bubinga/bubinga.c | 10 +- board/amcc/sequoia/sdram.c | 8 +- board/amcc/walnut/walnut.c | 10 +- board/amcc/yosemite/yosemite.c | 7 +- board/armadeus/apf27/apf27.c | 4 +- board/armltd/vexpress/vexpress_common.c | 4 +- board/armltd/vexpress64/vexpress64.c | 4 +- board/astro/mcf5373l/mcf5373l.c | 6 +- board/beckhoff/mx53cx9020/mx53cx9020.c | 4 +- board/broadcom/bcm23550_w1d/bcm23550_w1d.c | 4 +- board/broadcom/bcm28155_ap/bcm28155_ap.c | 4 +- board/broadcom/bcm_ep/board.c | 4 +- board/broadcom/bcmns2/northstar2.c | 4 +- board/cadence/xtfpga/xtfpga.c | 4 +- board/canmb/canmb.c | 8 +- board/cirrus/edb93xx/edb93xx.c | 4 +- board/cm5200/cm5200.c | 8 +- board/cobra5272/cobra5272.c | 7 +- board/compulab/cm_fx6/cm_fx6.c | 4 +- board/davedenx/aria/aria.c | 6 +- board/dbau1x00/dbau1x00.c | 8 +- board/denx/m53evk/m53evk.c | 4 +- board/esd/mecp5123/mecp5123.c | 6 +- board/esd/meesc/meesc.c | 4 +- board/esd/pmc440/sdram.c | 12 +- board/esd/vme8349/vme8349.c | 10 +- board/freescale/b4860qds/ddr.c | 6 +- board/freescale/b4860qds/spl.c | 2 +- board/freescale/c29xpcie/spl.c | 2 +- board/freescale/corenet_ds/ddr.c | 6 +- board/freescale/ls1021aqds/ddr.c | 10 +- board/freescale/ls1021aqds/ls1021aqds.c | 4 +- board/freescale/ls1043aqds/ddr.c | 6 +- board/freescale/ls1043aqds/ls1043aqds.c | 2 +- board/freescale/ls1043ardb/ddr.c | 6 +- board/freescale/ls1046aqds/ddr.c | 6 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1046ardb/ddr.c | 6 +- board/freescale/ls2080a/ddr.c | 8 +- board/freescale/ls2080aqds/ddr.c | 10 +- board/freescale/ls2080ardb/ddr.c | 10 +- board/freescale/m5208evbe/m5208evbe.c | 6 +- board/freescale/m52277evb/m52277evb.c | 6 +- board/freescale/m5235evb/m5235evb.c | 6 +- board/freescale/m5249evb/m5249evb.c | 9 +- board/freescale/m5253demo/m5253demo.c | 8 +- board/freescale/m5253evbe/m5253evbe.c | 8 +- board/freescale/m5272c3/m5272c3.c | 8 +- board/freescale/m5275evb/m5275evb.c | 8 +- board/freescale/m5282evb/m5282evb.c | 6 +- board/freescale/m53017evb/m53017evb.c | 6 +- board/freescale/m5329evb/m5329evb.c | 6 +- board/freescale/m5373evb/m5373evb.c | 6 +- board/freescale/m54418twr/m54418twr.c | 6 +- board/freescale/m54451evb/m54451evb.c | 6 +- board/freescale/m54455evb/m54455evb.c | 6 +- board/freescale/m547xevb/m547xevb.c | 6 +- board/freescale/m548xevb/m548xevb.c | 6 +- board/freescale/mpc5121ads/mpc5121ads.c | 6 +- board/freescale/mpc8308rdb/sdram.c | 8 +- board/freescale/mpc8313erdb/mpc8313erdb.c | 2 +- board/freescale/mpc8313erdb/sdram.c | 8 +- board/freescale/mpc8315erdb/mpc8315erdb.c | 2 +- board/freescale/mpc8315erdb/sdram.c | 10 +- board/freescale/mpc8323erdb/mpc8323erdb.c | 12 +- board/freescale/mpc832xemds/mpc832xemds.c | 12 +- board/freescale/mpc8349emds/mpc8349emds.c | 12 +- board/freescale/mpc8349itx/mpc8349itx.c | 10 +- board/freescale/mpc837xemds/mpc837xemds.c | 10 +- board/freescale/mpc837xerdb/mpc837xerdb.c | 10 +- board/freescale/mpc8610hpcd/mpc8610hpcd.c | 9 +- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 9 +- board/freescale/mx35pdk/mx35pdk.c | 4 +- board/freescale/mx53ard/mx53ard.c | 4 +- board/freescale/mx53loco/mx53loco.c | 4 +- board/freescale/mx53smd/mx53smd.c | 4 +- board/freescale/p1010rdb/spl.c | 2 +- board/freescale/p1022ds/spl.c | 2 +- board/freescale/p1_p2_rdb_pc/spl.c | 2 +- board/freescale/p2041rdb/ddr.c | 10 +- board/freescale/t102xqds/ddr.c | 6 +- board/freescale/t102xqds/spl.c | 2 +- board/freescale/t102xrdb/ddr.c | 6 +- board/freescale/t102xrdb/spl.c | 2 +- board/freescale/t1040qds/ddr.c | 6 +- board/freescale/t104xrdb/ddr.c | 6 +- board/freescale/t104xrdb/spl.c | 2 +- board/freescale/t208xqds/ddr.c | 6 +- board/freescale/t208xqds/spl.c | 2 +- board/freescale/t208xrdb/ddr.c | 6 +- board/freescale/t208xrdb/spl.c | 2 +- board/freescale/t4qds/ddr.c | 6 +- board/freescale/t4qds/spl.c | 2 +- board/freescale/t4rdb/ddr.c | 6 +- board/freescale/t4rdb/spl.c | 2 +- board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c | 6 +- board/gaisler/gr_ep2s60/gr_ep2s60.c | 6 +- board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c | 6 +- board/gaisler/grsim/grsim.c | 6 +- board/gaisler/grsim_leon2/grsim_leon2.c | 6 +- board/gdsys/mpc8308/sdram.c | 8 +- board/hisilicon/hikey/hikey.c | 4 +- board/ids/ids8313/ids8313.c | 8 +- board/ifm/ac14xx/ac14xx.c | 7 +- board/ifm/o2dnt2/o2dnt2.c | 6 +- board/imgtec/boston/ddr.c | 9 +- board/imgtec/malta/malta.c | 8 +- board/imgtec/xilfpga/xilfpga.c | 8 +- board/inka4x0/inka4x0.c | 8 +- board/intercontrol/digsy_mtc/digsy_mtc.c | 6 +- board/ipek01/ipek01.c | 6 +- board/jupiter/jupiter.c | 8 +- board/keymile/km82xx/km82xx.c | 8 +- board/keymile/km83xx/km83xx.c | 10 +- board/keymile/kmp204x/ddr.c | 8 +- board/liebherr/lwmon5/sdram.c | 8 +- board/micronas/vct/vct.c | 8 +- board/mini-box/picosam9g45/picosam9g45.c | 4 +- board/motionpro/motionpro.c | 8 +- board/mpc8308_p1m/sdram.c | 8 +- board/mpl/mip405/mip405.c | 8 +- board/mpl/pati/pati.c | 10 +- board/mpl/pip405/pip405.c | 8 +- board/munices/munices.c | 8 +- board/openrisc/openrisc-generic/openrisc-generic.c | 2 +- board/pb1x00/pb1x00.c | 8 +- board/pdm360ng/pdm360ng.c | 6 +- board/phytec/pcm030/pcm030.c | 8 +- board/qemu-mips/qemu-mips.c | 8 +- board/qualcomm/dragonboard410c/dragonboard410c.c | 4 +- board/rockchip/evb_rk3328/evb-rk3328.c | 4 +- board/rockchip/evb_rk3399/evb-rk3399.c | 4 +- board/ronetix/pm9261/pm9261.c | 4 +- board/ronetix/pm9263/pm9263.c | 4 +- board/ronetix/pm9g45/pm9g45.c | 4 +- board/samsung/arndale/arndale.c | 4 +- board/samsung/common/board.c | 4 +- board/samsung/goni/goni.c | 4 +- board/samsung/smdkc100/smdkc100.c | 4 +- board/samsung/smdkv310/smdkv310.c | 4 +- board/sbc8349/sbc8349.c | 10 +- board/sbc8641d/sbc8641d.c | 8 +- board/spear/common/spr_misc.c | 4 +- board/st/stih410-b2260/board.c | 4 +- board/st/stv0991/stv0991.c | 4 +- board/sysam/amcore/amcore.c | 9 +- board/ti/dra7xx/evm.c | 4 +- board/tqc/tqm5200/tqm5200.c | 8 +- board/tqc/tqm834x/tqm834x.c | 6 +- board/tqc/tqm8xx/tqm8xx.c | 7 +- board/v38b/v38b.c | 7 +- board/varisys/cyrus/ddr.c | 6 +- board/ve8313/ve8313.c | 6 +- board/xes/xpedite1000/xpedite1000.c | 6 +- board/xes/xpedite517x/xpedite517x.c | 8 +- .../xilinx/microblaze-generic/microblaze-generic.c | 4 +- .../xilinx/ppc405-generic/xilinx_ppc405_generic.c | 8 +- .../xilinx/ppc440-generic/xilinx_ppc440_generic.c | 8 +- board/xilinx/zynq/board.c | 4 +- board/xilinx/zynqmp/zynqmp.c | 4 +- board/zipitz2/zipitz2.c | 4 +- common/board_f.c | 162 ++++----------------- common/board_r.c | 4 +- drivers/ddr/fsl/main.c | 4 +- include/asm-generic/global_data.h | 6 + include/common.h | 26 +++- {arch/x86/include/asm => include}/init_helpers.h | 7 +- include/relocate.h | 39 +++++ 217 files changed, 976 insertions(+), 581 deletions(-) delete mode 100644 arch/arc/include/asm/init_helpers.h delete mode 100644 arch/arc/include/asm/relocate.h create mode 100644 arch/powerpc/lib/setup.c delete mode 100644 arch/x86/include/asm/relocate.h delete mode 100644 arch/xtensa/include/asm/relocate.h rename {arch/x86/include/asm => include}/init_helpers.h (56%) create mode 100644 include/relocate.h

It looks like only cm5200 and tqm8xx use this feature, so we don't really need it in generic code. Drop it and have the users access gd->board_type directly.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- arch/mips/mach-ath79/dram.c | 2 +- arch/mips/mach-pic32/cpu.c | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 2 +- arch/powerpc/cpu/mpc85xx/cpu.c | 4 ++-- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c | 4 ++-- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c | 2 +- arch/powerpc/cpu/ppc4xx/sdram.c | 4 ++-- arch/powerpc/cpu/ppc4xx/spl_boot.c | 2 +- board/Arcturus/ucp1020/spl.c | 2 +- board/BuS/eb_cpu5282/eb_cpu5282.c | 2 +- board/a3m071/a3m071.c | 2 +- board/a4m072/a4m072.c | 2 +- board/amcc/acadia/memory.c | 2 +- board/amcc/bamboo/bamboo.c | 2 +- board/amcc/bubinga/bubinga.c | 4 ++-- board/amcc/sequoia/sdram.c | 2 +- board/amcc/walnut/walnut.c | 4 ++-- board/amcc/yosemite/yosemite.c | 2 +- board/astro/mcf5373l/mcf5373l.c | 2 +- board/canmb/canmb.c | 2 +- board/cm5200/cm5200.c | 4 ++-- board/cobra5272/cobra5272.c | 2 +- board/davedenx/aria/aria.c | 2 +- board/dbau1x00/dbau1x00.c | 2 +- board/esd/mecp5123/mecp5123.c | 2 +- board/esd/pmc440/sdram.c | 2 +- board/esd/vme8349/vme8349.c | 2 +- board/freescale/b4860qds/ddr.c | 2 +- board/freescale/b4860qds/spl.c | 2 +- board/freescale/c29xpcie/spl.c | 2 +- board/freescale/corenet_ds/ddr.c | 2 +- board/freescale/ls1021aqds/ddr.c | 2 +- board/freescale/ls1021aqds/ls1021aqds.c | 2 +- board/freescale/ls1043aqds/ddr.c | 2 +- board/freescale/ls1043aqds/ls1043aqds.c | 2 +- board/freescale/ls1043ardb/ddr.c | 2 +- board/freescale/ls1046aqds/ddr.c | 2 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1046ardb/ddr.c | 2 +- board/freescale/ls2080a/ddr.c | 2 +- board/freescale/ls2080aqds/ddr.c | 2 +- board/freescale/ls2080ardb/ddr.c | 2 +- board/freescale/m5208evbe/m5208evbe.c | 2 +- board/freescale/m52277evb/m52277evb.c | 2 +- board/freescale/m5235evb/m5235evb.c | 2 +- board/freescale/m5249evb/m5249evb.c | 3 ++- board/freescale/m5253demo/m5253demo.c | 2 +- board/freescale/m5253evbe/m5253evbe.c | 2 +- board/freescale/m5272c3/m5272c3.c | 3 ++- board/freescale/m5275evb/m5275evb.c | 2 +- board/freescale/m5282evb/m5282evb.c | 2 +- board/freescale/m53017evb/m53017evb.c | 2 +- board/freescale/m5329evb/m5329evb.c | 2 +- board/freescale/m5373evb/m5373evb.c | 2 +- board/freescale/m54418twr/m54418twr.c | 2 +- board/freescale/m54451evb/m54451evb.c | 2 +- board/freescale/m54455evb/m54455evb.c | 2 +- board/freescale/m547xevb/m547xevb.c | 2 +- board/freescale/m548xevb/m548xevb.c | 2 +- board/freescale/mpc5121ads/mpc5121ads.c | 2 +- board/freescale/mpc8308rdb/sdram.c | 2 +- board/freescale/mpc8313erdb/mpc8313erdb.c | 2 +- board/freescale/mpc8313erdb/sdram.c | 2 +- board/freescale/mpc8315erdb/mpc8315erdb.c | 2 +- board/freescale/mpc8315erdb/sdram.c | 2 +- board/freescale/mpc8323erdb/mpc8323erdb.c | 2 +- board/freescale/mpc832xemds/mpc832xemds.c | 2 +- board/freescale/mpc8349emds/mpc8349emds.c | 2 +- board/freescale/mpc8349itx/mpc8349itx.c | 2 +- board/freescale/mpc837xemds/mpc837xemds.c | 2 +- board/freescale/mpc837xerdb/mpc837xerdb.c | 2 +- board/freescale/mpc8610hpcd/mpc8610hpcd.c | 3 +-- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 3 +-- board/freescale/p1010rdb/spl.c | 2 +- board/freescale/p1022ds/spl.c | 2 +- board/freescale/p1_p2_rdb_pc/spl.c | 2 +- board/freescale/p2041rdb/ddr.c | 2 +- board/freescale/t102xqds/ddr.c | 2 +- board/freescale/t102xqds/spl.c | 2 +- board/freescale/t102xrdb/ddr.c | 2 +- board/freescale/t102xrdb/spl.c | 2 +- board/freescale/t1040qds/ddr.c | 2 +- board/freescale/t104xrdb/ddr.c | 2 +- board/freescale/t104xrdb/spl.c | 2 +- board/freescale/t208xqds/ddr.c | 2 +- board/freescale/t208xqds/spl.c | 2 +- board/freescale/t208xrdb/ddr.c | 2 +- board/freescale/t208xrdb/spl.c | 2 +- board/freescale/t4qds/ddr.c | 2 +- board/freescale/t4qds/spl.c | 2 +- board/freescale/t4rdb/ddr.c | 2 +- board/freescale/t4rdb/spl.c | 2 +- board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c | 2 +- board/gaisler/gr_ep2s60/gr_ep2s60.c | 2 +- board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c | 2 +- board/gaisler/grsim/grsim.c | 2 +- board/gaisler/grsim_leon2/grsim_leon2.c | 2 +- board/gdsys/mpc8308/sdram.c | 2 +- board/ids/ids8313/ids8313.c | 2 +- board/ifm/ac14xx/ac14xx.c | 2 +- board/ifm/o2dnt2/o2dnt2.c | 2 +- board/imgtec/boston/ddr.c | 2 +- board/imgtec/malta/malta.c | 2 +- board/imgtec/xilfpga/xilfpga.c | 2 +- board/inka4x0/inka4x0.c | 2 +- board/intercontrol/digsy_mtc/digsy_mtc.c | 2 +- board/ipek01/ipek01.c | 2 +- board/jupiter/jupiter.c | 2 +- board/keymile/km82xx/km82xx.c | 2 +- board/keymile/km83xx/km83xx.c | 2 +- board/keymile/kmp204x/ddr.c | 2 +- board/liebherr/lwmon5/sdram.c | 2 +- board/micronas/vct/vct.c | 2 +- board/motionpro/motionpro.c | 2 +- board/mpc8308_p1m/sdram.c | 2 +- board/mpl/mip405/mip405.c | 4 ++-- board/mpl/pati/pati.c | 2 +- board/mpl/pip405/pip405.c | 4 ++-- board/munices/munices.c | 2 +- board/openrisc/openrisc-generic/openrisc-generic.c | 2 +- board/pb1x00/pb1x00.c | 2 +- board/pdm360ng/pdm360ng.c | 2 +- board/phytec/pcm030/pcm030.c | 2 +- board/qemu-mips/qemu-mips.c | 2 +- board/sbc8349/sbc8349.c | 2 +- board/sbc8641d/sbc8641d.c | 2 +- board/sysam/amcore/amcore.c | 2 +- board/tqc/tqm5200/tqm5200.c | 2 +- board/tqc/tqm834x/tqm834x.c | 2 +- board/tqc/tqm8xx/tqm8xx.c | 3 ++- board/v38b/v38b.c | 2 +- board/varisys/cyrus/ddr.c | 2 +- board/ve8313/ve8313.c | 2 +- board/xes/xpedite1000/xpedite1000.c | 2 +- board/xes/xpedite517x/xpedite517x.c | 2 +- board/xilinx/ppc405-generic/xilinx_ppc405_generic.c | 2 +- board/xilinx/ppc440-generic/xilinx_ppc440_generic.c | 2 +- common/board_f.c | 8 +------- include/asm-generic/global_data.h | 6 ++++++ include/common.h | 2 +- 141 files changed, 157 insertions(+), 156 deletions(-)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index 7e66ee08b5..583254519b 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -821,7 +821,7 @@ void update_early_mmu_table(void)
__weak int dram_init(void) { - gd->ram_size = initdram(0); + gd->ram_size = initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/arch/mips/mach-ath79/dram.c b/arch/mips/mach-ath79/dram.c index c29e98c2f4..5ef43a059d 100644 --- a/arch/mips/mach-ath79/dram.c +++ b/arch/mips/mach-ath79/dram.c @@ -9,7 +9,7 @@ #include <asm/addrspace.h> #include <mach/ddr.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ddr_tap_tuning(); return get_ram_size((void *)KSEG1, SZ_256M); diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index ac33391921..f15b58d849 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -110,7 +110,7 @@ static void ddr2_pmd_ungate(void) }
/* initialize the DDR2 Controller and DDR2 PHY */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ddr2_pmd_ungate(); ddr2_phy_init(); diff --git a/arch/powerpc/cpu/mpc5xxx/spl_boot.c b/arch/powerpc/cpu/mpc5xxx/spl_boot.c index e182dfbd45..23d2010343 100644 --- a/arch/powerpc/cpu/mpc5xxx/spl_boot.c +++ b/arch/powerpc/cpu/mpc5xxx/spl_boot.c @@ -62,7 +62,7 @@ void board_init_f(ulong bootflag) * First we need to initialize the SDRAM, so that the real * U-Boot or the OS (Linux) can be loaded */ - initdram(0); + initdram();
/* Clear bss */ memset(__bss_start, '\0', __bss_end - __bss_start); diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index cc30fa6e17..192634d41c 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -401,7 +401,7 @@ void mpc85xx_reginfo(void) #ifndef CONFIG_FSL_CORENET #if (defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)) && \ !defined(CONFIG_SYS_INIT_L2_ADDR) -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { #if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) || \ defined(CONFIG_ARCH_QEMU_E500) @@ -411,7 +411,7 @@ phys_size_t initdram(int board_type) #endif } #else /* CONFIG_SYS_RAMBOOT */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = 0;
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c index 7202c3fc46..3b79efb246 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c @@ -414,7 +414,7 @@ static unsigned char spd_read(uchar chip, uint addr) * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE}; @@ -2855,7 +2855,7 @@ static void test(void) * time parameters. * Configures the PPC405EX(r) and PPC460EX/GT *---------------------------------------------------------------------------*/ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { unsigned long val;
diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c index 455136c68c..3b072b7791 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c @@ -998,7 +998,7 @@ static void program_ddr0_44(unsigned long dimm_ranks[], * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { unsigned char const iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_ranks[MAXDIMMS]; diff --git a/arch/powerpc/cpu/ppc4xx/sdram.c b/arch/powerpc/cpu/ppc4xx/sdram.c index cd63456e70..2d805717a7 100644 --- a/arch/powerpc/cpu/ppc4xx/sdram.c +++ b/arch/powerpc/cpu/ppc4xx/sdram.c @@ -148,7 +148,7 @@ static ulong compute_rtr(ulong speed, ulong rows, ulong refresh) /* * Autodetect onboard SDRAM on 405 platforms */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong speed; ulong sdtr1; @@ -349,7 +349,7 @@ static void sdram_tr1_set(int ram_address, int* tr1_value) * so this should be extended for other future boards * using this routine! */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { int i; int tr1_bank1; diff --git a/arch/powerpc/cpu/ppc4xx/spl_boot.c b/arch/powerpc/cpu/ppc4xx/spl_boot.c index 318f23b646..f3aa46c4f1 100644 --- a/arch/powerpc/cpu/ppc4xx/spl_boot.c +++ b/arch/powerpc/cpu/ppc4xx/spl_boot.c @@ -26,7 +26,7 @@ void board_init_f(ulong bootflag) * First we need to initialize the SDRAM, so that the real * U-Boot or the OS (Linux) can be loaded */ - initdram(0); + initdram();
/* Clear bss */ memset(__bss_start, '\0', __bss_end - __bss_start); diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index 3a775be9ae..8a7fa1d97c 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -110,7 +110,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(0); + gd->ram_size = initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index b1740ee9b9..292752450d 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -35,7 +35,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { int size, i;
diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c index 55d0bc80c0..b11ff980b8 100644 --- a/board/a3m071/a3m071.c +++ b/board/a3m071/a3m071.c @@ -76,7 +76,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/a4m072/a4m072.c b/board/a4m072/a4m072.c index 20d8b80f7e..88d4942ce7 100644 --- a/board/a4m072/a4m072.c +++ b/board/a4m072/a4m072.c @@ -71,7 +71,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; uint svr, pvr; diff --git a/board/amcc/acadia/memory.c b/board/amcc/acadia/memory.c index 9673118857..841bcfa4bf 100644 --- a/board/amcc/acadia/memory.c +++ b/board/amcc/acadia/memory.c @@ -41,7 +41,7 @@ static void cram_bcr_write(u32 wr_val) return; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { int i; u32 val; diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c index 2838f9a1ed..ae69f5a1b1 100644 --- a/board/amcc/bamboo/bamboo.c +++ b/board/amcc/bamboo/bamboo.c @@ -436,7 +436,7 @@ int checkboard(void) }
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { return spd_sdram(); } diff --git a/board/amcc/bubinga/bubinga.c b/board/amcc/bubinga/bubinga.c index 9043de62d3..e3567173c2 100644 --- a/board/amcc/bubinga/bubinga.c +++ b/board/amcc/bubinga/bubinga.c @@ -52,10 +52,10 @@ int checkboard(void) }
/* ------------------------------------------------------------------------- - initdram(int board_type) reads EEPROM via I2c. EEPROM contains all of + initdram() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration ------------------------------------------------------------------------- */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return spd_sdram(); } diff --git a/board/amcc/sequoia/sdram.c b/board/amcc/sequoia/sdram.c index 67640d7edf..bb5c5ee449 100644 --- a/board/amcc/sequoia/sdram.c +++ b/board/amcc/sequoia/sdram.c @@ -31,7 +31,7 @@ extern void denali_core_search_data_eye(void); * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -phys_size_t initdram (int board_type) +phys_size_t initdram(void) { #if !defined(CONFIG_SYS_RAMBOOT) ulong speed = get_bus_freq(0); diff --git a/board/amcc/walnut/walnut.c b/board/amcc/walnut/walnut.c index c9482094f6..ca933d71a6 100644 --- a/board/amcc/walnut/walnut.c +++ b/board/amcc/walnut/walnut.c @@ -71,10 +71,10 @@ int checkboard(void) }
/* - * initdram(int board_type) reads EEPROM via I2c. EEPROM contains all of + * initdram() reads EEPROM via I2c. EEPROM contains all of * the necessary info for SDRAM controller configuration */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return spd_sdram(); } diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c index 56b5191d66..f61978c5d5 100644 --- a/board/amcc/yosemite/yosemite.c +++ b/board/amcc/yosemite/yosemite.c @@ -286,7 +286,7 @@ void sdram_tr1_set(int ram_address, int* tr1_value) *tr1_value = (first_good + last_bad) / 2; }
-phys_size_t initdram(int board) +phys_size_t initdram(void) { register uint reg; int tr1_bank1, tr1_bank2; diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c index 7ec7cb378f..70fcd61998 100644 --- a/board/astro/mcf5373l/mcf5373l.c +++ b/board/astro/mcf5373l/mcf5373l.c @@ -27,7 +27,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { #if !defined(CONFIG_MONITOR_IS_IN_RAM) sdram_t *sdp = (sdram_t *)(MMAP_SDRAM); diff --git a/board/canmb/canmb.c b/board/canmb/canmb.c index 15c934d29b..ba9930d370 100644 --- a/board/canmb/canmb.c +++ b/board/canmb/canmb.c @@ -65,7 +65,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c index fce998d00f..2ac9fd9cd1 100644 --- a/board/cm5200/cm5200.c +++ b/board/cm5200/cm5200.c @@ -97,14 +97,14 @@ static mem_conf_t* get_mem_config(int board_type) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT ulong test1, test2; mem_conf_t *mem_conf;
- mem_conf = get_mem_config(board_type); + mem_conf = get_mem_config(gd->board_type);
/* configure SDRAM start/end for detection */ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */ diff --git a/board/cobra5272/cobra5272.c b/board/cobra5272/cobra5272.c index 0f3bcc592a..9d4554da1f 100644 --- a/board/cobra5272/cobra5272.c +++ b/board/cobra5272/cobra5272.c @@ -16,7 +16,7 @@ int checkboard (void) return 0; };
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { volatile sdramctrl_t *sdp = (sdramctrl_t *) (MMAP_SDRAM);
diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c index 1b6c40f8d5..709c65ba0d 100644 --- a/board/davedenx/aria/aria.c +++ b/board/davedenx/aria/aria.c @@ -18,7 +18,7 @@
DECLARE_GLOBAL_DATA_PTR;
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { return fixed_sdram(NULL, NULL, 0); } diff --git a/board/dbau1x00/dbau1x00.c b/board/dbau1x00/dbau1x00.c index 75e6f0ef5a..cf2f88047d 100644 --- a/board/dbau1x00/dbau1x00.c +++ b/board/dbau1x00/dbau1x00.c @@ -11,7 +11,7 @@ #include <asm/mipsregs.h> #include <asm/io.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c index 656f0fa83f..b8eb32b1fb 100644 --- a/board/esd/mecp5123/mecp5123.c +++ b/board/esd/mecp5123/mecp5123.c @@ -62,7 +62,7 @@ int board_early_init_f(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return get_ram_size(0, fixed_sdram(NULL, NULL, 0)); } diff --git a/board/esd/pmc440/sdram.c b/board/esd/pmc440/sdram.c index e7f8115870..82ee289aa6 100644 --- a/board/esd/pmc440/sdram.c +++ b/board/esd/pmc440/sdram.c @@ -105,7 +105,7 @@ int initdram_by_rb(int rows, int banks) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t size; int n; diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index f8f1834b59..bf6ee7a73d 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -28,7 +28,7 @@
void ddr_enable_ecc(unsigned int dram_size);
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/b4860qds/ddr.c b/board/freescale/b4860qds/ddr.c index 99cd88466d..d070104618 100644 --- a/board/freescale/b4860qds/ddr.c +++ b/board/freescale/b4860qds/ddr.c @@ -176,7 +176,7 @@ found: popts->cpo_sample = 0x3e; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index 35b812cb18..17e2ba8953 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_NAND_BOOT nand_boot(); diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index 6613216950..785c859bee 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -67,7 +67,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_NAND_BOOT puts("TPL\n"); diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c index 9c1a4c2f7c..75de247a51 100644 --- a/board/freescale/corenet_ds/ddr.c +++ b/board/freescale/corenet_ds/ddr.c @@ -260,7 +260,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1021aqds/ddr.c b/board/freescale/ls1021aqds/ddr.c index 2f66ba9e7f..99a4984fbc 100644 --- a/board/freescale/ls1021aqds/ddr.c +++ b/board/freescale/ls1021aqds/ddr.c @@ -164,7 +164,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index 79078d237b..57314e2c9f 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -162,7 +162,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(0); + gd->ram_size = initdram();
return 0; } diff --git a/board/freescale/ls1043aqds/ddr.c b/board/freescale/ls1043aqds/ddr.c index c740062887..817c91a34a 100644 --- a/board/freescale/ls1043aqds/ddr.c +++ b/board/freescale/ls1043aqds/ddr.c @@ -108,7 +108,7 @@ found: #endif }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c index 6507c09143..755aef384e 100644 --- a/board/freescale/ls1043aqds/ls1043aqds.c +++ b/board/freescale/ls1043aqds/ls1043aqds.c @@ -153,7 +153,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(0); + gd->ram_size = initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/board/freescale/ls1043ardb/ddr.c b/board/freescale/ls1043ardb/ddr.c index f90b85df1a..b5c5b2ede3 100644 --- a/board/freescale/ls1043ardb/ddr.c +++ b/board/freescale/ls1043ardb/ddr.c @@ -170,7 +170,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1046aqds/ddr.c b/board/freescale/ls1046aqds/ddr.c index dc4d689adc..6a5cbbf739 100644 --- a/board/freescale/ls1046aqds/ddr.c +++ b/board/freescale/ls1046aqds/ddr.c @@ -92,7 +92,7 @@ found: popts->cpo_sample = 0x70; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c index af3f70a38b..f30dd23351 100644 --- a/board/freescale/ls1046aqds/ls1046aqds.c +++ b/board/freescale/ls1046aqds/ls1046aqds.c @@ -149,7 +149,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(0); + gd->ram_size = initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/board/freescale/ls1046ardb/ddr.c b/board/freescale/ls1046ardb/ddr.c index efe2ba6eb1..1e99538022 100644 --- a/board/freescale/ls1046ardb/ddr.c +++ b/board/freescale/ls1046ardb/ddr.c @@ -96,7 +96,7 @@ found: popts->cpo_sample = 0x70; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls2080a/ddr.c b/board/freescale/ls2080a/ddr.c index 5ed9e1461b..0bff922f07 100644 --- a/board/freescale/ls2080a/ddr.c +++ b/board/freescale/ls2080a/ddr.c @@ -158,7 +158,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, return 0; } #endif -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls2080aqds/ddr.c b/board/freescale/ls2080aqds/ddr.c index 0408c0fc25..bd32c54fc1 100644 --- a/board/freescale/ls2080aqds/ddr.c +++ b/board/freescale/ls2080aqds/ddr.c @@ -155,7 +155,7 @@ found: } }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls2080ardb/ddr.c b/board/freescale/ls2080ardb/ddr.c index 2851d5b443..b00e575ea2 100644 --- a/board/freescale/ls2080ardb/ddr.c +++ b/board/freescale/ls2080ardb/ddr.c @@ -158,7 +158,7 @@ found: } }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/m5208evbe/m5208evbe.c b/board/freescale/m5208evbe/m5208evbe.c index 1df128b268..6122750882 100644 --- a/board/freescale/m5208evbe/m5208evbe.c +++ b/board/freescale/m5208evbe/m5208evbe.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m52277evb/m52277evb.c b/board/freescale/m52277evb/m52277evb.c index a1127e52a3..571e1a6528 100644 --- a/board/freescale/m52277evb/m52277evb.c +++ b/board/freescale/m52277evb/m52277evb.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize;
diff --git a/board/freescale/m5235evb/m5235evb.c b/board/freescale/m5235evb/m5235evb.c index 68c1631f81..7aa0edfdc1 100644 --- a/board/freescale/m5235evb/m5235evb.c +++ b/board/freescale/m5235evb/m5235evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); gpio_t *gpio = (gpio_t *)(MMAP_GPIO); diff --git a/board/freescale/m5249evb/m5249evb.c b/board/freescale/m5249evb/m5249evb.c index 7ae842c3d3..b8544292a7 100644 --- a/board/freescale/m5249evb/m5249evb.c +++ b/board/freescale/m5249evb/m5249evb.c @@ -29,7 +29,8 @@ int checkboard (void) { };
-phys_size_t initdram (int board_type) { +phys_size_t initdram(void) +{ unsigned long junk = 0xa5a59696;
/* diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c index 7e516bfa40..fef2ca6af6 100644 --- a/board/freescale/m5253demo/m5253demo.c +++ b/board/freescale/m5253demo/m5253demo.c @@ -20,7 +20,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize = 0;
diff --git a/board/freescale/m5253evbe/m5253evbe.c b/board/freescale/m5253evbe/m5253evbe.c index 15ff755a56..3f4cdfbaf1 100644 --- a/board/freescale/m5253evbe/m5253evbe.c +++ b/board/freescale/m5253evbe/m5253evbe.c @@ -19,7 +19,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { /* * Check to see if the SDRAM has already been initialized diff --git a/board/freescale/m5272c3/m5272c3.c b/board/freescale/m5272c3/m5272c3.c index 3ed4a7da93..9fab24ebb9 100644 --- a/board/freescale/m5272c3/m5272c3.c +++ b/board/freescale/m5272c3/m5272c3.c @@ -18,7 +18,8 @@ int checkboard (void) { return 0; };
-phys_size_t initdram (int board_type) { +phys_size_t initdram(void) +{ sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
out_be16(&sdp->sdram_sdtr, 0xf539); diff --git a/board/freescale/m5275evb/m5275evb.c b/board/freescale/m5275evb/m5275evb.c index 16083d1bc0..00ce582249 100644 --- a/board/freescale/m5275evb/m5275evb.c +++ b/board/freescale/m5275evb/m5275evb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM); gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO); diff --git a/board/freescale/m5282evb/m5282evb.c b/board/freescale/m5282evb/m5282evb.c index 39f12fb4aa..19e56957bd 100644 --- a/board/freescale/m5282evb/m5282evb.c +++ b/board/freescale/m5282evb/m5282evb.c @@ -16,7 +16,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { u32 dramsize, i, dramclk;
diff --git a/board/freescale/m53017evb/m53017evb.c b/board/freescale/m53017evb/m53017evb.c index dbe886b03a..821e663b91 100644 --- a/board/freescale/m53017evb/m53017evb.c +++ b/board/freescale/m53017evb/m53017evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m5329evb/m5329evb.c b/board/freescale/m5329evb/m5329evb.c index 1f77adf4c2..c4613a4cbd 100644 --- a/board/freescale/m5329evb/m5329evb.c +++ b/board/freescale/m5329evb/m5329evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m5373evb/m5373evb.c b/board/freescale/m5373evb/m5373evb.c index bfcc4b23b0..f1ddee1378 100644 --- a/board/freescale/m5373evb/m5373evb.c +++ b/board/freescale/m5373evb/m5373evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m54418twr/m54418twr.c b/board/freescale/m54418twr/m54418twr.c index 5375d1675d..c3bee185d8 100644 --- a/board/freescale/m54418twr/m54418twr.c +++ b/board/freescale/m54418twr/m54418twr.c @@ -25,7 +25,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize;
diff --git a/board/freescale/m54451evb/m54451evb.c b/board/freescale/m54451evb/m54451evb.c index d2ad42c085..a4d11b6815 100644 --- a/board/freescale/m54451evb/m54451evb.c +++ b/board/freescale/m54451evb/m54451evb.c @@ -26,7 +26,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize; #ifdef CONFIG_CF_SBF diff --git a/board/freescale/m54455evb/m54455evb.c b/board/freescale/m54455evb/m54455evb.c index 76b4322a19..3bdcc332b6 100644 --- a/board/freescale/m54455evb/m54455evb.c +++ b/board/freescale/m54455evb/m54455evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize; #ifdef CONFIG_CF_SBF diff --git a/board/freescale/m547xevb/m547xevb.c b/board/freescale/m547xevb/m547xevb.c index 1e3cb6179f..e84a5ac4eb 100644 --- a/board/freescale/m547xevb/m547xevb.c +++ b/board/freescale/m547xevb/m547xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); diff --git a/board/freescale/m548xevb/m548xevb.c b/board/freescale/m548xevb/m548xevb.c index 05361550b3..06f9a5ede0 100644 --- a/board/freescale/m548xevb/m548xevb.c +++ b/board/freescale/m548xevb/m548xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index 7c44282ca2..e134091468 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -95,7 +95,7 @@ int is_micron(void){ return(ismicron); }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 msize = 0; /* diff --git a/board/freescale/mpc8308rdb/sdram.c b/board/freescale/mpc8308rdb/sdram.c index 89b665e649..ed1e84e003 100644 --- a/board/freescale/mpc8308rdb/sdram.c +++ b/board/freescale/mpc8308rdb/sdram.c @@ -65,7 +65,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c index 693dff651a..e3a5941f20 100644 --- a/board/freescale/mpc8313erdb/mpc8313erdb.c +++ b/board/freescale/mpc8313erdb/mpc8313erdb.c @@ -134,7 +134,7 @@ void board_init_f(ulong bootflag) CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE); puts("NAND boot... "); timer_init(); - initdram(0); + initdram(); relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, (gd_t *)gd, CONFIG_SYS_NAND_U_BOOT_RELOC); } diff --git a/board/freescale/mpc8313erdb/sdram.c b/board/freescale/mpc8313erdb/sdram.c index 6282c3d920..ce6fce5399 100644 --- a/board/freescale/mpc8313erdb/sdram.c +++ b/board/freescale/mpc8313erdb/sdram.c @@ -97,7 +97,7 @@ static long fixed_sdram(void) return msize; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index 1da6e2166d..7779b6daed 100644 --- a/board/freescale/mpc8315erdb/mpc8315erdb.c +++ b/board/freescale/mpc8315erdb/mpc8315erdb.c @@ -222,7 +222,7 @@ void board_init_f(ulong bootflag) CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE); puts("NAND boot... "); timer_init(); - initdram(0); + initdram(); relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000, (gd_t *)gd, CONFIG_SYS_NAND_U_BOOT_RELOC); } diff --git a/board/freescale/mpc8315erdb/sdram.c b/board/freescale/mpc8315erdb/sdram.c index 6c9431202f..fd8968c71c 100644 --- a/board/freescale/mpc8315erdb/sdram.c +++ b/board/freescale/mpc8315erdb/sdram.c @@ -92,7 +92,7 @@ static long fixed_sdram(void) } #endif /* CONFIG_SYS_RAMBOOT */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index 0a0152ad9e..f9f9a410c5 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -68,7 +68,7 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
int fixed_sdram(void);
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index adf425486e..d66ad33bf5 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -88,7 +88,7 @@ int board_early_init_r(void)
int fixed_sdram(void);
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 02b5040ef4..3bcfe03065 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -46,7 +46,7 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; phys_size_t msize = 0; diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 22a1d99c88..01eac0260f 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -116,7 +116,7 @@ volatile static struct pci_controller hose[] = { }; #endif /* CONFIG_PCI */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index 045841d57b..0463940bae 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -216,7 +216,7 @@ extern void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 07c0599858..d81778549c 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -60,7 +60,7 @@ void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 95e398c9f4..7668226321 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -116,8 +116,7 @@ int checkboard(void) }
-phys_size_t -initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 94633b5c99..1076442516 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -37,8 +37,7 @@ int checkboard(void) return 0; }
-phys_size_t -initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index 05c76f2e45..05da1dac7d 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -94,7 +94,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("\nTertiary program loader running in sram..."); #else diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index ef38551600..77ed2577f9 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -111,7 +111,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(0); + gd->ram_size = initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 2af5576ff7..3357702dba 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(0); + gd->ram_size = initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p2041rdb/ddr.c b/board/freescale/p2041rdb/ddr.c index b2493e1f61..b07bd98fb1 100644 --- a/board/freescale/p2041rdb/ddr.c +++ b/board/freescale/p2041rdb/ddr.c @@ -116,7 +116,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/t102xqds/ddr.c b/board/freescale/t102xqds/ddr.c index b6b1191990..507929bb70 100644 --- a/board/freescale/t102xqds/ddr.c +++ b/board/freescale/t102xqds/ddr.c @@ -169,7 +169,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index 3e96b33c40..a1481e9b63 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -142,7 +142,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t102xrdb/ddr.c b/board/freescale/t102xrdb/ddr.c index e66657869c..56f98ac2f9 100644 --- a/board/freescale/t102xrdb/ddr.c +++ b/board/freescale/t102xrdb/ddr.c @@ -229,7 +229,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index b70c2c5d79..f70a337512 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -129,7 +129,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t1040qds/ddr.c b/board/freescale/t1040qds/ddr.c index cb58d1e524..a5d3e54cfe 100644 --- a/board/freescale/t1040qds/ddr.c +++ b/board/freescale/t1040qds/ddr.c @@ -117,7 +117,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t104xrdb/ddr.c b/board/freescale/t104xrdb/ddr.c index 302f19be69..4a09cae782 100644 --- a/board/freescale/t104xrdb/ddr.c +++ b/board/freescale/t104xrdb/ddr.c @@ -120,7 +120,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 4402e0f4b0..076641c1ec 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -125,7 +125,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xqds/ddr.c b/board/freescale/t208xqds/ddr.c index d6e4554a80..044ac18562 100644 --- a/board/freescale/t208xqds/ddr.c +++ b/board/freescale/t208xqds/ddr.c @@ -104,7 +104,7 @@ found: popts->cpo_sample = 0x64; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index 334f5083b8..caa4de3e7f 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -128,7 +128,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xrdb/ddr.c b/board/freescale/t208xrdb/ddr.c index 3487261b9d..bcb536ae1b 100644 --- a/board/freescale/t208xrdb/ddr.c +++ b/board/freescale/t208xrdb/ddr.c @@ -97,7 +97,7 @@ found: popts->cpo_sample = 0x54; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index aa8e9285fe..44be70be87 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -98,7 +98,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4qds/ddr.c b/board/freescale/t4qds/ddr.c index 842073b6c6..24b1872560 100644 --- a/board/freescale/t4qds/ddr.c +++ b/board/freescale/t4qds/ddr.c @@ -112,7 +112,7 @@ found: popts->cpo_sample = 0x63; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index 5e946dc84f..bda0003565 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -133,7 +133,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4rdb/ddr.c b/board/freescale/t4rdb/ddr.c index 7b05821cf7..8596ccde1b 100644 --- a/board/freescale/t4rdb/ddr.c +++ b/board/freescale/t4rdb/ddr.c @@ -105,7 +105,7 @@ found: popts->cpo_sample = 0x64; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index a32e34ef96..d3a86e6599 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -91,7 +91,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(0); + gd->ram_size = initdram();
mmc_boot(); } diff --git a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c index d26212ea82..ecdc7e72d3 100644 --- a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c +++ b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c @@ -10,7 +10,7 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 1; } diff --git a/board/gaisler/gr_ep2s60/gr_ep2s60.c b/board/gaisler/gr_ep2s60/gr_ep2s60.c index 98fb45fdb8..66fe5a53b0 100644 --- a/board/gaisler/gr_ep2s60/gr_ep2s60.c +++ b/board/gaisler/gr_ep2s60/gr_ep2s60.c @@ -10,7 +10,7 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 1; } diff --git a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c index 32fbbe2d75..1725459af8 100644 --- a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c +++ b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c @@ -9,7 +9,7 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 1; } diff --git a/board/gaisler/grsim/grsim.c b/board/gaisler/grsim/grsim.c index fd73920b62..fa097377df 100644 --- a/board/gaisler/grsim/grsim.c +++ b/board/gaisler/grsim/grsim.c @@ -10,7 +10,7 @@ #include <common.h> #include <asm/leon.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 1; } diff --git a/board/gaisler/grsim_leon2/grsim_leon2.c b/board/gaisler/grsim_leon2/grsim_leon2.c index 882b0a4247..12df6bd7ef 100644 --- a/board/gaisler/grsim_leon2/grsim_leon2.c +++ b/board/gaisler/grsim_leon2/grsim_leon2.c @@ -10,7 +10,7 @@ #include <common.h> #include <asm/leon.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 1; } diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c index 0fce8cfbab..b7b31fb024 100644 --- a/board/gdsys/mpc8308/sdram.c +++ b/board/gdsys/mpc8308/sdram.c @@ -66,7 +66,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index e7838dcd2a..b40e4b30e8 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -119,7 +119,7 @@ static int setup_sdram(void) return msize; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c index 75bf1bb33c..b107dd196c 100644 --- a/board/ifm/ac14xx/ac14xx.c +++ b/board/ifm/ac14xx/ac14xx.c @@ -310,7 +310,7 @@ u32 sdram_init_seq[] = { /* EMPTY, optional, we don't do it */ };
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return fixed_sdram(NULL, sdram_init_seq, ARRAY_SIZE(sdram_init_seq)); } diff --git a/board/ifm/o2dnt2/o2dnt2.c b/board/ifm/o2dnt2/o2dnt2.c index 4fc6809ad6..7452d2b1f0 100644 --- a/board/ifm/o2dnt2/o2dnt2.c +++ b/board/ifm/o2dnt2/o2dnt2.c @@ -66,7 +66,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/imgtec/boston/ddr.c b/board/imgtec/boston/ddr.c index ceffef61ef..c841bf02a3 100644 --- a/board/imgtec/boston/ddr.c +++ b/board/imgtec/boston/ddr.c @@ -10,7 +10,7 @@
#include "boston-regs.h"
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0);
diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index 495504372a..c269d0a5a3 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -83,7 +83,7 @@ static enum sys_con malta_sys_con(void) } }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return CONFIG_SYS_MEM_SIZE; } diff --git a/board/imgtec/xilfpga/xilfpga.c b/board/imgtec/xilfpga/xilfpga.c index 77a1952c93..dc0a088ecb 100644 --- a/board/imgtec/xilfpga/xilfpga.c +++ b/board/imgtec/xilfpga/xilfpga.c @@ -12,7 +12,7 @@ #include <common.h>
/* initialize the DDR Controller and PHY */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { /* MIG IP block is smart and doesn't need SW * to do any init */ diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c index 0a32f0e1b9..47c3955c6d 100644 --- a/board/inka4x0/inka4x0.c +++ b/board/inka4x0/inka4x0.c @@ -77,7 +77,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *) CONFIG_SYS_MBAR; diff --git a/board/intercontrol/digsy_mtc/digsy_mtc.c b/board/intercontrol/digsy_mtc/digsy_mtc.c index 05d673dc89..9bada940b7 100644 --- a/board/intercontrol/digsy_mtc/digsy_mtc.c +++ b/board/intercontrol/digsy_mtc/digsy_mtc.c @@ -79,7 +79,7 @@ static void sdram_start(int hi_addr) * CONFIG_SYS_SDRAM_BASE is something other than 0x00000000. */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/ipek01/ipek01.c b/board/ipek01/ipek01.c index 2e62355c48..ab94c65499 100644 --- a/board/ipek01/ipek01.c +++ b/board/ipek01/ipek01.c @@ -80,7 +80,7 @@ static void sdram_start (int hi_addr) * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/jupiter/jupiter.c b/board/jupiter/jupiter.c index d56902bcd2..ae569d0fc0 100644 --- a/board/jupiter/jupiter.c +++ b/board/jupiter/jupiter.c @@ -76,7 +76,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index c2a7a5f995..12fd05d2f4 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -289,7 +289,7 @@ static long probe_sdram(memctl8260_t *memctl) #endif /* CONFIG_SYS_SDRAM_LIST */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; memctl8260_t *memctl = &immap->im_memctl; diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 154f97457b..111a8a7995 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -328,7 +328,7 @@ static int fixed_sdram(void) return msize; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/keymile/kmp204x/ddr.c b/board/keymile/kmp204x/ddr.c index 77af184c82..98fb1adfdd 100644 --- a/board/keymile/kmp204x/ddr.c +++ b/board/keymile/kmp204x/ddr.c @@ -48,7 +48,7 @@ void fsl_ddr_board_options(memctl_options_t *popts, popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR_ODT_75ohm; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = 0;
diff --git a/board/liebherr/lwmon5/sdram.c b/board/liebherr/lwmon5/sdram.c index bcb344940b..1932e06fd6 100644 --- a/board/liebherr/lwmon5/sdram.c +++ b/board/liebherr/lwmon5/sdram.c @@ -145,7 +145,7 @@ static void program_ecc(u32 start_address, * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -phys_size_t initdram (int board_type) +phys_size_t initdram(void) { /* CL=4 */ mtsdram(DDR0_02, 0x00000000); diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c index 0745ceeb7f..f4a6521e94 100644 --- a/board/micronas/vct/vct.c +++ b/board/micronas/vct/vct.c @@ -59,7 +59,7 @@ void _machine_restart(void) * SDRAM is already configured by the bootstrap code, only return the * auto-detected size here */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MBYTES_SDRAM << 20); diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index 7fa81b8677..3e2fe653bd 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -116,7 +116,7 @@ static void sdram_start(int hi_addr) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT diff --git a/board/mpc8308_p1m/sdram.c b/board/mpc8308_p1m/sdram.c index da36f63fdd..96d60c95ee 100644 --- a/board/mpc8308_p1m/sdram.c +++ b/board/mpc8308_p1m/sdram.c @@ -61,7 +61,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index 8b9892b868..e2961d1d4a 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -615,14 +615,14 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ /* - initdram(int board_type) reads EEPROM via I2c. EEPROM contains all of + initdram() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration */ /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) {
unsigned long bank_reg[4], tmp, bank_size; diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c index ddc21083d8..951010a6a3 100644 --- a/board/mpl/pati/pati.c +++ b/board/mpl/pati/pati.c @@ -133,7 +133,7 @@ extern int mem_test (unsigned long start, unsigned long ramsize, int quiet); /* * Get RAM size. */ -phys_size_t initdram(int board_type) +phys_size_t initdram(void) { unsigned char board_rev; unsigned long reg; diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index 1bd2fbfc58..07b30ed293 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -605,14 +605,14 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ /* - initdram(int board_type) reads EEPROM via I2c. EEPROM contains all of + initdram() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration */ /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { unsigned long bank_reg[4], tmp, bank_size; int i, ds; diff --git a/board/munices/munices.c b/board/munices/munices.c index 8f292ea8e2..b88160c8a8 100644 --- a/board/munices/munices.c +++ b/board/munices/munices.c @@ -58,7 +58,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/openrisc/openrisc-generic/openrisc-generic.c b/board/openrisc/openrisc-generic/openrisc-generic.c index 4f82600bbb..d4a964f14f 100644 --- a/board/openrisc/openrisc-generic/openrisc-generic.c +++ b/board/openrisc/openrisc-generic/openrisc-generic.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return 0; } diff --git a/board/pb1x00/pb1x00.c b/board/pb1x00/pb1x00.c index eb92914a79..baa5723f4a 100644 --- a/board/pb1x00/pb1x00.c +++ b/board/pb1x00/pb1x00.c @@ -11,7 +11,7 @@ #include <asm/mipsregs.h> #include <asm/io.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/pdm360ng/pdm360ng.c b/board/pdm360ng/pdm360ng.c index d91d427c6b..ef19daf3c9 100644 --- a/board/pdm360ng/pdm360ng.c +++ b/board/pdm360ng/pdm360ng.c @@ -48,7 +48,7 @@ sdram_conf_t mddrc_config[] = { }, };
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { int i; u32 msize = 0; diff --git a/board/phytec/pcm030/pcm030.c b/board/phytec/pcm030/pcm030.c index 8a9de0d963..470bd70792 100644 --- a/board/phytec/pcm030/pcm030.c +++ b/board/phytec/pcm030/pcm030.c @@ -73,7 +73,7 @@ static void sdram_start(int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/qemu-mips/qemu-mips.c b/board/qemu-mips/qemu-mips.c index 563044eb0c..3cdc91cf43 100644 --- a/board/qemu-mips/qemu-mips.c +++ b/board/qemu-mips/qemu-mips.c @@ -11,7 +11,7 @@ #include <asm/io.h> #include <netdev.h>
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/sbc8349/sbc8349.c b/board/sbc8349/sbc8349.c index 72786d2ace..b20de4c3c3 100644 --- a/board/sbc8349/sbc8349.c +++ b/board/sbc8349/sbc8349.c @@ -35,7 +35,7 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index 6bdf1a28e9..a541d25cc3 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -37,7 +37,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { long dram_size = 0;
diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index 77b5000de6..b7f6380bec 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -49,7 +49,7 @@ void fudelay(int usec) asm volatile ("nop"); }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { u32 dramsize, RC;
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index fef9d2b29a..1e843d5b03 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -133,7 +133,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index eca218c9cf..a05ae2a170 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -66,7 +66,7 @@ int board_early_init_r (void) { /************************************************************************** * DRAM initalization and size detection */ -phys_size_t initdram (int board_type) +phys_size_t initdram(void) { long bank_size; long size; diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 6d17830575..99357302f6 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -126,13 +126,14 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
-phys_size_t initdram (int board_type) +phys_size_t initdram(void) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; long int size8, size9, size10; long int size_b0 = 0; long int size_b1 = 0; + int board_type = gd->board_type;
upmconfig (UPMA, (uint *) sdram_table, sizeof (sdram_table) / sizeof (uint)); diff --git a/board/v38b/v38b.c b/board/v38b/v38b.c index a337729916..20490a3157 100644 --- a/board/v38b/v38b.c +++ b/board/v38b/v38b.c @@ -56,7 +56,7 @@ static void sdram_start(int hi_addr) #endif /* !CONFIG_SYS_RAMBOOT */
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/varisys/cyrus/ddr.c b/board/varisys/cyrus/ddr.c index bb1d29a94c..da6f5ad253 100644 --- a/board/varisys/cyrus/ddr.c +++ b/board/varisys/cyrus/ddr.c @@ -168,7 +168,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size;
diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c index 7f24a30688..5349a583fc 100644 --- a/board/ve8313/ve8313.c +++ b/board/ve8313/ve8313.c @@ -88,7 +88,7 @@ static long fixed_sdram(void) return msize; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/xes/xpedite1000/xpedite1000.c b/board/xes/xpedite1000/xpedite1000.c index 3b8a6683eb..ff64483cf4 100644 --- a/board/xes/xpedite1000/xpedite1000.c +++ b/board/xes/xpedite1000/xpedite1000.c @@ -116,7 +116,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return spd_sdram(); } diff --git a/board/xes/xpedite517x/xpedite517x.c b/board/xes/xpedite517x/xpedite517x.c index 0028870db0..9ec99a1e28 100644 --- a/board/xes/xpedite517x/xpedite517x.c +++ b/board/xes/xpedite517x/xpedite517x.c @@ -56,7 +56,7 @@ int board_early_init_r(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { phys_size_t dram_size = fsl_ddr_sdram();
diff --git a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c index 3729f07624..dfdd3f2310 100644 --- a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c +++ b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); diff --git a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c index d823352930..67fd668157 100644 --- a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c +++ b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c @@ -17,7 +17,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(int board_type) +phys_size_t initdram(void) { return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); diff --git a/common/board_f.c b/common/board_f.c index 7ec45299d7..b1b994cea6 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -180,13 +180,7 @@ static int announce_dram_init(void) #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K) static int init_func_ram(void) { -#ifdef CONFIG_BOARD_TYPES - int board_type = gd->board_type; -#else - int board_type = 0; /* use dummy arg */ -#endif - - gd->ram_size = initdram(board_type); + gd->ram_size = initdram();
if (gd->ram_size > 0) return 0; diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 5b356dd231..1a77c982fa 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -110,6 +110,12 @@ typedef struct global_data { } gd_t; #endif
+#ifdef CONFIG_BOARD_TYPES +#define gd_board_type() gd->board_type +#else +#define gd_board_type() 0 +#endif + /* * Global Data Flags - the top 16 bits are reserved for arch-specific flags */ diff --git a/include/common.h b/include/common.h index bc486489a2..330d3962b5 100644 --- a/include/common.h +++ b/include/common.h @@ -212,7 +212,7 @@ int timer_init(void); int cpu_init(void);
/* */ -phys_size_t initdram (int); +phys_size_t initdram(void);
#include <display_options.h>

On 31.03.2017 16:40, Simon Glass wrote:
It looks like only cm5200 and tqm8xx use this feature, so we don't really need it in generic code. Drop it and have the users access gd->board_type directly.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On 03/31/2017 07:40 AM, Simon Glass wrote:
It looks like only cm5200 and tqm8xx use this feature, so we don't really need it in generic code. Drop it and have the users access gd->board_type directly.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:24AM -0600, Simon Glass wrote:
It looks like only cm5200 and tqm8xx use this feature, so we don't really need it in generic code. Drop it and have the users access gd->board_type directly.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
Applied to u-boot/master, thanks!

At present we cannot use this function as an init sequence call without a wrapper, since it returns the RAM size. Adjust it to set the RAM size in global_data instead, and return 0 on success.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- arch/mips/mach-ath79/dram.c | 8 ++++++-- arch/mips/mach-pic32/cpu.c | 6 ++++-- arch/powerpc/cpu/mpc85xx/cpu.c | 14 +++++++++----- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c | 18 +++++++++++++----- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c | 8 ++++++-- arch/powerpc/cpu/ppc4xx/sdram.c | 18 ++++++++++++------ board/Arcturus/ucp1020/spl.c | 2 +- board/BuS/eb_cpu5282/eb_cpu5282.c | 6 ++++-- board/a3m071/a3m071.c | 6 ++++-- board/a4m072/a4m072.c | 8 ++++++-- board/amcc/acadia/memory.c | 8 ++++++-- board/amcc/bamboo/bamboo.c | 8 ++++++-- board/amcc/bubinga/bubinga.c | 8 ++++++-- board/amcc/sequoia/sdram.c | 8 ++++++-- board/amcc/walnut/walnut.c | 8 ++++++-- board/amcc/yosemite/yosemite.c | 7 +++++-- board/astro/mcf5373l/mcf5373l.c | 6 ++++-- board/canmb/canmb.c | 8 ++++++-- board/cm5200/cm5200.c | 6 ++++-- board/cobra5272/cobra5272.c | 7 +++++-- board/davedenx/aria/aria.c | 6 ++++-- board/dbau1x00/dbau1x00.c | 8 ++++++-- board/esd/mecp5123/mecp5123.c | 6 ++++-- board/esd/pmc440/sdram.c | 12 ++++++++---- board/esd/vme8349/vme8349.c | 10 +++++++--- board/freescale/b4860qds/ddr.c | 6 ++++-- board/freescale/b4860qds/spl.c | 2 +- board/freescale/c29xpcie/spl.c | 2 +- board/freescale/corenet_ds/ddr.c | 6 ++++-- board/freescale/ls1021aqds/ddr.c | 6 ++++-- board/freescale/ls1021aqds/ls1021aqds.c | 4 +--- board/freescale/ls1043aqds/ddr.c | 6 ++++-- board/freescale/ls1043aqds/ls1043aqds.c | 2 +- board/freescale/ls1043ardb/ddr.c | 6 ++++-- board/freescale/ls1046aqds/ddr.c | 6 ++++-- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1046ardb/ddr.c | 6 ++++-- board/freescale/ls2080a/ddr.c | 8 +++----- board/freescale/ls2080aqds/ddr.c | 10 ++++------ board/freescale/ls2080ardb/ddr.c | 10 ++++------ board/freescale/m5208evbe/m5208evbe.c | 6 ++++-- board/freescale/m52277evb/m52277evb.c | 6 ++++-- board/freescale/m5235evb/m5235evb.c | 6 ++++-- board/freescale/m5249evb/m5249evb.c | 8 ++++++-- board/freescale/m5253demo/m5253demo.c | 8 ++++++-- board/freescale/m5253evbe/m5253evbe.c | 8 ++++++-- board/freescale/m5272c3/m5272c3.c | 7 +++++-- board/freescale/m5275evb/m5275evb.c | 8 ++++++-- board/freescale/m5282evb/m5282evb.c | 6 ++++-- board/freescale/m53017evb/m53017evb.c | 6 ++++-- board/freescale/m5329evb/m5329evb.c | 6 ++++-- board/freescale/m5373evb/m5373evb.c | 6 ++++-- board/freescale/m54418twr/m54418twr.c | 6 ++++-- board/freescale/m54451evb/m54451evb.c | 6 ++++-- board/freescale/m54455evb/m54455evb.c | 6 ++++-- board/freescale/m547xevb/m547xevb.c | 6 ++++-- board/freescale/m548xevb/m548xevb.c | 6 ++++-- board/freescale/mpc5121ads/mpc5121ads.c | 6 ++++-- board/freescale/mpc8308rdb/sdram.c | 8 +++++--- board/freescale/mpc8313erdb/sdram.c | 8 +++++--- board/freescale/mpc8315erdb/sdram.c | 10 ++++++---- board/freescale/mpc8323erdb/mpc8323erdb.c | 12 ++++++++---- board/freescale/mpc832xemds/mpc832xemds.c | 12 ++++++++---- board/freescale/mpc8349emds/mpc8349emds.c | 12 ++++++++---- board/freescale/mpc8349itx/mpc8349itx.c | 10 +++++++--- board/freescale/mpc837xemds/mpc837xemds.c | 10 +++++++--- board/freescale/mpc837xerdb/mpc837xerdb.c | 10 +++++++--- board/freescale/mpc8610hpcd/mpc8610hpcd.c | 8 ++++++-- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 8 ++++++-- board/freescale/p1010rdb/spl.c | 2 +- board/freescale/p1022ds/spl.c | 2 +- board/freescale/p1_p2_rdb_pc/spl.c | 2 +- board/freescale/p2041rdb/ddr.c | 10 +++++++--- board/freescale/t102xqds/ddr.c | 6 ++++-- board/freescale/t102xqds/spl.c | 2 +- board/freescale/t102xrdb/ddr.c | 6 ++++-- board/freescale/t102xrdb/spl.c | 2 +- board/freescale/t1040qds/ddr.c | 6 ++++-- board/freescale/t104xrdb/ddr.c | 6 ++++-- board/freescale/t104xrdb/spl.c | 2 +- board/freescale/t208xqds/ddr.c | 6 ++++-- board/freescale/t208xqds/spl.c | 2 +- board/freescale/t208xrdb/ddr.c | 6 ++++-- board/freescale/t208xrdb/spl.c | 2 +- board/freescale/t4qds/ddr.c | 6 ++++-- board/freescale/t4qds/spl.c | 2 +- board/freescale/t4rdb/ddr.c | 6 ++++-- board/freescale/t4rdb/spl.c | 2 +- board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c | 6 ++++-- board/gaisler/gr_ep2s60/gr_ep2s60.c | 6 ++++-- board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c | 6 ++++-- board/gaisler/grsim/grsim.c | 6 ++++-- board/gaisler/grsim_leon2/grsim_leon2.c | 6 ++++-- board/gdsys/mpc8308/sdram.c | 8 +++++--- board/ids/ids8313/ids8313.c | 8 +++++--- board/ifm/ac14xx/ac14xx.c | 7 +++++-- board/ifm/o2dnt2/o2dnt2.c | 6 ++++-- board/imgtec/boston/ddr.c | 9 +++++++-- board/imgtec/malta/malta.c | 8 ++++++-- board/imgtec/xilfpga/xilfpga.c | 8 ++++++-- board/inka4x0/inka4x0.c | 8 ++++++-- board/intercontrol/digsy_mtc/digsy_mtc.c | 6 ++++-- board/ipek01/ipek01.c | 6 ++++-- board/jupiter/jupiter.c | 8 ++++++-- board/keymile/km82xx/km82xx.c | 8 ++++++-- board/keymile/km83xx/km83xx.c | 10 +++++++--- board/keymile/kmp204x/ddr.c | 8 ++++++-- board/liebherr/lwmon5/sdram.c | 8 ++++++-- board/micronas/vct/vct.c | 8 ++++++-- board/motionpro/motionpro.c | 8 ++++++-- board/mpc8308_p1m/sdram.c | 8 +++++--- board/mpl/mip405/mip405.c | 6 ++++-- board/mpl/pati/pati.c | 10 +++++++--- board/mpl/pip405/pip405.c | 6 ++++-- board/munices/munices.c | 8 ++++++-- board/openrisc/openrisc-generic/openrisc-generic.c | 2 +- board/pb1x00/pb1x00.c | 8 ++++++-- board/pdm360ng/pdm360ng.c | 6 ++++-- board/phytec/pcm030/pcm030.c | 8 ++++++-- board/qemu-mips/qemu-mips.c | 8 ++++++-- board/sbc8349/sbc8349.c | 10 +++++++--- board/sbc8641d/sbc8641d.c | 8 ++++++-- board/sysam/amcore/amcore.c | 9 +++++++-- board/tqc/tqm5200/tqm5200.c | 8 +++++--- board/tqc/tqm834x/tqm834x.c | 6 ++++-- board/tqc/tqm8xx/tqm8xx.c | 6 ++++-- board/v38b/v38b.c | 7 +++++-- board/varisys/cyrus/ddr.c | 6 ++++-- board/ve8313/ve8313.c | 6 ++++-- board/xes/xpedite1000/xpedite1000.c | 6 ++++-- board/xes/xpedite517x/xpedite517x.c | 8 ++++++-- board/xilinx/ppc405-generic/xilinx_ppc405_generic.c | 8 ++++++-- board/xilinx/ppc440-generic/xilinx_ppc440_generic.c | 8 ++++++-- common/board_f.c | 8 +------- drivers/ddr/fsl/main.c | 2 ++ include/common.h | 2 +- 137 files changed, 632 insertions(+), 305 deletions(-)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index 583254519b..583fa7a7e3 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -821,7 +821,7 @@ void update_early_mmu_table(void)
__weak int dram_init(void) { - gd->ram_size = initdram(); + initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/arch/mips/mach-ath79/dram.c b/arch/mips/mach-ath79/dram.c index 5ef43a059d..1c73addcb3 100644 --- a/arch/mips/mach-ath79/dram.c +++ b/arch/mips/mach-ath79/dram.c @@ -9,8 +9,12 @@ #include <asm/addrspace.h> #include <mach/ddr.h>
-phys_size_t initdram(void) +DECLARE_GLOBAL_DATA_PTR; + +int initdram(void) { ddr_tap_tuning(); - return get_ram_size((void *)KSEG1, SZ_256M); + gd->ram_size = get_ram_size((void *)KSEG1, SZ_256M); + + return 0; } diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index f15b58d849..c96e046848 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -110,12 +110,14 @@ static void ddr2_pmd_ungate(void) }
/* initialize the DDR2 Controller and DDR2 PHY */ -phys_size_t initdram(void) +int initdram(void) { ddr2_pmd_ungate(); ddr2_phy_init(); ddr2_ctrl_init(); - return ddr2_calculate_size(); + gd->ram_size = ddr2_calculate_size(); + + return 0; }
int misc_init_r(void) diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 192634d41c..64e0aa7518 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -401,17 +401,19 @@ void mpc85xx_reginfo(void) #ifndef CONFIG_FSL_CORENET #if (defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)) && \ !defined(CONFIG_SYS_INIT_L2_ADDR) -phys_size_t initdram(void) +int initdram(void) { #if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) || \ defined(CONFIG_ARCH_QEMU_E500) - return fsl_ddr_sdram_size(); + gd->ram_size = fsl_ddr_sdram_size(); #else - return (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; #endif + + return 0; } #else /* CONFIG_SYS_RAMBOOT */ -phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = 0;
@@ -460,7 +462,9 @@ phys_size_t initdram(void) #endif
debug("DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; } #endif /* CONFIG_SYS_RAMBOOT */ #endif diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c index 3b79efb246..87fd5e65e0 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c @@ -33,6 +33,8 @@
#include "ecc.h"
+DECLARE_GLOBAL_DATA_PTR; + #define PPC4xx_IBM_DDR2_DUMP_REGISTER(mnemonic) \ do { \ u32 data; \ @@ -414,7 +416,7 @@ static unsigned char spd_read(uchar chip, uint addr) * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -phys_size_t initdram(void) +int initdram(void) { unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE}; @@ -429,7 +431,9 @@ phys_size_t initdram(void) * Reduce RAM size to avoid overwriting memory used by * current stack? Not sure what is happening. */ - return sdram_memsize() / 2; + gd->ram_size = sdram_memsize() / 2; + + return 0; }
num_dimm_banks = sizeof(iic0_dimm_addr); @@ -650,7 +654,9 @@ phys_size_t initdram(void) */ set_mcsr(get_mcsr());
- return sdram_memsize(); + gd->ram_size = sdram_memsize(); + + return 0; }
static void get_spd_info(unsigned long *dimm_populated, @@ -2855,7 +2861,7 @@ static void test(void) * time parameters. * Configures the PPC405EX(r) and PPC460EX/GT *---------------------------------------------------------------------------*/ -phys_size_t initdram(void) +int initdram(void) { unsigned long val;
@@ -3011,7 +3017,9 @@ phys_size_t initdram(void) set_mcsr(get_mcsr()); #endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */
- return (CONFIG_SYS_MBYTES_SDRAM << 20); + gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20; + + return 0; } #endif /* CONFIG_SPD_EEPROM */
diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c index 3b072b7791..14d0fd9154 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c @@ -30,6 +30,8 @@ #include <asm/mmu.h> #include <asm/cache.h>
+DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_SPD_EEPROM) && \ (defined(CONFIG_440EPX) || defined(CONFIG_440GRX))
@@ -998,7 +1000,7 @@ static void program_ddr0_44(unsigned long dimm_ranks[], * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -phys_size_t initdram(void) +int initdram(void) { unsigned char const iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_ranks[MAXDIMMS]; @@ -1212,7 +1214,9 @@ phys_size_t initdram(void) #endif /* defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC) */
program_tlb(0, CONFIG_SYS_SDRAM_BASE, dram_size, MY_TLB_WORD2_I_ENABLE); - return dram_size; + gd->ram_size = dram_size; + + return 0; }
void board_add_ram_info(int use_default) diff --git a/arch/powerpc/cpu/ppc4xx/sdram.c b/arch/powerpc/cpu/ppc4xx/sdram.c index 2d805717a7..a49bd69aba 100644 --- a/arch/powerpc/cpu/ppc4xx/sdram.c +++ b/arch/powerpc/cpu/ppc4xx/sdram.c @@ -17,6 +17,8 @@ #include "sdram.h" #include "ecc.h"
+DECLARE_GLOBAL_DATA_PTR; + #ifdef CONFIG_SDRAM_BANK0
#ifndef CONFIG_440 @@ -148,7 +150,7 @@ static ulong compute_rtr(ulong speed, ulong rows, ulong refresh) /* * Autodetect onboard SDRAM on 405 platforms */ -phys_size_t initdram(void) +int initdram(void) { ulong speed; ulong sdtr1; @@ -226,11 +228,13 @@ phys_size_t initdram(void) /* * OK, size detected -> all done */ - return size; + gd->ram_size = size; + + return 0; } }
- return 0; + return -ENXIO; }
#else /* CONFIG_440 */ @@ -349,7 +353,7 @@ static void sdram_tr1_set(int ram_address, int* tr1_value) * so this should be extended for other future boards * using this routine! */ -phys_size_t initdram(void) +int initdram(void) { int i; int tr1_bank1; @@ -440,11 +444,13 @@ phys_size_t initdram(void) /* * OK, size detected -> all done */ - return size; + gd->ram_size = size; + + return 0; } }
- return 0; /* nothing found ! */ + return -ENXIO; /* nothing found ! */ }
#endif /* CONFIG_440 */ diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index 8a7fa1d97c..45e78c63a3 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -110,7 +110,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(); + initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index 292752450d..3024a9c681 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -35,7 +35,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { int size, i;
@@ -92,7 +92,9 @@ phys_size_t initdram(void) *(unsigned int *) (CONFIG_SYS_SDRAM_BASE1 + 0x220) = 0xA5A5; size += CONFIG_SYS_SDRAM_SIZE1 * 1024 * 1024; #endif - return size; + gd->ram_size = size; + + return 0; }
#if defined(CONFIG_SYS_DRAM_TEST) diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c index b11ff980b8..c1120c4004 100644 --- a/board/a3m071/a3m071.c +++ b/board/a3m071/a3m071.c @@ -76,7 +76,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -153,7 +153,9 @@ phys_size_t initdram(void) if ((SVR_MJREV(svr) >= 2) && (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) out_be32((void *)MPC5XXX_SDRAM_SDELAY, 0x04);
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
static void get_revisions(int *failsavelevel, int *digiboardversion, diff --git a/board/a4m072/a4m072.c b/board/a4m072/a4m072.c index 88d4942ce7..d4b30fd147 100644 --- a/board/a4m072/a4m072.c +++ b/board/a4m072/a4m072.c @@ -23,6 +23,8 @@
#include "mt46v32m16.h"
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start (int hi_addr) { @@ -71,7 +73,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; uint svr, pvr; @@ -150,7 +152,9 @@ phys_size_t initdram(void) __asm__ volatile ("sync"); }
- return dramsize; + gd->ram_size = dramsize; + + return 0; }
int checkboard (void) diff --git a/board/amcc/acadia/memory.c b/board/amcc/acadia/memory.c index 841bcfa4bf..cd78a147b1 100644 --- a/board/amcc/acadia/memory.c +++ b/board/amcc/acadia/memory.c @@ -15,6 +15,8 @@ #include <asm/io.h> #include <asm/ppc4xx-gpio.h>
+DECLARE_GLOBAL_DATA_PTR; + extern void board_pll_init_f(void);
static void cram_bcr_write(u32 wr_val) @@ -41,7 +43,7 @@ static void cram_bcr_write(u32 wr_val) return; }
-phys_size_t initdram(void) +int initdram(void) { int i; u32 val; @@ -77,5 +79,7 @@ phys_size_t initdram(void) for (i=0; i<200000; i++) ;
- return (CONFIG_SYS_MBYTES_RAM << 20); + gd->ram_size = CONFIG_SYS_MBYTES_RAM << 20; + + return 0; } diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c index ae69f5a1b1..453677aa66 100644 --- a/board/amcc/bamboo/bamboo.c +++ b/board/amcc/bamboo/bamboo.c @@ -12,6 +12,8 @@ #include <asm/ppc440.h> #include "bamboo.h"
+DECLARE_GLOBAL_DATA_PTR; + void ext_bus_cntlr_init(void); void configure_ppc440ep_pins(void); int is_nand_selected(void); @@ -436,9 +438,11 @@ int checkboard(void) }
-phys_size_t initdram(void) +int initdram(void) { - return spd_sdram(); + gd->ram_size = spd_sdram(); + + return 0; }
/*----------------------------------------------------------------------------+ diff --git a/board/amcc/bubinga/bubinga.c b/board/amcc/bubinga/bubinga.c index e3567173c2..725b9ca086 100644 --- a/board/amcc/bubinga/bubinga.c +++ b/board/amcc/bubinga/bubinga.c @@ -9,6 +9,8 @@ #include <asm/processor.h> #include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR; + long int spd_sdram(void);
int board_early_init_f(void) @@ -55,7 +57,9 @@ int checkboard(void) initdram() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration ------------------------------------------------------------------------- */ -phys_size_t initdram(void) +int initdram(void) { - return spd_sdram(); + gd->ram_size = spd_sdram(); + + return 0; } diff --git a/board/amcc/sequoia/sdram.c b/board/amcc/sequoia/sdram.c index bb5c5ee449..9bedb5bc8e 100644 --- a/board/amcc/sequoia/sdram.c +++ b/board/amcc/sequoia/sdram.c @@ -20,6 +20,8 @@ #include <asm/io.h> #include <asm/ppc440.h>
+DECLARE_GLOBAL_DATA_PTR; + /*-----------------------------------------------------------------------------+ * Prototypes *-----------------------------------------------------------------------------*/ @@ -31,7 +33,7 @@ extern void denali_core_search_data_eye(void); * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -phys_size_t initdram(void) +int initdram(void) { #if !defined(CONFIG_SYS_RAMBOOT) ulong speed = get_bus_freq(0); @@ -88,5 +90,7 @@ phys_size_t initdram(void) */ set_mcsr(get_mcsr());
- return (CONFIG_SYS_MBYTES_SDRAM << 20); + gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20; + + return 0; } diff --git a/board/amcc/walnut/walnut.c b/board/amcc/walnut/walnut.c index ca933d71a6..2a2441e101 100644 --- a/board/amcc/walnut/walnut.c +++ b/board/amcc/walnut/walnut.c @@ -9,6 +9,8 @@ #include <asm/processor.h> #include <spd_sdram.h>
+DECLARE_GLOBAL_DATA_PTR; + int board_early_init_f(void) { /*-------------------------------------------------------------------------+ @@ -74,7 +76,9 @@ int checkboard(void) * initdram() reads EEPROM via I2c. EEPROM contains all of * the necessary info for SDRAM controller configuration */ -phys_size_t initdram(void) +int initdram(void) { - return spd_sdram(); + gd->ram_size = spd_sdram(); + + return 0; } diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c index f61978c5d5..fde371d919 100644 --- a/board/amcc/yosemite/yosemite.c +++ b/board/amcc/yosemite/yosemite.c @@ -286,7 +286,7 @@ void sdram_tr1_set(int ram_address, int* tr1_value) *tr1_value = (first_good + last_bad) / 2; }
-phys_size_t initdram(void) +int initdram(void) { register uint reg; int tr1_bank1, tr1_bank2; @@ -334,7 +334,10 @@ phys_size_t initdram(void) sdram_tr1_set(0x08000000, &tr1_bank2); mtsdram(SDRAM0_TR1, (((tr1_bank1+tr1_bank2)/2) | 0x80800800));
- return CONFIG_SYS_SDRAM_BANKS * (CONFIG_SYS_KBYTES_SDRAM * 1024); /* return bytes */ + gd->ram_size = CONFIG_SYS_SDRAM_BANKS * + (CONFIG_SYS_KBYTES_SDRAM * 1024); /* set bytes */ + + return 0; }
/************************************************************************* diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c index 70fcd61998..da281e87fc 100644 --- a/board/astro/mcf5373l/mcf5373l.c +++ b/board/astro/mcf5373l/mcf5373l.c @@ -27,7 +27,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { #if !defined(CONFIG_MONITOR_IS_IN_RAM) sdram_t *sdp = (sdram_t *)(MMAP_SDRAM); @@ -79,8 +79,10 @@ phys_size_t initdram(void) * (Do not rely on the SDCS register(s) being set to 0x00000000 * during reset as stated in the data sheet.) */ - return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, + gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000 - CONFIG_SYS_SDRAM_BASE); + + return 0; }
#define UART_BASE MMAP_UART0 diff --git a/board/canmb/canmb.c b/board/canmb/canmb.c index ba9930d370..41194ecb7e 100644 --- a/board/canmb/canmb.c +++ b/board/canmb/canmb.c @@ -18,6 +18,8 @@ #include "mt48lc16m32s2-75.h" #endif
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start (int hi_addr) { @@ -65,7 +67,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -163,7 +165,9 @@ phys_size_t initdram(void)
#endif /* CONFIG_SYS_RAMBOOT */
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard (void) diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c index 2ac9fd9cd1..be0d65c694 100644 --- a/board/cm5200/cm5200.c +++ b/board/cm5200/cm5200.c @@ -97,7 +97,7 @@ static mem_conf_t* get_mem_config(int board_type) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT @@ -150,7 +150,9 @@ phys_size_t initdram(void) *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04; __asm__ volatile ("sync");
- return dramsize; + gd->ram_size = dramsize; + + return 0; }
diff --git a/board/cobra5272/cobra5272.c b/board/cobra5272/cobra5272.c index 9d4554da1f..48366763c1 100644 --- a/board/cobra5272/cobra5272.c +++ b/board/cobra5272/cobra5272.c @@ -8,6 +8,7 @@ #include <common.h> #include <asm/immap.h>
+DECLARE_GLOBAL_DATA_PTR;
int checkboard (void) { @@ -16,7 +17,7 @@ int checkboard (void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { volatile sdramctrl_t *sdp = (sdramctrl_t *) (MMAP_SDRAM);
@@ -26,7 +27,9 @@ phys_size_t initdram(void) /* Dummy write to start SDRAM */ *((volatile unsigned long *) 0) = 0;
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + + return 0; };
int testdram (void) diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c index 709c65ba0d..f0be2cbb9b 100644 --- a/board/davedenx/aria/aria.c +++ b/board/davedenx/aria/aria.c @@ -18,9 +18,11 @@
DECLARE_GLOBAL_DATA_PTR;
-phys_size_t initdram(void) +int initdram(void) { - return fixed_sdram(NULL, NULL, 0); + gd->ram_size = fixed_sdram(NULL, NULL, 0); + + return 0; }
int misc_init_r(void) diff --git a/board/dbau1x00/dbau1x00.c b/board/dbau1x00/dbau1x00.c index cf2f88047d..ea7cb744db 100644 --- a/board/dbau1x00/dbau1x00.c +++ b/board/dbau1x00/dbau1x00.c @@ -11,11 +11,15 @@ #include <asm/mipsregs.h> #include <asm/io.h>
-phys_size_t initdram(void) +DECLARE_GLOBAL_DATA_PTR; + +int initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ - return MEM_SIZE*1024*1024; + gd->ram_size = MEM_SIZE * 1024 * 1024; + + return 0; }
#define BCSR_PCMCIA_PC0DRVEN 0x0010 diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c index b8eb32b1fb..80963fefa5 100644 --- a/board/esd/mecp5123/mecp5123.c +++ b/board/esd/mecp5123/mecp5123.c @@ -62,9 +62,11 @@ int board_early_init_f(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { - return get_ram_size(0, fixed_sdram(NULL, NULL, 0)); + gd->ram_size = get_ram_size(0, fixed_sdram(NULL, NULL, 0)); + + return 0; }
int misc_init_r(void) diff --git a/board/esd/pmc440/sdram.c b/board/esd/pmc440/sdram.c index 82ee289aa6..e962d4c4bb 100644 --- a/board/esd/pmc440/sdram.c +++ b/board/esd/pmc440/sdram.c @@ -24,6 +24,8 @@ #include <asm/mmu.h> #include <asm/ppc440.h>
+DECLARE_GLOBAL_DATA_PTR; + extern int denali_wait_for_dlllock(void); extern void denali_core_search_data_eye(void);
@@ -105,7 +107,7 @@ int initdram_by_rb(int rows, int banks) return 0; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t size; int n; @@ -125,12 +127,14 @@ phys_size_t initdram(void) sdram_conf[n].banks);
/* check for suitable configuration */ - if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) - return size; + if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) { + gd->ram_size = size; + return 0; + }
/* delete TLB entries */ remove_tlb(CONFIG_SYS_SDRAM_BASE, size); }
- return 0; + return -ENXIO; } diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index bf6ee7a73d..0e7f8b130a 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -26,15 +26,17 @@ #include <i2c.h> #include <netdev.h>
+DECLARE_GLOBAL_DATA_PTR; + void ddr_enable_ecc(unsigned int dram_size);
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main memory */ im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; @@ -52,7 +54,9 @@ phys_size_t initdram(void) msize = get_ram_size(0, msize);
/* return total bus SDRAM size(bytes) -- DDR */ - return msize * 1024 * 1024; + gd->ram_size = msize * 1024 * 1024; + + return 0; }
int checkboard(void) diff --git a/board/freescale/b4860qds/ddr.c b/board/freescale/b4860qds/ddr.c index d070104618..085323132c 100644 --- a/board/freescale/b4860qds/ddr.c +++ b/board/freescale/b4860qds/ddr.c @@ -176,7 +176,7 @@ found: popts->cpo_sample = 0x3e; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -189,7 +189,9 @@ phys_size_t initdram(void) dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
- return dram_size; + gd->ram_size = dram_size; + + return 0; }
unsigned long long step_assign_addresses(fsl_ddr_info_t *pinfo, diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index 17e2ba8953..a27ad7fa84 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_NAND_BOOT nand_boot(); diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index 785c859bee..86d55bf2ac 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -67,7 +67,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_NAND_BOOT puts("TPL\n"); diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c index 75de247a51..ad93abf9f4 100644 --- a/board/freescale/corenet_ds/ddr.c +++ b/board/freescale/corenet_ds/ddr.c @@ -260,7 +260,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -278,5 +278,7 @@ phys_size_t initdram(void) dram_size *= 0x100000;
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/ls1021aqds/ddr.c b/board/freescale/ls1021aqds/ddr.c index 99a4984fbc..8e8cd37b8b 100644 --- a/board/freescale/ls1021aqds/ddr.c +++ b/board/freescale/ls1021aqds/ddr.c @@ -164,7 +164,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -179,7 +179,9 @@ phys_size_t initdram(void) fsl_dp_resume(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; }
void dram_init_banksize(void) diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index 57314e2c9f..909fc56275 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -162,9 +162,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(); - - return 0; + return initdram(); }
#ifdef CONFIG_FSL_ESDHC diff --git a/board/freescale/ls1043aqds/ddr.c b/board/freescale/ls1043aqds/ddr.c index 817c91a34a..db350e27b8 100644 --- a/board/freescale/ls1043aqds/ddr.c +++ b/board/freescale/ls1043aqds/ddr.c @@ -108,7 +108,7 @@ found: #endif }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -125,5 +125,7 @@ phys_size_t initdram(void) fsl_dp_ddr_restore(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c index 755aef384e..538bba53da 100644 --- a/board/freescale/ls1043aqds/ls1043aqds.c +++ b/board/freescale/ls1043aqds/ls1043aqds.c @@ -153,7 +153,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(); + initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/board/freescale/ls1043ardb/ddr.c b/board/freescale/ls1043ardb/ddr.c index b5c5b2ede3..2f133db0a6 100644 --- a/board/freescale/ls1043ardb/ddr.c +++ b/board/freescale/ls1043ardb/ddr.c @@ -170,7 +170,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -186,5 +186,7 @@ phys_size_t initdram(void) fsl_dp_ddr_restore(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/ls1046aqds/ddr.c b/board/freescale/ls1046aqds/ddr.c index 6a5cbbf739..481ed44046 100644 --- a/board/freescale/ls1046aqds/ddr.c +++ b/board/freescale/ls1046aqds/ddr.c @@ -92,7 +92,7 @@ found: popts->cpo_sample = 0x70; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -110,5 +110,7 @@ phys_size_t initdram(void)
erratum_a008850_post();
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c index f30dd23351..6238852af5 100644 --- a/board/freescale/ls1046aqds/ls1046aqds.c +++ b/board/freescale/ls1046aqds/ls1046aqds.c @@ -149,7 +149,7 @@ int dram_init(void) * before accessing DDR SPD. */ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); - gd->ram_size = initdram(); + initdram(); #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) /* This will break-before-make MMU for DDR */ update_early_mmu_table(); diff --git a/board/freescale/ls1046ardb/ddr.c b/board/freescale/ls1046ardb/ddr.c index 1e99538022..d1290e27f8 100644 --- a/board/freescale/ls1046ardb/ddr.c +++ b/board/freescale/ls1046ardb/ddr.c @@ -96,7 +96,7 @@ found: popts->cpo_sample = 0x70; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -110,5 +110,7 @@ phys_size_t initdram(void)
erratum_a008850_post();
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/ls2080a/ddr.c b/board/freescale/ls2080a/ddr.c index 0bff922f07..d340c4162d 100644 --- a/board/freescale/ls2080a/ddr.c +++ b/board/freescale/ls2080a/ddr.c @@ -158,14 +158,12 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, return 0; } #endif -phys_size_t initdram(void) +int initdram(void) { - phys_size_t dram_size; - puts("Initializing DDR....");
puts("using SPD\n"); - dram_size = fsl_ddr_sdram(); + gd->ram_size = fsl_ddr_sdram();
- return dram_size; + return 0; } diff --git a/board/freescale/ls2080aqds/ddr.c b/board/freescale/ls2080aqds/ddr.c index bd32c54fc1..1e9145d6ab 100644 --- a/board/freescale/ls2080aqds/ddr.c +++ b/board/freescale/ls2080aqds/ddr.c @@ -155,17 +155,15 @@ found: } }
-phys_size_t initdram(void) +int initdram(void) { - phys_size_t dram_size; - #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) - return fsl_ddr_sdram_size(); + gd->ram_size = fsl_ddr_sdram_size(); #else puts("Initializing DDR....using SPD\n");
- dram_size = fsl_ddr_sdram(); + gd->ram_size = fsl_ddr_sdram(); #endif
- return dram_size; + return 0; } diff --git a/board/freescale/ls2080ardb/ddr.c b/board/freescale/ls2080ardb/ddr.c index b00e575ea2..029ea61b95 100644 --- a/board/freescale/ls2080ardb/ddr.c +++ b/board/freescale/ls2080ardb/ddr.c @@ -158,17 +158,15 @@ found: } }
-phys_size_t initdram(void) +int initdram(void) { - phys_size_t dram_size; - #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) - return fsl_ddr_sdram_size(); + gd->ram_size = fsl_ddr_sdram_size(); #else puts("Initializing DDR....using SPD\n");
- dram_size = fsl_ddr_sdram(); + gd->ram_size = fsl_ddr_sdram(); #endif
- return dram_size; + return 0; } diff --git a/board/freescale/m5208evbe/m5208evbe.c b/board/freescale/m5208evbe/m5208evbe.c index 6122750882..edf486acc8 100644 --- a/board/freescale/m5208evbe/m5208evbe.c +++ b/board/freescale/m5208evbe/m5208evbe.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; @@ -68,7 +68,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m52277evb/m52277evb.c b/board/freescale/m52277evb/m52277evb.c index 571e1a6528..2873643582 100644 --- a/board/freescale/m52277evb/m52277evb.c +++ b/board/freescale/m52277evb/m52277evb.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize;
@@ -78,7 +78,9 @@ phys_size_t initdram(void)
udelay(100); #endif - return (dramsize); + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m5235evb/m5235evb.c b/board/freescale/m5235evb/m5235evb.c index 7aa0edfdc1..1d82e93786 100644 --- a/board/freescale/m5235evb/m5235evb.c +++ b/board/freescale/m5235evb/m5235evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); gpio_t *gpio = (gpio_t *)(MMAP_GPIO); @@ -97,7 +97,9 @@ phys_size_t initdram(void) *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696; }
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m5249evb/m5249evb.c b/board/freescale/m5249evb/m5249evb.c index b8544292a7..d3c2acd089 100644 --- a/board/freescale/m5249evb/m5249evb.c +++ b/board/freescale/m5249evb/m5249evb.c @@ -10,6 +10,8 @@ #include <malloc.h> #include <asm/immap.h>
+DECLARE_GLOBAL_DATA_PTR; + int checkboard (void) { ulong val; uchar val8; @@ -29,7 +31,7 @@ int checkboard (void) { };
-phys_size_t initdram(void) +int initdram(void) { unsigned long junk = 0xa5a59696;
@@ -82,7 +84,9 @@ phys_size_t initdram(void) mbar_writeLong(MCFSIM_DACR0, 0x0000b364); /* Enable DACR0[IMRS] (bit 6); RE remains enabled */ *((volatile unsigned long *) 0x800) = junk; /* Access RAM to initialize the mode register */
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + + return 0; };
diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c index fef2ca6af6..1c100e6d8c 100644 --- a/board/freescale/m5253demo/m5253demo.c +++ b/board/freescale/m5253demo/m5253demo.c @@ -13,6 +13,8 @@ #include <netdev.h> #include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR; + int checkboard(void) { puts("Board: "); @@ -20,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize = 0;
@@ -73,7 +75,9 @@ phys_size_t initdram(void) mb(); }
- return dramsize; + gd->ram_size = dramsize; + + return 0; }
int testdram(void) diff --git a/board/freescale/m5253evbe/m5253evbe.c b/board/freescale/m5253evbe/m5253evbe.c index 3f4cdfbaf1..eae499fa9d 100644 --- a/board/freescale/m5253evbe/m5253evbe.c +++ b/board/freescale/m5253evbe/m5253evbe.c @@ -12,6 +12,8 @@ #include <asm/immap.h> #include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR; + int checkboard(void) { puts("Board: "); @@ -19,7 +21,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { /* * Check to see if the SDRAM has already been initialized @@ -66,7 +68,9 @@ phys_size_t initdram(void) *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x800) = 0xa5a5a5a5; }
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + + return 0; }
int testdram(void) diff --git a/board/freescale/m5272c3/m5272c3.c b/board/freescale/m5272c3/m5272c3.c index 9fab24ebb9..bbe06ba9df 100644 --- a/board/freescale/m5272c3/m5272c3.c +++ b/board/freescale/m5272c3/m5272c3.c @@ -11,6 +11,7 @@ #include <asm/immap.h> #include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR;
int checkboard (void) { puts ("Board: "); @@ -18,7 +19,7 @@ int checkboard (void) { return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
@@ -28,7 +29,9 @@ phys_size_t initdram(void) /* Dummy write to start SDRAM */ *((volatile unsigned long *)0) = 0;
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + + return 0; };
int testdram (void) { diff --git a/board/freescale/m5275evb/m5275evb.c b/board/freescale/m5275evb/m5275evb.c index 00ce582249..48ad4a86b9 100644 --- a/board/freescale/m5275evb/m5275evb.c +++ b/board/freescale/m5275evb/m5275evb.c @@ -13,6 +13,8 @@ #include <asm/immap.h> #include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR; + #define PERIOD 13 /* system bus period in ns */ #define SDRAM_TREFI 7800 /* in ns */
@@ -23,7 +25,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM); gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO); @@ -88,7 +90,9 @@ phys_size_t initdram(void) | MCF_SDRAMC_SDCR_RCNT((SDRAM_TREFI/(PERIOD*64)) - 1 + 1) | MCF_SDRAMC_SDCR_DQS_OE(0x3));
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + + return 0; };
int testdram(void) diff --git a/board/freescale/m5282evb/m5282evb.c b/board/freescale/m5282evb/m5282evb.c index 19e56957bd..7f3c04c379 100644 --- a/board/freescale/m5282evb/m5282evb.c +++ b/board/freescale/m5282evb/m5282evb.c @@ -16,7 +16,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize, i, dramclk;
@@ -80,5 +80,7 @@ phys_size_t initdram(void) /* Write to the SDRAM Mode Register */ *(u32 *)(CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696; } - return dramsize; + gd->ram_size = dramsize; + + return 0; } diff --git a/board/freescale/m53017evb/m53017evb.c b/board/freescale/m53017evb/m53017evb.c index 821e663b91..b0c27b4967 100644 --- a/board/freescale/m53017evb/m53017evb.c +++ b/board/freescale/m53017evb/m53017evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; @@ -68,7 +68,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m5329evb/m5329evb.c b/board/freescale/m5329evb/m5329evb.c index c4613a4cbd..5609a7b376 100644 --- a/board/freescale/m5329evb/m5329evb.c +++ b/board/freescale/m5329evb/m5329evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; @@ -62,7 +62,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m5373evb/m5373evb.c b/board/freescale/m5373evb/m5373evb.c index f1ddee1378..48a262c12f 100644 --- a/board/freescale/m5373evb/m5373evb.c +++ b/board/freescale/m5373evb/m5373evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; @@ -62,7 +62,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m54418twr/m54418twr.c b/board/freescale/m54418twr/m54418twr.c index c3bee185d8..3f1100c355 100644 --- a/board/freescale/m54418twr/m54418twr.c +++ b/board/freescale/m54418twr/m54418twr.c @@ -25,7 +25,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize;
@@ -104,7 +104,9 @@ phys_size_t initdram(void)
udelay(100); #endif - return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m54451evb/m54451evb.c b/board/freescale/m54451evb/m54451evb.c index a4d11b6815..653a11352c 100644 --- a/board/freescale/m54451evb/m54451evb.c +++ b/board/freescale/m54451evb/m54451evb.c @@ -26,7 +26,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize; #ifdef CONFIG_CF_SBF @@ -82,7 +82,9 @@ phys_size_t initdram(void)
udelay(100); #endif - return (dramsize); + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m54455evb/m54455evb.c b/board/freescale/m54455evb/m54455evb.c index 3bdcc332b6..b9850c1a2a 100644 --- a/board/freescale/m54455evb/m54455evb.c +++ b/board/freescale/m54455evb/m54455evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize; #ifdef CONFIG_CF_SBF @@ -75,7 +75,9 @@ phys_size_t initdram(void)
udelay(100); #endif - return (dramsize << 1); + gd->ram_size = dramsize << 1; + + return 0; };
int testdram(void) diff --git a/board/freescale/m547xevb/m547xevb.c b/board/freescale/m547xevb/m547xevb.c index e84a5ac4eb..fc674522f6 100644 --- a/board/freescale/m547xevb/m547xevb.c +++ b/board/freescale/m547xevb/m547xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); @@ -79,7 +79,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/m548xevb/m548xevb.c b/board/freescale/m548xevb/m548xevb.c index 06f9a5ede0..c268ec6a60 100644 --- a/board/freescale/m548xevb/m548xevb.c +++ b/board/freescale/m548xevb/m548xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-phys_size_t initdram(void) +int initdram(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); @@ -79,7 +79,9 @@ phys_size_t initdram(void)
udelay(100);
- return dramsize; + gd->ram_size = dramsize; + + return 0; };
int testdram(void) diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index e134091468..a0e5d91c8f 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -95,7 +95,7 @@ int is_micron(void){ return(ismicron); }
-phys_size_t initdram(void) +int initdram(void) { u32 msize = 0; /* @@ -167,7 +167,9 @@ phys_size_t initdram(void) sizeof(elpida_init_sequence)/sizeof(u32)); }
- return msize; + gd->ram_size = msize; + + return 0; }
int misc_init_r(void) diff --git a/board/freescale/mpc8308rdb/sdram.c b/board/freescale/mpc8308rdb/sdram.c index ed1e84e003..aac56c3983 100644 --- a/board/freescale/mpc8308rdb/sdram.c +++ b/board/freescale/mpc8308rdb/sdram.c @@ -65,17 +65,19 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM */ msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ - return msize; + gd->ram_size = msize; + + return 0; } diff --git a/board/freescale/mpc8313erdb/sdram.c b/board/freescale/mpc8313erdb/sdram.c index ce6fce5399..4e5dfe6f15 100644 --- a/board/freescale/mpc8313erdb/sdram.c +++ b/board/freescale/mpc8313erdb/sdram.c @@ -97,14 +97,14 @@ static long fixed_sdram(void) return msize; }
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; u32 msize;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main SODIMM */ msize = fixed_sdram(); @@ -120,5 +120,7 @@ phys_size_t initdram(void) #endif
/* return total bus SDRAM size(bytes) -- DDR */ - return msize; + gd->ram_size = msize; + + return 0; } diff --git a/board/freescale/mpc8315erdb/sdram.c b/board/freescale/mpc8315erdb/sdram.c index fd8968c71c..947ffabbb5 100644 --- a/board/freescale/mpc8315erdb/sdram.c +++ b/board/freescale/mpc8315erdb/sdram.c @@ -92,13 +92,13 @@ static long fixed_sdram(void) } #endif /* CONFIG_SYS_RAMBOOT */
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; u32 msize;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM */ msize = fixed_sdram(); @@ -106,6 +106,8 @@ phys_size_t initdram(void) if (im->pmc.pmccr1 & PMCCR1_POWER_OFF) resume_from_sleep();
- /* return total bus SDRAM size(bytes) -- DDR */ - return msize; + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize; + + return 0; } diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index f9f9a410c5..e7d8b99738 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -21,6 +21,8 @@ #endif #include <asm/mmu.h>
+DECLARE_GLOBAL_DATA_PTR; + const qe_iop_conf_t qe_iop_conf_tab[] = { /* UCC3 */ {1, 0, 1, 0, 1}, /* TxD0 */ @@ -68,21 +70,23 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
int fixed_sdram(void);
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main SODIMM */ im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
msize = fixed_sdram();
- /* return total bus SDRAM size(bytes) -- DDR */ - return (msize * 1024 * 1024); + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize * 1024 * 1024; + + return 0; }
/************************************************************************* diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index d66ad33bf5..907ad09dc8 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -23,6 +23,8 @@ #include "../common/pq-mds-pib.h" #endif
+DECLARE_GLOBAL_DATA_PTR; + const qe_iop_conf_t qe_iop_conf_tab[] = { /* ETH3 */ {1, 0, 1, 0, 1}, /* TxD0 */ @@ -88,21 +90,23 @@ int board_early_init_r(void)
int fixed_sdram(void);
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main SODIMM */ im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
msize = fixed_sdram();
- /* return total bus SDRAM size(bytes) -- DDR */ - return (msize * 1024 * 1024); + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize * 1024 * 1024; + + return 0; }
/************************************************************************* diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 3bcfe03065..595bce16d1 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -22,6 +22,8 @@ #include <libfdt.h> #endif
+DECLARE_GLOBAL_DATA_PTR; + int fixed_sdram(void); void sdram_init(void);
@@ -46,13 +48,13 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; phys_size_t msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main SODIMM */ im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; @@ -73,8 +75,10 @@ phys_size_t initdram(void) */ sdram_init();
- /* return total bus SDRAM size(bytes) -- DDR */ - return msize; + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize; + + return 0; }
#if !defined(CONFIG_SPD_EEPROM) diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 01eac0260f..27f0ccd9a6 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -20,6 +20,8 @@ #include <libfdt.h> #endif
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SPD_EEPROM /************************************************************************* * fixed sdram init -- doesn't use serial presence detect. @@ -116,7 +118,7 @@ volatile static struct pci_controller hose[] = { }; #endif /* CONFIG_PCI */
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; @@ -125,7 +127,7 @@ phys_size_t initdram(void) #endif
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO;
/* DDR SDRAM - Main SODIMM */ im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; @@ -144,7 +146,9 @@ phys_size_t initdram(void) #endif
/* return total bus RAM size(bytes) */ - return msize * 1024 * 1024; + gd->ram_size = msize * 1024 * 1024; + + return 0; }
int checkboard(void) diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index 0463940bae..a3af246854 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -20,6 +20,8 @@ #include "pci.h" #include "../common/pq-mds-pib.h"
+DECLARE_GLOBAL_DATA_PTR; + int board_early_init_f(void) { u8 *bcsr = (u8 *)CONFIG_SYS_BCSR; @@ -216,13 +218,13 @@ extern void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO;
#if defined(CONFIG_SPD_EEPROM) msize = spd_sdram(); @@ -236,7 +238,9 @@ phys_size_t initdram(void) #endif
/* return total bus DDR size(bytes) */ - return (msize * 1024 * 1024); + gd->ram_size = msize * 1024 * 1024; + + return 0; }
#if !defined(CONFIG_SPD_EEPROM) diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index d81778549c..2f5431ee21 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -16,6 +16,8 @@ #include <vsc7385.h> #include <fsl_esdhc.h>
+DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_SYS_DRAM_TEST) int testdram(void) @@ -60,13 +62,13 @@ void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO;
#if defined(CONFIG_SPD_EEPROM) msize = spd_sdram(); @@ -79,7 +81,9 @@ phys_size_t initdram(void) ddr_enable_ecc(msize * 1024 * 1024); #endif /* return total bus DDR size(bytes) */ - return (msize * 1024 * 1024); + gd->ram_size = msize * 1024 * 1024; + + return 0; }
#if !defined(CONFIG_SPD_EEPROM) diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 7668226321..0422208133 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -19,6 +19,8 @@ #include <spd_sdram.h> #include <netdev.h>
+DECLARE_GLOBAL_DATA_PTR; + void sdram_init(void); phys_size_t fixed_sdram(void); int mpc8610hpcd_diu_init(void); @@ -116,7 +118,7 @@ int checkboard(void) }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = 0;
@@ -129,7 +131,9 @@ phys_size_t initdram(void) setup_ddr_bat(dram_size);
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; }
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 1076442516..07cb08b6b8 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -16,6 +16,8 @@ #include <fdt_support.h> #include <netdev.h>
+DECLARE_GLOBAL_DATA_PTR; + phys_size_t fixed_sdram(void);
int checkboard(void) @@ -37,7 +39,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = 0;
@@ -50,7 +52,9 @@ phys_size_t initdram(void) setup_ddr_bat(dram_size);
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; }
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index 05da1dac7d..0565367937 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -94,7 +94,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("\nTertiary program loader running in sram..."); #else diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index 77ed2577f9..1f490dc943 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -111,7 +111,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(); + initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 3357702dba..67637390be 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- gd->ram_size = initdram(); + initdram(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p2041rdb/ddr.c b/board/freescale/p2041rdb/ddr.c index b07bd98fb1..3df8d21725 100644 --- a/board/freescale/p2041rdb/ddr.c +++ b/board/freescale/p2041rdb/ddr.c @@ -12,6 +12,8 @@ #include <fsl_ddr_dimm_params.h> #include <asm/fsl_law.h>
+DECLARE_GLOBAL_DATA_PTR; + struct board_specific_parameters { u32 n_ranks; u32 datarate_mhz_high; @@ -116,7 +118,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = 0;
@@ -127,12 +129,14 @@ phys_size_t initdram(void) dram_size = fsl_ddr_sdram(); } else { puts("no SPD and fixed parameters\n"); - return dram_size; + return -ENXIO; }
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t102xqds/ddr.c b/board/freescale/t102xqds/ddr.c index 507929bb70..93003c25d8 100644 --- a/board/freescale/t102xqds/ddr.c +++ b/board/freescale/t102xqds/ddr.c @@ -169,7 +169,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -187,5 +187,7 @@ phys_size_t initdram(void) fsl_dp_resume(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index a1481e9b63..c847b01e7e 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -142,7 +142,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t102xrdb/ddr.c b/board/freescale/t102xrdb/ddr.c index 56f98ac2f9..773aa77781 100644 --- a/board/freescale/t102xrdb/ddr.c +++ b/board/freescale/t102xrdb/ddr.c @@ -229,7 +229,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -249,5 +249,7 @@ phys_size_t initdram(void) fsl_dp_resume(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index f70a337512..5be71628af 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -129,7 +129,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t1040qds/ddr.c b/board/freescale/t1040qds/ddr.c index a5d3e54cfe..d23787d43a 100644 --- a/board/freescale/t1040qds/ddr.c +++ b/board/freescale/t1040qds/ddr.c @@ -117,7 +117,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -134,5 +134,7 @@ phys_size_t initdram(void) fsl_dp_resume(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t104xrdb/ddr.c b/board/freescale/t104xrdb/ddr.c index 4a09cae782..b99ab95397 100644 --- a/board/freescale/t104xrdb/ddr.c +++ b/board/freescale/t104xrdb/ddr.c @@ -120,7 +120,7 @@ void board_mem_sleep_setup(void) } #endif
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -137,5 +137,7 @@ phys_size_t initdram(void) fsl_dp_resume(); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 076641c1ec..899691a779 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -125,7 +125,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xqds/ddr.c b/board/freescale/t208xqds/ddr.c index 044ac18562..adc109042b 100644 --- a/board/freescale/t208xqds/ddr.c +++ b/board/freescale/t208xqds/ddr.c @@ -104,7 +104,7 @@ found: popts->cpo_sample = 0x64; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -118,5 +118,7 @@ phys_size_t initdram(void) dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index caa4de3e7f..3e713dc2c3 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -128,7 +128,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xrdb/ddr.c b/board/freescale/t208xrdb/ddr.c index bcb536ae1b..b4ad615846 100644 --- a/board/freescale/t208xrdb/ddr.c +++ b/board/freescale/t208xrdb/ddr.c @@ -97,7 +97,7 @@ found: popts->cpo_sample = 0x54; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -111,5 +111,7 @@ phys_size_t initdram(void) dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index 44be70be87..a5f940c6f6 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -98,7 +98,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4qds/ddr.c b/board/freescale/t4qds/ddr.c index 24b1872560..84ff792225 100644 --- a/board/freescale/t4qds/ddr.c +++ b/board/freescale/t4qds/ddr.c @@ -112,7 +112,7 @@ found: popts->cpo_sample = 0x63; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -127,5 +127,7 @@ phys_size_t initdram(void) dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index bda0003565..05feedecc2 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -133,7 +133,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4rdb/ddr.c b/board/freescale/t4rdb/ddr.c index 8596ccde1b..d03baa3f45 100644 --- a/board/freescale/t4rdb/ddr.c +++ b/board/freescale/t4rdb/ddr.c @@ -105,7 +105,7 @@ found: popts->cpo_sample = 0x64; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -120,5 +120,7 @@ phys_size_t initdram(void) dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size *= 0x100000;
- return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index d3a86e6599..e96f3d38c5 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -91,7 +91,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- gd->ram_size = initdram(); + initdram();
mmc_boot(); } diff --git a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c index ecdc7e72d3..4ceb48b09d 100644 --- a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c +++ b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c @@ -10,9 +10,11 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(void) +int initdram(void) { - return 1; + /* Does not set gd->ram_size here */ + + return 0; }
int checkboard(void) diff --git a/board/gaisler/gr_ep2s60/gr_ep2s60.c b/board/gaisler/gr_ep2s60/gr_ep2s60.c index 66fe5a53b0..12d8c1025c 100644 --- a/board/gaisler/gr_ep2s60/gr_ep2s60.c +++ b/board/gaisler/gr_ep2s60/gr_ep2s60.c @@ -10,9 +10,11 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(void) +int initdram(void) { - return 1; + /* Does not set gd->ram_size here */ + + return 0; }
int checkboard(void) diff --git a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c index 1725459af8..02beb5c926 100644 --- a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c +++ b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c @@ -9,9 +9,11 @@ #include <config.h> #include <asm/leon.h>
-phys_size_t initdram(void) +int initdram(void) { - return 1; + /* Does not set gd->ram_size here */ + + return 0; }
int checkboard(void) diff --git a/board/gaisler/grsim/grsim.c b/board/gaisler/grsim/grsim.c index fa097377df..aa9ba50877 100644 --- a/board/gaisler/grsim/grsim.c +++ b/board/gaisler/grsim/grsim.c @@ -10,9 +10,11 @@ #include <common.h> #include <asm/leon.h>
-phys_size_t initdram(void) +int initdram(void) { - return 1; + /* Does not set gd->ram_size here */ + + return 0; }
int checkboard(void) diff --git a/board/gaisler/grsim_leon2/grsim_leon2.c b/board/gaisler/grsim_leon2/grsim_leon2.c index 12df6bd7ef..384db3d84b 100644 --- a/board/gaisler/grsim_leon2/grsim_leon2.c +++ b/board/gaisler/grsim_leon2/grsim_leon2.c @@ -10,9 +10,11 @@ #include <common.h> #include <asm/leon.h>
-phys_size_t initdram(void) +int initdram(void) { - return 1; + /* Does not set gd->ram_size here */ + + return 0; }
int checkboard(void) diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c index b7b31fb024..5b67a013da 100644 --- a/board/gdsys/mpc8308/sdram.c +++ b/board/gdsys/mpc8308/sdram.c @@ -66,17 +66,19 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
/* DDR SDRAM */ msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ - return msize; + gd->ram_size = msize; + + return 0; } diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index b40e4b30e8..d8e6701fac 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -119,14 +119,14 @@ static int setup_sdram(void) return msize; }
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; fsl_lbc_t *lbc = &im->im_lbc; u32 msize = 0;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
msize = setup_sdram();
@@ -134,7 +134,9 @@ phys_size_t initdram(void) out_be32(&lbc->mrtpr, CONFIG_SYS_LBC_MRTPR); sync();
- return msize; + gd->ram_size = msize; + + return 0; }
#if defined(CONFIG_OF_BOARD_SETUP) diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c index b107dd196c..129eb47b0e 100644 --- a/board/ifm/ac14xx/ac14xx.c +++ b/board/ifm/ac14xx/ac14xx.c @@ -310,9 +310,12 @@ u32 sdram_init_seq[] = { /* EMPTY, optional, we don't do it */ };
-phys_size_t initdram(void) +int initdram(void) { - return fixed_sdram(NULL, sdram_init_seq, ARRAY_SIZE(sdram_init_seq)); + gd->ram_size = fixed_sdram(NULL, sdram_init_seq, + ARRAY_SIZE(sdram_init_seq)); + + return 0; }
int misc_init_r(void) diff --git a/board/ifm/o2dnt2/o2dnt2.c b/board/ifm/o2dnt2/o2dnt2.c index 7452d2b1f0..4f81007ead 100644 --- a/board/ifm/o2dnt2/o2dnt2.c +++ b/board/ifm/o2dnt2/o2dnt2.c @@ -66,7 +66,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -phys_size_t initdram(void) +int initdram(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; @@ -181,7 +181,9 @@ phys_size_t initdram(void) (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) out_be32(&sdram->sdelay, 0x04);
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
diff --git a/board/imgtec/boston/ddr.c b/board/imgtec/boston/ddr.c index c841bf02a3..b92ff2aa88 100644 --- a/board/imgtec/boston/ddr.c +++ b/board/imgtec/boston/ddr.c @@ -10,11 +10,16 @@
#include "boston-regs.h"
-phys_size_t initdram(void) +DECLARE_GLOBAL_DATA_PTR; + +int initdram(void) { u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0);
- return (phys_size_t)(ddrconf0 & BOSTON_PLAT_DDRCONF0_SIZE) << 30; + gd->ram_size = (phys_size_t)(ddrconf0 & BOSTON_PLAT_DDRCONF0_SIZE) << + 30; + + return 0; }
ulong board_get_usable_ram_top(ulong total_size) diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index c269d0a5a3..f8c65b0e46 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -19,6 +19,8 @@
#include "superio.h"
+DECLARE_GLOBAL_DATA_PTR; + enum core_card { CORE_UNKNOWN, CORE_LV, @@ -83,9 +85,11 @@ static enum sys_con malta_sys_con(void) } }
-phys_size_t initdram(void) +int initdram(void) { - return CONFIG_SYS_MEM_SIZE; + gd->ram_size = CONFIG_SYS_MEM_SIZE; + + return 0; }
int checkboard(void) diff --git a/board/imgtec/xilfpga/xilfpga.c b/board/imgtec/xilfpga/xilfpga.c index dc0a088ecb..8aa7c10bff 100644 --- a/board/imgtec/xilfpga/xilfpga.c +++ b/board/imgtec/xilfpga/xilfpga.c @@ -11,10 +11,14 @@
#include <common.h>
+DECLARE_GLOBAL_DATA_PTR; + /* initialize the DDR Controller and PHY */ -phys_size_t initdram(void) +int initdram(void) { /* MIG IP block is smart and doesn't need SW * to do any init */ - return CONFIG_SYS_SDRAM_SIZE; /* in bytes */ + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; /* in bytes */ + + return 0; } diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c index 47c3955c6d..2dd9799ea7 100644 --- a/board/inka4x0/inka4x0.c +++ b/board/inka4x0/inka4x0.c @@ -36,6 +36,8 @@ #error "INKA4x0 SDRAM: invalid chip type specified!" #endif
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start (int hi_addr) { @@ -77,7 +79,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *) CONFIG_SYS_MBAR; @@ -139,7 +141,9 @@ phys_size_t initdram(void) } #endif /* CONFIG_SYS_RAMBOOT */
- return dramsize; + gd->ram_size = dramsize; + + return 0; }
int checkboard (void) diff --git a/board/intercontrol/digsy_mtc/digsy_mtc.c b/board/intercontrol/digsy_mtc/digsy_mtc.c index 9bada940b7..922d9ef0a1 100644 --- a/board/intercontrol/digsy_mtc/digsy_mtc.c +++ b/board/intercontrol/digsy_mtc/digsy_mtc.c @@ -79,7 +79,7 @@ static void sdram_start(int hi_addr) * CONFIG_SYS_SDRAM_BASE is something other than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -172,7 +172,9 @@ phys_size_t initdram(void) (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) out_be32((void *)MPC5XXX_SDRAM_SDELAY, 0x04);
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard(void) diff --git a/board/ipek01/ipek01.c b/board/ipek01/ipek01.c index ab94c65499..ca99332e51 100644 --- a/board/ipek01/ipek01.c +++ b/board/ipek01/ipek01.c @@ -80,7 +80,7 @@ static void sdram_start (int hi_addr) * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; @@ -135,7 +135,9 @@ phys_size_t initdram(void) */ out_be32 (&sdram->sdelay, 0x04);
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard (void) diff --git a/board/jupiter/jupiter.c b/board/jupiter/jupiter.c index ae569d0fc0..d134691361 100644 --- a/board/jupiter/jupiter.c +++ b/board/jupiter/jupiter.c @@ -29,6 +29,8 @@ #define SDRAM_CONFIG2 0x88b70004 #endif
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start (int hi_addr) { @@ -76,7 +78,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -194,7 +196,9 @@ phys_size_t initdram(void) __asm__ volatile ("sync"); }
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard (void) diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index 12fd05d2f4..bbabbcfc0b 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -15,6 +15,8 @@ #include <i2c.h> #include "../common/common.h"
+DECLARE_GLOBAL_DATA_PTR; + static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
/* @@ -289,7 +291,7 @@ static long probe_sdram(memctl8260_t *memctl) #endif /* CONFIG_SYS_SDRAM_LIST */
-phys_size_t initdram(void) +int initdram(void) { immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; memctl8260_t *memctl = &immap->im_memctl; @@ -305,7 +307,9 @@ phys_size_t initdram(void)
icache_enable();
- return psize; + gd->ram_size = psize; + + return 0; }
int checkboard(void) diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 111a8a7995..f83fa06e93 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -28,6 +28,8 @@
#include "../common/common.h"
+DECLARE_GLOBAL_DATA_PTR; + static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
const qe_iop_conf_t qe_iop_conf_tab[] = { @@ -328,13 +330,13 @@ static int fixed_sdram(void) return msize; }
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; + return -ENXIO;
out_be32(&im->sysconf.ddrlaw[0].bar, CONFIG_SYS_DDR_BASE & LAWBAR_BAR); @@ -348,7 +350,9 @@ phys_size_t initdram(void) #endif
/* return total bus SDRAM size(bytes) -- DDR */ - return msize * 1024 * 1024; + gd->ram_size = msize * 1024 * 1024; + + return 0; }
int checkboard(void) diff --git a/board/keymile/kmp204x/ddr.c b/board/keymile/kmp204x/ddr.c index 98fb1adfdd..006b809654 100644 --- a/board/keymile/kmp204x/ddr.c +++ b/board/keymile/kmp204x/ddr.c @@ -14,6 +14,8 @@ #include <fsl_ddr_sdram.h> #include <fsl_ddr_dimm_params.h>
+DECLARE_GLOBAL_DATA_PTR; + void fsl_ddr_board_options(memctl_options_t *popts, dimm_params_t *pdimm, unsigned int ctrl_num) @@ -48,7 +50,7 @@ void fsl_ddr_board_options(memctl_options_t *popts, popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR_ODT_75ohm; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = 0;
@@ -60,5 +62,7 @@ phys_size_t initdram(void) dram_size *= 0x100000;
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/liebherr/lwmon5/sdram.c b/board/liebherr/lwmon5/sdram.c index 1932e06fd6..f7251e567f 100644 --- a/board/liebherr/lwmon5/sdram.c +++ b/board/liebherr/lwmon5/sdram.c @@ -25,6 +25,8 @@ #include <asm/ppc440.h> #include <watchdog.h>
+DECLARE_GLOBAL_DATA_PTR; + /* * This DDR2 setup code can dynamically setup the TLB entries for the DDR2 memory * region. Right now the cache should still be disabled in U-Boot because of the @@ -145,7 +147,7 @@ static void program_ecc(u32 start_address, * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -phys_size_t initdram(void) +int initdram(void) { /* CL=4 */ mtsdram(DDR0_02, 0x00000000); @@ -241,5 +243,7 @@ phys_size_t initdram(void) */ set_mcsr(get_mcsr());
- return (CONFIG_SYS_MBYTES_SDRAM << 20); + gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20; + + return 0; } diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c index f4a6521e94..02824eaf4f 100644 --- a/board/micronas/vct/vct.c +++ b/board/micronas/vct/vct.c @@ -28,6 +28,8 @@ #define BOARD_NAME_ADD " NOR" #endif
+DECLARE_GLOBAL_DATA_PTR; + int board_early_init_f(void) { /* @@ -59,10 +61,12 @@ void _machine_restart(void) * SDRAM is already configured by the bootstrap code, only return the * auto-detected size here */ -phys_size_t initdram(void) +int initdram(void) { - return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, + gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MBYTES_SDRAM << 20); + + return 0; }
int checkboard(void) diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index 3e2fe653bd..a2520bc3bc 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -19,6 +19,8 @@ #include <status_led.h> #endif /* CONFIG_LED_STATUS */
+DECLARE_GLOBAL_DATA_PTR; + /* Kollmorgen DPR initialization data */ struct init_elem { unsigned long addr; @@ -116,7 +118,7 @@ static void sdram_start(int hi_addr) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT @@ -172,7 +174,9 @@ phys_size_t initdram(void) #endif /* CONFIG_SYS_RAMBOOT */
/* return total ram size */ - return dramsize; + gd->ram_size = dramsize; + + return 0; }
diff --git a/board/mpc8308_p1m/sdram.c b/board/mpc8308_p1m/sdram.c index 96d60c95ee..e0f4671b17 100644 --- a/board/mpc8308_p1m/sdram.c +++ b/board/mpc8308_p1m/sdram.c @@ -61,7 +61,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-phys_size_t initdram(void) +int initdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; @@ -72,6 +72,8 @@ phys_size_t initdram(void) /* DDR SDRAM */ msize = fixed_sdram();
- /* return total bus SDRAM size(bytes) -- DDR */ - return msize; + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize; + + return 0; } diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index e2961d1d4a..e6422965f9 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -622,7 +622,7 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-phys_size_t initdram(void) +int initdram(void) {
unsigned long bank_reg[4], tmp, bank_size; @@ -655,7 +655,9 @@ phys_size_t initdram(void) printf ("ECC ");
test_dram (TotalSize * MEGA_BYTE); - return (TotalSize * MEGA_BYTE); + gd->ram_size = TotalSize * MEGA_BYTE; + + return 0; }
/* ------------------------------------------------------------------------- */ diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c index 951010a6a3..7b7b93f682 100644 --- a/board/mpl/pati/pati.c +++ b/board/mpl/pati/pati.c @@ -55,6 +55,8 @@ asm (GEN_SYMNAME(name) " = " GEN_VALUE(value))
+DECLARE_GLOBAL_DATA_PTR; + /************************************************************************ * Early debug routines */ @@ -133,7 +135,7 @@ extern int mem_test (unsigned long start, unsigned long ramsize, int quiet); /* * Get RAM size. */ -phys_size_t initdram(void) +int initdram(void) { unsigned char board_rev; unsigned long reg; @@ -209,8 +211,10 @@ phys_size_t initdram(void) /* we have a x32 bit bus to the SDRAM, so shift the addr with 2 */ lmr<<=2; in32(CONFIG_SYS_SDRAM_BASE + lmr); - /* ok, we're done, return SDRAM size */ - return ((0x400000 << sdram_table[i].sz)); /* log2 value of 4MByte */ + /* ok, we're done, set SDRAM size to log2 value of 4MByte*/ + gd->ram_size = 0x400000 << sdram_table[i].sz; + + return 0; }
diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index 07b30ed293..c07d8f88b9 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -612,7 +612,7 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-phys_size_t initdram(void) +int initdram(void) { unsigned long bank_reg[4], tmp, bank_size; int i, ds; @@ -648,7 +648,9 @@ phys_size_t initdram(void) (void) get_clocks(); if (gd->cpu_clk > 220000000) TotalSize /= 2; - return (TotalSize * 1024 * 1024); + gd->ram_size = TotalSize * 1024 * 1024; + + return 0; }
/* ------------------------------------------------------------------------- */ diff --git a/board/munices/munices.c b/board/munices/munices.c index b88160c8a8..8f1a5a8341 100644 --- a/board/munices/munices.c +++ b/board/munices/munices.c @@ -11,6 +11,8 @@
#include "mt48lc16m16a2-75.h"
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start (int hi_addr) { @@ -58,7 +60,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -125,7 +127,9 @@ phys_size_t initdram(void)
#endif /* CONFIG_SYS_RAMBOOT */
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard (void) diff --git a/board/openrisc/openrisc-generic/openrisc-generic.c b/board/openrisc/openrisc-generic/openrisc-generic.c index d4a964f14f..8f9b98dbca 100644 --- a/board/openrisc/openrisc-generic/openrisc-generic.c +++ b/board/openrisc/openrisc-generic/openrisc-generic.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { return 0; } diff --git a/board/pb1x00/pb1x00.c b/board/pb1x00/pb1x00.c index baa5723f4a..e473531fd3 100644 --- a/board/pb1x00/pb1x00.c +++ b/board/pb1x00/pb1x00.c @@ -11,11 +11,15 @@ #include <asm/mipsregs.h> #include <asm/io.h>
-phys_size_t initdram(void) +DECLARE_GLOBAL_DATA_PTR; + +int initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ - return 64*1024*1024; + gd->ram_size = 64 * 1024 * 1024; + + return 0; }
#define BCSR_PCMCIA_PC0DRVEN 0x0010 diff --git a/board/pdm360ng/pdm360ng.c b/board/pdm360ng/pdm360ng.c index ef19daf3c9..c833aec9b2 100644 --- a/board/pdm360ng/pdm360ng.c +++ b/board/pdm360ng/pdm360ng.c @@ -48,7 +48,7 @@ sdram_conf_t mddrc_config[] = { }, };
-phys_size_t initdram(void) +int initdram(void) { int i; u32 msize = 0; @@ -95,7 +95,9 @@ phys_size_t initdram(void) break; }
- return msize; + gd->ram_size = msize; + + return 0; }
static int set_lcd_brightness(char *); diff --git a/board/phytec/pcm030/pcm030.c b/board/phytec/pcm030/pcm030.c index 470bd70792..19d87169ee 100644 --- a/board/phytec/pcm030/pcm030.c +++ b/board/phytec/pcm030/pcm030.c @@ -18,6 +18,8 @@
#include "mt46v32m16-75.h"
+DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_SYS_RAMBOOT static void sdram_start(int hi_addr) { @@ -73,7 +75,7 @@ static void sdram_start(int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; @@ -143,7 +145,9 @@ phys_size_t initdram(void)
#endif /* CONFIG_SYS_RAMBOOT */
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
int checkboard(void) diff --git a/board/qemu-mips/qemu-mips.c b/board/qemu-mips/qemu-mips.c index 3cdc91cf43..2638ea67d3 100644 --- a/board/qemu-mips/qemu-mips.c +++ b/board/qemu-mips/qemu-mips.c @@ -11,11 +11,15 @@ #include <asm/io.h> #include <netdev.h>
-phys_size_t initdram(void) +DECLARE_GLOBAL_DATA_PTR; + +int initdram(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ - return MEM_SIZE*1024*1024; + gd->ram_size = MEM_SIZE * 1024 * 1024; + + return 0; }
int checkboard(void) diff --git a/board/sbc8349/sbc8349.c b/board/sbc8349/sbc8349.c index b20de4c3c3..f01cd7ed52 100644 --- a/board/sbc8349/sbc8349.c +++ b/board/sbc8349/sbc8349.c @@ -19,6 +19,8 @@ #include <libfdt.h> #endif
+DECLARE_GLOBAL_DATA_PTR; + int fixed_sdram(void); void sdram_init(void);
@@ -35,7 +37,7 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; @@ -61,8 +63,10 @@ phys_size_t initdram(void) */ ddr_enable_ecc(msize * 1024 * 1024); #endif - /* return total bus SDRAM size(bytes) -- DDR */ - return (msize * 1024 * 1024); + /* set total bus SDRAM size(bytes) -- DDR */ + gd->ram_size = msize * 1024 * 1024; + + return 0; }
#if !defined(CONFIG_SPD_EEPROM) diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index a541d25cc3..44842d5af1 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -23,6 +23,8 @@ #include <libfdt.h> #include <fdt_support.h>
+DECLARE_GLOBAL_DATA_PTR; + long int fixed_sdram (void);
int board_early_init_f (void) @@ -37,7 +39,7 @@ int checkboard (void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { long dram_size = 0;
@@ -48,7 +50,9 @@ phys_size_t initdram(void) #endif
debug (" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; }
#if defined(CONFIG_SYS_DRAM_TEST) diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index b7f6380bec..e2b9123bac 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -14,6 +14,8 @@ #include <dm.h> #include <dm/platform_data/serial_coldfire.h>
+DECLARE_GLOBAL_DATA_PTR; + void init_lcd(void) { /* setup for possible K0108 lcd connected on the parallel port */ @@ -49,7 +51,7 @@ void fudelay(int usec) asm volatile ("nop"); }
-phys_size_t initdram(void) +int initdram(void) { u32 dramsize, RC;
@@ -99,7 +101,10 @@ phys_size_t initdram(void) out_be32(&dc->dacr0, 0x0000b344); out_be32((u32 *)0x00000c00, 0xbeaddeed);
- return get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE); + gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, + CONFIG_SYS_SDRAM_SIZE); + + return 0; }
static struct coldfire_serial_platdata mcf5307_serial_plat = { diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index 1e843d5b03..baf3208740 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -133,7 +133,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -252,10 +252,12 @@ phys_size_t initdram(void) }
#if defined(CONFIG_TQM5200_B) - return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; #else - return dramsize; + gd->ram_size = dramsize; #endif /* CONFIG_TQM5200_B */ + + return 0; }
int checkboard (void) diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index a05ae2a170..0968e494a5 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -66,7 +66,7 @@ int board_early_init_r (void) { /************************************************************************** * DRAM initalization and size detection */ -phys_size_t initdram(void) +int initdram(void) { long bank_size; long size; @@ -112,7 +112,9 @@ phys_size_t initdram(void) if(size < DDR_MAX_SIZE_PER_CS) break; }
- return size; + gd->ram_size = size; + + return 0; }
/************************************************************************** diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 99357302f6..489a22c161 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -126,7 +126,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; @@ -390,7 +390,9 @@ phys_size_t initdram(void) memctl->memc_or5 = CONFIG_SYS_OR5_ISP1362; memctl->memc_br5 = CONFIG_SYS_BR5_ISP1362; #endif /* CONFIG_ISP1362_USB */ - return (size_b0 + size_b1); + gd->ram_size = size_b0 + size_b1; + + return 0; }
/* ------------------------------------------------------------------------- */ diff --git a/board/v38b/v38b.c b/board/v38b/v38b.c index 20490a3157..c271fb5873 100644 --- a/board/v38b/v38b.c +++ b/board/v38b/v38b.c @@ -13,6 +13,7 @@ #include <net.h> #include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_RAMBOOT static void sdram_start(int hi_addr) @@ -56,7 +57,7 @@ static void sdram_start(int hi_addr) #endif /* !CONFIG_SYS_RAMBOOT */
-phys_size_t initdram(void) +int initdram(void) { ulong dramsize = 0; ulong dramsize2 = 0; @@ -166,7 +167,9 @@ phys_size_t initdram(void) __asm__ volatile ("sync"); }
- return dramsize + dramsize2; + gd->ram_size = dramsize + dramsize2; + + return 0; }
diff --git a/board/varisys/cyrus/ddr.c b/board/varisys/cyrus/ddr.c index da6f5ad253..abf4e93265 100644 --- a/board/varisys/cyrus/ddr.c +++ b/board/varisys/cyrus/ddr.c @@ -168,7 +168,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size;
@@ -184,5 +184,7 @@ phys_size_t initdram(void) dram_size *= 0x100000;
debug(" DDR: "); - return dram_size; + gd->ram_size = dram_size; + + return 0; } diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c index 5349a583fc..37441c7a46 100644 --- a/board/ve8313/ve8313.c +++ b/board/ve8313/ve8313.c @@ -88,7 +88,7 @@ static long fixed_sdram(void) return msize; }
-phys_size_t initdram(void) +int initdram(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; @@ -106,7 +106,9 @@ phys_size_t initdram(void) sync();
/* return total bus SDRAM size(bytes) -- DDR */ - return msize; + gd->ram_size = msize; + + return 0; }
#define VE8313_WDT_EN 0x00020000 diff --git a/board/xes/xpedite1000/xpedite1000.c b/board/xes/xpedite1000/xpedite1000.c index ff64483cf4..df5a7a0539 100644 --- a/board/xes/xpedite1000/xpedite1000.c +++ b/board/xes/xpedite1000/xpedite1000.c @@ -116,9 +116,11 @@ int checkboard(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { - return spd_sdram(); + gd->ram_size = spd_sdram(); + + return 0; }
/* diff --git a/board/xes/xpedite517x/xpedite517x.c b/board/xes/xpedite517x/xpedite517x.c index 9ec99a1e28..e436c28f78 100644 --- a/board/xes/xpedite517x/xpedite517x.c +++ b/board/xes/xpedite517x/xpedite517x.c @@ -13,6 +13,8 @@ #include <pca953x.h> #include "../common/fsl_8xxx_misc.h"
+DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_PCI) extern void ft_board_pci_setup(void *blob, bd_t *bd); #endif @@ -56,7 +58,7 @@ int board_early_init_r(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { phys_size_t dram_size = fsl_ddr_sdram();
@@ -65,7 +67,9 @@ phys_size_t initdram(void) ddr_enable_ecc(dram_size); #endif
- return dram_size; + gd->ram_size = dram_size; + + return 0; }
#if defined(CONFIG_OF_BOARD_SETUP) diff --git a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c index dfdd3f2310..6148a4b69c 100644 --- a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c +++ b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c @@ -10,6 +10,8 @@ #include <common.h> #include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR; + ulong get_PCI_freq(void) { return 0; @@ -21,10 +23,12 @@ int checkboard(void) return 0; }
-phys_size_t initdram(void) +int initdram(void) { - return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, + gd->ram_size = get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); + + return 0; }
void get_sys_info(sys_info_t *sys_info) diff --git a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c index 67fd668157..d7e6aee706 100644 --- a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c +++ b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c @@ -11,16 +11,20 @@ #include <netdev.h> #include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR; + int checkboard(void) { puts("Xilinx PPC440 Generic Board\n"); return 0; }
-phys_size_t initdram(void) +int initdram(void) { - return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, + gd->ram_size = get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); + + return 0; }
void get_sys_info(sys_info_t *sys_info) diff --git a/common/board_f.c b/common/board_f.c index b1b994cea6..3cd53737d3 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -180,13 +180,7 @@ static int announce_dram_init(void) #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K) static int init_func_ram(void) { - gd->ram_size = initdram(); - - if (gd->ram_size > 0) - return 0; - - puts("*** failed ***\n"); - return 1; + return initdram(); } #endif
diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c index 159c22e18a..9aa3eecd34 100644 --- a/drivers/ddr/fsl/main.c +++ b/drivers/ddr/fsl/main.c @@ -15,6 +15,8 @@ #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/include/common.h b/include/common.h index 330d3962b5..844f012297 100644 --- a/include/common.h +++ b/include/common.h @@ -212,7 +212,7 @@ int timer_init(void); int cpu_init(void);
/* */ -phys_size_t initdram(void); +int initdram(void);
#include <display_options.h>

On 31.03.2017 16:40, Simon Glass wrote:
At present we cannot use this function as an init sequence call without a wrapper, since it returns the RAM size. Adjust it to set the RAM size in global_data instead, and return 0 on success.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On 03/31/2017 07:40 AM, Simon Glass wrote:
At present we cannot use this function as an init sequence call without a wrapper, since it returns the RAM size. Adjust it to set the RAM size in global_data instead, and return 0 on success.
Signed-off-by: Simon Glass sjg@chromium.org
This is a _lot_ of changes.
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:25AM -0600, Simon Glass wrote:
At present we cannot use this function as an init sequence call without a wrapper, since it returns the RAM size. Adjust it to set the RAM size in global_data instead, and return 0 on success.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
Applied to u-boot/master, thanks!

This allows us to use the same DRAM init function on all archs.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/mips/mach-ath79/dram.c | 2 +- arch/mips/mach-pic32/cpu.c | 2 +- arch/mips/mach-pic32/include/mach/ddr.h | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 4 ++-- arch/powerpc/cpu/mpc85xx/cpu.c | 4 ++-- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c | 4 ++-- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c | 4 ++-- arch/powerpc/cpu/ppc4xx/sdram.c | 4 ++-- arch/powerpc/cpu/ppc4xx/spl_boot.c | 2 +- arch/xtensa/cpu/cpu.c | 5 +++++ board/Arcturus/ucp1020/spl.c | 2 +- board/BuS/eb_cpu5282/eb_cpu5282.c | 2 +- board/a3m071/a3m071.c | 2 +- board/a4m072/a4m072.c | 2 +- board/amcc/acadia/memory.c | 2 +- board/amcc/bamboo/bamboo.c | 2 +- board/amcc/bubinga/bubinga.c | 4 ++-- board/amcc/sequoia/sdram.c | 2 +- board/amcc/walnut/walnut.c | 4 ++-- board/amcc/yosemite/yosemite.c | 2 +- board/astro/mcf5373l/mcf5373l.c | 2 +- board/canmb/canmb.c | 2 +- board/cm5200/cm5200.c | 2 +- board/cobra5272/cobra5272.c | 2 +- board/davedenx/aria/aria.c | 2 +- board/dbau1x00/dbau1x00.c | 2 +- board/esd/mecp5123/mecp5123.c | 2 +- board/esd/pmc440/sdram.c | 2 +- board/esd/vme8349/vme8349.c | 2 +- board/freescale/b4860qds/ddr.c | 2 +- board/freescale/b4860qds/spl.c | 2 +- board/freescale/c29xpcie/spl.c | 2 +- board/freescale/corenet_ds/ddr.c | 2 +- board/freescale/ls1043ardb/ddr.c | 2 +- board/freescale/ls1046ardb/ddr.c | 2 +- board/freescale/ls2080a/ddr.c | 2 +- board/freescale/ls2080aqds/ddr.c | 2 +- board/freescale/ls2080ardb/ddr.c | 2 +- board/freescale/m5208evbe/m5208evbe.c | 2 +- board/freescale/m52277evb/m52277evb.c | 2 +- board/freescale/m5235evb/m5235evb.c | 2 +- board/freescale/m5249evb/m5249evb.c | 2 +- board/freescale/m5253demo/m5253demo.c | 2 +- board/freescale/m5253evbe/m5253evbe.c | 2 +- board/freescale/m5272c3/m5272c3.c | 2 +- board/freescale/m5275evb/m5275evb.c | 2 +- board/freescale/m5282evb/m5282evb.c | 2 +- board/freescale/m53017evb/m53017evb.c | 2 +- board/freescale/m5329evb/m5329evb.c | 2 +- board/freescale/m5373evb/m5373evb.c | 2 +- board/freescale/m54418twr/m54418twr.c | 2 +- board/freescale/m54451evb/m54451evb.c | 2 +- board/freescale/m54455evb/m54455evb.c | 2 +- board/freescale/m547xevb/m547xevb.c | 2 +- board/freescale/m548xevb/m548xevb.c | 2 +- board/freescale/mpc5121ads/mpc5121ads.c | 2 +- board/freescale/mpc8308rdb/sdram.c | 2 +- board/freescale/mpc8313erdb/mpc8313erdb.c | 2 +- board/freescale/mpc8313erdb/sdram.c | 2 +- board/freescale/mpc8315erdb/mpc8315erdb.c | 2 +- board/freescale/mpc8315erdb/sdram.c | 2 +- board/freescale/mpc8323erdb/mpc8323erdb.c | 2 +- board/freescale/mpc832xemds/mpc832xemds.c | 2 +- board/freescale/mpc8349emds/mpc8349emds.c | 2 +- board/freescale/mpc8349itx/mpc8349itx.c | 2 +- board/freescale/mpc837xemds/mpc837xemds.c | 2 +- board/freescale/mpc837xerdb/mpc837xerdb.c | 2 +- board/freescale/mpc8610hpcd/mpc8610hpcd.c | 2 +- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 2 +- board/freescale/p1010rdb/spl.c | 2 +- board/freescale/p1022ds/spl.c | 2 +- board/freescale/p1_p2_rdb_pc/spl.c | 2 +- board/freescale/p2041rdb/ddr.c | 2 +- board/freescale/t102xqds/ddr.c | 2 +- board/freescale/t102xqds/spl.c | 2 +- board/freescale/t102xrdb/ddr.c | 2 +- board/freescale/t102xrdb/spl.c | 2 +- board/freescale/t1040qds/ddr.c | 2 +- board/freescale/t104xrdb/ddr.c | 2 +- board/freescale/t104xrdb/spl.c | 2 +- board/freescale/t208xqds/ddr.c | 2 +- board/freescale/t208xqds/spl.c | 2 +- board/freescale/t208xrdb/ddr.c | 2 +- board/freescale/t208xrdb/spl.c | 2 +- board/freescale/t4qds/ddr.c | 2 +- board/freescale/t4qds/spl.c | 2 +- board/freescale/t4rdb/ddr.c | 2 +- board/freescale/t4rdb/spl.c | 2 +- board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c | 2 +- board/gaisler/gr_ep2s60/gr_ep2s60.c | 2 +- board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c | 2 +- board/gaisler/grsim/grsim.c | 2 +- board/gaisler/grsim_leon2/grsim_leon2.c | 2 +- board/gdsys/mpc8308/sdram.c | 2 +- board/ids/ids8313/ids8313.c | 2 +- board/ifm/ac14xx/ac14xx.c | 2 +- board/ifm/o2dnt2/o2dnt2.c | 2 +- board/imgtec/boston/ddr.c | 2 +- board/imgtec/malta/malta.c | 2 +- board/imgtec/xilfpga/xilfpga.c | 2 +- board/inka4x0/inka4x0.c | 2 +- board/intercontrol/digsy_mtc/digsy_mtc.c | 2 +- board/ipek01/ipek01.c | 2 +- board/jupiter/jupiter.c | 2 +- board/keymile/km82xx/km82xx.c | 2 +- board/keymile/km83xx/km83xx.c | 2 +- board/keymile/kmp204x/ddr.c | 2 +- board/liebherr/lwmon5/sdram.c | 2 +- board/micronas/vct/vct.c | 2 +- board/motionpro/motionpro.c | 2 +- board/mpc8308_p1m/sdram.c | 2 +- board/mpl/mip405/mip405.c | 4 ++-- board/mpl/pati/pati.c | 2 +- board/mpl/pip405/pip405.c | 4 ++-- board/munices/munices.c | 2 +- board/openrisc/openrisc-generic/openrisc-generic.c | 2 +- board/pb1x00/pb1x00.c | 2 +- board/pdm360ng/pdm360ng.c | 2 +- board/phytec/pcm030/pcm030.c | 2 +- board/qemu-mips/qemu-mips.c | 2 +- board/sbc8349/sbc8349.c | 2 +- board/sbc8641d/sbc8641d.c | 2 +- board/sysam/amcore/amcore.c | 2 +- board/tqc/tqm5200/tqm5200.c | 2 +- board/tqc/tqm834x/tqm834x.c | 2 +- board/tqc/tqm8xx/tqm8xx.c | 2 +- board/v38b/v38b.c | 2 +- board/varisys/cyrus/ddr.c | 2 +- board/ve8313/ve8313.c | 2 +- board/xes/xpedite1000/xpedite1000.c | 2 +- board/xes/xpedite517x/xpedite517x.c | 2 +- board/xilinx/ppc405-generic/xilinx_ppc405_generic.c | 2 +- board/xilinx/ppc440-generic/xilinx_ppc440_generic.c | 2 +- common/board_f.c | 15 --------------- drivers/ddr/fsl/main.c | 2 +- 135 files changed, 147 insertions(+), 157 deletions(-)
diff --git a/arch/mips/mach-ath79/dram.c b/arch/mips/mach-ath79/dram.c index 1c73addcb3..2706812b91 100644 --- a/arch/mips/mach-ath79/dram.c +++ b/arch/mips/mach-ath79/dram.c @@ -11,7 +11,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { ddr_tap_tuning(); gd->ram_size = get_ram_size((void *)KSEG1, SZ_256M); diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index c96e046848..c3194f0a39 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -110,7 +110,7 @@ static void ddr2_pmd_ungate(void) }
/* initialize the DDR2 Controller and DDR2 PHY */ -int initdram(void) +int dram_init(void) { ddr2_pmd_ungate(); ddr2_phy_init(); diff --git a/arch/mips/mach-pic32/include/mach/ddr.h b/arch/mips/mach-pic32/include/mach/ddr.h index 00abfa3ca9..e7da807d66 100644 --- a/arch/mips/mach-pic32/include/mach/ddr.h +++ b/arch/mips/mach-pic32/include/mach/ddr.h @@ -8,7 +8,7 @@ #ifndef __MICROCHIP_PIC32_DDR_H #define __MICROCHIP_PIC32_DDR_H
-/* called by initdram() function */ +/* called by dram_init() function */ void ddr2_phy_init(void); void ddr2_ctrl_init(void); phys_size_t ddr2_calculate_size(void); diff --git a/arch/powerpc/cpu/mpc5xxx/spl_boot.c b/arch/powerpc/cpu/mpc5xxx/spl_boot.c index 23d2010343..2d7f6c4a93 100644 --- a/arch/powerpc/cpu/mpc5xxx/spl_boot.c +++ b/arch/powerpc/cpu/mpc5xxx/spl_boot.c @@ -32,7 +32,7 @@ void board_init_f(ulong bootflag) /* * On MPC5200, the initial RAM (and gd) is located in the internal * SRAM. So we can actually call the preloader console init code - * before calling initdram(). This makes serial output (printf) + * before calling dram_init(). This makes serial output (printf) * available very early, even before SDRAM init, which has been * an U-Boot priciple from day 1. */ @@ -62,7 +62,7 @@ void board_init_f(ulong bootflag) * First we need to initialize the SDRAM, so that the real * U-Boot or the OS (Linux) can be loaded */ - initdram(); + dram_init();
/* Clear bss */ memset(__bss_start, '\0', __bss_end - __bss_start); diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 64e0aa7518..e3ef4ae816 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -401,7 +401,7 @@ void mpc85xx_reginfo(void) #ifndef CONFIG_FSL_CORENET #if (defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)) && \ !defined(CONFIG_SYS_INIT_L2_ADDR) -int initdram(void) +int dram_init(void) { #if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) || \ defined(CONFIG_ARCH_QEMU_E500) @@ -413,7 +413,7 @@ int initdram(void) return 0; } #else /* CONFIG_SYS_RAMBOOT */ -int initdram(void) +int dram_init(void) { phys_size_t dram_size = 0;
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c index 87fd5e65e0..7f0672e516 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c @@ -416,7 +416,7 @@ static unsigned char spd_read(uchar chip, uint addr) * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -int initdram(void) +int dram_init(void) { unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE}; @@ -2861,7 +2861,7 @@ static void test(void) * time parameters. * Configures the PPC405EX(r) and PPC460EX/GT *---------------------------------------------------------------------------*/ -int initdram(void) +int dram_init(void) { unsigned long val;
diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c index 14d0fd9154..67c950b2fb 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c @@ -1000,7 +1000,7 @@ static void program_ddr0_44(unsigned long dimm_ranks[], * banks appropriately. If Auto Memory Configuration is * not used, it is assumed that no DIMM is plugged *-----------------------------------------------------------------------------*/ -int initdram(void) +int dram_init(void) { unsigned char const iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned long dimm_ranks[MAXDIMMS]; @@ -1014,7 +1014,7 @@ int initdram(void) unsigned long cas_latency = 0; /* to quiet initialization warning */ unsigned long dram_size;
- debug("\nEntering initdram()\n"); + debug("\nEntering dram_init()\n");
/*------------------------------------------------------------------ * Stop the DDR-SDRAM controller. diff --git a/arch/powerpc/cpu/ppc4xx/sdram.c b/arch/powerpc/cpu/ppc4xx/sdram.c index a49bd69aba..c416bcebf6 100644 --- a/arch/powerpc/cpu/ppc4xx/sdram.c +++ b/arch/powerpc/cpu/ppc4xx/sdram.c @@ -150,7 +150,7 @@ static ulong compute_rtr(ulong speed, ulong rows, ulong refresh) /* * Autodetect onboard SDRAM on 405 platforms */ -int initdram(void) +int dram_init(void) { ulong speed; ulong sdtr1; @@ -353,7 +353,7 @@ static void sdram_tr1_set(int ram_address, int* tr1_value) * so this should be extended for other future boards * using this routine! */ -int initdram(void) +int dram_init(void) { int i; int tr1_bank1; diff --git a/arch/powerpc/cpu/ppc4xx/spl_boot.c b/arch/powerpc/cpu/ppc4xx/spl_boot.c index f3aa46c4f1..b30f169e89 100644 --- a/arch/powerpc/cpu/ppc4xx/spl_boot.c +++ b/arch/powerpc/cpu/ppc4xx/spl_boot.c @@ -26,7 +26,7 @@ void board_init_f(ulong bootflag) * First we need to initialize the SDRAM, so that the real * U-Boot or the OS (Linux) can be loaded */ - initdram(); + dram_init();
/* Clear bss */ memset(__bss_start, '\0', __bss_end - __bss_start); diff --git a/arch/xtensa/cpu/cpu.c b/arch/xtensa/cpu/cpu.c index 6787a6182c..7044480597 100644 --- a/arch/xtensa/cpu/cpu.c +++ b/arch/xtensa/cpu/cpu.c @@ -47,3 +47,8 @@ int arch_cpu_init(void) gd->ram_size = CONFIG_SYS_SDRAM_SIZE; return 0; } + +int dram_init(void) +{ + return 0; +} diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index 45e78c63a3..cd484fc44b 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -110,7 +110,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- initdram(); + dram_init(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index 3024a9c681..a00a83a4a5 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -35,7 +35,7 @@ int checkboard (void) return 0; }
-int initdram(void) +int dram_init(void) { int size, i;
diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c index c1120c4004..7f6536440a 100644 --- a/board/a3m071/a3m071.c +++ b/board/a3m071/a3m071.c @@ -76,7 +76,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/a4m072/a4m072.c b/board/a4m072/a4m072.c index d4b30fd147..e4ada76d9d 100644 --- a/board/a4m072/a4m072.c +++ b/board/a4m072/a4m072.c @@ -73,7 +73,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; uint svr, pvr; diff --git a/board/amcc/acadia/memory.c b/board/amcc/acadia/memory.c index cd78a147b1..36500da6f4 100644 --- a/board/amcc/acadia/memory.c +++ b/board/amcc/acadia/memory.c @@ -43,7 +43,7 @@ static void cram_bcr_write(u32 wr_val) return; }
-int initdram(void) +int dram_init(void) { int i; u32 val; diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c index 453677aa66..6a50b393f4 100644 --- a/board/amcc/bamboo/bamboo.c +++ b/board/amcc/bamboo/bamboo.c @@ -438,7 +438,7 @@ int checkboard(void) }
-int initdram(void) +int dram_init(void) { gd->ram_size = spd_sdram();
diff --git a/board/amcc/bubinga/bubinga.c b/board/amcc/bubinga/bubinga.c index 725b9ca086..c73424d8c6 100644 --- a/board/amcc/bubinga/bubinga.c +++ b/board/amcc/bubinga/bubinga.c @@ -54,10 +54,10 @@ int checkboard(void) }
/* ------------------------------------------------------------------------- - initdram() reads EEPROM via I2c. EEPROM contains all of + dram_init() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration ------------------------------------------------------------------------- */ -int initdram(void) +int dram_init(void) { gd->ram_size = spd_sdram();
diff --git a/board/amcc/sequoia/sdram.c b/board/amcc/sequoia/sdram.c index 9bedb5bc8e..0e0a3aa0db 100644 --- a/board/amcc/sequoia/sdram.c +++ b/board/amcc/sequoia/sdram.c @@ -33,7 +33,7 @@ extern void denali_core_search_data_eye(void); * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -int initdram(void) +int dram_init(void) { #if !defined(CONFIG_SYS_RAMBOOT) ulong speed = get_bus_freq(0); diff --git a/board/amcc/walnut/walnut.c b/board/amcc/walnut/walnut.c index 2a2441e101..b21daa0af8 100644 --- a/board/amcc/walnut/walnut.c +++ b/board/amcc/walnut/walnut.c @@ -73,10 +73,10 @@ int checkboard(void) }
/* - * initdram() reads EEPROM via I2c. EEPROM contains all of + * dram_init() reads EEPROM via I2c. EEPROM contains all of * the necessary info for SDRAM controller configuration */ -int initdram(void) +int dram_init(void) { gd->ram_size = spd_sdram();
diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c index fde371d919..bcaf3437ec 100644 --- a/board/amcc/yosemite/yosemite.c +++ b/board/amcc/yosemite/yosemite.c @@ -286,7 +286,7 @@ void sdram_tr1_set(int ram_address, int* tr1_value) *tr1_value = (first_good + last_bad) / 2; }
-int initdram(void) +int dram_init(void) { register uint reg; int tr1_bank1, tr1_bank2; diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c index da281e87fc..d011ae5723 100644 --- a/board/astro/mcf5373l/mcf5373l.c +++ b/board/astro/mcf5373l/mcf5373l.c @@ -27,7 +27,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { #if !defined(CONFIG_MONITOR_IS_IN_RAM) sdram_t *sdp = (sdram_t *)(MMAP_SDRAM); diff --git a/board/canmb/canmb.c b/board/canmb/canmb.c index 41194ecb7e..77abe3721a 100644 --- a/board/canmb/canmb.c +++ b/board/canmb/canmb.c @@ -67,7 +67,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c index be0d65c694..7b862355c8 100644 --- a/board/cm5200/cm5200.c +++ b/board/cm5200/cm5200.c @@ -97,7 +97,7 @@ static mem_conf_t* get_mem_config(int board_type) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -int initdram(void) +int dram_init(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT diff --git a/board/cobra5272/cobra5272.c b/board/cobra5272/cobra5272.c index 48366763c1..0ceaa1f772 100644 --- a/board/cobra5272/cobra5272.c +++ b/board/cobra5272/cobra5272.c @@ -17,7 +17,7 @@ int checkboard (void) return 0; };
-int initdram(void) +int dram_init(void) { volatile sdramctrl_t *sdp = (sdramctrl_t *) (MMAP_SDRAM);
diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c index f0be2cbb9b..e3441cad4e 100644 --- a/board/davedenx/aria/aria.c +++ b/board/davedenx/aria/aria.c @@ -18,7 +18,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { gd->ram_size = fixed_sdram(NULL, NULL, 0);
diff --git a/board/dbau1x00/dbau1x00.c b/board/dbau1x00/dbau1x00.c index ea7cb744db..81285d7470 100644 --- a/board/dbau1x00/dbau1x00.c +++ b/board/dbau1x00/dbau1x00.c @@ -13,7 +13,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c index 80963fefa5..66dc407bae 100644 --- a/board/esd/mecp5123/mecp5123.c +++ b/board/esd/mecp5123/mecp5123.c @@ -62,7 +62,7 @@ int board_early_init_f(void) return 0; }
-int initdram(void) +int dram_init(void) { gd->ram_size = get_ram_size(0, fixed_sdram(NULL, NULL, 0));
diff --git a/board/esd/pmc440/sdram.c b/board/esd/pmc440/sdram.c index e962d4c4bb..e361d54a29 100644 --- a/board/esd/pmc440/sdram.c +++ b/board/esd/pmc440/sdram.c @@ -107,7 +107,7 @@ int initdram_by_rb(int rows, int banks) return 0; }
-int initdram(void) +int dram_init(void) { phys_size_t size; int n; diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index 0e7f8b130a..36a55195df 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
void ddr_enable_ecc(unsigned int dram_size);
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/b4860qds/ddr.c b/board/freescale/b4860qds/ddr.c index 085323132c..5cc2f73a16 100644 --- a/board/freescale/b4860qds/ddr.c +++ b/board/freescale/b4860qds/ddr.c @@ -176,7 +176,7 @@ found: popts->cpo_sample = 0x3e; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index a27ad7fa84..60d7f0d48a 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- initdram(); + dram_init();
#ifdef CONFIG_SPL_NAND_BOOT nand_boot(); diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index 86d55bf2ac..94093f11a8 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -67,7 +67,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_NAND_BOOT puts("TPL\n"); diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c index ad93abf9f4..496d8415ec 100644 --- a/board/freescale/corenet_ds/ddr.c +++ b/board/freescale/corenet_ds/ddr.c @@ -260,7 +260,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1043ardb/ddr.c b/board/freescale/ls1043ardb/ddr.c index 2f133db0a6..62474b67af 100644 --- a/board/freescale/ls1043ardb/ddr.c +++ b/board/freescale/ls1043ardb/ddr.c @@ -170,7 +170,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, } #endif
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls1046ardb/ddr.c b/board/freescale/ls1046ardb/ddr.c index d1290e27f8..fdf5b1a29a 100644 --- a/board/freescale/ls1046ardb/ddr.c +++ b/board/freescale/ls1046ardb/ddr.c @@ -96,7 +96,7 @@ found: popts->cpo_sample = 0x70; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/ls2080a/ddr.c b/board/freescale/ls2080a/ddr.c index d340c4162d..d8d094c052 100644 --- a/board/freescale/ls2080a/ddr.c +++ b/board/freescale/ls2080a/ddr.c @@ -158,7 +158,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, return 0; } #endif -int initdram(void) +int dram_init(void) { puts("Initializing DDR....");
diff --git a/board/freescale/ls2080aqds/ddr.c b/board/freescale/ls2080aqds/ddr.c index 1e9145d6ab..b65a76a6fc 100644 --- a/board/freescale/ls2080aqds/ddr.c +++ b/board/freescale/ls2080aqds/ddr.c @@ -155,7 +155,7 @@ found: } }
-int initdram(void) +int dram_init(void) { #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) gd->ram_size = fsl_ddr_sdram_size(); diff --git a/board/freescale/ls2080ardb/ddr.c b/board/freescale/ls2080ardb/ddr.c index 029ea61b95..1164df17b6 100644 --- a/board/freescale/ls2080ardb/ddr.c +++ b/board/freescale/ls2080ardb/ddr.c @@ -158,7 +158,7 @@ found: } }
-int initdram(void) +int dram_init(void) { #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) gd->ram_size = fsl_ddr_sdram_size(); diff --git a/board/freescale/m5208evbe/m5208evbe.c b/board/freescale/m5208evbe/m5208evbe.c index edf486acc8..4b841c6221 100644 --- a/board/freescale/m5208evbe/m5208evbe.c +++ b/board/freescale/m5208evbe/m5208evbe.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m52277evb/m52277evb.c b/board/freescale/m52277evb/m52277evb.c index 2873643582..e4dfb6fda0 100644 --- a/board/freescale/m52277evb/m52277evb.c +++ b/board/freescale/m52277evb/m52277evb.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { u32 dramsize;
diff --git a/board/freescale/m5235evb/m5235evb.c b/board/freescale/m5235evb/m5235evb.c index 1d82e93786..93403f6748 100644 --- a/board/freescale/m5235evb/m5235evb.c +++ b/board/freescale/m5235evb/m5235evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); gpio_t *gpio = (gpio_t *)(MMAP_GPIO); diff --git a/board/freescale/m5249evb/m5249evb.c b/board/freescale/m5249evb/m5249evb.c index d3c2acd089..7c9b599d66 100644 --- a/board/freescale/m5249evb/m5249evb.c +++ b/board/freescale/m5249evb/m5249evb.c @@ -31,7 +31,7 @@ int checkboard (void) { };
-int initdram(void) +int dram_init(void) { unsigned long junk = 0xa5a59696;
diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c index 1c100e6d8c..c2cc2d76e4 100644 --- a/board/freescale/m5253demo/m5253demo.c +++ b/board/freescale/m5253demo/m5253demo.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { u32 dramsize = 0;
diff --git a/board/freescale/m5253evbe/m5253evbe.c b/board/freescale/m5253evbe/m5253evbe.c index eae499fa9d..c1ed431190 100644 --- a/board/freescale/m5253evbe/m5253evbe.c +++ b/board/freescale/m5253evbe/m5253evbe.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { /* * Check to see if the SDRAM has already been initialized diff --git a/board/freescale/m5272c3/m5272c3.c b/board/freescale/m5272c3/m5272c3.c index bbe06ba9df..efff465d0f 100644 --- a/board/freescale/m5272c3/m5272c3.c +++ b/board/freescale/m5272c3/m5272c3.c @@ -19,7 +19,7 @@ int checkboard (void) { return 0; };
-int initdram(void) +int dram_init(void) { sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
diff --git a/board/freescale/m5275evb/m5275evb.c b/board/freescale/m5275evb/m5275evb.c index 48ad4a86b9..5a9831d619 100644 --- a/board/freescale/m5275evb/m5275evb.c +++ b/board/freescale/m5275evb/m5275evb.c @@ -25,7 +25,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM); gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO); diff --git a/board/freescale/m5282evb/m5282evb.c b/board/freescale/m5282evb/m5282evb.c index 7f3c04c379..eb618b54f4 100644 --- a/board/freescale/m5282evb/m5282evb.c +++ b/board/freescale/m5282evb/m5282evb.c @@ -16,7 +16,7 @@ int checkboard (void) return 0; }
-int initdram(void) +int dram_init(void) { u32 dramsize, i, dramclk;
diff --git a/board/freescale/m53017evb/m53017evb.c b/board/freescale/m53017evb/m53017evb.c index b0c27b4967..71cca35e02 100644 --- a/board/freescale/m53017evb/m53017evb.c +++ b/board/freescale/m53017evb/m53017evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m5329evb/m5329evb.c b/board/freescale/m5329evb/m5329evb.c index 5609a7b376..4e0b4e4bd8 100644 --- a/board/freescale/m5329evb/m5329evb.c +++ b/board/freescale/m5329evb/m5329evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m5373evb/m5373evb.c b/board/freescale/m5373evb/m5373evb.c index 48a262c12f..f2ed298f0f 100644 --- a/board/freescale/m5373evb/m5373evb.c +++ b/board/freescale/m5373evb/m5373evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); u32 dramsize, i; diff --git a/board/freescale/m54418twr/m54418twr.c b/board/freescale/m54418twr/m54418twr.c index 3f1100c355..433539486e 100644 --- a/board/freescale/m54418twr/m54418twr.c +++ b/board/freescale/m54418twr/m54418twr.c @@ -25,7 +25,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { u32 dramsize;
diff --git a/board/freescale/m54451evb/m54451evb.c b/board/freescale/m54451evb/m54451evb.c index 653a11352c..050624bf92 100644 --- a/board/freescale/m54451evb/m54451evb.c +++ b/board/freescale/m54451evb/m54451evb.c @@ -26,7 +26,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { u32 dramsize; #ifdef CONFIG_CF_SBF diff --git a/board/freescale/m54455evb/m54455evb.c b/board/freescale/m54455evb/m54455evb.c index b9850c1a2a..d6b0650b99 100644 --- a/board/freescale/m54455evb/m54455evb.c +++ b/board/freescale/m54455evb/m54455evb.c @@ -22,7 +22,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { u32 dramsize; #ifdef CONFIG_CF_SBF diff --git a/board/freescale/m547xevb/m547xevb.c b/board/freescale/m547xevb/m547xevb.c index fc674522f6..d28f43da04 100644 --- a/board/freescale/m547xevb/m547xevb.c +++ b/board/freescale/m547xevb/m547xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); diff --git a/board/freescale/m548xevb/m548xevb.c b/board/freescale/m548xevb/m548xevb.c index c268ec6a60..56060b68b6 100644 --- a/board/freescale/m548xevb/m548xevb.c +++ b/board/freescale/m548xevb/m548xevb.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; };
-int initdram(void) +int dram_init(void) { siu_t *siu = (siu_t *) (MMAP_SIU); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index a0e5d91c8f..f87579f193 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -95,7 +95,7 @@ int is_micron(void){ return(ismicron); }
-int initdram(void) +int dram_init(void) { u32 msize = 0; /* diff --git a/board/freescale/mpc8308rdb/sdram.c b/board/freescale/mpc8308rdb/sdram.c index aac56c3983..81e155a401 100644 --- a/board/freescale/mpc8308rdb/sdram.c +++ b/board/freescale/mpc8308rdb/sdram.c @@ -65,7 +65,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c index e3a5941f20..8974378326 100644 --- a/board/freescale/mpc8313erdb/mpc8313erdb.c +++ b/board/freescale/mpc8313erdb/mpc8313erdb.c @@ -134,7 +134,7 @@ void board_init_f(ulong bootflag) CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE); puts("NAND boot... "); timer_init(); - initdram(); + dram_init(); relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, (gd_t *)gd, CONFIG_SYS_NAND_U_BOOT_RELOC); } diff --git a/board/freescale/mpc8313erdb/sdram.c b/board/freescale/mpc8313erdb/sdram.c index 4e5dfe6f15..a4128cbd11 100644 --- a/board/freescale/mpc8313erdb/sdram.c +++ b/board/freescale/mpc8313erdb/sdram.c @@ -97,7 +97,7 @@ static long fixed_sdram(void) return msize; }
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index 7779b6daed..22f1565b4c 100644 --- a/board/freescale/mpc8315erdb/mpc8315erdb.c +++ b/board/freescale/mpc8315erdb/mpc8315erdb.c @@ -222,7 +222,7 @@ void board_init_f(ulong bootflag) CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE); puts("NAND boot... "); timer_init(); - initdram(); + dram_init(); relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000, (gd_t *)gd, CONFIG_SYS_NAND_U_BOOT_RELOC); } diff --git a/board/freescale/mpc8315erdb/sdram.c b/board/freescale/mpc8315erdb/sdram.c index 947ffabbb5..b69c86bb81 100644 --- a/board/freescale/mpc8315erdb/sdram.c +++ b/board/freescale/mpc8315erdb/sdram.c @@ -92,7 +92,7 @@ static long fixed_sdram(void) } #endif /* CONFIG_SYS_RAMBOOT */
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index e7d8b99738..f30a1510ee 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -70,7 +70,7 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
int fixed_sdram(void);
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index 907ad09dc8..b49e03e4f9 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -90,7 +90,7 @@ int board_early_init_r(void)
int fixed_sdram(void);
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 595bce16d1..5f502e2a65 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -48,7 +48,7 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; phys_size_t msize = 0; diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 27f0ccd9a6..895e9ffda6 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -118,7 +118,7 @@ volatile static struct pci_controller hose[] = { }; #endif /* CONFIG_PCI */
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index a3af246854..233049227f 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -218,7 +218,7 @@ extern void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 2f5431ee21..319f0479e2 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -62,7 +62,7 @@ void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void);
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 0422208133..d97562c849 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -118,7 +118,7 @@ int checkboard(void) }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 07cb08b6b8..2604a51e91 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -39,7 +39,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index 0565367937..2cebc2c002 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -94,7 +94,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init(); #ifdef CONFIG_SPL_NAND_BOOT puts("\nTertiary program loader running in sram..."); #else diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index 1f490dc943..a117dc3a2c 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -111,7 +111,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- initdram(); + dram_init(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 67637390be..1cf3497aa6 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif
- initdram(); + dram_init(); #ifdef CONFIG_SPL_NAND_BOOT puts("Tertiary program loader running in sram..."); #else diff --git a/board/freescale/p2041rdb/ddr.c b/board/freescale/p2041rdb/ddr.c index 3df8d21725..1ab98fc089 100644 --- a/board/freescale/p2041rdb/ddr.c +++ b/board/freescale/p2041rdb/ddr.c @@ -118,7 +118,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size = 0;
diff --git a/board/freescale/t102xqds/ddr.c b/board/freescale/t102xqds/ddr.c index 93003c25d8..d822d3f806 100644 --- a/board/freescale/t102xqds/ddr.c +++ b/board/freescale/t102xqds/ddr.c @@ -169,7 +169,7 @@ void board_mem_sleep_setup(void) } #endif
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index c847b01e7e..b987ecea1d 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -142,7 +142,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t102xrdb/ddr.c b/board/freescale/t102xrdb/ddr.c index 773aa77781..49460a02d1 100644 --- a/board/freescale/t102xrdb/ddr.c +++ b/board/freescale/t102xrdb/ddr.c @@ -229,7 +229,7 @@ void board_mem_sleep_setup(void) } #endif
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index 5be71628af..dc6d9eeef6 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -129,7 +129,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t1040qds/ddr.c b/board/freescale/t1040qds/ddr.c index d23787d43a..8f7909dc68 100644 --- a/board/freescale/t1040qds/ddr.c +++ b/board/freescale/t1040qds/ddr.c @@ -117,7 +117,7 @@ void board_mem_sleep_setup(void) } #endif
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t104xrdb/ddr.c b/board/freescale/t104xrdb/ddr.c index b99ab95397..4e55844abe 100644 --- a/board/freescale/t104xrdb/ddr.c +++ b/board/freescale/t104xrdb/ddr.c @@ -120,7 +120,7 @@ void board_mem_sleep_setup(void) } #endif
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 899691a779..2e43307b2d 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -125,7 +125,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n");
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xqds/ddr.c b/board/freescale/t208xqds/ddr.c index adc109042b..ba65049709 100644 --- a/board/freescale/t208xqds/ddr.c +++ b/board/freescale/t208xqds/ddr.c @@ -104,7 +104,7 @@ found: popts->cpo_sample = 0x64; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index 3e713dc2c3..d7d716b690 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -128,7 +128,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t208xrdb/ddr.c b/board/freescale/t208xrdb/ddr.c index b4ad615846..50dc69a443 100644 --- a/board/freescale/t208xrdb/ddr.c +++ b/board/freescale/t208xrdb/ddr.c @@ -97,7 +97,7 @@ found: popts->cpo_sample = 0x54; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index a5f940c6f6..b43140148b 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -98,7 +98,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4qds/ddr.c b/board/freescale/t4qds/ddr.c index 84ff792225..740897015e 100644 --- a/board/freescale/t4qds/ddr.c +++ b/board/freescale/t4qds/ddr.c @@ -112,7 +112,7 @@ found: popts->cpo_sample = 0x63; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index 05feedecc2..9ecdaedda3 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -133,7 +133,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
#ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); diff --git a/board/freescale/t4rdb/ddr.c b/board/freescale/t4rdb/ddr.c index d03baa3f45..8415527ec2 100644 --- a/board/freescale/t4rdb/ddr.c +++ b/board/freescale/t4rdb/ddr.c @@ -105,7 +105,7 @@ found: popts->cpo_sample = 0x64; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index e96f3d38c5..5feab1cfcd 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -91,7 +91,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all();
- initdram(); + dram_init();
mmc_boot(); } diff --git a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c index 4ceb48b09d..f1868550c7 100644 --- a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c +++ b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c @@ -10,7 +10,7 @@ #include <config.h> #include <asm/leon.h>
-int initdram(void) +int dram_init(void) { /* Does not set gd->ram_size here */
diff --git a/board/gaisler/gr_ep2s60/gr_ep2s60.c b/board/gaisler/gr_ep2s60/gr_ep2s60.c index 12d8c1025c..a73d89db2f 100644 --- a/board/gaisler/gr_ep2s60/gr_ep2s60.c +++ b/board/gaisler/gr_ep2s60/gr_ep2s60.c @@ -10,7 +10,7 @@ #include <config.h> #include <asm/leon.h>
-int initdram(void) +int dram_init(void) { /* Does not set gd->ram_size here */
diff --git a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c index 02beb5c926..d86047a785 100644 --- a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c +++ b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c @@ -9,7 +9,7 @@ #include <config.h> #include <asm/leon.h>
-int initdram(void) +int dram_init(void) { /* Does not set gd->ram_size here */
diff --git a/board/gaisler/grsim/grsim.c b/board/gaisler/grsim/grsim.c index aa9ba50877..99262b0813 100644 --- a/board/gaisler/grsim/grsim.c +++ b/board/gaisler/grsim/grsim.c @@ -10,7 +10,7 @@ #include <common.h> #include <asm/leon.h>
-int initdram(void) +int dram_init(void) { /* Does not set gd->ram_size here */
diff --git a/board/gaisler/grsim_leon2/grsim_leon2.c b/board/gaisler/grsim_leon2/grsim_leon2.c index 384db3d84b..c6c4bb4270 100644 --- a/board/gaisler/grsim_leon2/grsim_leon2.c +++ b/board/gaisler/grsim_leon2/grsim_leon2.c @@ -10,7 +10,7 @@ #include <common.h> #include <asm/leon.h>
-int initdram(void) +int dram_init(void) { /* Does not set gd->ram_size here */
diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c index 5b67a013da..5d2ec89b8c 100644 --- a/board/gdsys/mpc8308/sdram.c +++ b/board/gdsys/mpc8308/sdram.c @@ -66,7 +66,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index d8e6701fac..4433e8c77e 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -119,7 +119,7 @@ static int setup_sdram(void) return msize; }
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c index 129eb47b0e..348613736d 100644 --- a/board/ifm/ac14xx/ac14xx.c +++ b/board/ifm/ac14xx/ac14xx.c @@ -310,7 +310,7 @@ u32 sdram_init_seq[] = { /* EMPTY, optional, we don't do it */ };
-int initdram(void) +int dram_init(void) { gd->ram_size = fixed_sdram(NULL, sdram_init_seq, ARRAY_SIZE(sdram_init_seq)); diff --git a/board/ifm/o2dnt2/o2dnt2.c b/board/ifm/o2dnt2/o2dnt2.c index 4f81007ead..72a8469f1c 100644 --- a/board/ifm/o2dnt2/o2dnt2.c +++ b/board/ifm/o2dnt2/o2dnt2.c @@ -66,7 +66,7 @@ static void sdram_start(int hi_addr) * use of CONFIG_SYS_SDRAM_BASE. The code does not work if * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */ -int initdram(void) +int dram_init(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/imgtec/boston/ddr.c b/board/imgtec/boston/ddr.c index b92ff2aa88..3479b98b88 100644 --- a/board/imgtec/boston/ddr.c +++ b/board/imgtec/boston/ddr.c @@ -12,7 +12,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0);
diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index f8c65b0e46..de81aa01f0 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -85,7 +85,7 @@ static enum sys_con malta_sys_con(void) } }
-int initdram(void) +int dram_init(void) { gd->ram_size = CONFIG_SYS_MEM_SIZE;
diff --git a/board/imgtec/xilfpga/xilfpga.c b/board/imgtec/xilfpga/xilfpga.c index 8aa7c10bff..841d61459d 100644 --- a/board/imgtec/xilfpga/xilfpga.c +++ b/board/imgtec/xilfpga/xilfpga.c @@ -14,7 +14,7 @@ DECLARE_GLOBAL_DATA_PTR;
/* initialize the DDR Controller and PHY */ -int initdram(void) +int dram_init(void) { /* MIG IP block is smart and doesn't need SW * to do any init */ diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c index 2dd9799ea7..2e7c681934 100644 --- a/board/inka4x0/inka4x0.c +++ b/board/inka4x0/inka4x0.c @@ -79,7 +79,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *) CONFIG_SYS_MBAR; diff --git a/board/intercontrol/digsy_mtc/digsy_mtc.c b/board/intercontrol/digsy_mtc/digsy_mtc.c index 922d9ef0a1..0854754fb0 100644 --- a/board/intercontrol/digsy_mtc/digsy_mtc.c +++ b/board/intercontrol/digsy_mtc/digsy_mtc.c @@ -79,7 +79,7 @@ static void sdram_start(int hi_addr) * CONFIG_SYS_SDRAM_BASE is something other than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/ipek01/ipek01.c b/board/ipek01/ipek01.c index ca99332e51..68759ca930 100644 --- a/board/ipek01/ipek01.c +++ b/board/ipek01/ipek01.c @@ -80,7 +80,7 @@ static void sdram_start (int hi_addr) * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { struct mpc5xxx_mmap_ctl *mmap_ctl = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/jupiter/jupiter.c b/board/jupiter/jupiter.c index d134691361..e534fd18cb 100644 --- a/board/jupiter/jupiter.c +++ b/board/jupiter/jupiter.c @@ -78,7 +78,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index bbabbcfc0b..51b4571d40 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -291,7 +291,7 @@ static long probe_sdram(memctl8260_t *memctl) #endif /* CONFIG_SYS_SDRAM_LIST */
-int initdram(void) +int dram_init(void) { immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; memctl8260_t *memctl = &immap->im_memctl; diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index f83fa06e93..8020c379fd 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -330,7 +330,7 @@ static int fixed_sdram(void) return msize; }
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/keymile/kmp204x/ddr.c b/board/keymile/kmp204x/ddr.c index 006b809654..6f82e15f82 100644 --- a/board/keymile/kmp204x/ddr.c +++ b/board/keymile/kmp204x/ddr.c @@ -50,7 +50,7 @@ void fsl_ddr_board_options(memctl_options_t *popts, popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR_ODT_75ohm; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size = 0;
diff --git a/board/liebherr/lwmon5/sdram.c b/board/liebherr/lwmon5/sdram.c index f7251e567f..275bd7a4c7 100644 --- a/board/liebherr/lwmon5/sdram.c +++ b/board/liebherr/lwmon5/sdram.c @@ -147,7 +147,7 @@ static void program_ecc(u32 start_address, * initdram -- 440EPx's DDR controller is a DENALI Core * ************************************************************************/ -int initdram(void) +int dram_init(void) { /* CL=4 */ mtsdram(DDR0_02, 0x00000000); diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c index 02824eaf4f..8bf8d5f4e8 100644 --- a/board/micronas/vct/vct.c +++ b/board/micronas/vct/vct.c @@ -61,7 +61,7 @@ void _machine_restart(void) * SDRAM is already configured by the bootstrap code, only return the * auto-detected size here */ -int initdram(void) +int dram_init(void) { gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MBYTES_SDRAM << 20); diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index a2520bc3bc..7883a179e8 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -118,7 +118,7 @@ static void sdram_start(int hi_addr) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -int initdram(void) +int dram_init(void) { ulong dramsize = 0; #ifndef CONFIG_SYS_RAMBOOT diff --git a/board/mpc8308_p1m/sdram.c b/board/mpc8308_p1m/sdram.c index e0f4671b17..05c477d389 100644 --- a/board/mpc8308_p1m/sdram.c +++ b/board/mpc8308_p1m/sdram.c @@ -61,7 +61,7 @@ static long fixed_sdram(void) return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); }
-int initdram(void) +int dram_init(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize; diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index e6422965f9..4d8671fe67 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -615,14 +615,14 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ /* - initdram() reads EEPROM via I2c. EEPROM contains all of + dram_init() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration */ /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-int initdram(void) +int dram_init(void) {
unsigned long bank_reg[4], tmp, bank_size; diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c index 7b7b93f682..1288f743cc 100644 --- a/board/mpl/pati/pati.c +++ b/board/mpl/pati/pati.c @@ -135,7 +135,7 @@ extern int mem_test (unsigned long start, unsigned long ramsize, int quiet); /* * Get RAM size. */ -int initdram(void) +int dram_init(void) { unsigned char board_rev; unsigned long reg; diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index c07d8f88b9..408518d648 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -605,14 +605,14 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ /* - initdram() reads EEPROM via I2c. EEPROM contains all of + dram_init() reads EEPROM via I2c. EEPROM contains all of the necessary info for SDRAM controller configuration */ /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize);
-int initdram(void) +int dram_init(void) { unsigned long bank_reg[4], tmp, bank_size; int i, ds; diff --git a/board/munices/munices.c b/board/munices/munices.c index 8f1a5a8341..9571f2b44a 100644 --- a/board/munices/munices.c +++ b/board/munices/munices.c @@ -60,7 +60,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/openrisc/openrisc-generic/openrisc-generic.c b/board/openrisc/openrisc-generic/openrisc-generic.c index 8f9b98dbca..6a79548490 100644 --- a/board/openrisc/openrisc-generic/openrisc-generic.c +++ b/board/openrisc/openrisc-generic/openrisc-generic.c @@ -21,7 +21,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { return 0; } diff --git a/board/pb1x00/pb1x00.c b/board/pb1x00/pb1x00.c index e473531fd3..1c0540a989 100644 --- a/board/pb1x00/pb1x00.c +++ b/board/pb1x00/pb1x00.c @@ -13,7 +13,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/pdm360ng/pdm360ng.c b/board/pdm360ng/pdm360ng.c index c833aec9b2..9db31d3312 100644 --- a/board/pdm360ng/pdm360ng.c +++ b/board/pdm360ng/pdm360ng.c @@ -48,7 +48,7 @@ sdram_conf_t mddrc_config[] = { }, };
-int initdram(void) +int dram_init(void) { int i; u32 msize = 0; diff --git a/board/phytec/pcm030/pcm030.c b/board/phytec/pcm030/pcm030.c index 19d87169ee..619bbfab7e 100644 --- a/board/phytec/pcm030/pcm030.c +++ b/board/phytec/pcm030/pcm030.c @@ -75,7 +75,7 @@ static void sdram_start(int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { volatile struct mpc5xxx_mmap_ctl *mm = (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; diff --git a/board/qemu-mips/qemu-mips.c b/board/qemu-mips/qemu-mips.c index 2638ea67d3..583acc2e44 100644 --- a/board/qemu-mips/qemu-mips.c +++ b/board/qemu-mips/qemu-mips.c @@ -13,7 +13,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int initdram(void) +int dram_init(void) { /* Sdram is setup by assembler code */ /* If memory could be changed, we should return the true value here */ diff --git a/board/sbc8349/sbc8349.c b/board/sbc8349/sbc8349.c index f01cd7ed52..a3395ed680 100644 --- a/board/sbc8349/sbc8349.c +++ b/board/sbc8349/sbc8349.c @@ -37,7 +37,7 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; u32 msize = 0; diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index 44842d5af1..08ced102b6 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -39,7 +39,7 @@ int checkboard (void) return 0; }
-int initdram(void) +int dram_init(void) { long dram_size = 0;
diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index e2b9123bac..fab789ee6c 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -51,7 +51,7 @@ void fudelay(int usec) asm volatile ("nop"); }
-int initdram(void) +int dram_init(void) { u32 dramsize, RC;
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index baf3208740..8615dda447 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -133,7 +133,7 @@ static void sdram_start (int hi_addr) * is something else than 0x00000000. */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 0968e494a5..4642342bfb 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -66,7 +66,7 @@ int board_early_init_r (void) { /************************************************************************** * DRAM initalization and size detection */ -int initdram(void) +int dram_init(void) { long bank_size; long size; diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 489a22c161..58bd7fae47 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -126,7 +126,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
-int initdram(void) +int dram_init(void) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8xx_t *memctl = &immap->im_memctl; diff --git a/board/v38b/v38b.c b/board/v38b/v38b.c index c271fb5873..73227c1b15 100644 --- a/board/v38b/v38b.c +++ b/board/v38b/v38b.c @@ -57,7 +57,7 @@ static void sdram_start(int hi_addr) #endif /* !CONFIG_SYS_RAMBOOT */
-int initdram(void) +int dram_init(void) { ulong dramsize = 0; ulong dramsize2 = 0; diff --git a/board/varisys/cyrus/ddr.c b/board/varisys/cyrus/ddr.c index abf4e93265..2ba7b3a3ea 100644 --- a/board/varisys/cyrus/ddr.c +++ b/board/varisys/cyrus/ddr.c @@ -168,7 +168,7 @@ found: popts->ddr_cdr1 = DDR_CDR1_DHC_EN; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size;
diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c index 37441c7a46..3818ab96b3 100644 --- a/board/ve8313/ve8313.c +++ b/board/ve8313/ve8313.c @@ -88,7 +88,7 @@ static long fixed_sdram(void) return msize; }
-int initdram(void) +int dram_init(void) { volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &im->im_lbc; diff --git a/board/xes/xpedite1000/xpedite1000.c b/board/xes/xpedite1000/xpedite1000.c index df5a7a0539..ef646fa4a1 100644 --- a/board/xes/xpedite1000/xpedite1000.c +++ b/board/xes/xpedite1000/xpedite1000.c @@ -116,7 +116,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { gd->ram_size = spd_sdram();
diff --git a/board/xes/xpedite517x/xpedite517x.c b/board/xes/xpedite517x/xpedite517x.c index e436c28f78..19b96f636d 100644 --- a/board/xes/xpedite517x/xpedite517x.c +++ b/board/xes/xpedite517x/xpedite517x.c @@ -58,7 +58,7 @@ int board_early_init_r(void) return 0; }
-int initdram(void) +int dram_init(void) { phys_size_t dram_size = fsl_ddr_sdram();
diff --git a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c index 6148a4b69c..be6b4dc5b9 100644 --- a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c +++ b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c @@ -23,7 +23,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { gd->ram_size = get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); diff --git a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c index d7e6aee706..07a3ab7f82 100644 --- a/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c +++ b/board/xilinx/ppc440-generic/xilinx_ppc440_generic.c @@ -19,7 +19,7 @@ int checkboard(void) return 0; }
-int initdram(void) +int dram_init(void) { gd->ram_size = get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR, CONFIG_SYS_SDRAM_SIZE_MB * 1024 * 1024); diff --git a/common/board_f.c b/common/board_f.c index 3cd53737d3..90c9a55173 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -177,13 +177,6 @@ static int announce_dram_init(void) return 0; }
-#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K) -static int init_func_ram(void) -{ - return initdram(); -} -#endif - static int show_dram_config(void) { unsigned long long size; @@ -867,15 +860,7 @@ static const init_fnc_t init_sequence_f[] = { init_func_spi, #endif announce_dram_init, - /* TODO: unify all these dram functions? */ -#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \ - defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || \ - defined(CONFIG_SH) dram_init, /* configure available RAM banks */ -#endif -#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K) - init_func_ram, -#endif #ifdef CONFIG_POST post_init_f, #endif diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c index 9aa3eecd34..f0382506f7 100644 --- a/drivers/ddr/fsl/main.c +++ b/drivers/ddr/fsl/main.c @@ -796,7 +796,7 @@ phys_size_t __fsl_ddr_sdram(fsl_ddr_info_t *pinfo)
/* * fsl_ddr_sdram(void) -- this is the main function to be - * called by initdram() in the board file. + * called by dram_init() in the board file. * * It returns amount of memory configured in bytes. */

On 31.03.2017 16:40, Simon Glass wrote:
This allows us to use the same DRAM init function on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On 03/31/2017 07:40 AM, Simon Glass wrote:
This allows us to use the same DRAM init function on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:26AM -0600, Simon Glass wrote:
This allows us to use the same DRAM init function on all archs.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
This isn't going to work as-is. As part of testing this patch I found that arc wasn't converted. This in turn lead me to do a 'git grep' and as part of fixing the missing renames I found some platforms such as aarch64 layerscape (and ls1021aqds and probably a few others) that make use of both dram_init and initdram. I think that in the end the non-trivial cases here can be re-worked and we can move forward on this, but it's not just a simple rename. Thanks!

Hi Tom,
On 5 April 2017 at 14:36, Tom Rini trini@konsulko.com wrote:
On Fri, Mar 31, 2017 at 08:40:26AM -0600, Simon Glass wrote:
This allows us to use the same DRAM init function on all archs.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
This isn't going to work as-is. As part of testing this patch I found that arc wasn't converted. This in turn lead me to do a 'git grep' and as part of fixing the missing renames I found some platforms such as aarch64 layerscape (and ls1021aqds and probably a few others) that make use of both dram_init and initdram. I think that in the end the non-trivial cases here can be re-worked and we can move forward on this, but it's not just a simple rename. Thanks!
Aargh I thought I got all of these. Will take another look.
Regards, Simon

All archs put U-Boot at the bottom of the relocated region. Xtensa does not, but perhaps not for any good reason. Adjust it to see if things still work OK.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 90c9a55173..0b0b01543e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -887,7 +887,7 @@ static const init_fnc_t init_sequence_f[] = { * - board info struct */ setup_dest_addr, -#if defined(CONFIG_BLACKFIN) || defined(CONFIG_XTENSA) +#if defined(CONFIG_BLACKFIN) /* Blackfin u-boot monitor should be on top of the ram */ reserve_uboot, #endif @@ -919,7 +919,7 @@ static const init_fnc_t init_sequence_f[] = { # endif #endif /* CONFIG_DM_VIDEO */ reserve_trace, -#if !defined(CONFIG_BLACKFIN) && !defined(CONFIG_XTENSA) +#if !defined(CONFIG_BLACKFIN) reserve_uboot, #endif #ifndef CONFIG_SPL_BUILD

On Fri, Mar 31, 2017 at 08:40:27AM -0600, Simon Glass wrote:
All archs put U-Boot at the bottom of the relocated region. Xtensa does not, but perhaps not for any good reason. Adjust it to see if things still work OK.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated rather than whether to do it at all. So move the #ifdef into the function.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 0b0b01543e..c7b5e0af9e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -345,13 +345,16 @@ static int reserve_prom(void) } #endif
-#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) +#if defined(CONFIG_LOGBUFFER) static int reserve_logbuffer(void) { +#ifndef CONFIG_ALT_LB_ADDR /* reserve kernel log buffer */ gd->relocaddr -= LOGBUFF_RESERVE; debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, gd->relocaddr); +#endif + return 0; } #endif @@ -894,7 +897,7 @@ static const init_fnc_t init_sequence_f[] = { #if defined(CONFIG_SPARC) reserve_prom, #endif -#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) +#if defined(CONFIG_LOGBUFFER) reserve_logbuffer, #endif #ifdef CONFIG_PRAM

On Fri, Mar 31, 2017 at 08:40:28AM -0600, Simon Glass wrote:
CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated rather than whether to do it at all. So move the #ifdef into the function.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

The arch-specific details of the cache being off are best handled inside the reserve_mmu(). This cleans up the init sequence a little.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index c7b5e0af9e..1fc73a70fe 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -380,10 +380,10 @@ static int reserve_round_4k(void) return 0; }
-#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ - defined(CONFIG_ARM) +#ifdef CONFIG_ARM static int reserve_mmu(void) { +#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) /* reserve TLB table */ gd->arch.tlb_size = PGTABLE_SIZE; gd->relocaddr -= gd->arch.tlb_size; @@ -402,6 +402,7 @@ static int reserve_mmu(void) */ gd->arch.tlb_allocated = gd->arch.tlb_addr; #endif +#endif
return 0; } @@ -904,8 +905,7 @@ static const init_fnc_t init_sequence_f[] = { reserve_pram, #endif reserve_round_4k, -#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ - defined(CONFIG_ARM) +#ifdef CONFIG_ARM reserve_mmu, #endif #ifdef CONFIG_DM_VIDEO

On 03/31/2017 07:40 AM, Simon Glass wrote:
The arch-specific details of the cache being off are best handled inside the reserve_mmu(). This cleans up the init sequence a little.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:29AM -0600, Simon Glass wrote:
The arch-specific details of the cache being off are best handled inside the reserve_mmu(). This cleans up the init sequence a little.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: York Sun york.sun@nxp.com
Applied to u-boot/master, thanks!

Move the ugly #ifdefs inside the reserve_video() function so we can collect all this init into one place.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 1fc73a70fe..230a9baf9c 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -408,9 +408,9 @@ static int reserve_mmu(void) } #endif
-#ifdef CONFIG_DM_VIDEO static int reserve_video(void) { +#ifdef CONFIG_DM_VIDEO ulong addr; int ret;
@@ -419,14 +419,7 @@ static int reserve_video(void) if (ret) return ret; gd->relocaddr = addr; - - return 0; -} -#else - -# ifdef CONFIG_LCD -static int reserve_lcd(void) -{ +#elif defined(CONFIG_LCD) # ifdef CONFIG_FB_ADDR gd->fb_base = CONFIG_FB_ADDR; # else @@ -434,24 +427,17 @@ static int reserve_lcd(void) gd->relocaddr = lcd_setmem(gd->relocaddr); gd->fb_base = gd->relocaddr; # endif /* CONFIG_FB_ADDR */ - - return 0; -} -# endif /* CONFIG_LCD */ - -# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \ +#elif defined(CONFIG_VIDEO) && \ + (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \ !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \ !defined(CONFIG_BLACKFIN) && !defined(CONFIG_M68K) -static int reserve_legacy_video(void) -{ /* reserve memory for video display (always full pages) */ gd->relocaddr = video_setmem(gd->relocaddr); gd->fb_base = gd->relocaddr; +#endif
return 0; } -# endif -#endif /* !CONFIG_DM_VIDEO */
static int reserve_trace(void) { @@ -908,19 +894,7 @@ static const init_fnc_t init_sequence_f[] = { #ifdef CONFIG_ARM reserve_mmu, #endif -#ifdef CONFIG_DM_VIDEO reserve_video, -#else -# ifdef CONFIG_LCD - reserve_lcd, -# endif - /* TODO: Why the dependency on CONFIG_8xx? */ -# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \ - !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \ - !defined(CONFIG_BLACKFIN) && !defined(CONFIG_M68K) - reserve_legacy_video, -# endif -#endif /* CONFIG_DM_VIDEO */ reserve_trace, #if !defined(CONFIG_BLACKFIN) reserve_uboot,

On Fri, Mar 31, 2017 at 08:40:30AM -0600, Simon Glass wrote:
Move the ugly #ifdefs inside the reserve_video() function so we can collect all this init into one place.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

This is never defined when building this file, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 230a9baf9c..7751c6c7e0 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -106,10 +106,6 @@ __weak void blue_led_off(void) {} * a structure... */
-/* - * Could the CONFIG_SPL_BUILD infection become a flag in gd? - */ - #if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG) static int init_func_watchdog_init(void) { @@ -472,7 +468,6 @@ static int reserve_uboot(void) return 0; }
-#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -494,7 +489,6 @@ static int reserve_board(void) } return 0; } -#endif
static int setup_machine(void) { @@ -899,10 +893,8 @@ static const init_fnc_t init_sequence_f[] = { #if !defined(CONFIG_BLACKFIN) reserve_uboot, #endif -#ifndef CONFIG_SPL_BUILD reserve_malloc, reserve_board, -#endif setup_machine, reserve_global_data, reserve_fdt,

On 03/31/2017 07:41 AM, Simon Glass wrote:
This is never defined when building this file, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:31AM -0600, Simon Glass wrote:
This is never defined when building this file, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: York Sun york.sun@nxp.com
Applied to u-boot/master, thanks!

By making dram_init_banksize() return an error code we can drop the wrapper. Adjust this and clean up all implementations.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/cpu/arm926ejs/armada100/dram.c | 4 +++- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 4 +++- arch/arm/include/asm/u-boot-arm.h | 2 +- arch/arm/mach-davinci/misc.c | 4 +++- arch/arm/mach-meson/board.c | 4 +++- arch/arm/mach-mvebu/arm64-common.c | 8 +++++--- arch/arm/mach-mvebu/dram.c | 4 +++- arch/arm/mach-omap2/am33xx/emif4.c | 4 +++- arch/arm/mach-omap2/omap3/emif4.c | 4 +++- arch/arm/mach-omap2/omap3/sdrc.c | 4 +++- arch/arm/mach-orion5x/dram.c | 4 +++- arch/arm/mach-tegra/board2.c | 4 +++- arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 4 +++- arch/arm/mach-uniphier/dram_init.c | 4 +++- arch/x86/cpu/broadwell/sdram.c | 4 +++- arch/x86/cpu/coreboot/sdram.c | 4 +++- arch/x86/cpu/efi/sdram.c | 4 +++- arch/x86/cpu/ivybridge/sdram.c | 4 +++- arch/x86/cpu/qemu/dram.c | 4 +++- arch/x86/cpu/quark/dram.c | 4 +++- arch/x86/include/asm/u-boot-x86.h | 2 +- arch/x86/lib/efi/efi.c | 6 ++++-- arch/x86/lib/fsp/fsp_dram.c | 4 +++- board/AndesTech/adp-ag101p/adp-ag101p.c | 4 +++- board/armadeus/apf27/apf27.c | 4 +++- board/armltd/vexpress/vexpress_common.c | 4 +++- board/armltd/vexpress64/vexpress64.c | 4 +++- board/beckhoff/mx53cx9020/mx53cx9020.c | 4 +++- board/broadcom/bcm23550_w1d/bcm23550_w1d.c | 4 +++- board/broadcom/bcm28155_ap/bcm28155_ap.c | 4 +++- board/broadcom/bcm_ep/board.c | 4 +++- board/broadcom/bcmns2/northstar2.c | 4 +++- board/cadence/xtfpga/xtfpga.c | 4 +++- board/cirrus/edb93xx/edb93xx.c | 4 +++- board/compulab/cm_fx6/cm_fx6.c | 4 +++- board/denx/m53evk/m53evk.c | 4 +++- board/esd/meesc/meesc.c | 4 +++- board/freescale/ls1021aqds/ddr.c | 4 +++- board/freescale/mx35pdk/mx35pdk.c | 4 +++- board/freescale/mx53ard/mx53ard.c | 4 +++- board/freescale/mx53loco/mx53loco.c | 4 +++- board/freescale/mx53smd/mx53smd.c | 4 +++- board/hisilicon/hikey/hikey.c | 4 +++- board/mini-box/picosam9g45/picosam9g45.c | 4 +++- board/qualcomm/dragonboard410c/dragonboard410c.c | 4 +++- board/rockchip/evb_rk3328/evb-rk3328.c | 4 +++- board/rockchip/evb_rk3399/evb-rk3399.c | 4 +++- board/ronetix/pm9261/pm9261.c | 4 +++- board/ronetix/pm9263/pm9263.c | 4 +++- board/ronetix/pm9g45/pm9g45.c | 4 +++- board/samsung/arndale/arndale.c | 4 +++- board/samsung/common/board.c | 4 +++- board/samsung/goni/goni.c | 4 +++- board/samsung/smdkc100/smdkc100.c | 4 +++- board/samsung/smdkv310/smdkv310.c | 4 +++- board/spear/common/spr_misc.c | 4 +++- board/st/stih410-b2260/board.c | 4 +++- board/st/stv0991/stv0991.c | 4 +++- board/ti/dra7xx/evm.c | 4 +++- board/xilinx/microblaze-generic/microblaze-generic.c | 4 +++- board/xilinx/zynq/board.c | 4 +++- board/xilinx/zynqmp/zynqmp.c | 4 +++- board/zipitz2/zipitz2.c | 4 +++- common/board_f.c | 14 ++++---------- 64 files changed, 192 insertions(+), 76 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/armada100/dram.c b/arch/arm/cpu/arm926ejs/armada100/dram.c index f3b9a66cd5..6a9000e304 100644 --- a/arch/arm/cpu/arm926ejs/armada100/dram.c +++ b/arch/arm/cpu/arm926ejs/armada100/dram.c @@ -108,7 +108,9 @@ int dram_init(void) * If this function is not defined here, * board.c alters dram bank zero configuration defined above. */ -void dram_init_banksize(void) +int dram_init_banksize(void) { dram_init(); + + return 0; } diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index 583fa7a7e3..36e504537e 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -610,7 +610,7 @@ phys_size_t get_effective_memsize(void) return ea_size; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { #ifdef CONFIG_SYS_DP_DDR_BASE_PHY phys_size_t dp_ddr_size; @@ -719,6 +719,8 @@ void dram_init_banksize(void) } } #endif + + return 0; }
#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 305a302dfc..2129f37c8f 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -36,7 +36,7 @@ int arch_early_init_r(void);
/* board/.../... */ int board_init(void); -void dram_init_banksize (void); +int dram_init_banksize(void); void board_quiesce_devices(void);
/* cpu/.../interrupt.c */ diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c index e699d61874..e1064e0a2f 100644 --- a/arch/arm/mach-davinci/misc.c +++ b/arch/arm/mach-davinci/misc.c @@ -28,10 +28,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; } #endif
diff --git a/arch/arm/mach-meson/board.c b/arch/arm/mach-meson/board.c index f159cbf849..273dbeb020 100644 --- a/arch/arm/mach-meson/board.c +++ b/arch/arm/mach-meson/board.c @@ -34,11 +34,13 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { /* Reserve first 16 MiB of RAM for firmware */ gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + (16 * 1024 * 1024); gd->bd->bi_dram[0].size = gd->ram_size - (16 * 1024 * 1024); + + return 0; }
void reset_cpu(ulong addr) diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c index 8f026559c2..1c0477a3ca 100644 --- a/arch/arm/mach-mvebu/arm64-common.c +++ b/arch/arm/mach-mvebu/arm64-common.c @@ -82,7 +82,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { const void *fdt = gd->fdt_blob; const fdt32_t *val; @@ -90,13 +90,13 @@ void dram_init_banksize(void)
val = get_memory_reg_prop(fdt, &len); if (len < 0) - return; + return -ENXIO;
ac = fdt_address_cells(fdt, 0); sc = fdt_size_cells(fdt, 0); if (ac < 1 || sc > 2 || sc < 1 || sc > 2) { printf("invalid address/size cells\n"); - return; + return -ENXIO; }
cells = ac + sc; @@ -114,6 +114,8 @@ void dram_init_banksize(void) i, (unsigned long)gd->bd->bi_dram[i].start, (unsigned long)gd->bd->bi_dram[i].size); } + + return 0; }
int arch_cpu_init(void) diff --git a/arch/arm/mach-mvebu/dram.c b/arch/arm/mach-mvebu/dram.c index a8ec5ea21b..e3f304c366 100644 --- a/arch/arm/mach-mvebu/dram.c +++ b/arch/arm/mach-mvebu/dram.c @@ -273,7 +273,7 @@ int dram_init(void) * If this function is not defined here, * board.c alters dram bank zero configuration defined above. */ -void dram_init_banksize(void) +int dram_init_banksize(void) { u64 size = 0; int i; @@ -287,6 +287,8 @@ void dram_init_banksize(void) if (size > SDRAM_SIZE_MAX) mvebu_sdram_bs_set(i, 0x40000000); } + + return 0; }
#if defined(CONFIG_ARCH_MVEBU) diff --git a/arch/arm/mach-omap2/am33xx/emif4.c b/arch/arm/mach-omap2/am33xx/emif4.c index 27fa3fb462..3a110f2845 100644 --- a/arch/arm/mach-omap2/am33xx/emif4.c +++ b/arch/arm/mach-omap2/am33xx/emif4.c @@ -32,10 +32,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
diff --git a/arch/arm/mach-omap2/omap3/emif4.c b/arch/arm/mach-omap2/omap3/emif4.c index a2aadc9816..d540cf08d2 100644 --- a/arch/arm/mach-omap2/omap3/emif4.c +++ b/arch/arm/mach-omap2/omap3/emif4.c @@ -142,7 +142,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize (void) +int dram_init_banksize(void) { unsigned int size0 = 0, size1 = 0;
@@ -153,6 +153,8 @@ void dram_init_banksize (void) gd->bd->bi_dram[0].size = size0; gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + get_sdr_cs_offset(CS1); gd->bd->bi_dram[1].size = size1; + + return 0; }
/* diff --git a/arch/arm/mach-omap2/omap3/sdrc.c b/arch/arm/mach-omap2/omap3/sdrc.c index 4f15ac9cb5..f64cd912ff 100644 --- a/arch/arm/mach-omap2/omap3/sdrc.c +++ b/arch/arm/mach-omap2/omap3/sdrc.c @@ -216,7 +216,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize (void) +int dram_init_banksize(void) { unsigned int size0 = 0, size1 = 0;
@@ -227,6 +227,8 @@ void dram_init_banksize (void) gd->bd->bi_dram[0].size = size0; gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + get_sdr_cs_offset(CS1); gd->bd->bi_dram[1].size = size1; + + return 0; }
/* diff --git a/arch/arm/mach-orion5x/dram.c b/arch/arm/mach-orion5x/dram.c index 9ed93d25bc..e9c03f3837 100644 --- a/arch/arm/mach-orion5x/dram.c +++ b/arch/arm/mach-orion5x/dram.c @@ -42,7 +42,7 @@ int dram_init (void) return 0; }
-void dram_init_banksize (void) +int dram_init_banksize(void) { int i;
@@ -52,4 +52,6 @@ void dram_init_banksize (void) (long *) (gd->bd->bi_dram[i].start), CONFIG_MAX_RAM_BANK_SIZE); } + + return 0; } diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index 5a457b913e..b73cd632e7 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -315,7 +315,7 @@ static ulong usable_ram_size_below_4g(void) * start address of that bank cannot be represented in the 32-bit .size * field. */ -void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = usable_ram_size_below_4g(); @@ -334,6 +334,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].start = 0; gd->bd->bi_dram[1].size = 0; } + + return 0; }
/* diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c index 37dd8d4334..bf1616628b 100644 --- a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c +++ b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c @@ -72,7 +72,7 @@ int dram_init(void)
extern unsigned long nvtboot_boot_x0;
-void dram_init_banksize(void) +int dram_init_banksize(void) { int i;
@@ -80,6 +80,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[i].start = ram_banks[i].start; gd->bd->bi_dram[i].size = ram_banks[i].size; } + + return 0; }
ulong board_get_usable_ram_top(ulong total_size) diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index d9f6c16fdc..f79b7cf3ca 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -232,7 +232,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { struct uniphier_dram_map dram_map[3] = {}; int i; @@ -246,6 +246,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[i].start = dram_map[i].base; gd->bd->bi_dram[i].size = dram_map[i].size; } + + return 0; }
#ifdef CONFIG_OF_BOARD_SETUP diff --git a/arch/x86/cpu/broadwell/sdram.c b/arch/x86/cpu/broadwell/sdram.c index 74736cd56c..774aba6359 100644 --- a/arch/x86/cpu/broadwell/sdram.c +++ b/arch/x86/cpu/broadwell/sdram.c @@ -28,9 +28,11 @@ ulong board_get_usable_ram_top(ulong total_size) return mrc_common_board_get_usable_ram_top(total_size); }
-void dram_init_banksize(void) +int dram_init_banksize(void) { mrc_common_dram_init_banksize(); + + return 0; }
void broadwell_fill_pei_data(struct pei_data *pei_data) diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c index 7115e7a151..82407affaf 100644 --- a/arch/x86/cpu/coreboot/sdram.c +++ b/arch/x86/cpu/coreboot/sdram.c @@ -104,7 +104,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { int i, j;
@@ -121,4 +121,6 @@ void dram_init_banksize(void) } } } + + return 0; } diff --git a/arch/x86/cpu/efi/sdram.c b/arch/x86/cpu/efi/sdram.c index 51599445ab..413e55b596 100644 --- a/arch/x86/cpu/efi/sdram.c +++ b/arch/x86/cpu/efi/sdram.c @@ -22,8 +22,10 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = efi_get_ram_base(); gd->bd->bi_dram[0].size = CONFIG_EFI_RAM_SIZE; + + return 0; } diff --git a/arch/x86/cpu/ivybridge/sdram.c b/arch/x86/cpu/ivybridge/sdram.c index 201368c9c7..643d804e35 100644 --- a/arch/x86/cpu/ivybridge/sdram.c +++ b/arch/x86/cpu/ivybridge/sdram.c @@ -46,9 +46,11 @@ ulong board_get_usable_ram_top(ulong total_size) return mrc_common_board_get_usable_ram_top(total_size); }
-void dram_init_banksize(void) +int dram_init_banksize(void) { mrc_common_dram_init_banksize(); + + return 0; }
static int read_seed_from_cmos(struct pei_data *pei_data) diff --git a/arch/x86/cpu/qemu/dram.c b/arch/x86/cpu/qemu/dram.c index a88d0d2654..9d84af5ef2 100644 --- a/arch/x86/cpu/qemu/dram.c +++ b/arch/x86/cpu/qemu/dram.c @@ -26,10 +26,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = 0; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
/* diff --git a/arch/x86/cpu/quark/dram.c b/arch/x86/cpu/quark/dram.c index 40c830af96..47beb86da3 100644 --- a/arch/x86/cpu/quark/dram.c +++ b/arch/x86/cpu/quark/dram.c @@ -162,10 +162,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = 0; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
/* diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index cc7fc7370e..33c6e2bb68 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -41,7 +41,7 @@ void x86_disable_caches(void); int x86_init_cache(void); void reset_cpu(ulong addr); ulong board_get_usable_ram_top(ulong total_size); -void dram_init_banksize(void); +int dram_init_banksize(void); int default_print_cpuinfo(void);
/* Set up a UART which can be used with printch(), printhex8(), etc. */ diff --git a/arch/x86/lib/efi/efi.c b/arch/x86/lib/efi/efi.c index 533318bc36..b1746fa474 100644 --- a/arch/x86/lib/efi/efi.c +++ b/arch/x86/lib/efi/efi.c @@ -92,7 +92,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { struct efi_mem_desc *desc, *end; struct efi_entry_memmap *map; @@ -103,7 +103,7 @@ void dram_init_banksize(void) if (ret) { /* We should have stopped in dram_init(), something is wrong */ debug("%s: Missing memory map\n", __func__); - return; + return -ENXIO; } end = (struct efi_mem_desc *)((ulong)map + size); desc = map->desc; @@ -123,6 +123,8 @@ void dram_init_banksize(void) EFI_PAGE_SHIFT; num_banks++; } + + return 0; }
int checkcpu(void) diff --git a/arch/x86/lib/fsp/fsp_dram.c b/arch/x86/lib/fsp/fsp_dram.c index fcfe693ce5..8b880cd594 100644 --- a/arch/x86/lib/fsp/fsp_dram.c +++ b/arch/x86/lib/fsp/fsp_dram.c @@ -41,10 +41,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = 0; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
/* diff --git a/board/AndesTech/adp-ag101p/adp-ag101p.c b/board/AndesTech/adp-ag101p/adp-ag101p.c index 84c77f76ff..805a266f63 100644 --- a/board/AndesTech/adp-ag101p/adp-ag101p.c +++ b/board/AndesTech/adp-ag101p/adp-ag101p.c @@ -49,12 +49,14 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_0; gd->bd->bi_dram[0].size = PHYS_SDRAM_0_SIZE; gd->bd->bi_dram[1].start = PHYS_SDRAM_1; gd->bd->bi_dram[1].size = PHYS_SDRAM_1_SIZE; + + return 0; }
int board_eth_init(bd_t *bd) diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c index 16adf6e5de..1abfe88949 100644 --- a/board/armadeus/apf27/apf27.c +++ b/board/armadeus/apf27/apf27.c @@ -193,7 +193,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, @@ -204,6 +204,8 @@ void dram_init_banksize(void) PHYS_SDRAM_2_SIZE); else gd->bd->bi_dram[1].size = 0; + + return 0; }
ulong board_get_usable_ram_top(ulong total_size) diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c index d3b3b31924..458f1d8148 100644 --- a/board/armltd/vexpress/vexpress_common.c +++ b/board/armltd/vexpress/vexpress_common.c @@ -109,7 +109,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = @@ -117,6 +117,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; }
/* diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index e34af6c4d9..0a224178df 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -70,7 +70,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; @@ -78,6 +78,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; #endif + + return 0; }
/* diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c b/board/beckhoff/mx53cx9020/mx53cx9020.c index 9b3ac22e70..c5d55dc68f 100644 --- a/board/beckhoff/mx53cx9020/mx53cx9020.c +++ b/board/beckhoff/mx53cx9020/mx53cx9020.c @@ -86,13 +86,15 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = mx53_dram_size[0];
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = mx53_dram_size[1]; + + return 0; }
u32 get_board_rev(void) diff --git a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c index 533e99ece6..5f4c634362 100644 --- a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c +++ b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c @@ -62,10 +62,12 @@ int dram_init(void) }
/* This is called after dram_init() so use get_ram_size result */ -void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
#ifdef CONFIG_MMC_SDHCI_KONA diff --git a/board/broadcom/bcm28155_ap/bcm28155_ap.c b/board/broadcom/bcm28155_ap/bcm28155_ap.c index b868812972..f5b94f6430 100644 --- a/board/broadcom/bcm28155_ap/bcm28155_ap.c +++ b/board/broadcom/bcm28155_ap/bcm28155_ap.c @@ -69,10 +69,12 @@ int dram_init(void) }
/* This is called after dram_init() so use get_ram_size result */ -void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
#ifdef CONFIG_MMC_SDHCI_KONA diff --git a/board/broadcom/bcm_ep/board.c b/board/broadcom/bcm_ep/board.c index c28b203cea..a409622788 100644 --- a/board/broadcom/bcm_ep/board.c +++ b/board/broadcom/bcm_ep/board.c @@ -37,10 +37,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
int board_early_init_f(void) diff --git a/board/broadcom/bcmns2/northstar2.c b/board/broadcom/bcmns2/northstar2.c index a64431d35e..10279a5763 100644 --- a/board/broadcom/bcmns2/northstar2.c +++ b/board/broadcom/bcmns2/northstar2.c @@ -43,13 +43,15 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE + PHYS_SDRAM_1_SIZE; gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; + + return 0; }
void reset_cpu(ulong addr) diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c index 5899aa6362..39b9b12567 100644 --- a/board/cadence/xtfpga/xtfpga.c +++ b/board/cadence/xtfpga/xtfpga.c @@ -48,10 +48,12 @@ int checkboard(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE); gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; + + return 0; }
int board_postclk_init(void) diff --git a/board/cirrus/edb93xx/edb93xx.c b/board/cirrus/edb93xx/edb93xx.c index 51ff16215e..720b490f2b 100644 --- a/board/cirrus/edb93xx/edb93xx.c +++ b/board/cirrus/edb93xx/edb93xx.c @@ -216,9 +216,11 @@ static unsigned dram_init_banksize_int(int print) return dram_total; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { dram_init_banksize_int(0); + + return 0; }
/* called in board_init_f (before relocation) */ diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 5b88bcce59..80b5dc9026 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -688,7 +688,7 @@ int misc_init_r(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[1].start = PHYS_SDRAM_2; @@ -720,6 +720,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].size = 0x7FF00000; break; } + + return 0; }
int dram_init(void) diff --git a/board/denx/m53evk/m53evk.c b/board/denx/m53evk/m53evk.c index ef63bbd10a..1e4db24c89 100644 --- a/board/denx/m53evk/m53evk.c +++ b/board/denx/m53evk/m53evk.c @@ -59,13 +59,15 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = mx53_dram_size[0];
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = mx53_dram_size[1]; + + return 0; }
static void setup_iomux_uart(void) diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index fe781dcc92..19b673e6d2 100644 --- a/board/esd/meesc/meesc.c +++ b/board/esd/meesc/meesc.c @@ -132,10 +132,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM; gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; + + return 0; }
int board_eth_init(bd_t *bis) diff --git a/board/freescale/ls1021aqds/ddr.c b/board/freescale/ls1021aqds/ddr.c index 8e8cd37b8b..3bf2e49762 100644 --- a/board/freescale/ls1021aqds/ddr.c +++ b/board/freescale/ls1021aqds/ddr.c @@ -184,8 +184,10 @@ int initdram(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; } diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c index fb0ab77445..123fb11f42 100644 --- a/board/freescale/mx35pdk/mx35pdk.c +++ b/board/freescale/mx35pdk/mx35pdk.c @@ -47,13 +47,15 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; + + return 0; }
#define I2C_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_DOWN | PAD_CTL_ODE) diff --git a/board/freescale/mx53ard/mx53ard.c b/board/freescale/mx53ard/mx53ard.c index a6e46b92f9..eb9f74337f 100644 --- a/board/freescale/mx53ard/mx53ard.c +++ b/board/freescale/mx53ard/mx53ard.c @@ -32,13 +32,15 @@ int dram_init(void)
return 0; } -void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; + + return 0; }
#ifdef CONFIG_NAND_MXC diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 9e1072f4b1..3741fa178c 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -58,13 +58,15 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = mx53_dram_size[0];
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = mx53_dram_size[1]; + + return 0; }
u32 get_board_rev(void) diff --git a/board/freescale/mx53smd/mx53smd.c b/board/freescale/mx53smd/mx53smd.c index 938c611ef8..630d6714af 100644 --- a/board/freescale/mx53smd/mx53smd.c +++ b/board/freescale/mx53smd/mx53smd.c @@ -30,13 +30,15 @@ int dram_init(void)
return 0; } -void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; + + return 0; }
#define UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \ diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index df3b5e717a..0f0eb3acb8 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -410,7 +410,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { /* * Reserve regions below from DT memory node (which gets generated @@ -442,6 +442,8 @@ void dram_init_banksize(void)
gd->bd->bi_dram[5].start = 0x22000000; gd->bd->bi_dram[5].size = 0x1c000000; + + return 0; }
void reset_cpu(ulong addr) diff --git a/board/mini-box/picosam9g45/picosam9g45.c b/board/mini-box/picosam9g45/picosam9g45.c index 32ba9c6225..5eb2ad77ca 100644 --- a/board/mini-box/picosam9g45/picosam9g45.c +++ b/board/mini-box/picosam9g45/picosam9g45.c @@ -283,7 +283,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, @@ -291,6 +291,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].start = PHYS_SDRAM_2; gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; }
#ifdef CONFIG_RESET_PHY_R diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 818ae04dfd..e923ddc2e2 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -19,10 +19,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; }
diff --git a/board/rockchip/evb_rk3328/evb-rk3328.c b/board/rockchip/evb_rk3328/evb-rk3328.c index 7e70f381c9..a7895cb251 100644 --- a/board/rockchip/evb_rk3328/evb-rk3328.c +++ b/board/rockchip/evb_rk3328/evb-rk3328.c @@ -22,11 +22,13 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { /* Reserve 0x200000 for ATF bl31 */ gd->bd->bi_dram[0].start = 0x200000; gd->bd->bi_dram[0].size = 0x7e000000; + + return 0; }
int usb_gadget_handle_interrupts(void) diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c index c437f1be0b..362fa0bc6e 100644 --- a/board/rockchip/evb_rk3399/evb-rk3399.c +++ b/board/rockchip/evb_rk3399/evb-rk3399.c @@ -67,9 +67,11 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { /* Reserve 0x200000 for ATF bl31 */ gd->bd->bi_dram[0].start = 0x200000; gd->bd->bi_dram[0].size = 0x7e000000; + + return 0; } diff --git a/board/ronetix/pm9261/pm9261.c b/board/ronetix/pm9261/pm9261.c index e2cb94ee13..79073d8aaa 100644 --- a/board/ronetix/pm9261/pm9261.c +++ b/board/ronetix/pm9261/pm9261.c @@ -264,10 +264,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM; gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; + + return 0; }
#ifdef CONFIG_RESET_PHY_R diff --git a/board/ronetix/pm9263/pm9263.c b/board/ronetix/pm9263/pm9263.c index e9f9b67b77..accf16f151 100644 --- a/board/ronetix/pm9263/pm9263.c +++ b/board/ronetix/pm9263/pm9263.c @@ -360,10 +360,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM; gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; + + return 0; }
#ifdef CONFIG_RESET_PHY_R diff --git a/board/ronetix/pm9g45/pm9g45.c b/board/ronetix/pm9g45/pm9g45.c index c2707e0015..c1225800a9 100644 --- a/board/ronetix/pm9g45/pm9g45.c +++ b/board/ronetix/pm9g45/pm9g45.c @@ -144,10 +144,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM; gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; + + return 0; }
#ifdef CONFIG_RESET_PHY_R diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c index 881d080522..405ed3b923 100644 --- a/board/samsung/arndale/arndale.c +++ b/board/samsung/arndale/arndale.c @@ -55,7 +55,7 @@ int power_init_board(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { int i; u32 addr, size; @@ -67,6 +67,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[i].start = addr; gd->bd->bi_dram[i].size = size; } + + return 0; }
#ifdef CONFIG_GENERIC_MMC diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index ba928e0fa7..49e4db2de9 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -108,7 +108,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { unsigned int i; unsigned long addr, size; @@ -120,6 +120,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[i].start = addr; gd->bd->bi_dram[i].size = size; } + + return 0; }
static int board_uart_init(void) diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 9c48d71a67..35ed398df6 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -52,7 +52,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; @@ -60,6 +60,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; gd->bd->bi_dram[2].start = PHYS_SDRAM_3; gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE; + + return 0; }
#ifdef CONFIG_DISPLAY_BOARDINFO diff --git a/board/samsung/smdkc100/smdkc100.c b/board/samsung/smdkc100/smdkc100.c index 66b6a9801f..79e127d99a 100644 --- a/board/samsung/smdkc100/smdkc100.c +++ b/board/samsung/smdkc100/smdkc100.c @@ -51,10 +51,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; }
#ifdef CONFIG_DISPLAY_BOARDINFO diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c index fc0e8d252b..c730ac082b 100644 --- a/board/samsung/smdkv310/smdkv310.c +++ b/board/samsung/smdkv310/smdkv310.c @@ -52,7 +52,7 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, @@ -66,6 +66,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[3].start = PHYS_SDRAM_4; gd->bd->bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE); + + return 0; }
int board_eth_init(bd_t *bis) diff --git a/board/spear/common/spr_misc.c b/board/spear/common/spr_misc.c index bc92cd6f49..d6a84dba60 100644 --- a/board/spear/common/spr_misc.c +++ b/board/spear/common/spr_misc.c @@ -33,10 +33,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; }
int board_early_init_f() diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c index 0c06bcaa61..1e7d4217d3 100644 --- a/board/st/stih410-b2260/board.c +++ b/board/st/stih410-b2260/board.c @@ -16,10 +16,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; }
int board_init(void) diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c index add1ce1a79..6a19730069 100644 --- a/board/st/stv0991/stv0991.c +++ b/board/st/stv0991/stv0991.c @@ -93,10 +93,12 @@ int dram_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; }
#ifdef CONFIG_CMD_NET diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index de6fc19cb0..ae2d59da43 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -498,7 +498,7 @@ int board_init(void) return 0; }
-void dram_init_banksize(void) +int dram_init_banksize(void) { u64 ram_size;
@@ -510,6 +510,8 @@ void dram_init_banksize(void) gd->bd->bi_dram[1].start = 0x200000000; gd->bd->bi_dram[1].size = ram_size - CONFIG_MAX_MEM_MAPPED; } + + return 0; }
int board_late_init(void) diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index ccd4ec955b..aa55ebad38 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -25,10 +25,12 @@ static int reset_pin = -1;
ulong ram_base;
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = ram_base; gd->bd->bi_dram[0].size = get_effective_memsize(); + + return 0; }
int dram_init(void) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 6a3cbe0a0d..b2fbecf6de 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -130,9 +130,11 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) }
#if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -void dram_init_banksize(void) +int dram_init_banksize(void) { fdtdec_setup_memory_banksize(); + + return 0; }
int dram_init(void) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 4e5871b76a..3849b5885d 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -180,9 +180,11 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) }
#if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -void dram_init_banksize(void) +int dram_init_banksize(void) { fdtdec_setup_memory_banksize(); + + return 0; }
int dram_init(void) diff --git a/board/zipitz2/zipitz2.c b/board/zipitz2/zipitz2.c index d3ca939238..e81d6ff18d 100644 --- a/board/zipitz2/zipitz2.c +++ b/board/zipitz2/zipitz2.c @@ -69,10 +69,12 @@ void usb_board_stop(void) } #endif
-void dram_init_banksize(void) +int dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; }
#ifdef CONFIG_CMD_MMC diff --git a/common/board_f.c b/common/board_f.c index 7751c6c7e0..0c0bdc44e3 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -201,12 +201,14 @@ static int show_dram_config(void) return 0; }
-__weak void dram_init_banksize(void) +__weak int dram_init_banksize(void) { #if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = get_effective_memsize(); #endif + + return 0; }
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) @@ -652,14 +654,6 @@ static int init_post(void) } #endif
-static int setup_dram_config(void) -{ - /* Ram is board specific, so move it to board code ... */ - dram_init_banksize(); - - return 0; -} - static int reloc_fdt(void) { #ifndef CONFIG_OF_EMBED @@ -900,7 +894,7 @@ static const init_fnc_t init_sequence_f[] = { reserve_fdt, reserve_arch, reserve_stacks, - setup_dram_config, + dram_init_banksize, show_dram_config, #if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH)

On 31.03.2017 16:40, Simon Glass wrote:
By making dram_init_banksize() return an error code we can drop the wrapper. Adjust this and clean up all implementations.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On Fri, Mar 31, 2017 at 08:40:32AM -0600, Simon Glass wrote:
By making dram_init_banksize() return an error code we can drop the wrapper. Adjust this and clean up all implementations.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
Applied to u-boot/master, thanks!

This is an weak function present on all archs so we should have it in the common header file. Remove it from arch-specific headers and add a function comment.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/include/asm/u-boot-arm.h | 1 - arch/x86/include/asm/u-boot-x86.h | 1 - include/common.h | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 2129f37c8f..b931c22060 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -36,7 +36,6 @@ int arch_early_init_r(void);
/* board/.../... */ int board_init(void); -int dram_init_banksize(void); void board_quiesce_devices(void);
/* cpu/.../interrupt.c */ diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 33c6e2bb68..d2d603967e 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -41,7 +41,6 @@ void x86_disable_caches(void); int x86_init_cache(void); void reset_cpu(ulong addr); ulong board_get_usable_ram_top(ulong total_size); -int dram_init_banksize(void); int default_print_cpuinfo(void);
/* Set up a UART which can be used with printch(), printhex8(), etc. */ diff --git a/include/common.h b/include/common.h index 844f012297..1441581c40 100644 --- a/include/common.h +++ b/include/common.h @@ -206,6 +206,23 @@ typedef void (interrupt_handler_t)(void *); */ int dram_init(void);
+/** + * dram_init_banksize() - Set up DRAM bank sizes + * + * This can be implemented by boards to set up the DRAM bank information in + * gd->bd->bi_dram(). It is called just before relocation, after dram_init() + * is called. + * + * If this is not provided, a default implementation will try to set up a + * single bank. It will do this if CONFIG_NR_DRAM_BANKS and + * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of + * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to + * get_effective_memsize(). + * + * @return 0 if OK, -ve on error + */ +int dram_init_banksize(void); + void hang (void) __attribute__ ((noreturn));
int timer_init(void);

On Fri, Mar 31, 2017 at 08:40:33AM -0600, Simon Glass wrote:
This is an weak function present on all archs so we should have it in the common header file. Remove it from arch-specific headers and add a function comment.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

Drop headers which are not used or needed in this file. The compiler.h header is included by common.h.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 0c0bdc44e3..5df00f33b1 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -11,16 +11,12 @@ */
#include <common.h> -#include <linux/compiler.h> #include <version.h> #include <console.h> #include <environment.h> #include <dm.h> #include <fdtdec.h> #include <fs.h> -#if defined(CONFIG_CMD_IDE) -#include <ide.h> -#endif #include <i2c.h> #include <initcall.h> #include <logbuff.h> @@ -59,7 +55,6 @@ #include <asm/relocate.h> #endif #include <dm/root.h> -#include <linux/compiler.h>
/* * Pointer to initial global data area

On 03/31/2017 07:41 AM, Simon Glass wrote:
Drop headers which are not used or needed in this file. The compiler.h header is included by common.h.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:34AM -0600, Simon Glass wrote:
Drop headers which are not used or needed in this file. The compiler.h header is included by common.h.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: York Sun york.sun@nxp.com
Applied to u-boot/master, thanks!

This is to keep the header file order consistent.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c index 5df00f33b1..925861124c 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -45,7 +45,6 @@ #include <trace.h> #include <video.h> #include <watchdog.h> -#include <linux/errno.h> #include <asm/io.h> #include <asm/sections.h> #if defined(CONFIG_X86) || defined(CONFIG_ARC) @@ -55,6 +54,7 @@ #include <asm/relocate.h> #endif #include <dm/root.h> +#include <linux/errno.h>
/* * Pointer to initial global data area

On 03/31/2017 07:41 AM, Simon Glass wrote:
This is to keep the header file order consistent.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:35AM -0600, Simon Glass wrote:
This is to keep the header file order consistent.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: York Sun york.sun@nxp.com
Applied to u-boot/master, thanks!

We don't need this PPC-specific function in generic code. Move it to the powerpc directory.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/setup.c | 32 ++++++++++++++++++++++++++++++++ common/board_f.c | 25 ------------------------- include/common.h | 7 +++++++ 4 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 arch/powerpc/lib/setup.c
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 3c97476a83..4f68613a41 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -17,6 +17,7 @@ MINIMAL=y endif endif
+obj-$(CONFIG_SYS_EXTBDINFO) += setup.o ifdef MINIMAL obj-y += cache.o time.o obj-y += ticks.o diff --git a/arch/powerpc/lib/setup.c b/arch/powerpc/lib/setup.c new file mode 100644 index 0000000000..a4213359e2 --- /dev/null +++ b/arch/powerpc/lib/setup.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <version.h> + +DECLARE_GLOBAL_DATA_PTR; + +int setup_board_extra(void) +{ + bd_t *bd = gd->bd; + + strncpy((char *)bd->bi_s_version, "1.2", sizeof(bd->bi_s_version)); + strncpy((char *)bd->bi_r_version, U_BOOT_VERSION, + sizeof(bd->bi_r_version)); + + bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */ + bd->bi_plb_busfreq = gd->bus_clk; +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ + defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ + defined(CONFIG_440EPX) || defined(CONFIG_440GRX) + bd->bi_pci_busfreq = get_PCI_freq(); + bd->bi_opbfreq = get_OPB_freq(); +#elif defined(CONFIG_XILINX_405) + bd->bi_pci_busfreq = get_PCI_freq(); +#endif + + return 0; +} diff --git a/common/board_f.c b/common/board_f.c index 925861124c..c0fe6b08fb 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -11,7 +11,6 @@ */
#include <common.h> -#include <version.h> #include <console.h> #include <environment.h> #include <dm.h> @@ -615,30 +614,6 @@ static int setup_board_part2(void) } #endif
-#ifdef CONFIG_SYS_EXTBDINFO -static int setup_board_extra(void) -{ - bd_t *bd = gd->bd; - - strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version)); - strncpy((char *) bd->bi_r_version, U_BOOT_VERSION, - sizeof(bd->bi_r_version)); - - bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */ - bd->bi_plb_busfreq = gd->bus_clk; -#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ - defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ - defined(CONFIG_440EPX) || defined(CONFIG_440GRX) - bd->bi_pci_busfreq = get_PCI_freq(); - bd->bi_opbfreq = get_OPB_freq(); -#elif defined(CONFIG_XILINX_405) - bd->bi_pci_busfreq = get_PCI_freq(); -#endif - - return 0; -} -#endif - #ifdef CONFIG_POST static int init_post(void) { diff --git a/include/common.h b/include/common.h index 1441581c40..93cc1abbe2 100644 --- a/include/common.h +++ b/include/common.h @@ -305,6 +305,13 @@ int print_cpuinfo(void); int update_flash_size(int flash_size); int arch_early_init_r(void);
+/* + * setup_board_extra() - Fill in extra details in the bd_t structure + * + * @return 0 if OK, -ve on error + */ +int setup_board_extra(void); + /** * arch_fsp_init() - perform firmware support package init *

On 31.03.2017 16:40, Simon Glass wrote:
We don't need this PPC-specific function in generic code. Move it to the powerpc directory.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On Fri, Mar 31, 2017 at 08:40:36AM -0600, Simon Glass wrote:
We don't need this PPC-specific function in generic code. Move it to the powerpc directory.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de
Applied to u-boot/master, thanks!

This header file is used by two archs. It could be used by all of them since it allows the cache to be on during relocation. Move it into a generic file.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arc/include/asm/init_helpers.h | 12 ------------ arch/x86/lib/spl.c | 2 +- common/board_f.c | 4 +--- common/board_r.c | 4 +--- {arch/x86/include/asm => include}/init_helpers.h | 7 ++++++- 5 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 arch/arc/include/asm/init_helpers.h rename {arch/x86/include/asm => include}/init_helpers.h (56%)
diff --git a/arch/arc/include/asm/init_helpers.h b/arch/arc/include/asm/init_helpers.h deleted file mode 100644 index 7607e19561..0000000000 --- a/arch/arc/include/asm/init_helpers.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _ASM_ARC_INIT_HELPERS_H -#define _ASM_ARC_INIT_HELPERS_H - -int init_cache_f_r(void); - -#endif /* _ASM_ARC_INIT_HELPERS_H */ diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index ed2d40b552..2b1b450737 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -6,9 +6,9 @@
#include <common.h> #include <debug_uart.h> +#include <init_helpers.h> #include <spl.h> #include <asm/cpu.h> -#include <asm/init_helpers.h> #include <asm/mtrr.h> #include <asm/processor.h> #include <asm-generic/sections.h> diff --git a/common/board_f.c b/common/board_f.c index c0fe6b08fb..1b6c2b9789 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -18,6 +18,7 @@ #include <fs.h> #include <i2c.h> #include <initcall.h> +#include <init_helpers.h> #include <logbuff.h> #include <malloc.h> #include <mapmem.h> @@ -46,9 +47,6 @@ #include <watchdog.h> #include <asm/io.h> #include <asm/sections.h> -#if defined(CONFIG_X86) || defined(CONFIG_ARC) -#include <asm/init_helpers.h> -#endif #if defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_XTENSA) #include <asm/relocate.h> #endif diff --git a/common/board_r.c b/common/board_r.c index 5c9e6987b9..f7c02281b3 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -27,6 +27,7 @@ #include <ide.h> #endif #include <initcall.h> +#include <init_helpers.h> #ifdef CONFIG_PS2KBD #include <keyboard.h> #endif @@ -56,9 +57,6 @@ #include <asm/mmu.h> #endif #include <asm/sections.h> -#ifdef CONFIG_X86 -#include <asm/init_helpers.h> -#endif #include <dm/root.h> #include <linux/compiler.h> #include <linux/err.h> diff --git a/arch/x86/include/asm/init_helpers.h b/include/init_helpers.h similarity index 56% rename from arch/x86/include/asm/init_helpers.h rename to include/init_helpers.h index ef05ac4781..3efcfddb7b 100644 --- a/arch/x86/include/asm/init_helpers.h +++ b/include/init_helpers.h @@ -8,6 +8,11 @@ #ifndef _INIT_HELPERS_H_ #define _INIT_HELPERS_H_
+/** + * init_cache_f_r() - Turn on the cache in preparation for relocation + * + * @return 0 if OK, -ve on error + */ int init_cache_f_r(void);
-#endif /* !_INIT_HELPERS_H_ */ +#endif /* _INIT_HELPERS_H_ */

On Fri, Mar 31, 2017 at 08:40:37AM -0600, Simon Glass wrote:
This header file is used by two archs. It could be used by all of them since it allows the cache to be on during relocation. Move it into a generic file.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

This header file is used by three archs. It could be used by all of them since relocation is a common function. Move it into a generic file.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arc/include/asm/relocate.h | 16 ---------------- arch/x86/include/asm/relocate.h | 17 ----------------- arch/x86/lib/relocate.c | 2 +- arch/xtensa/include/asm/relocate.h | 14 -------------- arch/xtensa/lib/relocate.c | 2 +- common/board_f.c | 4 +--- include/relocate.h | 39 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 42 insertions(+), 52 deletions(-) delete mode 100644 arch/arc/include/asm/relocate.h delete mode 100644 arch/x86/include/asm/relocate.h delete mode 100644 arch/xtensa/include/asm/relocate.h create mode 100644 include/relocate.h
diff --git a/arch/arc/include/asm/relocate.h b/arch/arc/include/asm/relocate.h deleted file mode 100644 index 4c5f923416..0000000000 --- a/arch/arc/include/asm/relocate.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _ASM_ARC_RELOCATE_H -#define _ASM_ARC_RELOCATE_H - -#include <common.h> - -int copy_uboot_to_ram(void); -int clear_bss(void); -int do_elf_reloc_fixups(void); - -#endif /* _ASM_ARC_RELOCATE_H */ diff --git a/arch/x86/include/asm/relocate.h b/arch/x86/include/asm/relocate.h deleted file mode 100644 index cff3abc23a..0000000000 --- a/arch/x86/include/asm/relocate.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (C) Copyright 2011 - * Graeme Russ, graeme.russ@gmail.com - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _RELOCATE_H_ -#define _RELOCATE_H_ - -#include <common.h> - -int copy_uboot_to_ram(void); -int clear_bss(void); -int do_elf_reloc_fixups(void); - -#endif /* !_RELOCATE_H_ */ diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 1da5210d27..114f602f7a 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -17,8 +17,8 @@
#include <common.h> #include <inttypes.h> +#include <relocate.h> #include <asm/u-boot-x86.h> -#include <asm/relocate.h> #include <asm/sections.h> #include <elf.h>
diff --git a/arch/xtensa/include/asm/relocate.h b/arch/xtensa/include/asm/relocate.h deleted file mode 100644 index 9c4ce23988..0000000000 --- a/arch/xtensa/include/asm/relocate.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (C) 2016 Cadence Design Systems Inc. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _ASM_XTENSA_RELOCATE_H -#define _ASM_XTENSA_RELOCATE_H - -#include <common.h> - -int clear_bss(void); - -#endif /* _ASM_XTENSA_RELOCATE_H */ diff --git a/arch/xtensa/lib/relocate.c b/arch/xtensa/lib/relocate.c index 3f747ec55a..010c1b035e 100644 --- a/arch/xtensa/lib/relocate.c +++ b/arch/xtensa/lib/relocate.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-2.0+ */
-#include <asm/relocate.h> +#include <relocate.h> #include <asm/sections.h> #include <asm/string.h>
diff --git a/common/board_f.c b/common/board_f.c index 1b6c2b9789..bbcf6f4fe5 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -39,6 +39,7 @@
#include <os.h> #include <post.h> +#include <relocate.h> #include <spi.h> #include <status_led.h> #include <timer.h> @@ -47,9 +48,6 @@ #include <watchdog.h> #include <asm/io.h> #include <asm/sections.h> -#if defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_XTENSA) -#include <asm/relocate.h> -#endif #include <dm/root.h> #include <linux/errno.h>
diff --git a/include/relocate.h b/include/relocate.h new file mode 100644 index 0000000000..0d4b27aa2b --- /dev/null +++ b/include/relocate.h @@ -0,0 +1,39 @@ +/* + * (C) Copyright 2011 + * Graeme Russ, graeme.russ@gmail.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _RELOCATE_H_ +#define _RELOCATE_H_ + +#include <common.h> + +/** + * copy_uboot_to_ram() - Copy U-Boot to its new relocated position + * + * @return 0 if OK, -ve on error + */ +int copy_uboot_to_ram(void); + +/** + * clear_bss() - Clear the BSS (Blocked Start by Symbol) segment + * + * This clears the memory used by global variables + * + * @return 0 if OK, -ve on error + */ +int clear_bss(void); + +/** + * do_elf_reloc_fixups() - Fix up ELF relocations in the relocated code + * + * This processes the relocation tables to ensure that the code can run in its + * new location. + * + * @return 0 if OK, -ve on error + */ +int do_elf_reloc_fixups(void); + +#endif /* _RELOCATE_H_ */

On Fri, Mar 31, 2017 at 08:40:38AM -0600, Simon Glass wrote:
This header file is used by three archs. It could be used by all of them since relocation is a common function. Move it into a generic file.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

These includes don't seem to be needed now. Drop them. Reserve the mp.h header for PowerPC for now.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index bbcf6f4fe5..14f901571f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -22,21 +22,6 @@ #include <logbuff.h> #include <malloc.h> #include <mapmem.h> - -/* TODO: Can we move these into arch/ headers? */ -#ifdef CONFIG_8xx -#include <mpc8xx.h> -#endif -#ifdef CONFIG_5xx -#include <mpc5xx.h> -#endif -#ifdef CONFIG_MPC5xxx -#include <mpc5xxx.h> -#endif -#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) -#include <asm/mp.h> -#endif - #include <os.h> #include <post.h> #include <relocate.h> @@ -46,6 +31,9 @@ #include <trace.h> #include <video.h> #include <watchdog.h> +#if defined(CONFIG_MP) && defined(CONFIG_PPC) +#include <asm/mp.h> +#endif #include <asm/io.h> #include <asm/sections.h> #include <dm/root.h>

On 31.03.2017 16:40, Simon Glass wrote:
These includes don't seem to be needed now. Drop them. Reserve the mp.h header for PowerPC for now.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On 03/31/2017 07:41 AM, Simon Glass wrote:
These includes don't seem to be needed now. Drop them. Reserve the mp.h header for PowerPC for now.
Signed-off-by: Simon Glass sjg@chromium.org
common/board_f.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index bbcf6f4fe5..14f901571f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -22,21 +22,6 @@ #include <logbuff.h> #include <malloc.h> #include <mapmem.h>
-/* TODO: Can we move these into arch/ headers? */ -#ifdef CONFIG_8xx -#include <mpc8xx.h> -#endif -#ifdef CONFIG_5xx -#include <mpc5xx.h> -#endif -#ifdef CONFIG_MPC5xxx -#include <mpc5xxx.h> -#endif -#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) -#include <asm/mp.h> -#endif
#include <os.h> #include <post.h> #include <relocate.h> @@ -46,6 +31,9 @@ #include <trace.h> #include <video.h> #include <watchdog.h> +#if defined(CONFIG_MP) && defined(CONFIG_PPC) +#include <asm/mp.h> +#endif
I don't know if this is safe for other PPC SoCs. For FSL/NXP PPC (in this case, only MPC86xx and E500 have CONFIG_MP),
Reviewed-by: York Sun york.sun@nxp.com

On Fri, Mar 31, 2017 at 08:40:39AM -0600, Simon Glass wrote:
These includes don't seem to be needed now. Drop them. Reserve the mp.h header for PowerPC for now.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Stefan Roese sr@denx.de Reviewed-by: York Sun york.sun@nxp.com
Applied to u-boot/master, thanks!
participants (4)
-
Simon Glass
-
Stefan Roese
-
Tom Rini
-
york sun