public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Regarding Start.S file
@ 2011-09-14 17:22 Asmit Patel
  2011-09-14 17:48 ` Asmit Patel
  0 siblings, 1 reply; 4+ messages in thread
From: Asmit Patel @ 2011-09-14 17:22 UTC (permalink / raw)
  To: u-boot

Hi All,
I am new to u-boot and ARM. I am trying to understand uboot thtough start.S
file.
I have few questions about it.
1) What is the deifference between ARM Supervisior and User mode. why uboot
is not running in user mode?
2) At the start of startup file I found below code.

.globl _start
_start: b start_code
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used
ldr pc, _irq
ldr pc, _fiq

_undefined_instruction: .word undefined_instruction
_software_interrupt: .word software_interrupt
_prefetch_abort: .word prefetch_abort
_data_abort: .word data_abort
_not_used: .word not_used
_irq: .word irq
_fiq: .word fiq

.balignl 16,0xdeadbeef


What is this code will do? as i believe the instruction "b start_code" will
branch it to start_code then how does the other code below branch
instruction will work?

3) where does exception vector table located during power on? on boot rom or
at any other place?


Thanks & Regards,
Asmit Patel"

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

* [U-Boot] Regarding Start.S file
  2011-09-14 17:22 [U-Boot] Regarding Start.S file Asmit Patel
@ 2011-09-14 17:48 ` Asmit Patel
  2011-09-14 18:10   ` Albert ARIBAUD
  2011-09-14 18:13   ` Marek Vasut
  0 siblings, 2 replies; 4+ messages in thread
From: Asmit Patel @ 2011-09-14 17:48 UTC (permalink / raw)
  To: u-boot

Hi All,
I am new to u-boot and ARM. I am trying to understand uboot thtough start.S
file.
I have few questions about it.
1) What is the deifference between ARM Supervisior and User mode. why uboot
is not running in user mode?
2) At the start of startup file I found below code.

 .globl _start
 _start: b start_code
ldr pc, _undefined_instruction
 ldr pc, _software_interrupt
 ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used
ldr pc, _irq
ldr pc, _fiq

_undefined_instruction: .word undefined_instruction
_software_interrupt: .word software_interrupt
 _prefetch_abort: .word prefetch_abort
_data_abort: .word data_abort
 _not_used: .word not_used
_irq: .word irq
 _fiq: .word fiq

 .balignl 16,0xdeadbeef


What is this code will do? as i believe the instruction "b start_code" will
branch it to start_code then how does the other code below branch
instruction will work?

3) where does exception vector table located during power on? on boot rom or
at any other place?


Thanks & Regards,
Asmit Patel"

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

* [U-Boot] Regarding Start.S file
  2011-09-14 17:48 ` Asmit Patel
@ 2011-09-14 18:10   ` Albert ARIBAUD
  2011-09-14 18:13   ` Marek Vasut
  1 sibling, 0 replies; 4+ messages in thread
From: Albert ARIBAUD @ 2011-09-14 18:10 UTC (permalink / raw)
  To: u-boot

Hi Asmit,

Le 14/09/2011 19:48, Asmit Patel a ?crit :
> Hi All,
> I am new to u-boot and ARM. I am trying to understand uboot thtough start.S
> file.
> I have few questions about it.

As the custodian for the ARM u-boot repository, I feel compelled to try 
and answer your questions. :)

> 1) What is the deifference between ARM Supervisior and User mode. why uboot
> is not running in user mode?

As for the difference between ARM user and supervisor modes, you should 
go to the ARM Ltd. website and look up their documentation, especially 
the ISA Reference Manual for the specific ISA you're interested in. 
However, in a very broad and inexact way, user mode is for application 
code and has restrictions on some instructions, while supervisor mode is 
for OS code and has no restrictions -- which explains why U-Boot is in 
user mode.

> 2) At the start of startup file I found below code.
>
>   .globl _start
>   _start: b start_code
> ldr pc, _undefined_instruction
>   ldr pc, _software_interrupt
>   ldr pc, _prefetch_abort
> ldr pc, _data_abort
> ldr pc, _not_used
> ldr pc, _irq
> ldr pc, _fiq
>
> _undefined_instruction: .word undefined_instruction
> _software_interrupt: .word software_interrupt
>   _prefetch_abort: .word prefetch_abort
> _data_abort: .word data_abort
>   _not_used: .word not_used
> _irq: .word irq
>   _fiq: .word fiq
>
>   .balignl 16,0xdeadbeef
>
>
> What is this code will do? as i believe the instruction "b start_code" will
> branch it to start_code then how does the other code below branch
> instruction will work?

That's where you should really go to the ARM Ltd. documentation, because 
this code is nothing U-Boot specific and purely derived from ARM 
architecture.

> 3) where does exception vector table located during power on? on boot rom or
> at any other place?

Again, this is not an U-Boot related question; this time, it is a core 
or even SoC or board specific thing, as various platforms have various 
boot processes.

> Thanks&  Regards,
> Asmit Patel"

Amicalement,
-- 
Albert.

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

* [U-Boot] Regarding Start.S file
  2011-09-14 17:48 ` Asmit Patel
  2011-09-14 18:10   ` Albert ARIBAUD
@ 2011-09-14 18:13   ` Marek Vasut
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2011-09-14 18:13 UTC (permalink / raw)
  To: u-boot

On Wednesday, September 14, 2011 07:48:12 PM Asmit Patel wrote:
> Hi All,
> I am new to u-boot and ARM. I am trying to understand uboot thtough start.S
> file.
> I have few questions about it.
> 1) What is the deifference between ARM Supervisior and User mode. why uboot
> is not running in user mode?

SVC has the biggest privileges (can do everything, no restrictions).

> 2) At the start of startup file I found below code.
> 
>  .globl _start
>  _start: b start_code
> ldr pc, _undefined_instruction
>  ldr pc, _software_interrupt
>  ldr pc, _prefetch_abort
> ldr pc, _data_abort
> ldr pc, _not_used
> ldr pc, _irq
> ldr pc, _fiq
> 
> _undefined_instruction: .word undefined_instruction
> _software_interrupt: .word software_interrupt
>  _prefetch_abort: .word prefetch_abort
> _data_abort: .word data_abort
>  _not_used: .word not_used
> _irq: .word irq
>  _fiq: .word fiq
> 
>  .balignl 16,0xdeadbeef
> 
> 
> What is this code will do? as i believe the instruction "b start_code" will
> branch it to start_code then how does the other code below branch
> instruction will work?

Upon exception, the CPU jumps to the exception vector, this is the vectoring 
jumptable here. So ... if you get for example "irq exception", aka interrupt 
happens, the cpu jumps to fixed address 0x14. This here then jumps to the real 
handler.

> 
> 3) where does exception vector table located during power on? on boot rom
> or at any other place?

Depends on the CPU and the initial memory mapping. If U-Boot is in NOR mapped to 
0x0, it's the stuff above. It can be in bootrom, but that depends.
> 
> 
> Thanks & Regards,
> Asmit Patel"

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

end of thread, other threads:[~2011-09-14 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-14 17:22 [U-Boot] Regarding Start.S file Asmit Patel
2011-09-14 17:48 ` Asmit Patel
2011-09-14 18:10   ` Albert ARIBAUD
2011-09-14 18:13   ` Marek Vasut

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