qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: chen huacai <zltjiangshi@gmail.com>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [RFC][MIPS][PATCH 1/6] Initial support of bonito north bridge used by fulong mini pc
Date: Tue, 11 May 2010 22:52:08 +0300	[thread overview]
Message-ID: <AANLkTiksRVS3T7idjM0ZX6H9YdPiX9NFZfdGecit6xRb@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilDjfMxyYBhTt8gowRVkXLk6loiZ8qvsxF8Rqgz@mail.gmail.com>

On 5/11/10, chen huacai <zltjiangshi@gmail.com> wrote:
> >>  +    s->pci = qemu_mallocz(sizeof(*s->pci));
>  >>  +    assert(s->pci != NULL);
>  >>  +    bonito_state = s;
>  >>  +
>  >>  +    /* get the north bridge pci bus */
>  >>  +    s->pci->bus = pci_register_bus(NULL, "pci", pci_bonito_set_irq,
>  >>  +                                   pci_bonito_map_irq, pic, 0x28, 32);
>  >>  +
>  >>  +    /* set the north bridge register mapping */
>  >>  +    s->bonito_reg_handle = cpu_register_io_memory(bonito_read,
>  >>  bonito_write, s);
>  >>  +    s->bonito_reg_start = BONITO_INTERNAL_REG_BASE;
>  >
>  > Usually the devices don't specify their addresses, but these are
>  > passed from the board level.
>
>
> I'm a bit confusing here, bonito internal registers are mapped to a
>  fixed physical address according to specification.

With qdev system, the board should map the device. In this old way,
you can just pass the (fixed) addresses from board level. It probably
makes conversion to qdev easier.

>  >>  +    /*add PCI io space */
>  >>  +    /*PCI IO Space  0x1fd0 0000 - 0x1fd1 0000 */
>  >>  +    if (s->bonito_pciio_length)
>  >>  +    {
>  >>  +        cpu_register_physical_memory(s->bonito_pciio_start,
>  >>  +                                     s->bonito_pciio_length,
>  >>  IO_MEM_UNASSIGNED);
>  >
>  > Why would this be needed?
>
>
> This is borrowed from gt64xxx.c

IO_MEM_UNASSIGNED is the default MMIO type, there shouldn't be any
need to map it (except to remove a previous mapping).

>  >>  +    d = pci_register_device(s->pci->bus, "Bonito PCI Bus", sizeof(PCIDevice),
>  >>  +                            0, bonito_read_config, bonito_write_config);
>  >>  +
>  >>  +    pci_config_set_vendor_id(d->config, 0xdf53); //Bonito North Bridge
>  >>  +    pci_config_set_device_id(d->config, 0x00d5);
>  >
>  > Please put the above constants to hw/pci_ids.h.
>
>
> Bonito north bridge is built on FPGA now, VENDOR_ID/DEVICE_ID are
>  temporary value so I didn't put them in pci_ids.h

In that case, perhaps the code should be committed after the design
has stabilized a bit more?

>  For your other comments I'll improve my code, thanks.
>
>  Best regards,
>
>
>  Huacai Chen
>

  reply	other threads:[~2010-05-11 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09  2:00 [Qemu-devel] [RFC][MIPS][PATCH 1/6] Initial support of bonito north bridge used by fulong mini pc chen huacai
2010-05-09  9:41 ` Stefan Weil
2010-05-09 11:25   ` chen huacai
2010-05-09 19:04     ` Stefan Weil
2010-05-10 11:21   ` chen huacai
2010-05-10 17:19     ` Stefan Weil
2010-05-09  9:56 ` Stefan Weil
2010-05-10  4:02   ` yajin
2010-05-10 19:14 ` Blue Swirl
2010-05-11  2:32   ` chen huacai
2010-05-11 19:52     ` Blue Swirl [this message]
2010-05-12  0:59       ` chen huacai
2010-05-12  7:37       ` yajin

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=AANLkTiksRVS3T7idjM0ZX6H9YdPiX9NFZfdGecit6xRb@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=aurelien@aurel32.net \
    --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).