All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/10] x86: Access the VGA ROM when needed
Date: Mon, 5 Jan 2015 21:49:44 +0800	[thread overview]
Message-ID: <CAEUhbmVQ0+oL+Tak-TRk_Pc1gjiyDV8vmA-q4+W=xfibLodKSQ@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ2X6SzNpHnQ5jr1U0Wwf2X7R+_KVwRJJtfR4zkoLS-Bug@mail.gmail.com>

Hi Simon,

On Mon, Jan 5, 2015 at 9:45 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 3 January 2015 at 22:54, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Hi Simon,
>>
>> On Tue, Dec 30, 2014 at 10:32 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Add code to the generic pci_rom file to access the VGA ROM in PCI space
>>> when needed.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>  drivers/pci/pci_auto.c | 28 +++++++++++++++++++++++++++-
>>>  drivers/pci/pci_rom.c  |  7 ++++++-
>>>  include/pci.h          |  9 +++++++++
>>>  3 files changed, 42 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
>>> index 44470fa..61bf6b4 100644
>>> --- a/drivers/pci/pci_auto.c
>>> +++ b/drivers/pci/pci_auto.c
>>> @@ -11,7 +11,7 @@
>>>   */
>>>
>>>  #include <common.h>
>>> -
>>> +#include <errno.h>
>>>  #include <pci.h>
>>>
>>>  #undef DEBUG
>>> @@ -191,6 +191,32 @@ void pciauto_setup_device(struct pci_controller *hose,
>>>         pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
>>>  }
>>>
>>> +int pciauto_setup_rom(struct pci_controller *hose, pci_dev_t dev)
>>> +{
>>> +       pci_addr_t bar_value;
>>> +       pci_size_t bar_size;
>>> +       u32 bar_response;
>>> +       u16 cmdstat = 0;
>>> +
>>> +       pci_hose_write_config_dword(hose, dev, PCI_ROM_ADDRESS, -2);

I think it is better for people to understand if not writing -2.

>>> +       pci_hose_read_config_dword(hose, dev, PCI_ROM_ADDRESS, &bar_response);
>>> +       if (!bar_response)
>>> +               return -ENOENT;
>>> +
>>> +       bar_size = -(bar_response & ~1);
>>> +       DEBUGF("PCI Autoconfig: ROM, size=%#x, ", bar_size);
>>> +       if (pciauto_region_allocate(hose->pci_mem, bar_size, &bar_value) == 0) {
>>
>> Should we assume pci roms are always mapped using the pci_mem region?
>> If not, maybe we can add another parameter 'region_type' to
>> pciauto_setup_rom()?
>
> I'm not sure - do you think we should support the cacheable area too?
> Would that help?
>

I'm not sure either. I thought you might know more than me as so far I
see pci rom is used for vga, ahci, pxe roms, and storage media for mac
addresses on some ethernet cards. They all belong to pci_mem regions.
Let's do it pci_mem and revisit it in the future if we see something
different.

[snip]

Regards,
Bin

  reply	other threads:[~2015-01-05 13:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30  2:32 [U-Boot] [PATCH 0/10] x86: Add generic VESA video driver Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 01/10] bios_emulator: Fix an #ifdef typo in the header file Simon Glass
2015-01-04  5:10   ` Bin Meng
2015-01-15  4:23     ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 02/10] x86: Correct endianness isues in pci_rom Simon Glass
2015-01-04  5:43   ` Bin Meng
2015-01-15  4:23     ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 03/10] x86: Support ROMs on other archs Simon Glass
2015-01-04  5:43   ` Bin Meng
2015-01-15  4:23     ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 04/10] bios_emulator: Don't display error when emulator terminates Simon Glass
2015-01-15  4:23   ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 05/10] bios_emulator: Add some VESA interface debugging Simon Glass
2015-01-15  4:24   ` Simon Glass
2019-07-30 20:52   ` Heinrich Schuchardt
2019-08-01 16:51     ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 06/10] x86: pci: Don't stop when we get a vendor/device mismatch Simon Glass
2015-01-04  5:51   ` Bin Meng
2015-01-15  4:24     ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 07/10] x86: Add a VESA video driver Simon Glass
2015-01-15  4:24   ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 08/10] x86: Drop the x86_fb driver Simon Glass
2015-01-15  4:25   ` Simon Glass
2014-12-30  2:32 ` [U-Boot] [PATCH 09/10] x86: Access the VGA ROM when needed Simon Glass
2015-01-04  5:54   ` Bin Meng
2015-01-05  1:45     ` Simon Glass
2015-01-05 13:49       ` Bin Meng [this message]
2015-01-14 19:36         ` Simon Glass
2015-01-15  2:17           ` Bin Meng
2014-12-30  2:32 ` [U-Boot] [PATCH 10/10] RFC: Test code for glacier PCI video support Simon Glass
2015-01-08  4:46   ` Bin Meng
2015-01-08  6:18   ` Bin Meng
2015-01-08 15:06     ` Simon Glass
2015-01-09  1:34       ` Bin Meng
2015-01-09  3:35         ` Simon Glass
2015-01-09  5:23           ` Bin Meng
2015-01-09 19:02             ` Simon Glass
2015-01-10  3:52               ` Bin Meng
2015-01-10 16:08                 ` Simon Glass
2015-01-11  3:04                   ` Bin Meng
2015-01-11  3:42                     ` Simon Glass
2015-01-11  4:20                       ` Bin Meng
2015-01-13  1:11                         ` Simon Glass

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='CAEUhbmVQ0+oL+Tak-TRk_Pc1gjiyDV8vmA-q4+W=xfibLodKSQ@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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.