public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] zynq: Use arch_cpu_init() instead of lowlevel_init()
@ 2013-08-22 12:52 Michal Simek
  2013-09-23 12:31 ` Albert ARIBAUD
  2013-10-17  6:49 ` Albert ARIBAUD
  0 siblings, 2 replies; 17+ messages in thread
From: Michal Simek @ 2013-08-22 12:52 UTC (permalink / raw)
  To: u-boot

Zynq lowlevel_init() was implemented in C but stack
pointer is setup after function call in _main().
Move architecture setup to arch_cpu_init() which is call
as the first function in board_init_f() which
already have correct stack pointer.

Reported-by: Sven Schwermer <sven.schwermer@tuhh.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
I can't see any problem to call zynq setup a little
bit later. There is already expectation that u-boot
runs from DDR.
Moving lowlevel_init from C to ASM is possible but
I will have to introduce new macros with hardcoded
values. Using structures is much nicer.

---
 arch/arm/cpu/armv7/zynq/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/zynq/cpu.c b/arch/arm/cpu/armv7/zynq/cpu.c
index 4367d1a..8846f30 100644
--- a/arch/arm/cpu/armv7/zynq/cpu.c
+++ b/arch/arm/cpu/armv7/zynq/cpu.c
@@ -11,6 +11,10 @@

 void lowlevel_init(void)
 {
+}
+
+int arch_cpu_init(void)
+{
 	zynq_slcr_unlock();
 	/* remap DDR to zero, FILTERSTART */
 	writel(0, &scu_base->filter_start);
@@ -31,6 +35,8 @@ void lowlevel_init(void)
 	writel(0xC, &slcr_base->ddr_urgent);

 	zynq_slcr_lock();
+
+	return 0;
 }

 void reset_cpu(ulong addr)
--
1.8.2.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130822/ee64ce22/attachment.pgp>

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-10-17 12:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 12:52 [U-Boot] [PATCH] zynq: Use arch_cpu_init() instead of lowlevel_init() Michal Simek
2013-09-23 12:31 ` Albert ARIBAUD
2013-09-23 14:19   ` Michal Simek
2013-09-23 14:37     ` Albert ARIBAUD
2013-09-23 14:56       ` Michal Simek
2013-09-24 10:38       ` Michal Simek
2013-10-02 19:43         ` Albert ARIBAUD
2013-10-03  6:58           ` Michal Simek
2013-10-03  8:41             ` Albert ARIBAUD
2013-10-03  9:56               ` Michal Simek
2013-10-03 16:07                 ` Albert ARIBAUD
2013-10-17  6:33                   ` Albert ARIBAUD
2013-10-17  7:37                     ` Edgar E. Iglesias
2013-10-17  8:25                       ` Albert ARIBAUD
2013-10-17  8:30                         ` Michal Simek
2013-10-17 12:43                           ` Albert ARIBAUD
2013-10-17  6:49 ` Albert ARIBAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox