diff options
| -rw-r--r-- | arch/x86/include/asm/uv/bios.h | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 30 | ||||
| -rw-r--r-- | arch/x86/kernel/bios_uv.c | 19 |
3 files changed, 52 insertions, 1 deletions
diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h index 2751f3075d8b..163427597d03 100644 --- a/arch/x86/include/asm/uv/bios.h +++ b/arch/x86/include/asm/uv/bios.h | |||
| @@ -36,7 +36,8 @@ enum uv_bios_cmd { | |||
| 36 | UV_BIOS_WATCHLIST_ALLOC, | 36 | UV_BIOS_WATCHLIST_ALLOC, |
| 37 | UV_BIOS_WATCHLIST_FREE, | 37 | UV_BIOS_WATCHLIST_FREE, |
| 38 | UV_BIOS_MEMPROTECT, | 38 | UV_BIOS_MEMPROTECT, |
| 39 | UV_BIOS_GET_PARTITION_ADDR | 39 | UV_BIOS_GET_PARTITION_ADDR, |
| 40 | UV_BIOS_SET_LEGACY_VGA_TARGET | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | /* | 43 | /* |
| @@ -96,6 +97,7 @@ extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int, | |||
| 96 | extern int uv_bios_mq_watchlist_free(int, int); | 97 | extern int uv_bios_mq_watchlist_free(int, int); |
| 97 | extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); | 98 | extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); |
| 98 | extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); | 99 | extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); |
| 100 | extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); | ||
| 99 | 101 | ||
| 100 | extern void uv_bios_init(void); | 102 | extern void uv_bios_init(void); |
| 101 | 103 | ||
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 21db3cbea7dc..6ef2899eb861 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/cpu.h> | 20 | #include <linux/cpu.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
| 23 | #include <linux/pci.h> | ||
| 23 | 24 | ||
| 24 | #include <asm/uv/uv_mmrs.h> | 25 | #include <asm/uv/uv_mmrs.h> |
| 25 | #include <asm/uv/uv_hub.h> | 26 | #include <asm/uv/uv_hub.h> |
| @@ -34,6 +35,8 @@ | |||
| 34 | 35 | ||
| 35 | DEFINE_PER_CPU(int, x2apic_extra_bits); | 36 | DEFINE_PER_CPU(int, x2apic_extra_bits); |
| 36 | 37 | ||
| 38 | #define PR_DEVEL(fmt, args...) pr_devel("%s: " fmt, __func__, args) | ||
| 39 | |||
| 37 | static enum uv_system_type uv_system_type; | 40 | static enum uv_system_type uv_system_type; |
| 38 | static u64 gru_start_paddr, gru_end_paddr; | 41 | static u64 gru_start_paddr, gru_end_paddr; |
| 39 | int uv_min_hub_revision_id; | 42 | int uv_min_hub_revision_id; |
| @@ -553,6 +556,30 @@ late_initcall(uv_init_heartbeat); | |||
| 553 | 556 | ||
| 554 | #endif /* !CONFIG_HOTPLUG_CPU */ | 557 | #endif /* !CONFIG_HOTPLUG_CPU */ |
| 555 | 558 | ||
| 559 | /* Direct Legacy VGA I/O traffic to designated IOH */ | ||
| 560 | int uv_set_vga_state(struct pci_dev *pdev, bool decode, | ||
| 561 | unsigned int command_bits, bool change_bridge) | ||
| 562 | { | ||
| 563 | int domain, bus, rc; | ||
| 564 | |||
| 565 | PR_DEVEL("devfn %x decode %d cmd %x chg_brdg %d\n", | ||
| 566 | pdev->devfn, decode, command_bits, change_bridge); | ||
| 567 | |||
| 568 | if (!change_bridge) | ||
| 569 | return 0; | ||
| 570 | |||
| 571 | if ((command_bits & PCI_COMMAND_IO) == 0) | ||
| 572 | return 0; | ||
| 573 | |||
| 574 | domain = pci_domain_nr(pdev->bus); | ||
| 575 | bus = pdev->bus->number; | ||
| 576 | |||
| 577 | rc = uv_bios_set_legacy_vga_target(decode, domain, bus); | ||
| 578 | PR_DEVEL("vga decode %d %x:%x, rc: %d\n", decode, domain, bus, rc); | ||
| 579 | |||
| 580 | return rc; | ||
| 581 | } | ||
| 582 | |||
| 556 | /* | 583 | /* |
| 557 | * Called on each cpu to initialize the per_cpu UV data area. | 584 | * Called on each cpu to initialize the per_cpu UV data area. |
| 558 | * FIXME: hotplug not supported yet | 585 | * FIXME: hotplug not supported yet |
| @@ -691,4 +718,7 @@ void __init uv_system_init(void) | |||
| 691 | uv_cpu_init(); | 718 | uv_cpu_init(); |
| 692 | uv_scir_register_cpu_notifier(); | 719 | uv_scir_register_cpu_notifier(); |
| 693 | proc_mkdir("sgi_uv", NULL); | 720 | proc_mkdir("sgi_uv", NULL); |
| 721 | |||
| 722 | /* register Legacy VGA I/O redirection handler */ | ||
| 723 | pci_register_set_vga_state(uv_set_vga_state); | ||
| 694 | } | 724 | } |
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c index b0206a211b09..575127a6e352 100644 --- a/arch/x86/kernel/bios_uv.c +++ b/arch/x86/kernel/bios_uv.c | |||
| @@ -154,6 +154,25 @@ s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) | |||
| 154 | } | 154 | } |
| 155 | EXPORT_SYMBOL_GPL(uv_bios_freq_base); | 155 | EXPORT_SYMBOL_GPL(uv_bios_freq_base); |
| 156 | 156 | ||
| 157 | /* | ||
| 158 | * uv_bios_set_legacy_vga_target - Set Legacy VGA I/O Target | ||
| 159 | * @decode: true to enable target, false to disable target | ||
| 160 | * @domain: PCI domain number | ||
| 161 | * @bus: PCI bus number | ||
| 162 | * | ||
| 163 | * Returns: | ||
| 164 | * 0: Success | ||
| 165 | * -EINVAL: Invalid domain or bus number | ||
| 166 | * -ENOSYS: Capability not available | ||
| 167 | * -EBUSY: Legacy VGA I/O cannot be retargeted at this time | ||
| 168 | */ | ||
| 169 | int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus) | ||
| 170 | { | ||
| 171 | return uv_bios_call(UV_BIOS_SET_LEGACY_VGA_TARGET, | ||
| 172 | (u64)decode, (u64)domain, (u64)bus, 0, 0); | ||
| 173 | } | ||
| 174 | EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga_target); | ||
| 175 | |||
| 157 | 176 | ||
| 158 | #ifdef CONFIG_EFI | 177 | #ifdef CONFIG_EFI |
| 159 | void uv_bios_init(void) | 178 | void uv_bios_init(void) |
