Skip to contentSkip to conversation

arc: Move dram_init out of arch code, into board code

PATCH New Alexandru Gagniuc 2 participants 5 messages Jun 5, 2017 – Jun 15, 2017 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/arc/lib/cpu.c             | 6 ------
 board/synopsys/axs10x/axs10x.c | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arc/lib/cpu.c +0 -6
index cb80893..d1f10ab 100644
@@ -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;
-}
board/synopsys/axs10x/axs10x.c +6 -0
index e6b69da..bd69502 100644
@@ -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;
+}
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 arc: Move dram_init out of arch code, into board code

Hi Alexandru,

Quoted 6 lines · Alexandru Gagniuc

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

#2 lore raw

PATCH 1/1 arc: Move dram_init out of arch code, into board code

Quoted 10 lines · Alexey Brodkin

Hi Alexandru,

Quoted 6 lines · Alexandru Gagniuc

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.

Quoted 2 lines

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.

Quoted 2 lines

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.

Quoted 1 line

BTW since commit 80e4bbfcd92d "travisci: Add support for ARC"

I'll give that a try, thanks!

Alex

Quoted 2 lines

-Alexey

#3 lore raw

PATCH 1/1 arc: Move dram_init out of arch code, into board code

Hi Alexandru,

Quoted 29 lines · Alexandru Gagniuc
Quoted 12 lines · Alexey Brodkin

Hi Alexandru,

Quoted 7 lines · Alexandru Gagniuc

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.

Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 1 line
Quoted 3 lines
Quoted 1 line

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

author
#4 lore raw

PATCH 1/1 arc: Move dram_init out of arch code, into board code

Hi Alexey,

Quoted 2 lines · Alexey Brodkin

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