[U-Boot] [PATCH] arc: Move dram_init out of arch code, into board code

The following commit f1683aa board_f: Rename initdram() to dram_init() wrongly assumed that the lack of DRAM init is the property of the architecture. In fact, it is only the AXS10x boards that do not need a special raminit. Those assumptions are not true on the ARC SoC we're looking at.
Move dram_init() to the board code to prevent a duplicate symbol.
Signed-off-by: Alexandru Gagniuc alex.g@adaptrum.com --- arch/arc/lib/cpu.c | 6 ------ board/synopsys/axs10x/axs10x.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c index cb80893..d1f10ab 100644 --- a/arch/arc/lib/cpu.c +++ b/arch/arc/lib/cpu.c @@ -28,9 +28,3 @@ int arch_early_init_r(void) gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; return 0; } - -/* This is a dummy function on arc */ -int dram_init(void) -{ - return 0; -} diff --git a/board/synopsys/axs10x/axs10x.c b/board/synopsys/axs10x/axs10x.c index e6b69da..bd69502 100644 --- a/board/synopsys/axs10x/axs10x.c +++ b/board/synopsys/axs10x/axs10x.c @@ -91,3 +91,9 @@ void smp_kick_all_cpus(void) writel(cmd, (void __iomem *)AXC003_CREG_CPU_START); } #endif + +/* This is a dummy function on AXS10x */ +int dram_init(void) +{ + return 0; +}

Hi Alexandru,
On Mon, 2017-06-05 at 10:49 -0700, Alexandru Gagniuc wrote:
The following commit f1683aa board_f: Rename initdram() to dram_init() wrongly assumed that the lack of DRAM init is the property of the architecture. In fact, it is only the AXS10x boards that do not need a special raminit. Those assumptions are not true on the ARC SoC we're looking at.
Actually there're more boards with ARC cores. In particular nSIM for ARC700 and ARC HS38, as well as Abilis TB100. So it might make sense to declare generic dram_init() in arch/arc/lib/cpu.c as a weak function and add your own implementations as needed.
BTW since commit 80e4bbfcd92d "travisci: Add support for ARC" you may push your changes to any github repo and have TravisCI building for all ARC boards. This way you may at least test if stuff gets built for all boards.
-Alexey

On 06/05/2017 12:22 PM, Alexey Brodkin wrote:
Hi Alexandru,
On Mon, 2017-06-05 at 10:49 -0700, Alexandru Gagniuc wrote:
The following commit f1683aa board_f: Rename initdram() to dram_init() wrongly assumed that the lack of DRAM init is the property of the architecture. In fact, it is only the AXS10x boards that do not need a special raminit. Those assumptions are not true on the ARC SoC we're looking at.
Actually there're more boards with ARC cores. In particular nSIM for ARC700 and ARC HS38, as well as Abilis TB100.
Oops. Missed those. I'll have an updated patch later in the week.
So it might make sense to declare generic dram_init() in arch/arc/lib/cpu.c as a weak function and add your own implementations as needed.
I disagree. The few saved lines of code to properly link the correct function are not worth the lost days when figuring out why my xyz() function is not doing the right thing.
BTW since commit 80e4bbfcd92d "travisci: Add support for ARC"
I'll give that a try, thanks!
Alex
-Alexey

Hi Alexandru,
On Mon, 2017-06-05 at 13:00 -0700, Alexandru Gagniuc wrote:
On 06/05/2017 12:22 PM, Alexey Brodkin wrote:
Hi Alexandru,
On Mon, 2017-06-05 at 10:49 -0700, Alexandru Gagniuc wrote:
The following commit f1683aa board_f: Rename initdram() to dram_init() wrongly assumed that the lack of DRAM init is the property of the architecture. In fact, it is only the AXS10x boards that do not need a special raminit. Those assumptions are not true on the ARC SoC we're looking at.
Actually there're more boards with ARC cores. In particular nSIM for ARC700 and ARC HS38, as well as Abilis TB100.
Oops. Missed those. I'll have an updated patch later in the week.
So it might make sense to declare generic dram_init() in arch/arc/lib/cpu.c as a weak function and add your own implementations as needed.
I disagree. The few saved lines of code to properly link the correct function are not worth the lost days when figuring out why my xyz() function is not doing the right thing.
BTW since commit 80e4bbfcd92d "travisci: Add support for ARC"
I'll give that a try, thanks!
Any progress with that one? Or I'm missing your respin(s)?
-Alexey

Hi Alexey,
On 06/15/2017 12:21 PM, Alexey Brodkin wrote:
Any progress with that one? Or I'm missing your respin(s)?
You're not missing them. I got caught up with other things bringing up this SOC. I'm looking at enabling SPL and having a working boot path. I want to have a working solution instead of pushing out small patches and realizing later that I might have to revert some.
I'm currently waiting on the hardware team to enable all the requisite logic blocks. I'll make sure you'll be among the first to get the updates.
Alex
participants (3)
-
Alex
-
Alexandru Gagniuc
-
Alexey Brodkin