linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* IMAP_ADDR on PPC 8xx
@ 2006-05-08 17:23 Walter L. Wimer III
  2006-05-08 22:46 ` Wolfgang Denk
  0 siblings, 1 reply; 13+ messages in thread
From: Walter L. Wimer III @ 2006-05-08 17:23 UTC (permalink / raw)
  To: linuxppc-embedded


Hi Everyone,

I'm looking for wisdom/understanding about IMAP_ADDR on PPC 8xx
platforms.

In particular, I have an MPC885ADS board running "U-Boot 1.1.3 (Apr 19
2005 - 13:39:58)".  It will boot neither 2.6.15 nor 2.6.16.11.  After
U-Boot decompresses the kernel, I get no kernel output at all; it just
hangs.

After some debugging, I think things go awry when the code starts
dereferencing IMAP_ADDR as a direct pointer.  IMAP_ADDR is defined to be
0xFF000000, but the MPC885ADS documentation says that the internal
memory map is supposed to at 0x22000000.  In addition, when I look at
the bd_t pointer from U-Boot, it's saying that 0x22000000 is the correct
address.

We have a 2.6.11.7 kernel that successfully boots on this board.  The
port was done by another engineer who has moved on to another job.  His
port includes a patch that replaces all references to IMAP_ADDR with a
global pointer that is initialized using io_remap() of the internal map
value from the U-Boot bd_t structure.

Why is this a problem for us and apparently not for anyone else on this
list?  Is no one else using U-Boot?  Or does everyone else's U-Boot use
0xFF000000 instead of 0x22000000?  Or do I have a different problem
entirely?  :-)

While reading through the archives, I see that using IMAP_ADDR the way
it is currently used is somewhat frowned upon anyway.  Is this one of
those things that we (the PPC Linux community) should fix the "right
way" once and for all?  I'm happy to submit a patch once I understand
what the "right way" is...  :-)



Thanks!!!

Walt Wimer
TimeSys Corporation

^ permalink raw reply	[flat|nested] 13+ messages in thread
* IMAP_ADDR on PPC 8xx
@ 2006-05-09 18:38 Kenneth Poole
  2006-05-09 19:52 ` Walter L. Wimer III
  0 siblings, 1 reply; 13+ messages in thread
From: Kenneth Poole @ 2006-05-09 18:38 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

In our build, (currently based on 2.6.14.3) we define IMAP_ADDR as
follows:

#define	IMAP_ADDR	(((bd_t *)__res)->bi_immr_base)

With very few exceptions, nearly all driver code that dereferences
IMAP_ADDR can be used unchanged and the IMMR value is always the value
passed up from the bootloader. We build one image that runs on multiple
platforms and some platforms place the IMMR address space at different
addresses than others. It's not a constant.

Regardless, I see little reason to ioremap() the IMMR address. The MMU
is set up in such a way that IMMR based locations can be accessed
directly.

Ken Poole, MRV Communications, Inc.

> In a related vein, as I alluded to in my previous email, there has
been
> previous discussion on this list about the fact that it is frowned
upon
> for device drivers to directly dereference IMAP_ADDR.  Instead, I've
> seen a recommendation that each individual driver perform an
io_remap()
> operation on IMAP_ADDR and save the resulting kernel virtual address
in
> a driver-specific data structure.  Is this a universally-accepted
> viewpoint?  Is this something that the community agrees "should be
> fixed" and we're just waiting for someone (like me) to volunteer to
fix
> all the drivers?

> Or are there arguments in favor of keeping the direct IMAP_ADDR
> dereferences?  For example, if each driver performs its own separate
> io_remap(), doesn't that have potentially negative consequences on the
> VM system for some PPC implementations (e.g. increased contention for
> TLB entries)?

> Are these issues addressed by or otherwise impacted by other ongoing
PPC
> Linux work such as the "ppc" + "ppc64" --> "powerpc" effort / "flat
> device tree" stuff???


[-- Attachment #2: Type: text/html, Size: 6931 bytes --]

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

end of thread, other threads:[~2006-05-10 20:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-08 17:23 IMAP_ADDR on PPC 8xx Walter L. Wimer III
2006-05-08 22:46 ` Wolfgang Denk
2006-05-09 17:14   ` Walter L. Wimer III
2006-05-09 20:22     ` Wolfgang Denk
2006-05-09 20:46       ` Walter L. Wimer III
  -- strict thread matches above, loose matches on Subject: below --
2006-05-09 18:38 Kenneth Poole
2006-05-09 19:52 ` Walter L. Wimer III
2006-05-09 21:51   ` Dan Malek
2006-05-10 15:23     ` Walter L. Wimer III
2006-05-10 16:49       ` Walter L. Wimer III
2006-05-10 17:45         ` Dan Malek
2006-05-10 19:58           ` John Rigby
2006-05-10 20:19           ` Walter L. Wimer III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).