1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 28d152e7aSLuis R. Rodriguez #include <linux/kernel.h> 38d152e7aSLuis R. Rodriguez #include <linux/init.h> 4*056b44a4SArnd Bergmann #include <linux/pnp.h> 58d152e7aSLuis R. Rodriguez 68d152e7aSLuis R. Rodriguez #include <asm/setup.h> 78d152e7aSLuis R. Rodriguez #include <asm/bios_ebda.h> 88d152e7aSLuis R. Rodriguez x86_early_init_platform_quirks(void)98d152e7aSLuis R. Rodriguezvoid __init x86_early_init_platform_quirks(void) 108d152e7aSLuis R. Rodriguez { 1193ffa9a4SDmitry Torokhov x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT; 128d152e7aSLuis R. Rodriguez x86_platform.legacy.rtc = 1; 13e348caefSJan Kiszka x86_platform.legacy.warm_reset = 1; 14edce2121SIngo Molnar x86_platform.legacy.reserve_bios_regions = 0; 1580dfd83dSLuis R. Rodriguez x86_platform.legacy.devices.pnpbios = 1; 168d152e7aSLuis R. Rodriguez 178d152e7aSLuis R. Rodriguez switch (boot_params.hdr.hardware_subarch) { 181330e3bcSLuis R. Rodriguez case X86_SUBARCH_PC: 19edce2121SIngo Molnar x86_platform.legacy.reserve_bios_regions = 1; 201330e3bcSLuis R. Rodriguez break; 218d152e7aSLuis R. Rodriguez case X86_SUBARCH_XEN: 2293ffa9a4SDmitry Torokhov x86_platform.legacy.devices.pnpbios = 0; 2393ffa9a4SDmitry Torokhov x86_platform.legacy.rtc = 0; 2493ffa9a4SDmitry Torokhov break; 258d152e7aSLuis R. Rodriguez case X86_SUBARCH_INTEL_MID: 26a50b22a7SLuis R. Rodriguez case X86_SUBARCH_CE4100: 27f6935b7bSLuis R. Rodriguez x86_platform.legacy.devices.pnpbios = 0; 288d152e7aSLuis R. Rodriguez x86_platform.legacy.rtc = 0; 2993ffa9a4SDmitry Torokhov x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT; 308d152e7aSLuis R. Rodriguez break; 318d152e7aSLuis R. Rodriguez } 328d152e7aSLuis R. Rodriguez 338d152e7aSLuis R. Rodriguez if (x86_platform.set_legacy_features) 348d152e7aSLuis R. Rodriguez x86_platform.set_legacy_features(); 358d152e7aSLuis R. Rodriguez } 3680dfd83dSLuis R. Rodriguez x86_pnpbios_disabled(void)37f79b1c57SRajneesh Bhardwajbool __init x86_pnpbios_disabled(void) 38f79b1c57SRajneesh Bhardwaj { 39f79b1c57SRajneesh Bhardwaj return x86_platform.legacy.devices.pnpbios == 0; 40f79b1c57SRajneesh Bhardwaj } 41f79b1c57SRajneesh Bhardwaj 4280dfd83dSLuis R. Rodriguez #if defined(CONFIG_PNPBIOS) arch_pnpbios_disabled(void)4380dfd83dSLuis R. Rodriguezbool __init arch_pnpbios_disabled(void) 4480dfd83dSLuis R. Rodriguez { 45f79b1c57SRajneesh Bhardwaj return x86_pnpbios_disabled(); 4680dfd83dSLuis R. Rodriguez } 4780dfd83dSLuis R. Rodriguez #endif 48