From cdbb0cf8ecf30d5dbbfa500e8939a32ef45896c5 Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Mon, 28 Nov 2016 00:15:31 +0200 Subject: sh: add common dram_init() function for all boards Generic board support assumes a different method of specifying DRAM size on board, also it can be shared among all boards, notably only sh7763rdp board has a custom legacy dram_init(), however the difference is only in printing some additional information, this feature can be removed. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Simon Glass --- arch/sh/lib/Makefile | 2 +- arch/sh/lib/board.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 arch/sh/lib/board.c (limited to 'arch/sh') diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index c5cf89f493..7be20b1bdd 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -5,7 +5,7 @@ # SPDX-License-Identifier: GPL-2.0+ # - +obj-y += board.o obj-$(CONFIG_CMD_BOOTM) += bootm.o ifeq ($(CONFIG_CPU_SH2),y) obj-y += time_sh2.o diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c new file mode 100644 index 0000000000..7cb594e31a --- /dev/null +++ b/arch/sh/lib/board.c @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2016 Vladimir Zapolskiy + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, + CONFIG_SYS_SDRAM_SIZE); + + return 0; +} -- cgit v1.2.3