All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] linux doesn't boot when CS for initial cache disabled
@ 2003-05-09 15:52 Thomas Schäfer
  2003-05-09 18:48 ` Kenneth Johansson
  2003-05-10 16:53 ` Wolfgang Denk
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Schäfer @ 2003-05-09 15:52 UTC (permalink / raw)
  To: u-boot

Hi all,

I want to port u-boot to a custom board based on the walnut board where
CS0-CS7 are in use by separate chips. I tried to program CS4, which is used
for temporary stack and data before relocation, with the settings for a chip
after the relocation has been done. u-boot seems to work fine with this
setting, global data structure and board info structure are located in RAM
and contain the correct values. Loading a kernel via tftp works without
problems. As soon as I'm trying to boot the kernel, the system hangs after
the kernel has been uncompressed. Trying to debug the kernel boot sequence,
I found that the function reloc_offset seems to hang in an endless loop.

My question is: why is that CS for the temporary stack of u-boot important
for the start sequence of the linux kernel? The Readme says that this stack
and data area is only used before relocation of u-boot.

Any comments would be appreciated

Best regards,

Thomas Sch?fer

____________________________________

GIGA STREAM - UMTS Technologies GmbH

Konrad-Zuse-Str. 7
66115 Saarbr?cken

Tel.: + 49 (0)681 / 95916 - 203
Fax:  + 49 (0)681 / 95916 - 100
E-mail: tschaefer at giga-stream.de

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [U-Boot-Users] linux doesn't boot when CS for initial cache disabled
@ 2003-05-12 18:14 Thomas Schäfer
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Schäfer @ 2003-05-12 18:14 UTC (permalink / raw)
  To: u-boot

Here is what I did:

I'm testing with an IBM Walnut board (PPC405GP) with u-boot 0.3.0 and 2.4.17
kernel from Montavista. After booting u-boot and loading the kernel via
tftp, I submit the following commands on the console:

=> setdcr 12
0012: 00000004 ? 7
0012: 00000007 ? .
=> setdcr 13
0013: 400da000 ? 0
0013: 00000000 ? .

This disables CS7, which is used for the temporary stack in my
configuration.

The kernel function start_here (arch/ppc/kernel/head_4xx.S) is the place
where the MMU is used first. Setting a breakpoint (in my case at 0xc00022d0)
and trying to trace from this point with my BDI2000 results in a data
machine check interrupt:

BDI>bi 0xc00022d0
Breakpoint identification is 0
BDI>go
- TARGET: target has entered debug mode
BDI>info
    Target state      : debug mode
    Debug entry cause : instruction breakpoint
    Current PC        : 0xc00022d0
    Current CR        : 0x24004004
    Current MSR       : 0x00001030
    Current LR        : 0x0000001c
BDI>ti
    Target state      : debug mode
    Debug entry cause : JTAG stop request
    Current PC        : 0x00000280
    Current CR        : 0x28004004
    Current MSR       : 0x00000000
    Current LR        : 0xc0002b34
# Step timeout detected
BDI>

Unfortunately I have no idea why this happens. Looking at the register
contents I found that the address of the temporary stack (0x40000000) is
still stored in r2, but this should have no effect on booting the kernel???

BDI>rd
GPR00: c00022d0 07f9f5e8 40000000 c10003c0
GPR04: c0000000 00000000 007ffc00 007ffc0e
GPR08: 07fc9f10 000186a0 00000003 00000002
GPR12: 00000000 c01605b0 07fe5800 00000000
GPR16: 00000001 007ffc0e 007ffc00 ffffffff
GPR20: 00000000 07fe2398 07f9fe88 00000002
GPR24: 00000000 00000000 007ffb90 007ffc0e
GPR28: 007ffc00 00000000 00000000 007ffb90
CR   : 24004004     MSR: 00001030
BDI>

Any ideas?

Best regards,

Thomas Schaefer

____________________________________

GIGA STREAM - UMTS Technologies GmbH

Konrad-Zuse-Str. 7
66115 Saarbr?cken

Tel.: + 49 (0)681 / 95916 - 203
Fax:  + 49 (0)681 / 95916 - 100
E-mail: tschaefer at giga-stream.de

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [U-Boot-Users] linux doesn't boot when CS for initial cache disabled
@ 2003-05-27 13:39 Thomas Schäfer
  2003-05-27 14:43 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Schäfer @ 2003-05-27 13:39 UTC (permalink / raw)
  To: u-boot

Hi all,

I'm testing with an IBM Walnut board (PPC405GP) with u-boot 0.3.0 and 2.4.17
kernel from Montavista. After booting u-boot and loading the kernel via
tftp, I submit the following commands on the console:

=> setdcr 12
0012: 00000004 ? 7
0012: 00000007 ? .
=> setdcr 13
0013: 400da000 ? 0
0013: 00000000 ? .

This disables CS7, which is used for the temporary stack in my
configuration.

After that, I can still load a linux kernel via tftp, but it hangs in the
early bootup sequence when turning the MMU on.

I found that the data cache for the temporary stack has to be flushed and
disabled before the CS for the temporary stack is disabled. I changed the
u-boot code at this point and everything worked fine.

Here the changes in the code are summarized:

/board/walnut405/walnut405.c:
- The function board_pre_init was divided and a new function
board_pre_init_r was created, which contains the EBC programming

/include/common.h:
- The prototype for board_pre_init_r was added

/cpu/ppc4xx/cpu_init.c
- In the cpu_init_r function, data cache is flushed and disabled first.
After that the CS for the temporary stack is disabled and board_pre_init is
called to program the EBC. This means that the EBC is programmed later in
the boot process than before, but EBC programming seems not to be necessary
that early (with the exception of the CS for the NVRAM, where the
programming was left in board_pre_init).
- In the cpu_init_f function, the EBC programming code was moved into
cpu_init_r.

I had to do those changes, because all available CS lines are used on one of
our custom boards. Now I have the possibility to use a CS for the temporary
stack in early boot stage and for hardware devices after relocation.

If the changes are of some use for the project, I can provide a patch.

Best regards,

Thomas Sch?fer

____________________________________

GIGA STREAM - UMTS Technologies GmbH

Konrad-Zuse-Str. 7
66115 Saarbr?cken

Tel.: + 49 (0)681 / 95916 - 203
Fax:  + 49 (0)681 / 95916 - 100
E-mail: tschaefer at giga-stream.de

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

end of thread, other threads:[~2003-05-27 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-09 15:52 [U-Boot-Users] linux doesn't boot when CS for initial cache disabled Thomas Schäfer
2003-05-09 18:48 ` Kenneth Johansson
2003-05-10 16:53 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 18:14 Thomas Schäfer
2003-05-27 13:39 Thomas Schäfer
2003-05-27 14:43 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.