Merged mainline into pci
This commit is contained in:
parent
e45f7848e6
commit
181aaf0e59
5 changed files with 21 additions and 16 deletions
|
@ -38,11 +38,11 @@ static struct grub_video_patch
|
|||
};
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
scan_card (int bus, int dev, int func, grub_pci_id_t pciid)
|
||||
scan_card (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
if (grub_pci_read_byte (addr + 3) == 0x3)
|
||||
{
|
||||
struct grub_video_patch *p = video_patches;
|
||||
|
|
|
@ -41,6 +41,7 @@ enable_rom_area (void)
|
|||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_uint32_t *rom_ptr;
|
||||
grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0};
|
||||
|
||||
rom_ptr = (grub_uint32_t *) VBIOS_ADDR;
|
||||
if (*rom_ptr != BLANK_MEM)
|
||||
|
@ -49,7 +50,7 @@ enable_rom_area (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
addr = grub_pci_make_address (0, 0, 0, 36);
|
||||
addr = grub_pci_make_address (dev, 36);
|
||||
grub_pci_write_byte (addr++, 0x30);
|
||||
grub_pci_write_byte (addr++, 0x33);
|
||||
grub_pci_write_byte (addr++, 0x33);
|
||||
|
@ -73,8 +74,9 @@ static void
|
|||
lock_rom_area (void)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0};
|
||||
|
||||
addr = grub_pci_make_address (0, 0, 0, 36);
|
||||
addr = grub_pci_make_address (dev, 36);
|
||||
grub_pci_write_byte (addr++, 0x10);
|
||||
grub_pci_write_byte (addr++, 0x11);
|
||||
grub_pci_write_byte (addr++, 0x11);
|
||||
|
|
|
@ -469,21 +469,22 @@ find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len)
|
|||
{
|
||||
int found = 0;
|
||||
|
||||
auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid);
|
||||
|
||||
int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
if (grub_pci_read (addr) >> 24 == 0x3)
|
||||
{
|
||||
int i;
|
||||
|
||||
grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n",
|
||||
bus, dev, func, pciid);
|
||||
grub_pci_get_bus (dev), grub_pci_get_device (dev),
|
||||
grub_pci_get_function (dev), pciid);
|
||||
addr += 8;
|
||||
for (i = 0; i < 6; i++, addr += 4)
|
||||
{
|
||||
|
|
|
@ -71,21 +71,22 @@ find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len)
|
|||
{
|
||||
int found = 0;
|
||||
|
||||
auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid);
|
||||
|
||||
int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
if (grub_pci_read (addr) >> 24 == 0x3)
|
||||
{
|
||||
int i;
|
||||
|
||||
grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n",
|
||||
bus, dev, func, pciid);
|
||||
grub_pci_get_bus (dev), grub_pci_get_device (dev),
|
||||
grub_pci_get_function (dev), pciid);
|
||||
addr += 8;
|
||||
for (i = 0; i < 6; i++, addr += 4)
|
||||
{
|
||||
|
|
|
@ -84,21 +84,22 @@ find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len)
|
|||
{
|
||||
int found = 0;
|
||||
|
||||
auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid);
|
||||
|
||||
int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
|
||||
int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
if (grub_pci_read (addr) >> 24 == 0x3)
|
||||
{
|
||||
int i;
|
||||
|
||||
grub_dprintf ("fb", "Display controller: %d:%d.%d\nDevice id: %x\n",
|
||||
bus, dev, func, pciid);
|
||||
grub_pci_get_bus (dev), grub_pci_get_device (dev),
|
||||
grub_pci_get_function (dev), pciid);
|
||||
addr += 8;
|
||||
for (i = 0; i < 6; i++, addr += 4)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue