Commit e2c874f9 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v6.6-1' of...

Merge tag 'platform-drivers-x86-v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:

 - hp-bioscfg: New firmware-attributes driver for changing BIOS settings
   from within Linux

 - asus-wmi: Add charger mode, middle fan and eGPU settings support

 - ideapad: Support keyboard backlight control on more models

 - mellanox: Support for new models

 - sel-3350: New LED and power-supply driver for this industrial
   mainboard

 - simatic-ipc: Add RTC battery monitor and various new models support

 - miscellaneous other cleanups / fixes

* tag 'platform-drivers-x86-v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (101 commits)
  platform/x86: asus-wmi: corrections to egpu safety check
  platform/x86: mlx-platform: Add dependency on PCI to Kconfig
  platform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI symbol
  platform/x86/amd/pmc: Fix build error with randconfig
  platform/x86/amd/pmf: Fix a missing cleanup path
  watchdog: simatic: Use idiomatic selection of P2SB
  platform/x86: p2sb: Make the Kconfig symbol hidden
  Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
  platform: mellanox: nvsw-sn2201: change fans i2c busses.
  platform: mellanox: mlxreg-hotplug: Extend condition for notification callback processing
  platform: mellanox: Add initial support for PCIe based programming logic device
  platform: mellanox: mlx-platform: Get interrupt line through ACPI
  platform: mellanox: mlx-platform: Introduce ACPI init flow
  platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure
  platform: mellanox: mlx-platform: Add reset callback
  platform: mellanox: Cosmetic changes
  platform: mellanox: mlx-platform: Modify power off callback
  platform: mellanox: mlx-platform: add support for additional CPLD
  platform: mellanox: mlx-platform: Add reset cause attribute
  platform: mellanox: mlx-platform: Modify health and power hotplug action
  ...
