blob: b348a672f71d5ecd381822deab84585d35d1afc8 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -07002#include <linux/kernel.h>
3#include <linux/init.h>
4
5#include <asm/setup.h>
6#include <asm/bios_ebda.h>
7
8void __init x86_early_init_platform_quirks(void)
9{
Dmitry Torokhov93ffa9a2016-12-09 12:57:38 -080010 x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070011 x86_platform.legacy.rtc = 1;
Jan Kiszkae348cae2017-11-27 09:11:44 +010012 x86_platform.legacy.warm_reset = 1;
Ingo Molnaredce2122016-07-21 09:53:52 +020013 x86_platform.legacy.reserve_bios_regions = 0;
Luis R. Rodriguez80dfd832016-04-13 17:04:41 -070014 x86_platform.legacy.devices.pnpbios = 1;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070015
16 switch (boot_params.hdr.hardware_subarch) {
Luis R. Rodriguez1330e3b2016-04-13 17:04:36 -070017 case X86_SUBARCH_PC:
Ingo Molnaredce2122016-07-21 09:53:52 +020018 x86_platform.legacy.reserve_bios_regions = 1;
Luis R. Rodriguez1330e3b2016-04-13 17:04:36 -070019 break;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070020 case X86_SUBARCH_XEN:
Dmitry Torokhov93ffa9a2016-12-09 12:57:38 -080021 x86_platform.legacy.devices.pnpbios = 0;
22 x86_platform.legacy.rtc = 0;
23 break;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070024 case X86_SUBARCH_INTEL_MID:
Luis R. Rodrigueza50b22a2016-04-13 17:04:46 -070025 case X86_SUBARCH_CE4100:
Luis R. Rodriguezf6935b72016-04-13 17:04:45 -070026 x86_platform.legacy.devices.pnpbios = 0;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070027 x86_platform.legacy.rtc = 0;
Dmitry Torokhov93ffa9a2016-12-09 12:57:38 -080028 x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT;
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -070029 break;
30 }
31
32 if (x86_platform.set_legacy_features)
33 x86_platform.set_legacy_features();
34}
Luis R. Rodriguez80dfd832016-04-13 17:04:41 -070035
Rajneesh Bhardwajf79b1c52018-03-29 20:36:55 +053036bool __init x86_pnpbios_disabled(void)
37{
38 return x86_platform.legacy.devices.pnpbios == 0;
39}
40
Luis R. Rodriguez80dfd832016-04-13 17:04:41 -070041#if defined(CONFIG_PNPBIOS)
42bool __init arch_pnpbios_disabled(void)
43{
Rajneesh Bhardwajf79b1c52018-03-29 20:36:55 +053044 return x86_pnpbios_disabled();
Luis R. Rodriguez80dfd832016-04-13 17:04:41 -070045}
46#endif