mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* cortex-a9 boot issue
@ 2019-05-01 10:32 Barbier, Renaud
  2019-05-02 10:21 ` Lucas Stach
  0 siblings, 1 reply; 3+ messages in thread
From: Barbier, Renaud @ 2019-05-01 10:32 UTC (permalink / raw)
  To: barebox

I have added support for a cortex-a9 off the master branch. 

I am seeing an issue to boot to the prompt found in the function hyp_install. The assembly code is as follows:
	mrs	r12, cpsr
	and	r12, r12, #MODE_MASK

	@ Save the initial CPU state
	adr	r0, .L__boot_cpu_mode_offset
	ldr	r1, [r0]
	str	r12, [r0, r1]   ===> I get an exception here because the register r12 is being written to [r0 + r1] which points to the SPI NOR  boot flash.

Commenting out the call to all functions calling hyp_install, barebox does get to the prompt. 

Is there something I could be missing that would put the __boot_cpu_mode variable in a writable area?

Cheers,
Renaud


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: cortex-a9 boot issue
  2019-05-01 10:32 cortex-a9 boot issue Barbier, Renaud
@ 2019-05-02 10:21 ` Lucas Stach
  2019-05-02 13:16   ` Barbier, Renaud
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2019-05-02 10:21 UTC (permalink / raw)
  To: Barbier, Renaud, barebox

Hi Renaud,

Am Mittwoch, den 01.05.2019, 10:32 +0000 schrieb Barbier, Renaud:
> I have added support for a cortex-a9 off the master branch. 
> 
> I am seeing an issue to boot to the prompt found in the function
> hyp_install. The assembly code is as follows:
> 	mrs	r12, cpsr
> 	and	r12, r12, #MODE_MASK
> 
> 	@ Save the initial CPU state
> 	adr	r0, .L__boot_cpu_mode_offset
> 	ldr	r1, [r0]
> 	str	r12, [r0, r1]   ===> I get an exception here because
> the register r12 is being written to [r0 + r1] which points to the
> SPI NOR  boot flash.
> 
> Commenting out the call to all functions calling hyp_install, barebox
> does get to the prompt. 
> 
> Is there something I could be missing that would put the
> __boot_cpu_mode variable in a writable area?

No, this code was just not written with XIP in mind and I'm currently
no sure how to improve this, given how early this code needs to be
executed.

Regards,
Lucas

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* RE: cortex-a9 boot issue
  2019-05-02 10:21 ` Lucas Stach
@ 2019-05-02 13:16   ` Barbier, Renaud
  0 siblings, 0 replies; 3+ messages in thread
From: Barbier, Renaud @ 2019-05-02 13:16 UTC (permalink / raw)
  To: Lucas Stach, barebox

Thanks.
At present, not calling this hyp_install function seems to be ok

Should I have used  a pre-bootloader? 
What is the barebox/ARM way I should have followed? I come from PPC and not familiar yet with the PBL.


> -----Original Message-----
> From: Lucas Stach [mailto:l.stach@pengutronix.de]
> Sent: 02 May 2019 11:22
> To: Barbier, Renaud <renaud.barbier@abaco.com>;
> barebox@lists.infradead.org
> Subject: Re: cortex-a9 boot issue
> 
> 
> 
> [EXTERNAL SOURCE]: This email originated from outside Abaco. DO NOT CLICK
> a link or open an attachment unless you know the content is safe and are
> expecting it from the sender. If in doubt, contact the sender separately to
> verify.
> 
> Hi Renaud,
> 
> Am Mittwoch, den 01.05.2019, 10:32 +0000 schrieb Barbier, Renaud:
> > I have added support for a cortex-a9 off the master branch.
> >
> > I am seeing an issue to boot to the prompt found in the function
> > hyp_install. The assembly code is as follows:
> >       mrs     r12, cpsr
> >       and     r12, r12, #MODE_MASK
> >
> >       @ Save the initial CPU state
> >       adr     r0, .L__boot_cpu_mode_offset
> >       ldr     r1, [r0]
> >       str     r12, [r0, r1]   ===> I get an exception here because
> > the register r12 is being written to [r0 + r1] which points to the
> > SPI NOR  boot flash.
> >
> > Commenting out the call to all functions calling hyp_install, barebox
> > does get to the prompt.
> >
> > Is there something I could be missing that would put the
> > __boot_cpu_mode variable in a writable area?
> 
> No, this code was just not written with XIP in mind and I'm currently
> no sure how to improve this, given how early this code needs to be
> executed.
> 
> Regards,
> Lucas
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-05-02 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 10:32 cortex-a9 boot issue Barbier, Renaud
2019-05-02 10:21 ` Lucas Stach
2019-05-02 13:16   ` Barbier, Renaud

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