parents e0152e74 acce85a7
......@@ -662,3 +662,56 @@ Description: This file shows the system reset cause due to AC power failure.
Value 1 in file means this is reset cause, 0 - otherwise.
The file is read only.
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min
Date: August 2023
KernelVersion: 6.6
Contact: Vadim Pasternak <vadimp@nvidia.com>
Description: These files show with which CPLD part numbers, version and minor
versions have been burned the 5-th CPLD device equipped on a
system.
The files are read only.
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap
Date: August 2023
KernelVersion: 6.6
Contact: Vadim Pasternak <vadimp@nvidia.com>
Description: This file indicates the available method of CPLD/FPGA devices
field update through the JTAG chain:
b00 - field update through LPC bus register memory space.
b01 - Reserved.
b10 - Reserved.
b11 - field update through CPU GPIOs bit-banging.
The file is read only.
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open
Date: August 2023
KernelVersion: 6.6
Contact: Vadim Pasternak <vadimp@nvidia.com>
Description: 1 - indicates that system lid is opened, otherwise 0.
The file is read only.
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb
Date: August 2023
KernelVersion: 6.6
Contact: Vadim Pasternak <vadimp@nvidia.com>
Description: This file if set 1 indicates that system has been reset by
long press of power button.
The file is read only.
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
Date: August 2023
KernelVersion: 6.6
Contact: Vadim Pasternak <vadimp@nvidia.com>
Description: This file shows 1 in case the system reset happened due to the
failure of any DC-DC power converter devices equipped on the
switch board.
The file is read only.
What: /sys/kernel/debug/tpmi-<n>/pfs_dump
Date: November 2023
KernelVersion: 6.6
Contact: srinivas.pandruvada@linux.intel.com
Description:
The PFS (PM Feature Structure) table, shows details of each power
management feature. This includes:
tpmi_id, number of entries, entry size, offset, vsec offset, lock status
and disabled status.
Users: Debugging, any user space test suite
What: /sys/kernel/debug/tpmi-<n>/tpmi-id-<n>/mem_dump
Date: November 2023
KernelVersion: 6.6
Contact: srinivas.pandruvada@linux.intel.com
Description:
Shows the memory dump of the MMIO region for a TPMI ID.
Users: Debugging, any user space test suite
What: /sys/kernel/debug/tpmi-<n>/tpmi-id-<n>/mem_write
Date: November 2023
KernelVersion: 6.6
Contact: srinivas.pandruvada@linux.intel.com
Description:
Allows to write at any offset. It doesn't check for Read/Write access
as hardware will not allow to write at read-only memory. This write is
at offset multiples of 4. The format is instance,offset,contents.
Example:
echo 0,0x20,0xff > mem_write
echo 1,64,64 > mem_write
Users: Debugging, any user space test suite
......@@ -22,6 +22,11 @@ Description:
- integer: a range of numerical values
- string
HP specific types
-----------------
- ordered-list - a set of ordered list valid values
All attribute types support the following values:
current_value:
......@@ -126,6 +131,21 @@ Description:
value will not be effective through sysfs until this rule is
met.
HP specific class extensions
------------------------------
On HP systems the following additional attributes are available:
"ordered-list"-type specific properties:
elements:
A file that can be read to obtain the possible
list of values of the <attr>. Values are separated using
semi-colon (``;``) and listed according to their priority.
An element listed first has the highest priority. Writing
the list in a different order to current_value alters
the priority order for the particular attribute.
What: /sys/class/firmware-attributes/*/authentication/
Date: February 2021
KernelVersion: 5.11
......@@ -206,7 +226,7 @@ Description:
Drivers may emit a CHANGE uevent when a password is set or unset
userspace may check it again.
On Dell and Lenovo systems, if Admin password is set, then all BIOS attributes
On Dell, Lenovo and HP systems, if Admin password is set, then all BIOS attributes
require password validation.
On Lenovo systems if you change the Admin password the new password is not active until
the next boot.
......@@ -296,6 +316,15 @@ Description:
echo "signature" > authentication/Admin/signature
echo "password" > authentication/Admin/certificate_to_password
HP specific class extensions
--------------------------------
On HP systems the following additional settings are available:
role: enhanced-bios-auth:
This role is specific to Secure Platform Management (SPM) attribute.
It requires configuring an endorsement (kek) and signing certificate (sk).
What: /sys/class/firmware-attributes/*/attributes/pending_reboot
Date: February 2021
......@@ -364,3 +393,71 @@ Description:
use it to enable extra debug attributes or BIOS features for testing purposes.
Note that any changes to this attribute requires a reboot for changes to take effect.
HP specific class extensions - Secure Platform Manager (SPM)
--------------------------------
What: /sys/class/firmware-attributes/*/authentication/SPM/kek
Date: March 2023
KernelVersion: 5.18
Contact: "Jorge Lopez" <jorge.lopez2@hp.com>
Description:
'kek' Key-Encryption-Key is a write-only file that can be used to configure the
RSA public key that will be used by the BIOS to verify
signatures when setting the signing key. When written,
the bytes should correspond to the KEK certificate
(x509 .DER format containing an OU). The size of the
certificate must be less than or equal to 4095 bytes.
What: /sys/class/firmware-attributes/*/authentication/SPM/sk
Date: March 2023
KernelVersion: 5.18
Contact: "Jorge Lopez" <jorge.lopez2@hp.com>
Description:
'sk' Signature Key is a write-only file that can be used to configure the RSA
public key that will be used by the BIOS to verify signatures
when configuring BIOS settings and security features. When
written, the bytes should correspond to the modulus of the
public key. The exponent is assumed to be 0x10001.
What: /sys/class/firmware-attributes/*/authentication/SPM/status
Date: March 2023
KernelVersion: 5.18
Contact: "Jorge Lopez" <jorge.lopez2@hp.com>
Description:
'status' is a read-only file that returns ASCII text in JSON format reporting
the status information.
"State": "not provisioned | provisioned | provisioning in progress",
"Version": "Major.Minor",
"Nonce": <16-bit unsigned number display in base 10>,
"FeaturesInUse": <16-bit unsigned number display in base 10>,
"EndorsementKeyMod": "<256 bytes in base64>",
"SigningKeyMod": "<256 bytes in base64>"
What: /sys/class/firmware-attributes/*/attributes/Sure_Start/audit_log_entries
Date: March 2023
KernelVersion: 5.18
Contact: "Jorge Lopez" <jorge.lopez2@hp.com>
Description:
'audit_log_entries' is a read-only file that returns the events in the log.
Audit log entry format
Byte 0-15: Requested Audit Log entry (Each Audit log is 16 bytes)
Byte 16-127: Unused
What: /sys/class/firmware-attributes/*/attributes/Sure_Start/audit_log_entry_count
Date: March 2023
KernelVersion: 5.18
Contact: "Jorge Lopez" <jorge.lopez2@hp.com>
Description:
'audit_log_entry_count' is a read-only file that returns the number of existing
audit log events available to be read. Values are separated using comma. (``,``)
[No of entries],[log entry size],[Max number of entries supported]
log entry size identifies audit log size for the current BIOS version.
The current size is 16 bytes but it can be up to 128 bytes long in future BIOS
versions.
......@@ -98,3 +98,91 @@ Description:
Enable an LCD response-time boost to reduce or remove ghosting:
* 0 - Disable,
* 1 - Enable
What: /sys/devices/platform/<platform>/charge_mode
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Get the current charging mode being used:
* 1 - Barrel connected charger,
* 2 - USB-C charging
* 3 - Both connected, barrel used for charging
What: /sys/devices/platform/<platform>/egpu_connected
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Show if the egpu (XG Mobile) is correctly connected:
* 0 - False,
* 1 - True
What: /sys/devices/platform/<platform>/mini_led_mode
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Change the mini-LED mode:
* 0 - Single-zone,
* 1 - Multi-zone
What: /sys/devices/platform/<platform>/ppt_pl1_spl
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the Package Power Target total of CPU: PL1 on Intel, SPL on AMD.
Shown on Intel+Nvidia or AMD+Nvidia based systems:
* min=5, max=250
What: /sys/devices/platform/<platform>/ppt_pl2_sppt
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the Slow Package Power Tracking Limit of CPU: PL2 on Intel, SPPT,
on AMD. Shown on Intel+Nvidia or AMD+Nvidia based systems:
* min=5, max=250
What: /sys/devices/platform/<platform>/ppt_fppt
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the Fast Package Power Tracking Limit of CPU. AMD+Nvidia only:
* min=5, max=250
What: /sys/devices/platform/<platform>/ppt_apu_sppt
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the APU SPPT limit. Shown on full AMD systems only:
* min=5, max=130
What: /sys/devices/platform/<platform>/ppt_platform_sppt
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the platform SPPT limit. Shown on full AMD systems only:
* min=5, max=130
What: /sys/devices/platform/<platform>/nv_dynamic_boost
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the dynamic boost limit of the Nvidia dGPU:
* min=5, max=25
What: /sys/devices/platform/<platform>/nv_temp_target
Date: Jun 2023
KernelVersion: 6.5
Contact: "Luke Jones" <luke@ljones.dev>
Description:
Set the target temperature limit of the Nvidia dGPU:
* min=75, max=87
......@@ -84,3 +84,69 @@ Description:
The file used to write BlueField boot log with the format
"[INFO|WARN|ERR|ASSERT ]<msg>". Log level 'INFO' is used by
default if not specified.
What: /sys/bus/platform/devices/MLNXBF04:00/oob_mac
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "oob_mac" sysfs attribute holds the MAC address for
the out-of-band 1Gbps Ethernet port. This MAC address is
provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/opn
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "opn" sysfs attribute holds the board's part number.
This value is provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/sku
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "sku" sysfs attribute holds the board's SKU number.
This value is provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/modl
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "modl" sysfs attribute holds the board's model number.
This value is provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/sn
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "sn" sysfs attribute holds the board's serial number.
This value is provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/uuid
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "uuid" sysfs attribute holds the board's UUID.
This value is provided by the manufacturing team.
What: /sys/bus/platform/devices/MLNXBF04:00/rev
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "rev" sysfs attribute holds the board's revision.
This value is provided on a board-level label.
What: /sys/bus/platform/devices/MLNXBF04:00/mfg_lock
Date: August 2023
KernelVersion: 6.5
Contact: "David Thompson <davthompson@nvidia.com>"
Description:
The "mfg_lock" sysfs attribute is write-only.
A successful write to this attribute will latch the
board-level attributes into EEPROM, making them read-only.
......@@ -1018,7 +1018,7 @@ AMD PMC DRIVER
M: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: drivers/platform/x86/amd/pmc.c
F: drivers/platform/x86/amd/pmc/
AMD PMF DRIVER
M: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
......@@ -9522,6 +9522,12 @@ S: Obsolete
W: http://w1.fi/hostap-driver.html
F: drivers/net/wireless/intersil/hostap/
HP BIOSCFG DRIVER
M: Jorge Lopez <jorge.lopez2@hp.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: drivers/platform/x86/hp/hp-bioscfg/
HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
L: platform-driver-x86@vger.kernel.org
S: Orphan
......@@ -10802,6 +10808,7 @@ INTEL TPMI DRIVER
M: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: Documentation/ABI/testing/debugfs-tpmi
F: drivers/platform/x86/intel/tpmi.c
F: include/linux/intel_tpmi.h
......@@ -19496,6 +19503,32 @@ F: drivers/media/mmc/siano/
F: drivers/media/usb/siano/
F: drivers/media/usb/siano/
SIEMENS IPC LED DRIVERS
M: Gerd Haeussler <gerd.haeussler.ext@siemens.com>
M: Xing Tong Wu <xingtong.wu@siemens.com>
M: Tobias Schaffner <tobias.schaffner@siemens.com>
L: linux-leds@vger.kernel.org
S: Maintained
F: drivers/leds/simple/
SIEMENS IPC PLATFORM DRIVERS
M: Gerd Haeussler <gerd.haeussler.ext@siemens.com>
M: Xing Tong Wu <xingtong.wu@siemens.com>
M: Tobias Schaffner <tobias.schaffner@siemens.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: drivers/platform/x86/siemens/
F: include/linux/platform_data/x86/simatic-ipc-base.h
F: include/linux/platform_data/x86/simatic-ipc.h
SIEMENS IPC WATCHDOG DRIVERS
M: Gerd Haeussler <gerd.haeussler.ext@siemens.com>
M: Xing Tong Wu <xingtong.wu@siemens.com>
M: Tobias Schaffner <tobias.schaffner@siemens.com>
L: linux-watchdog@vger.kernel.org
S: Maintained
F: drivers/watchdog/simatic-ipc-wdt.c
SIFIVE DRIVERS
M: Palmer Dabbelt <palmer@dabbelt.com>
M: Paul Walmsley <paul.walmsley@sifive.com>
......@@ -23112,8 +23145,10 @@ S: Orphan
F: drivers/net/wireless/legacy/wl3501*
WMI BINARY MOF DRIVER
L: platform-drivers-x86@vger.kernel.org
S: Orphan
M: Armin Wolf <W_Armin@gmx.de>
R: Thomas Weißschuh <linux@weissschuh.net>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: Documentation/ABI/stable/sysfs-platform-wmi-bmof
F: Documentation/wmi/devices/wmi-bmof.rst
F: drivers/platform/x86/wmi-bmof.c
......
......@@ -2,6 +2,7 @@
config LEDS_SIEMENS_SIMATIC_IPC
tristate "LED driver for Siemens Simatic IPCs"
depends on SIEMENS_SIMATIC_IPC
default y
help
This option enables support for the LEDs of several Industrial PCs
from Siemens.
......
......@@ -12,6 +12,7 @@
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/slab.h>
......
This diff is collapsed.
......@@ -81,6 +81,28 @@
*/
#define MLXBF_BOOTCTL_FW_RESET 0x8200000D
/*
* SMC function IDs to set, get and lock the manufacturing information
* stored within the eeprom.
*/
#define MLXBF_BOOTCTL_SET_MFG_INFO 0x8200000E
#define MLXBF_BOOTCTL_GET_MFG_INFO 0x8200000F
#define MLXBF_BOOTCTL_LOCK_MFG_INFO 0x82000011
/*
* SMC function IDs to set and get the large ICM carveout size
* stored in the eeprom.
*/
#define MLNX_HANDLE_SET_ICM_INFO 0x82000012
#define MLNX_HANDLE_GET_ICM_INFO 0x82000013
#define MAX_ICM_BUFFER_SIZE 10
/*
* SMC function ID to set the ARM boot state to up
*/
#define MLNX_HANDLE_OS_UP 0x82000014
/* SMC function IDs for SiP Service queries */
#define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT 0x8200ff00
#define MLXBF_BOOTCTL_SIP_SVC_UID 0x8200ff01
......@@ -106,4 +128,9 @@
/* Additional value to disable the MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION. */
#define MLXBF_BOOTCTL_NONE 0x7fffffff /* Don't change next boot action */
#define MLXBF_LARGE_ICMC_MAX_STRING_SIZE 16
#define MLXBF_LARGE_ICMC_SIZE_MIN 0x80
#define MLXBF_LARGE_ICMC_SIZE_MAX 0x100000
#define MLXBF_LARGE_ICMC_GRANULARITY MLXBF_LARGE_ICMC_SIZE_MIN
#endif /* __MLXBF_BOOTCTL_H__ */
......@@ -12,7 +12,6 @@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_data/mlxreg.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
......@@ -113,7 +112,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
* Return if adapter number is negative. It could be in case hotplug
* event is not associated with hotplug device.
*/
if (data->hpdev.nr < 0)
if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION)
return 0;
pdata = dev_get_platdata(&priv->pdev->dev);
......
......@@ -11,7 +11,6 @@
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_data/mlxreg.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
......
......@@ -84,6 +84,10 @@
#define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5)
#define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6)
#define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7)
#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1)
#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2)
#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3)
#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4)
#define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR
#define NVSW_SN2201_NR_NONE -1
......@@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = {
.reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET,
.mask = BIT(0),
.hpdev.brdinfo = &nvsw_sn2201_fan_devices[0],
.hpdev.nr = NVSW_SN2201_NR_NONE,
.hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR,
},
{
.label = "fan2",
.reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET,
.mask = BIT(1),
.hpdev.brdinfo = &nvsw_sn2201_fan_devices[1],
.hpdev.nr = NVSW_SN2201_NR_NONE,
.hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR,
},
{
.label = "fan3",
.reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET,
.mask = BIT(2),
.hpdev.brdinfo = &nvsw_sn2201_fan_devices[2],
.hpdev.nr = NVSW_SN2201_NR_NONE,
.hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR,
},
{
.label = "fan4",
.reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET,
.mask = BIT(3),
.hpdev.brdinfo = &nvsw_sn2201_fan_devices[3],
.hpdev.nr = NVSW_SN2201_NR_NONE,
.hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR,
},
};
......
......@@ -965,7 +965,7 @@ config SERIAL_MULTI_INSTANTIATE
config MLX_PLATFORM
tristate "Mellanox Technologies platform support"
depends on I2C
depends on ACPI && I2C && PCI
select REGMAP
help
This option enables system support for the Mellanox Technologies
......@@ -1074,17 +1074,7 @@ config INTEL_SCU_IPC_UTIL
low level access for debug work and updating the firmware. Say
N unless you will be doing this on an Intel MID platform.
config SIEMENS_SIMATIC_IPC
tristate "Siemens Simatic IPC Class driver"
depends on PCI
help
This Simatic IPC class driver is the central of several drivers. It
is mainly used for system identification, after which drivers in other
classes will take care of driving specifics of those machines.
i.e. LEDs and watchdog.
To compile this driver as a module, choose M here: the module
will be called simatic-ipc.
source "drivers/platform/x86/siemens/Kconfig"
config WINMATE_FM07_KEYS
tristate "Winmate FM07/FM07P front-panel keys driver"
......@@ -1094,10 +1084,25 @@ config WINMATE_FM07_KEYS
buttons below the display. This module adds an input device
that delivers key events when these buttons are pressed.
config SEL3350_PLATFORM
tristate "SEL-3350 LEDs and power supplies"
depends on ACPI
depends on GPIOLIB
depends on PINCTRL_BROXTON
select POWER_SUPPLY
select NEW_LEDS
select LEDS_CLASS
select LEDS_GPIO
help
Support for LEDs and power supplies on SEL-3350 computers.
To compile this driver as a module, choose M here: the module
will be called sel3350-platform.
endif # X86_PLATFORM_DEVICES
config P2SB
bool "Primary to Sideband (P2SB) bridge access support"
bool
depends on PCI && X86
help
The Primary to Sideband (P2SB) bridge is an interface to some
......
......@@ -131,7 +131,10 @@ obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o
obj-$(CONFIG_X86_INTEL_LPSS) += pmc_atom.o
# Siemens Simatic Industrial PCs
obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += simatic-ipc.o
obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += siemens/
# Winmate
obj-$(CONFIG_WINMATE_FM07_KEYS) += winmate-fm07-keys.o
# SEL
obj-$(CONFIG_SEL3350_PLATFORM) += sel3350-platform.o
......@@ -4,21 +4,7 @@
#
source "drivers/platform/x86/amd/pmf/Kconfig"
config AMD_PMC
tristate "AMD SoC PMC driver"
depends on ACPI && PCI && RTC_CLASS && AMD_NB
select SERIO
help
The driver provides support for AMD Power Management Controller
primarily responsible for S2Idle transactions that are driven from
a platform firmware running on SMU. This driver also provides a debug
mechanism to investigate the S2Idle transactions and failures.
Say Y or M here if you have a notebook powered by AMD RYZEN CPU/APU.
If you choose to compile this driver as a module the module will be
called amd-pmc.
source "drivers/platform/x86/amd/pmc/Kconfig"
config AMD_HSMP
tristate "AMD HSMP Driver"
......
......@@ -4,8 +4,7 @@
# AMD x86 Platform-Specific Drivers
#
amd-pmc-y := pmc.o pmc-quirks.o
obj-$(CONFIG_AMD_PMC) += amd-pmc.o
obj-$(CONFIG_AMD_PMC) += pmc/
amd_hsmp-y := hsmp.o
obj-$(CONFIG_AMD_HSMP) += amd_hsmp.o
obj-$(CONFIG_AMD_PMF) += pmf/
# SPDX-License-Identifier: GPL-2.0-only
#
# AMD PMC Driver
#
config AMD_PMC
tristate "AMD SoC PMC driver"
depends on ACPI && PCI && RTC_CLASS && AMD_NB
depends on SUSPEND
select SERIO
help
The driver provides support for AMD Power Management Controller
primarily responsible for S2Idle transactions that are driven from
a platform firmware running on SMU. This driver also provides a debug
mechanism to investigate the S2Idle transactions and failures.
Say Y or M here if you have a notebook powered by AMD RYZEN CPU/APU.
If you choose to compile this driver as a module the module will be
called amd-pmc.
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for linux/drivers/platform/x86/amd/pmc
# AMD Power Management Controller Driver
#
amd-pmc-objs := pmc.o pmc-quirks.o
obj-$(CONFIG_AMD_PMC) += amd-pmc.o
......@@ -8,6 +8,7 @@
* Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
*/
#include <linux/string_choices.h>
#include <linux/workqueue.h>
#include "pmf.h"
......@@ -399,7 +400,7 @@ static ssize_t cnqf_enable_store(struct device *dev,
amd_pmf_set_sps_power_limits(pdev);
}
dev_dbg(pdev->dev, "Received CnQF %s\n", input ? "on" : "off");
dev_dbg(pdev->dev, "Received CnQF %s\n", str_on_off(input));
return count;
}
......@@ -409,7 +410,7 @@ static ssize_t cnqf_enable_show(struct device *dev,
{
struct amd_pmf_dev *pdev = dev_get_drvdata(dev);
return sysfs_emit(buf, "%s\n", pdev->cnqf_enabled ? "on" : "off");
return sysfs_emit(buf, "%s\n", str_on_off(pdev->cnqf_enabled));
}
static DEVICE_ATTR_RW(cnqf_enable);
......
......@@ -324,7 +324,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
{
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) {
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) ||
is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) {
power_supply_unreg_notifier(&dev->pwr_src_notifier);
amd_pmf_deinit_sps(dev);
}
......
This diff is collapsed.
......@@ -393,6 +393,7 @@ static int init_bios_attributes(int attr_type, const char *guid)
struct kobject *attr_name_kobj; //individual attribute names
union acpi_object *obj = NULL;
union acpi_object *elements;
struct kobject *duplicate;
struct kset *tmp_set;
int min_elements;
......@@ -451,9 +452,11 @@ static int init_bios_attributes(int attr_type, const char *guid)
else
tmp_set = wmi_priv.main_dir_kset;
if (kset_find_obj(tmp_set, elements[ATTR_NAME].string.pointer)) {
pr_debug("duplicate attribute name found - %s\n",
duplicate = kset_find_obj(tmp_set, elements[ATTR_NAME].string.pointer);
if (duplicate) {
pr_debug("Duplicate attribute name found - %s\n",
elements[ATTR_NAME].string.pointer);
kobject_put(duplicate);
goto nextobj;
}
......
......@@ -60,4 +60,20 @@ config TC1100_WMI
This is a driver for the WMI extensions (wireless and bluetooth power
control) of the HP Compaq TC1100 tablet.
config HP_BIOSCFG
tristate "HP BIOS Configuration Driver"
default m
depends on ACPI_WMI
select NLS
select FW_ATTR_CLASS
help
This driver enables administrators to securely manage BIOS settings
using digital certificates and public-key cryptography that eliminate
the need for passwords for both remote and local management. It supports
changing BIOS settings on many HP machines from 2018 and newer without
the use of any additional software.
To compile this driver as a module, choose M here: the module will
be called hp-bioscfg.
endif # X86_PLATFORM_DRIVERS_HP
......@@ -8,3 +8,4 @@
obj-$(CONFIG_HP_ACCEL) += hp_accel.o
obj-$(CONFIG_HP_WMI) += hp-wmi.o
obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o
obj-$(CONFIG_HP_BIOSCFG) += hp-bioscfg/
obj-$(CONFIG_HP_BIOSCFG) := hp-bioscfg.o
hp-bioscfg-objs := bioscfg.o \
biosattr-interface.o \
enum-attributes.o \
int-attributes.o \
order-list-attributes.o \
passwdobj-attributes.o \
spmobj-attributes.o \
string-attributes.o \
surestart-attributes.o
// SPDX-License-Identifier: GPL-2.0
/*
* Functions corresponding to methods under BIOS interface GUID
* for use with hp-bioscfg driver.
*
* Copyright (c) 2022 Hewlett-Packard Inc.
*/
#include <linux/wmi.h>
#include "bioscfg.h"
/*
* struct bios_args buffer is dynamically allocated. New WMI command types
* were introduced that exceeds 128-byte data size. Changes to handle
* the data size allocation scheme were kept in hp_wmi_perform_query function.
*/
struct bios_args {
u32 signature;
u32 command;
u32 commandtype;
u32 datasize;
u8 data[];
};
/**
* hp_set_attribute
*
* @a_name: The attribute name
* @a_value: The attribute value
*
* Sets an attribute to new value
*
* Returns zero on success
* -ENODEV if device is not found
* -EINVAL if the instance of 'Setup Admin' password is not found.
* -ENOMEM unable to allocate memory
*/
int hp_set_attribute(const char *a_name, const char *a_value)
{
int security_area_size;
int a_name_size, a_value_size;
u16 *buffer = NULL;
u16 *start;
int buffer_size, instance, ret;
char *auth_token_choice;
mutex_lock(&bioscfg_drv.mutex);
instance = hp_get_password_instance_for_type(SETUP_PASSWD);
if (instance < 0) {
ret = -EINVAL;
goto out_set_attribute;
}
/* Select which auth token to use; password or [auth token] */
if (bioscfg_drv.spm_data.auth_token)
auth_token_choice = bioscfg_drv.spm_data.auth_token;
else
auth_token_choice = bioscfg_drv.password_data[instance].current_password;
a_name_size = hp_calculate_string_buffer(a_name);
a_value_size = hp_calculate_string_buffer(a_value);
security_area_size = hp_calculate_security_buffer(auth_token_choice);
buffer_size = a_name_size + a_value_size + security_area_size;
buffer = kmalloc(buffer_size + 1, GFP_KERNEL);
if (!buffer) {
ret = -ENOMEM;
goto out_set_attribute;
}
/* build variables to set */
start = buffer;
start = hp_ascii_to_utf16_unicode(start, a_name);
if (!start) {
ret = -EINVAL;
goto out_set_attribute;
}
start = hp_ascii_to_utf16_unicode(start, a_value);
if (!start) {
ret = -EINVAL;
goto out_set_attribute;
}
ret = hp_populate_security_buffer(start, auth_token_choice);
if (ret < 0)
goto out_set_attribute;
ret = hp_wmi_set_bios_setting(buffer, buffer_size);
out_set_attribute:
kfree(buffer);
mutex_unlock(&bioscfg_drv.mutex);
return ret;
}
/**
* hp_wmi_perform_query
*
* @query: The commandtype (enum hp_wmi_commandtype)
* @command: The command (enum hp_wmi_command)
* @buffer: Buffer used as input and/or output
* @insize: Size of input buffer
* @outsize: Size of output buffer
*
* returns zero on success
* an HP WMI query specific error code (which is positive)
* -EINVAL if the query was not successful at all
* -EINVAL if the output buffer size exceeds buffersize
*
* Note: The buffersize must at least be the maximum of the input and output
* size. E.g. Battery info query is defined to have 1 byte input
* and 128 byte output. The caller would do:
* buffer = kzalloc(128, GFP_KERNEL);
* ret = hp_wmi_perform_query(HPWMI_BATTERY_QUERY, HPWMI_READ,
* buffer, 1, 128)
*/
int hp_wmi_perform_query(int query, enum hp_wmi_command command, void *buffer,
u32 insize, u32 outsize)
{
struct acpi_buffer input, output = { ACPI_ALLOCATE_BUFFER, NULL };
struct bios_return *bios_return;
union acpi_object *obj = NULL;
struct bios_args *args = NULL;
int mid, actual_outsize, ret;
size_t bios_args_size;
mid = hp_encode_outsize_for_pvsz(outsize);
if (WARN_ON(mid < 0))
return mid;
bios_args_size = struct_size(args, data, insize);
args = kmalloc(bios_args_size, GFP_KERNEL);
if (!args)
return -ENOMEM;
input.length = bios_args_size;
input.pointer = args;
/* BIOS expects 'SECU' in hex as the signature value*/
args->signature = 0x55434553;
args->command = command;
args->commandtype = query;
args->datasize = insize;
memcpy(args->data, buffer, flex_array_size(args, data, insize));
ret = wmi_evaluate_method(HP_WMI_BIOS_GUID, 0, mid, &input, &output);
if (ret)
goto out_free;
obj = output.pointer;
if (!obj) {
ret = -EINVAL;
goto out_free;
}
if (obj->type != ACPI_TYPE_BUFFER ||
obj->buffer.length < sizeof(*bios_return)) {
pr_warn("query 0x%x returned wrong type or too small buffer\n", query);
ret = -EINVAL;
goto out_free;
}
bios_return = (struct bios_return *)obj->buffer.pointer;
ret = bios_return->return_code;
if (ret) {
if (ret != INVALID_CMD_VALUE && ret != INVALID_CMD_TYPE)
pr_warn("query 0x%x returned error 0x%x\n", query, ret);
goto out_free;
}
/* Ignore output data of zero size */
if (!outsize)
goto out_free;
actual_outsize = min_t(u32, outsize, obj->buffer.length - sizeof(*bios_return));
memcpy_and_pad(buffer, outsize, obj->buffer.pointer + sizeof(*bios_return),
actual_outsize, 0);
out_free:
ret = hp_wmi_error_and_message(ret);
kfree(obj);
kfree(args);
return ret;
}
static void *utf16_empty_string(u16 *p)
{
*p++ = 2;
*p++ = 0x00;
return p;
}
/**
* hp_ascii_to_utf16_unicode - Convert ascii string to UTF-16 unicode
*
* BIOS supports UTF-16 characters that are 2 bytes long. No variable
* multi-byte language supported.
*
* @p: Unicode buffer address
* @str: string to convert to unicode
*
* Returns a void pointer to the buffer string
*/
void *hp_ascii_to_utf16_unicode(u16 *p, const u8 *str)
{
int len = strlen(str);
int ret;
/*
* Add null character when reading an empty string
* "02 00 00 00"
*/
if (len == 0)
return utf16_empty_string(p);
/* Move pointer len * 2 number of bytes */
*p++ = len * 2;
ret = utf8s_to_utf16s(str, strlen(str), UTF16_HOST_ENDIAN, p, len);
if (ret < 0) {
dev_err(bioscfg_drv.class_dev, "UTF16 conversion failed\n");
return NULL;
}
if (ret * sizeof(u16) > U16_MAX) {
dev_err(bioscfg_drv.class_dev, "Error string too long\n");
return NULL;
}
p += len;
return p;
}
/**
* hp_wmi_set_bios_setting - Set setting's value in BIOS
*
* @input_buffer: Input buffer address
* @input_size: Input buffer size
*
* Returns: Count of unicode characters written to BIOS if successful, otherwise
* -ENOMEM unable to allocate memory
* -EINVAL buffer not allocated or too small
*/
int hp_wmi_set_bios_setting(u16 *input_buffer, u32 input_size)
{
union acpi_object *obj;
struct acpi_buffer input = {input_size, input_buffer};
struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
int ret;
ret = wmi_evaluate_method(HP_WMI_SET_BIOS_SETTING_GUID, 0, 1, &input, &output);
obj = output.pointer;
if (!obj)
return -EINVAL;
if (obj->type != ACPI_TYPE_INTEGER) {
ret = -EINVAL;
goto out_free;
}
ret = obj->integer.value;
if (ret) {
ret = hp_wmi_error_and_message(ret);
goto out_free;
}
out_free:
kfree(obj);
return ret;
}
static int hp_attr_set_interface_probe(struct wmi_device *wdev, const void *context)
{
mutex_lock(&bioscfg_drv.mutex);
mutex_unlock(&bioscfg_drv.mutex);
return 0;
}
static void hp_attr_set_interface_remove(struct wmi_device *wdev)
{
mutex_lock(&bioscfg_drv.mutex);
mutex_unlock(&bioscfg_drv.mutex);
}
static const struct wmi_device_id hp_attr_set_interface_id_table[] = {
{ .guid_string = HP_WMI_BIOS_GUID},
{ }
};
static struct wmi_driver hp_attr_set_interface_driver = {
.driver = {
.name = DRIVER_NAME,
},
.probe = hp_attr_set_interface_probe,
.remove = hp_attr_set_interface_remove,
.id_table = hp_attr_set_interface_id_table,
};
int hp_init_attr_set_interface(void)
{
return wmi_driver_register(&hp_attr_set_interface_driver);
}
void hp_exit_attr_set_interface(void)
{
wmi_driver_unregister(&hp_attr_set_interface_driver);
}
MODULE_DEVICE_TABLE(wmi, hp_attr_set_interface_id_table);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for linux/drivers/platform/x86/siemens
# Siemens x86 Platform-Specific Drivers
#
obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += simatic-ipc.o
obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT) += simatic-ipc-batt.o
obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_APOLLOLAKE) += simatic-ipc-batt-apollolake.o
obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_ELKHARTLAKE) += simatic-ipc-batt-elkhartlake.o
obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_F7188X) += simatic-ipc-batt-f7188x.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Siemens SIMATIC IPC driver for CMOS battery monitoring
*
* Copyright (c) Siemens AG, 2023
*
* Author:
* Henning Schild <henning.schild@siemens.com>
*/
#ifndef _SIMATIC_IPC_BATT_H
#define _SIMATIC_IPC_BATT_H
int simatic_ipc_batt_probe(struct platform_device *pdev,
struct gpiod_lookup_table *table);
int simatic_ipc_batt_remove(struct platform_device *pdev,
struct gpiod_lookup_table *table);
#endif /* _SIMATIC_IPC_BATT_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -27,4 +27,6 @@ struct intel_tpmi_plat_info *tpmi_get_platform_data(struct auxiliary_device *aux
struct resource *tpmi_get_resource_at_index(struct auxiliary_device *auxdev, int index);
int tpmi_get_resource_count(struct auxiliary_device *auxdev);
int tpmi_get_feature_status(struct auxiliary_device *auxdev, int feature_id, int *locked,
int *disabled);
#endif
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment