* [U-Boot] mcf5307, timer 2 issue loading linux
@ 2011-08-03 8:09 angelo
2011-08-03 12:50 ` Greg Ungerer
2011-08-03 13:07 ` Wolfgang Denk
0 siblings, 2 replies; 5+ messages in thread
From: angelo @ 2011-08-03 8:09 UTC (permalink / raw)
To: u-boot
Hi all,
i am reporting the following issue, maybe related to something wrong in
my new mcf5307 support addition (still under testing), or maybe not:
1. U-Boot run correctly, timer2 is enabled as a system timestamp counter.
2. I load a uClinux bianry from flash to SDRAM with "cp.l FLASH_ADDR
SDRAM_ADDR SIZE/4
3. i launch the binary with "go SDRAM_ADDR"
First startup of linux (head.S) is locked, since U-boot timer2 interrupt
happen, exactly while linux startup (in head.S) is moving ROMFS inside
sdram.
After the interrupt happen, i was assuming it return correctly allowing
linux to load, but execution is locked inside this ROMFS copy of head.S.
Disabling the timer2 init in board.c, linux is loaded as expected.
Shouldn't timer2 be disabled for al coldfire models before loading linux ?
Every help is appreciated.
reagrds,
angelo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] mcf5307, timer 2 issue loading linux
2011-08-03 8:09 [U-Boot] mcf5307, timer 2 issue loading linux angelo
@ 2011-08-03 12:50 ` Greg Ungerer
2011-08-03 13:06 ` angelo
2011-08-03 13:07 ` Wolfgang Denk
1 sibling, 1 reply; 5+ messages in thread
From: Greg Ungerer @ 2011-08-03 12:50 UTC (permalink / raw)
To: u-boot
Hi Angelo,
On 08/03/2011 06:09 PM, angelo wrote:
> i am reporting the following issue, maybe related to something wrong in
> my new mcf5307 support addition (still under testing), or maybe not:
>
>
> 1. U-Boot run correctly, timer2 is enabled as a system timestamp counter.
> 2. I load a uClinux bianry from flash to SDRAM with "cp.l FLASH_ADDR
> SDRAM_ADDR SIZE/4
> 3. i launch the binary with "go SDRAM_ADDR"
>
> First startup of linux (head.S) is locked, since U-boot timer2 interrupt
> happen, exactly while linux startup (in head.S) is moving ROMFS inside
> sdram.
> After the interrupt happen, i was assuming it return correctly allowing
> linux to load, but execution is locked inside this ROMFS copy of head.S.
>
> Disabling the timer2 init in board.c, linux is loaded as expected.
>
> Shouldn't timer2 be disabled for al coldfire models before loading linux ?
What interrupt level is timer2 set to?
The second instruction into running uClinux is:
movew #0x2700, %sr
which will disable all interrupts - excepting anything set to the
non-maskable level 7.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg at snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close, FAX: +61 7 3891 3630
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] mcf5307, timer 2 issue loading linux
2011-08-03 12:50 ` Greg Ungerer
@ 2011-08-03 13:06 ` angelo
0 siblings, 0 replies; 5+ messages in thread
From: angelo @ 2011-08-03 13:06 UTC (permalink / raw)
To: u-boot
Hi all,
finally this is what seems to happen:
1. U-boot setup timer 2 using LEVEL 7 autovectored interrupt. For this case
the uClinux " movew #0x2700, %sr " in head.S don't disable the timer
interrupt.
2. execution of uClinux proceed into head.S, rewriting %a7 (%sp) just
after writing
%sr.
3. at a certain (probably variable) moment, timer interrupt happen, and
since the
stack pointer is no more valid, it seems to get stucked and can't return
correctly.
Solution (temporary, RFC)
uBoot command bootm allows an "arch_preboot_os()":
cmd_bootm.c
case BOOTM_STATE_OS_GO:
disable_interrupts();
arch_preboot_os();
boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
break;
I used it to disable LEVEL7 interrupt. Next os loading works.
NOTE: For this issue using command "go" is not possible, since it is not
meant for os loading,
and don't do any arch_preboot_os(); .
What i still don't understand is why this issue is not happening on
other coldfire models that have
UBoot and uClinux. Probably they are faster, and head.S can be processed
and timers re-initialized before interrupt occours.
Let me know your thoughts.
Regards,
angelo
On 03/08/2011 14:50, Greg Ungerer wrote:
> Hi Angelo,
>
> On 08/03/2011 06:09 PM, angelo wrote:
>> i am reporting the following issue, maybe related to something wrong in
>> my new mcf5307 support addition (still under testing), or maybe not:
>>
>>
>> 1. U-Boot run correctly, timer2 is enabled as a system timestamp
>> counter.
>> 2. I load a uClinux bianry from flash to SDRAM with "cp.l FLASH_ADDR
>> SDRAM_ADDR SIZE/4
>> 3. i launch the binary with "go SDRAM_ADDR"
>>
>> First startup of linux (head.S) is locked, since U-boot timer2 interrupt
>> happen, exactly while linux startup (in head.S) is moving ROMFS inside
>> sdram.
>> After the interrupt happen, i was assuming it return correctly allowing
>> linux to load, but execution is locked inside this ROMFS copy of head.S.
>>
>> Disabling the timer2 init in board.c, linux is loaded as expected.
>>
>> Shouldn't timer2 be disabled for al coldfire models before loading
>> linux ?
>
> What interrupt level is timer2 set to?
>
> The second instruction into running uClinux is:
>
> movew #0x2700, %sr
>
> which will disable all interrupts - excepting anything set to the
> non-maskable level 7.
>
> Regards
> Greg
>
>
> ------------------------------------------------------------------------
> Greg Ungerer -- Principal Engineer EMAIL: gerg at snapgear.com
> SnapGear Group, McAfee PHONE: +61 7 3435 2888
> 8 Gardner Close, FAX: +61 7 3891 3630
> Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
--
.:.:.SYSAM.:.:.
di Angelo Dureghello
via San Nazario 149
34151, Trieste, Italy
++39 340 7631990
www.sysam.it <http://www.sysam.it>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.png
Type: image/png
Size: 3033 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110803/e78b93b9/attachment.png
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] mcf5307, timer 2 issue loading linux
2011-08-03 8:09 [U-Boot] mcf5307, timer 2 issue loading linux angelo
2011-08-03 12:50 ` Greg Ungerer
@ 2011-08-03 13:07 ` Wolfgang Denk
2011-08-03 13:29 ` angelo
1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2011-08-03 13:07 UTC (permalink / raw)
To: u-boot
Dear angelo,
In message <4E390235.2090107@gmail.com> you wrote:
>
> i am reporting the following issue, maybe related to something wrong in
> my new mcf5307 support addition (still under testing), or maybe not:
>
>
> 1. U-Boot run correctly, timer2 is enabled as a system timestamp counter.
> 2. I load a uClinux bianry from flash to SDRAM with "cp.l FLASH_ADDR
> SDRAM_ADDR SIZE/4
> 3. i launch the binary with "go SDRAM_ADDR"
You must not start Linux with a "go" command. Please use "bootm" for
this purpose (and then you also don;t have to copy the kernal
manually).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the beginning, I was made. I didn't ask to be made. No one consul-
ted with me or considered my feelings in this matter. But if it
brought some passing fancy to some lowly humans as they haphazardly
pranced their way through life's mournful jungle, then so be it.
- Marvin the Paranoid Android
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] mcf5307, timer 2 issue loading linux
2011-08-03 13:07 ` Wolfgang Denk
@ 2011-08-03 13:29 ` angelo
0 siblings, 0 replies; 5+ messages in thread
From: angelo @ 2011-08-03 13:29 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
i confirm that before the patch/solution applied (i just posted it), i
also tried "bootm FLASH_ADDR". Same result, loading fail, since timer2
interrupt is not stopped and the interrupt happen just after the linux
head.S execution.
As i said, probably this issue was not visible in other coldfire models
since mcf5307 run at 90mhz only.
I have copied the "arch_preboot_os()" solution from other boards, that
was doing the same thing, disabling async interrupts before loading the os.
Regards,
angelo
On 03/08/2011 15:07, Wolfgang Denk wrote:
> Dear angelo,
>
> In message<4E390235.2090107@gmail.com> you wrote:
>
>> i am reporting the following issue, maybe related to something wrong in
>> my new mcf5307 support addition (still under testing), or maybe not:
>>
>>
>> 1. U-Boot run correctly, timer2 is enabled as a system timestamp counter.
>> 2. I load a uClinux bianry from flash to SDRAM with "cp.l FLASH_ADDR
>> SDRAM_ADDR SIZE/4
>> 3. i launch the binary with "go SDRAM_ADDR"
>>
> You must not start Linux with a "go" command. Please use "bootm" for
> this purpose (and then you also don;t have to copy the kernal
> manually).
>
> Best regards,
>
> Wolfgang Denk
>
>
--
.:.:.SYSAM.:.:.
di Angelo Dureghello
via San Nazario 149
34151, Trieste, Italy
++39 340 7631990
www.sysam.it <http://www.sysam.it>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.png
Type: image/png
Size: 3033 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110803/187428aa/attachment.png
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-03 13:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-03 8:09 [U-Boot] mcf5307, timer 2 issue loading linux angelo
2011-08-03 12:50 ` Greg Ungerer
2011-08-03 13:06 ` angelo
2011-08-03 13:07 ` Wolfgang Denk
2011-08-03 13:29 ` angelo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox