diff options
author | Simon Glass <sjg@chromium.org> | 2017-03-31 14:40:32 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-04-05 20:36:51 (GMT) |
commit | 76b00aca4f1c13bc8f91a539e612abc70d0c692f (patch) | |
tree | 35f0e984413ef3d44ff50c53e8adc418f10b40e2 /arch/arm | |
parent | abf7f4c7040b3914bea327243dcfac0ef840fbaf (diff) | |
download | u-boot-fsl-qoriq-76b00aca4f1c13bc8f91a539e612abc70d0c692f.tar.xz |
board_f: Drop setup_dram_config() wrapper
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/cpu/arm926ejs/armada100/dram.c | 4 | ||||
-rw-r--r-- | arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/u-boot-arm.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/misc.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-meson/board.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/arm64-common.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/dram.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/am33xx/emif4.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap3/emif4.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap3/sdrc.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/dram.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board2.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram_init.c | 4 |
14 files changed, 42 insertions, 16 deletions
diff --git a/arch/arm/cpu/arm926ejs/armada100/dram.c b/arch/arm/cpu/arm926ejs/armada100/dram.c index f3b9a66..6a9000e 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 1e6d90c..ea6c090 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -663,7 +663,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; @@ -772,6 +772,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 305a302..2129f37 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 e699d61..e1064e0 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 f159cbf..273dbeb 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 8f02655..1c0477a 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 a8ec5ea..e3f304c 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 27fa3fb..3a110f2 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 a2aadc9..d540cf0 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 4f15ac9..f64cd91 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 9ed93d2..e9c03f3 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 5a457b9..b73cd63 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 37dd8d4..bf16166 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 d9f6c16..f79b7cf 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 |