Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  blacklist.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Check to see if the given machine has a known bad ACPI BIOS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *  or if the BIOS is too old.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Check given machine against acpi_rev_dmi_table[].
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  Copyright (C) 2004 Len Brown <len.brown@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *  Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/dmi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include "internal.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #ifdef CONFIG_DMI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * POLICY: If *anything* doesn't work, put it on the blacklist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  *	   If they are critical errors, mark it critical, and abort driver load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) static struct acpi_platform_list acpi_blacklist[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	/* Compaq Presario 1700 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	{"PTLTD ", "  DSDT  ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	 "Multiple problems", 1},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	/* Sony FX120, FX140, FX150? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	{"SONY  ", "U0      ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	 "ACPI driver problem", 1},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	/* Compaq Presario 800, Insyde BIOS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	{"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	 "Does not use _REG to protect EC OpRegions", 1},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	/* IBM 600E - _ADR should return 7, but it returns 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	{"IBM   ", "TP600E  ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	 "Incorrect _ADR", 1},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) int __init acpi_blacklisted(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	int blacklisted = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	i = acpi_match_platform_list(acpi_blacklist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (i >= 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		pr_err(PREFIX "Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		       acpi_blacklist[i].oem_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		       acpi_blacklist[i].oem_table_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		       acpi_blacklist[i].oem_revision);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		pr_err(PREFIX "Reason: %s. This is a %s error\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		       acpi_blacklist[i].reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		       (acpi_blacklist[i].data ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			"non-recoverable" : "recoverable"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		blacklisted = acpi_blacklist[i].data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	(void)early_acpi_osi_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #ifdef CONFIG_DMI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	dmi_check_system(acpi_rev_dmi_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	return blacklisted;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #ifdef CONFIG_DMI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	printk(KERN_NOTICE PREFIX "DMI detected: %s (force ACPI _REV to 5)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	       d->ident);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	acpi_rev_override_setup(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	 * DELL XPS 13 (2015) switches sound between HDA and I2S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	 * depending on the ACPI _REV callback. If userspace supports
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	 * I2S sufficiently (or if you do not care about sound), you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	 * can safely disable this quirk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	 .callback = dmi_enable_rev_override,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	 .ident = "DELL XPS 13 (2015)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	 .matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		      DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	 .callback = dmi_enable_rev_override,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	 .ident = "DELL Precision 5520",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	 .matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		      DMI_MATCH(DMI_PRODUCT_NAME, "Precision 5520"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	 .callback = dmi_enable_rev_override,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	 .ident = "DELL Precision 3520",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	 .matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		      DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3520"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	 * Resolves a quirk with the Dell Latitude 3350 that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	 * causes the ethernet adapter to not function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	 .callback = dmi_enable_rev_override,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	 .ident = "DELL Latitude 3350",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	 .matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		      DMI_MATCH(DMI_PRODUCT_NAME, "Latitude 3350"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	 .callback = dmi_enable_rev_override,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	 .ident = "DELL Inspiron 7537",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	 .matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		      DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7537"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	{}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #endif /* CONFIG_DMI */