qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Isaku Yamahata <yamahata@valinux.co.jp>
To: chen huacai <zltjiangshi@gmail.com>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net, mst@redhat.com
Subject: Re: [Qemu-devel] Re: [RFC][PATCH] PCI: fix pci_to_cpu_addr() issue
Date: Fri, 2 Jul 2010 11:11:17 +0900	[thread overview]
Message-ID: <20100702021117.GA16712@valinux.co.jp> (raw)
In-Reply-To: <AANLkTil7aTXTtV2NQgg7MdnwHd6ZVq_i7BAghagswtgY@mail.gmail.com>

Thank you the pointer. I found the followings.
https://groups.google.com/group/archlinux-for-loongson/web/loongson
https://groups.google.com/group/archlinux-for-loongson/web/bonito64-spec.pdf
Am I referring to a correct spec?

According to it,
[0x00000000,  0x10000000) RAM
[0x10000000,  0x14000000) PCI_Lo0
[0x14000000,  0x18000000) PCI_Lo1
[0x18000000,  0x1c000000) PCI_Lo2
[0x20000000,  0x80000000) PCI_1.5
[0x80000000, 0x100000000) PCI_2		

[0x00000000, 0x0c000000) in physical address is RAM, so I don't understand PMON uses
the area. I may be misunderstanding something.
Can you elaborate please?

PCI_Lo[123] is interesting. The base address can be programmed independently.
Such operation isn't assumed by qemu.


On Wed, Jun 30, 2010 at 10:05:55PM +0800, chen huacai wrote:
> Maybe this is what you want, please look at Page 10.
> http://people.openrays.org/~comcat/godson/doc/godson2e.north.bridge.manual.pdf
> But it is written in Chinese, I'm sorry that I also don't have an
> English version.
> 
> 
> On Wed, Jun 30, 2010 at 9:38 PM, Isaku Yamahata <yamahata@valinux.co.jp> wrote:
> > Can you elaborate on how pci bus is mapped into local bus?
> > Is there specification publicly available? Google didn't tell me.
> >
> >
> > On Wed, Jun 30, 2010 at 06:39:53PM +0800, Huacai Chen wrote:
> >> It seems like software may both use CPU address or PCI address to access a PCI
> >> device. For example, Bonito north bridge map PCI memory space at 0x10000000 ~
> >> 0x1C000000. PMON code use 0x00000000 ~ 0x0C000000, but Linux kernel code use
> >> 0x10000000 ~ 0x1C000000 to access devices. If set pci_mem_base to 0, PMON can't
> >> work, but if set pci_mem_base to 0x10000000, Linux can't access PCI. So I make
> >> this patch to make both cases works.
> >>
> >> However, I don't know whether the modification will break other archs, so
> >> request for comments here.
> >>
> >> Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
> >> ---
> >> ??hw/pci.c | ?? ??2 +-
> >> ??1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/hw/pci.c b/hw/pci.c
> >> index 7787005..50e3572 100644
> >> --- a/hw/pci.c
> >> +++ b/hw/pci.c
> >> @@ -672,7 +672,7 @@ PCIDevice *pci_register_device(PCIBus *bus, const char *name,
> >> ??static target_phys_addr_t pci_to_cpu_addr(PCIBus *bus,
> >> ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??target_phys_addr_t addr)
> >> ??{
> >> - ?? ??return addr + bus->mem_base;
> >> + ?? ??return addr | bus->mem_base;
> >> ??}
> >>
> >> ??static void pci_unregister_io_regions(PCIDevice *pci_dev)
> >> --
> >> 1.7.0.4
> >>
> >
> > --
> > yamahata
> >
> 
> 
> 
> -- 
> Huacai Chen
> 

-- 
yamahata

  reply	other threads:[~2010-07-02  2:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30 10:39 [Qemu-devel] [RFC][PATCH] PCI: fix pci_to_cpu_addr() issue Huacai Chen
2010-06-30 13:38 ` [Qemu-devel] " Isaku Yamahata
2010-06-30 14:05   ` chen huacai
2010-07-02  2:11     ` Isaku Yamahata [this message]
     [not found]       ` <AANLkTilli02u9jZ52c0aoTBs-JSEY_mYDwqt2GyeKoYw@mail.gmail.com>
     [not found]         ` <20100702101318.GD16712@valinux.co.jp>
2010-07-03  4:11           ` chen huacai
2010-07-04 13:42             ` Isaku Yamahata

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=20100702021117.GA16712@valinux.co.jp \
    --to=yamahata@valinux.co.jp \
    --cc=aurelien@aurel32.net \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zltjiangshi@gmail.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 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).