All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Perkins <james@loowit.net>
To: Ralph Siemsen <rsiemsen@rossvideo.com>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: early UART mapping in head_44x.S
Date: Tue, 13 Jul 2004 15:28:47 -0700	[thread overview]
Message-ID: <40F4621F.1000206@loowit.net> (raw)
In-Reply-To: <40F452D6.9020806@rossvideo.com>


Ralph Siemsen wrote:

>
> I've been trying to boot a vanilla 2.6.7 kernel on a board similar to
> Ocotea (the board boots 2.4.x okay).  I wasn't getting any serial
> output, despite setting CONFIG_SERIAL_TEXT_DEBUG and doing early
> registration of a console (as per David Woodhouse's posts on this list).
>
> After much tracing and a lucky suggestion on IRC, I seem to have
> stumbled on the cause, although I don't fully understand what is going
> on.  In arch/ppc/kernel/head_44x.S (from 2.6.7 mainline) there is a
> block of code that sets up the "early UART mapping".  It does three
> tlbwe instructions, and then repeats the same a second time but in
> "Translation state 1".  This second set seems to cause my problems.
> When I comment out the 5 instructions before the isync, I magically
> start getting printk outputs.
>
> But as-written, the code causes an exception immediately upon the first
> attempt to write to the mapped space.  Of course there are no exception
> handlers in place at this point, so things grind to a halt very quickly.
>
> Can anyone explain how this is meant to work?  Specifically, the
>     ori    r3,r3,PPC44x_TLB_TS
> would clear the other bits in this register, including the "valid" bit,
> so how is this mapping supposed to work?

ori won't clear the invalid bits, it just "or"s in the TS bit itself.
What suprises me is that TLB 1 is being written twice. It may make more
sense to change the second case

         li      r0,1            /* TLB slot 1 */

to
        li      r0,2             /* TLB slot 2 */

So that there is both a TS=0 and a TS=1 mapping, in TLB entry index 1
and 2, respectively -- this will catch both the MSR[DS]=0 and MSR[DS]=1
cases.

Note I haven't explored further into the allocation the kernel uses for
TLB entries; I just looked through head_44x.S

Cheers,
James

--
James Perkins         james@loowit.net         http://loowit.net/~james
-=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=-
    I have no fear of death.... It's how you live that really counts.
		    -- Katharine Hepburn, 1907-2003


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
** This list is shutting down 7/24/2004.

  parent reply	other threads:[~2004-07-13 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 21:23 early UART mapping in head_44x.S Ralph Siemsen
2004-07-13 21:51 ` Ralph Siemsen
2004-07-13 22:28 ` James Perkins [this message]
2004-07-13 22:48   ` Ralph Siemsen
2004-07-22 23:55 ` Matt Porter
  -- strict thread matches above, loose matches on Subject: below --
2004-08-02 12:30 Daren Hayward
2004-08-02 13:57 ` Matt Porter
2004-08-03 17:58 ` Ralph Siemsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40F4621F.1000206@loowit.net \
    --to=james@loowit.net \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=rsiemsen@rossvideo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.