All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Enabling caches on MPC8270
@ 2005-02-28 17:32 Martin Klonfar
  2005-02-28 18:17 ` Jerry Van Baren
  2005-02-28 20:01 ` Wolfgang Denk
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Klonfar @ 2005-02-28 17:32 UTC (permalink / raw)
  To: u-boot

I am developing a standalone aplication for MPC8270 (PM827 board),
but I have the U-Boot 1.0.1 for, say, "inspiration" as well. I can
not force the CPU to use caches. I use the standard (i.e.
documented) technique - setting the ICE/DCE and ICFI/DCFI bits in
HID0 and then clearing the ICFI/DCFI bits. I have also tried to set
the IFEM and ABE bits (although I don't see any reason for it in
single-processor system) - inspiration by U-Boot :-) - with no
result. CPU either gets 'crazy', decrementing the PC instead of
incrementing it, or it just doesn't work correctly (for example CRC
verification, which normally passes through, suddenly doesn't). No
address translation mechanism is activated. When I let the U-Boot
to initialize the CPU, the instruction cache works. Then I can
reset the CPU, use my initialization code, and it works as well. Is
there some other control of the caches in addition to HID0 and HID2?
 Enabling the data cache makes the CPU 'crazy' in either case (i.e.
even after initialization by the U-Boot). Thanks for any hint.
   Martin


-- 
Levn?j?? internet v pracovn? dny ji? od 18:00 hod.
Surfujte s VOLN?!
http://mimospicku.volny.cz

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

* [U-Boot-Users] Enabling caches on MPC8270
  2005-02-28 17:32 [U-Boot-Users] Enabling caches on MPC8270 Martin Klonfar
@ 2005-02-28 18:17 ` Jerry Van Baren
  2005-02-28 20:01 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry Van Baren @ 2005-02-28 18:17 UTC (permalink / raw)
  To: u-boot

Martin Klonfar wrote:
> I am developing a standalone aplication for MPC8270 (PM827 board),
> but I have the U-Boot 1.0.1 for, say, "inspiration" as well. I can
> not force the CPU to use caches. I use the standard (i.e.
> documented) technique - setting the ICE/DCE and ICFI/DCFI bits in
> HID0 and then clearing the ICFI/DCFI bits. I have also tried to set
> the IFEM and ABE bits (although I don't see any reason for it in
> single-processor system) - inspiration by U-Boot :-) - with no
> result. CPU either gets 'crazy', decrementing the PC instead of
> incrementing it, or it just doesn't work correctly (for example CRC
> verification, which normally passes through, suddenly doesn't). No
> address translation mechanism is activated. When I let the U-Boot
> to initialize the CPU, the instruction cache works. Then I can
> reset the CPU, use my initialization code, and it works as well. Is
> there some other control of the caches in addition to HID0 and HID2?
>  Enabling the data cache makes the CPU 'crazy' in either case (i.e.
> even after initialization by the U-Boot). Thanks for any hint.
>    Martin

I don't know if this is your problem, but your disavowing of using the 
memory management makes me suspicious that it is...

You need to set up the memory management to mark your I/O memory areas 
non-cached.  When you turn on caches, they apply to the _whole_ memory 
space unless otherwise marked "non cached."  For simple programs like 
u-boot and, most likely, yours, the BATs (especially DBAT) is 
sufficient.  Linux uses the full blown page tables which gets a little 
more complex ;-).

gvb

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

* [U-Boot-Users] Enabling caches on MPC8270
  2005-02-28 17:32 [U-Boot-Users] Enabling caches on MPC8270 Martin Klonfar
  2005-02-28 18:17 ` Jerry Van Baren
@ 2005-02-28 20:01 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2005-02-28 20:01 UTC (permalink / raw)
  To: u-boot

In message <2c5004c14f78da7fb3bda80a35e456cc@www4.mail.volny.cz> you wrote:
> I am developing a standalone aplication for MPC8270 (PM827 board),
> but I have the U-Boot 1.0.1 for, say, "inspiration" as well. I can
> not force the CPU to use caches. I use the standard (i.e.

This is an old story: enabling instruction cache => using burst  mode
to fetch instructions => stress for the SDRAMs.

> result. CPU either gets 'crazy', decrementing the PC instead of
> incrementing it, or it just doesn't work correctly (for example CRC
> verification, which normally passes through, suddenly doesn't). No

Memory problems?

> address translation mechanism is activated. When I let the U-Boot
> to initialize the CPU, the instruction cache works. Then I can
> reset the CPU, use my initialization code, and it works as well. Is

Memroy problems?

> there some other control of the caches in addition to HID0 and HID2?

You didn't write if you're trying to execute yoiur code  from  SDRAM,
but it sounds is if you would. In this case see the FAQ:
http://www.denx.de/twiki/bin/view/DULG/UBootCrashAfterRelocation

>  Enabling the data cache makes the CPU 'crazy' in either case (i.e.
> even after initialization by the U-Boot). Thanks for any hint.

This is normal on a MPC82xx processor. An explanation can be found in
the README (search for IMMR).

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.

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

end of thread, other threads:[~2005-02-28 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-28 17:32 [U-Boot-Users] Enabling caches on MPC8270 Martin Klonfar
2005-02-28 18:17 ` Jerry Van Baren
2005-02-28 20:01 ` Wolfgang Denk

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.