diff mbox

[U-Boot,v2,13/26] dm: x86: pci: Adjust bios_run_on_x86() to use the DM PCI API

Message ID 1448828291-12660-14-git-send-email-sjg@chromium.org
State Accepted
Commit 8beb0bda9c59146df70b960ce69ecfbd6f744028
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Nov. 29, 2015, 8:17 p.m. UTC
This function should take a struct udevice rather than pci_dev_t. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v2: None

 arch/x86/lib/bios.c   | 3 ++-
 drivers/pci/pci_rom.c | 4 ++--
 include/bios_emul.h   | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

Comments

Bin Meng Dec. 7, 2015, 10:53 a.m. UTC | #1
On Mon, Nov 30, 2015 at 4:17 AM, Simon Glass <sjg@chromium.org> wrote:
> This function should take a struct udevice rather than pci_dev_t. Update it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/bios.c   | 3 ++-
>  drivers/pci/pci_rom.c | 4 ++--
>  include/bios_emul.h   | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c
> index 1d75cfc..9324bdb 100644
> --- a/arch/x86/lib/bios.c
> +++ b/arch/x86/lib/bios.c
> @@ -242,9 +242,10 @@ static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info)
>         vbe_set_mode(mode_info);
>  }
>
> -void bios_run_on_x86(pci_dev_t pcidev, unsigned long addr, int vesa_mode,
> +void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
>                      struct vbe_mode_info *mode_info)
>  {
> +       pci_dev_t pcidev = dm_pci_get_bdf(dev);
>         u32 num_dev;
>
>         num_dev = PCI_BUS(pcidev) << 8 | PCI_DEV(pcidev) << 3 |
> diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
> index 5989bad..c4112cb 100644
> --- a/drivers/pci/pci_rom.c
> +++ b/drivers/pci/pci_rom.c
> @@ -332,8 +332,8 @@ int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void),
>  #ifdef CONFIG_X86
>                 bios_set_interrupt_handler(0x15, int15_handler);
>
> -               bios_run_on_x86(dm_pci_get_bdf(dev), (unsigned long)ram,
> -                               vesa_mode, &mode_info);
> +               bios_run_on_x86(dev, (unsigned long)ram, vesa_mode,
> +                               &mode_info);
>  #endif
>         }
>         debug("Final vesa mode %#x\n", mode_info.video_mode);
> diff --git a/include/bios_emul.h b/include/bios_emul.h
> index 3643b82..80979ed 100644
> --- a/include/bios_emul.h
> +++ b/include/bios_emul.h
> @@ -42,7 +42,7 @@ struct vbe_mode_info;
>  int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo **pVGAInfo, int cleanUp);
>
>  /* Run a BIOS ROM natively (only supported on x86 machines) */
> -void bios_run_on_x86(pci_dev_t pcidev, unsigned long addr, int vesa_mode,
> +void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
>                      struct vbe_mode_info *mode_info);
>
>  /**
> --

Tested-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass Dec. 14, 2015, 3:45 a.m. UTC | #2
Applied to u-boot-dm/next.
diff mbox

Patch

diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c
index 1d75cfc..9324bdb 100644
--- a/arch/x86/lib/bios.c
+++ b/arch/x86/lib/bios.c
@@ -242,9 +242,10 @@  static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info)
 	vbe_set_mode(mode_info);
 }
 
-void bios_run_on_x86(pci_dev_t pcidev, unsigned long addr, int vesa_mode,
+void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
 		     struct vbe_mode_info *mode_info)
 {
+	pci_dev_t pcidev = dm_pci_get_bdf(dev);
 	u32 num_dev;
 
 	num_dev = PCI_BUS(pcidev) << 8 | PCI_DEV(pcidev) << 3 |
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 5989bad..c4112cb 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -332,8 +332,8 @@  int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void),
 #ifdef CONFIG_X86
 		bios_set_interrupt_handler(0x15, int15_handler);
 
-		bios_run_on_x86(dm_pci_get_bdf(dev), (unsigned long)ram,
-				vesa_mode, &mode_info);
+		bios_run_on_x86(dev, (unsigned long)ram, vesa_mode,
+				&mode_info);
 #endif
 	}
 	debug("Final vesa mode %#x\n", mode_info.video_mode);
diff --git a/include/bios_emul.h b/include/bios_emul.h
index 3643b82..80979ed 100644
--- a/include/bios_emul.h
+++ b/include/bios_emul.h
@@ -42,7 +42,7 @@  struct vbe_mode_info;
 int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo **pVGAInfo, int cleanUp);
 
 /* Run a BIOS ROM natively (only supported on x86 machines) */
-void bios_run_on_x86(pci_dev_t pcidev, unsigned long addr, int vesa_mode,
+void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
 		     struct vbe_mode_info *mode_info);
 
 /**