Re: Launch(UINT32 pFunc) function at startup.s

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



hi,

ROMHDR at Address 80100044h
Download successful!
Jumping to image at 0x80101000 (physical 0xA0101000)...
!OEMEthGetFrame
Got EDBG_CMD_JUMPIMG
Got EDBG_CMD_CONFIG, flags:0x0000000F

what i can understand from this is that ..first u r making RAM image ,2nd u
r enabling KITL and 3rd i guess is ur not configuring KITL so ur system just
is waiting for KITL connection.
i see ur address seems pretty OK.
can u disable KITL and/or make flash image and try if you are succesful.
if so ,pls do configure ur KITL.

cheers
regards
Umesh
"sathiyakeerthi" wrote:


Hi,
I am understanding that the OALStartup is the first module of Kernel image.
so after jumb to Launch physical address, OALStartup will start to execute
automatically. is my understanding wrong? do i need to call the OALStartup
after launch? But i am in confuse that OEM bootloader startup file name and
OEM OAL startup file name are same as "OALStartUp.s". let me know how to
call the OEM OAL startup after launch.
Thanks for your Patient replies for this beginner.





"Voidcoder" wrote:

Where does your OALStartUp call come from?
Can you confirm that the function is really called?


"sathiyakeerthi" <sathiyakeerthi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A58DCEB5-89C9-4457-A0FA-C9FBF2A35E3B@xxxxxxxxxxxxxxxx
Hi ,
Thanks for you deatiled reply.now the problem is not Jump to the physical
launch address. because the LEDs are not glowing inside the OAL startup
module. and How can i find that i am succesfully jumb to kernelstart ?
here i have given the startup.s file.. please go through this file and
suggest me.


File: startup.s
;
; Kernel startup routine for the Intel Mainstone II board.
;
;------------------------------------------------------------------------------
INCLUDE kxarm.h
INCLUDE bulverde.inc
INCLUDE sandgateii.inc
INCLUDE xlli_Bulverde_defs.inc


IMPORT KernelStart

TEXTAREA

;------------------------------------------------------------------------


; Include memory configuration file with g_oalAddressTable
;
INCLUDE oemaddrtab_cfg.inc

;-------------------------------------------------------------------------------
;
; OALStartUp: OEM OAL startup code.
;
; Inputs: None.
;
; On return: N/A.
;
; Register used: r0
;
;-------------------------------------------------------------------------------
;
ALIGN
LEAF_ENTRY OALStartUp

; Initialize the hex LEDs on the Mainstone II board. These use GPIOs
which were
; configured in the OALXScaleSetFrequencies callback during clock
initialization.
;
bl Init_HexLEDs

; Compute the OEMAddressTable's physical address and
; load it into r0. KernelStart expects r0 to contain
; the physical address of this table. The MMU isn't
; turned on until well into KernelStart.
;
add r0, pc, #g_oalAddressTable - (. + 8)
mov r11, r0
b KernelStart
nop
nop
nop
nop
nop
nop

STALL
b STALL ; Spin forever.


;-------------------------------------------------------------------------------
;
; Init_HexLEDs: Initializes the Mainstone II board logic to enable the hex
LEDs.
;
; Inputs: None.
;
; On return: N/A.
;
; Register used: r0-r3
;
;-------------------------------------------------------------------------------
;
ALIGN
Init_HexLEDs

;;;;;;;;;;;;;;;;Glow all led106;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ldr r4,=0x40E00000
mov r1,#0x1E00
str r1, [r4,#0x124]

mov r1,#0x1E00
str r1, [r4,#0x10c]

mov r1,#0x1E00
str r1, [r4,#0x118]


;;;;;;;;;;;;;;;;;;;;;END;;;;;;;;;;;;;;;;;;;;;;;;;;;;SATHIYA

IF Interworking :LOR: Thumbing
bx lr
ELSE
mov pc, lr ; Return to caller.
ENDIF



;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------

LTORG ; insert a literal pool here.

;
; TURN_ON_BTB - Enables the Branch Target Buffer
;
; Turn on the BTB via cp15.1[11] - Uses r0
;
;
LEAF_ENTRY TURN_ON_BTB

mcr p15, 0, r0, c7, c5, 0 ; flush the icache & BTB
mrc p15, 0, r0, c1, c0, 0
orr r0, r0, #0x800
mcr p15, 0, r0, c1, c0, 0

IF Interworking :LOR: Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF


END

;------------------------------------------------------------------------------



"voidcoder" wrote:

Basically the flow looks like this:

1. Bootloader jumps to !OS! StartUp function. Note in some
BSPs the same StartUp code is shared between the bootoader
and OS startup code. In that case the flow is controled
using preprocessor conditional statements or just simple
PC address checking.

2. StartUp function turns off MMU and caches (if needed).

3. StartUp function performs some additional configuration,
eg. default I/O configuration, default core clock and voltage,
default memory controller settings, switching CPU to supervisor
mode, etc etc etc. This part is platform specific.

Note on some platforms the same StartUp function handles
all sort of resets, including "resume" etc. So you may find
some conditional branching here, depending on the
actual reset reason ...

4. StartUp function jumps to kernel initialization function
KernelStart. For ARM based devices this function takes
one 32-bit parameter: pointer to OAMAddressTable,
passed via R0 register. Something like this:

IMPORT KernelStart

add r0, pc, #OEMAddressTable - (. + 8)
b KernelStart

5. Kernel initializes the first level pages and turns on MMU
and caches.

6. Kernel configures stacks for each mode as it must be prepared
to handle interrupts once you turn the interrupts on in your
OEMInit().

7. Kernel calls OEMInitDebugSerial() function to give you a
chance to initialize the debug serial port.

8. Kernel calls OEMInit() function, where you normally perform
the following actions:

- Perform any sort of hardware initialization, that can not be
handled later by the device drivers or just needed at earlier
boot phase.

- Configure the system timer.

- Initialize KITL connection.

- Anything else (platform specific)

- Configure the interrupt controller, setup interrupt mapping tables,
and finally, unmask system tick interrupt.

- return the control to the kernel.


"sathiyakeerthi" <sathiyakeerthi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2455CD3B-8676-4B59-B546-98E56E0C7EEC@xxxxxxxxxxxxxxxx
Greatttt, Now LED can glow in Launch function. Thanks for you help. I need
more help regarding launch the image.now i can understand that i am inside
the launch function. ie.
please explain ,what will happen after this launch function ? from where
the OAL startup function was called? (There are 2 OAL startup functions in
OAL directry and eboot directry, so i confused)
i feel till now not Jump to the physical launch address. please let me
know
solution.


thanks
sathiya.

"Voidcoder" wrote:

Well, your address seems to be ok. But I think MMU is still
ON when you jump to Launch() function. Are you sure that
you can access MAINSTONEII_GPIO_HIGH::0x40E00000
(!physical address!) at this point? Note this is only possible
if you have a corresponding virtual memory mapping.

My guess is that CPU registers are mapped to a different
location, at least your OEM address table shows:

DCD 0x84500000, 0x40000000, 32 ; Memory-mapped registers

So your MAINSTONEII_GPIO_HIGH (Virtual Cached) =
0x84500000 + 0x00E00000 = 0x85300000

Normally virtual memory is configured as follow:

0x80000000 - 0x9FFFFFFF -> CACHED
0xA0000000 - 0xBFFFFFFF -> UNCACHED

In order to convert your address to uncached you have to
set "uncached" bit 0x20000000.

MAINSTONEII_GPIO_HIGH (Virtual Uncached) =
Virtual Cached + 0x20000000 =
0x85300000 + 0x20000000 =
0xA5300000


Your led blinking code at this point
(with MMU turned ON):

;;;;;;;;;;;;;;;;Glow all led;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
ldr r4,=0xA5300000 ; (Virtual Uncached)
mov r1,#0x1E00
str r1, [r4,#0x124]

mov r1,#0x1E00
str r1, [r4,#0x10c]

mov r1,#0x1E00
str r1, [r4,#0x118]



"sathiyakeerthi" <sathiyakeerthi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:BFF9B708-ADB4-4AC9-8CEE-68E91653C54A@xxxxxxxxxxxxxxxx

Hello Mr. Voice coder,

Thanks. As your Guidance I have checked the startup address in
Kern.map,
kernkitl.map, kernkitl.map, kernkitlprof.map.

0001:00000000 StartUp 00011000
oal_startup_pxa27x:startup.obj


My entry point address is 0x80101000(physical 0xA0101000)
.



Relevant Pages

  • Re: Launch(UINT32 pFunc) function at startup.s
    ... I am understanding that the OALStartup is the first module of Kernel image. ... so after jumb to Launch physical address, ... OEM OAL startup file name are same as "OALStartUp.s". ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Launch(UINT32 pFunc) function at startup.s
    ... Kernel startup routine for the Intel Mainstone II board. ... OALStartUp: OEM OAL startup code. ... StartUp function jumps to kernel initialization function ... more help regarding launch the image.now i can understand that i am inside ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Installing Two Operating Systems 4 Speed
    ... Log on under your own account. ... Launch msconfig.exe via the Start/Run menu. ... Click the Startup tab in MSConfig. ... While installing two versions of Windows might speed up your wife's ...
    (microsoft.public.windowsxp.general)
  • Re: Installing Two Operating Systems 4 Speed
    ... Log on under your own account. ... Launch msconfig.exe via the Start/Run menu. ... Click the Startup tab in MSConfig. ... While installing two versions of Windows might speed up your wife's ...
    (microsoft.public.windowsxp.general)
  • Re: Startup Problem
    ... on some machines it cannot start during Windows startup. ... > 1) The program is a MFC ActiveX container app. ... > launch it manually. ... Startup folder instead of using the Run key. ...
    (microsoft.public.vc.mfc)