^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <asm/setup.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <asm/bios_ebda.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) void __init x86_early_init_platform_quirks(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) x86_platform.legacy.rtc = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) x86_platform.legacy.warm_reset = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) x86_platform.legacy.reserve_bios_regions = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) x86_platform.legacy.devices.pnpbios = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) switch (boot_params.hdr.hardware_subarch) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) case X86_SUBARCH_PC:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) x86_platform.legacy.reserve_bios_regions = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) case X86_SUBARCH_XEN:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) x86_platform.legacy.devices.pnpbios = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) x86_platform.legacy.rtc = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) case X86_SUBARCH_INTEL_MID:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) case X86_SUBARCH_CE4100:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) x86_platform.legacy.devices.pnpbios = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) x86_platform.legacy.rtc = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) if (x86_platform.set_legacy_features)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) x86_platform.set_legacy_features();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) bool __init x86_pnpbios_disabled(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) return x86_platform.legacy.devices.pnpbios == 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #if defined(CONFIG_PNPBIOS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) bool __init arch_pnpbios_disabled(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) return x86_pnpbios_disabled();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #endif