linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Malek <dan@embeddededge.com>
To: Kamalesh B <kamal@tataelxsi.co.in>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Problem porting 2.4.17 linux to MPC8260ADS
Date: Mon, 03 Mar 2003 16:00:15 -0500	[thread overview]
Message-ID: <3E63C25F.3080607@embeddededge.com> (raw)
In-Reply-To: 3E59BF74.8C163181@tataelxsi.co.in


Kamalesh B wrote:

> [KAMAL]:
> All memory mapping is handled correctly.
> SDRAM is mapped to 0xC0000000 from 0x00000000
> Flash is mapped to 0xFF800000 from 0xFF800000
> Board control/status register is mapped to 0xF0100000 from 0x04500000
> IMMR is mapped to 0xF0000000 from 0x04700000
>
> Iam using BATs to do this (BAT0 and BAT1)

If I understand correctly (and I may not), this isn't being done
correctly.  Linux is going to take over the BATs for it's own mapping.
It doesn't matter what you have set in them.

You must ensure the IMMR is physically mapped to 0xf0000000.  That is,
you have to change the IMMR register to this value, you can't use
a BAT to map this value to the virtual 0xf0000000 and then call Linux.

The SDRAM will be remapped by Linux to use the BAT 3/4 registers based
upon how much memory you tell it is available in the board descriptor
structure.

The Flash and board control register will have to be mapped using ioremap()
and you will have to use the subsequent returned virtual address to
access these regions.



> [KAMAL]:
> After turning on MMU, iam using the LED code to flash leds and it is
> working. Memory map of board control status register after turning on MMU is
> 0xf0100000. Only at this point it won't.

No, they are not mapped there.  The only thing Linux knows about early
in the kernel is a small portion of the ram.  Linux completely changes the
MMU mapping, it doesn't matter what you have mapped when you call the kernel.
Your board control registers are not mapped any longer shortly after you
call the Linux kernel.


> [KAMAL]:
> Led flashing code looks something like this
> --- Code begins ---
> lis r20, 0xf010
> lis r21, 0
> stw r21, 0(r20)
> --- Code ends ---

That will crash the kernel shortly after you start it.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~2003-03-03 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-21 16:15 Problem porting 2.4.17 linux to MPC8260ADS Kamalesh B
2003-02-21 17:04 ` Dan Malek
2003-02-24  6:45   ` Kamalesh B
2003-02-24  8:10     ` Shen Rong
2003-02-28  5:31       ` RAMDISK Kamalesh B
2003-02-28 21:29         ` RAMDISK Wolfgang Denk
2003-03-03 21:00     ` Dan Malek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-04  9:20 Problem porting 2.4.17 linux to MPC8260ADS Meszaros Lajos

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=3E63C25F.3080607@embeddededge.com \
    --to=dan@embeddededge.com \
    --cc=kamal@tataelxsi.co.in \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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 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).