aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware
AgeCommit message (Collapse)AuthorFilesLines
2018-10-15gsmi: Add GSMI commands to log S0ix infoFurquan Shaikh1-1/+92
Add new GSMI commands (GSMI_CMD_LOG_S0IX_SUSPEND = 0xa, GSMI_CMD_LOG_S0IX_RESUME = 0xb) that allow firmware to log any information during S0ix suspend/resume paths. Traditional ACPI suspend S3 involves BIOS both during the suspend and the resume paths. However, modern suspend type like S0ix does not involve firmware on either of the paths. This command gives the firmware an opportunity to log any required information about the suspend and resume operations e.g. wake sources. Additionally, this change adds a module parameter to allow platforms to specifically enable S0ix logging if required. This prevents any other platforms from unnecessarily making a GSMI call which could have any side-effects. Tested by verifying that wake sources are correctly logged in eventlog. Signed-off-by: Furquan Shaikh <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> Reviewed-by: Rajat Jain <[email protected]> Signed-off-by: Furquan Shaikh <[email protected]> Tested-by: Furquan Shaikh <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> [zwisler: update changelog for upstream] Signed-off-by: Ross Zwisler <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-15gsmi: Remove autoselected dependency on EFI and EFI_VARSDuncan Laurie2-7/+15
Instead of selecting EFI and EFI_VARS automatically when GSMI is enabled let that portion of the driver be conditionally compiled if EFI and EFI_VARS are enabled. This allows the rest of the driver (specifically event log) to be used if EFI_VARS is not enabled. To test: 1) verify that EFI_VARS is not automatically selected when CONFIG_GOOGLE_GSMI is enabled 2) verify that the kernel boots on Link and that GSMI event log is still available and functional 3) specifically boot the kernel on Alex to ensure it does not try to load efivars and that gsmi also does not load because it is not in the supported DMI table Signed-off-by: Duncan Laurie <[email protected]> Reviewed-by: Olof Johansson <[email protected]> Signed-off-by: Benson Leung <[email protected]> Signed-off-by: Ben Zhang <[email protected]> Signed-off-by: Filipe Brandenburger <[email protected]> Signed-off-by: Furquan Shaikh <[email protected]> Tested-by: Furquan Shaikh <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> [zwisler: update changelog for upstream] Signed-off-by: Ross Zwisler <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-15gsmi: Add coreboot to list of matching BIOS vendorsDuncan Laurie1-0/+6
In order to use this coreboot needs board support for: CONFIG_ELOG=y CONFIG_ELOG_GSMI=y And the kernel driver needs enabled: CONFIG_GOOGLE_GSMI=y To test, verify that clean shutdown event is added to the log: > mosys eventlog list | grep 'Clean Shutdown' 11 | 2012-06-25 09:49:24 | Kernl Event | Clean Shutdown Signed-off-by: Duncan Laurie <[email protected]> Reviewed-by: Vadim Bendebury <[email protected]> Reviewed-by: Stefan Reinauer <[email protected]> Signed-off-by: Furquan Shaikh <[email protected]> Tested-by: Furquan Shaikh <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> Reviewed-by: Justin TerAvest <[email protected]> [zwisler: update changelog for upstream] Signed-off-by: Ross Zwisler <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-15gsmi: Fix bug in append_to_eventlog sysfs handlerDuncan Laurie1-3/+2
The sysfs handler should return the number of bytes consumed, which in the case of a successful write is the entire buffer. Also fix a bug where param.data_len was being set to (count - (2 * sizeof(u32))) instead of just (count - sizeof(u32)). The latter is correct because we skip over the leading u32 which is our param.type, but we were also incorrectly subtracting sizeof(u32) on the line where we were actually setting param.data_len: param.data_len = count - sizeof(u32); This meant that for our example event.kernel_software_watchdog with total length 10 bytes, param.data_len was just 2 prior to this change. To test, successfully append an event to the log with gsmi sysfs. This sample event is for a "Kernel Software Watchdog" > xxd -g 1 event.kernel_software_watchdog 0000000: 01 00 00 00 ad de 06 00 00 00 > cat event.kernel_software_watchdog > /sys/firmware/gsmi/append_to_eventlog > mosys eventlog list | tail -1 14 | 2012-06-25 10:14:14 | Kernl Event | Software Watchdog Signed-off-by: Duncan Laurie <[email protected]> Reviewed-by: Vadim Bendebury <[email protected]> Reviewed-by: Stefan Reinauer <[email protected]> Signed-off-by: Furquan Shaikh <[email protected]> Tested-by: Furquan Shaikh <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> Reviewed-by: Justin TerAvest <[email protected]> [zwisler: updated changelog for 2nd bug fix and upstream] Signed-off-by: Ross Zwisler <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-11Merge tag 'tegra-for-4.20-firmware-2' of ↵Arnd Bergmann1-0/+19
git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers firmware: tegra: Changes for v4.20-rc1 This contains a fix for suspend/resume support for the BPMP found on Tegra186 and Tegra194. * tag 'tegra-for-4.20-firmware-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: bpmp: Implement suspend/resume support Signed-off-by: Arnd Bergmann <[email protected]>
2018-10-10firmware: tegra: bpmp: Implement suspend/resume supportThierry Reding1-0/+19
When returning from a system sleep state, the BPMP driver needs to reinitialize the IVC channels used to communicate with the BPMP to restore proper functionality. Signed-off-by: Thierry Reding <[email protected]>
2018-10-10Merge tag 'zynqmp-soc-clk-for-v4.20' of https://github.com/Xilinx/linux-xlnx ↵Arnd Bergmann1-0/+42
into next/drivers arm64: zynqmp: SoC CLK changes for v4.20 This patchset adds CCF compliant clock driver for ZynqMP. Clock driver queries supported clock information from firmware and regiters pll and output clocks with CCF. * tag 'zynqmp-soc-clk-for-v4.20' of https://github.com/Xilinx/linux-xlnx: drivers: clk: Add ZynqMP clock driver dt-bindings: clock: Add bindings for ZynqMP clock driver firmware: xilinx: Add zynqmp IOCTL API for device control Documentation: xilinx: Add documentation for eemi APIs Signed-off-by: Arnd Bergmann <[email protected]>
2018-10-10Merge tag 'imx-drivers-4.20-2' of ↵Arnd Bergmann6-0/+384
git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/drivers i.MX drivers change for 4.20, round 2: - A series from Aisheng Dong to add SCU firmware driver for i.MX8 SoCs. It implements IPC mechanism based on mailbox for message exchange between AP and SCU firmware, and a set of SCU IPC service APIs used by clients like i.MX8 power domain and clock drivers. * tag 'imx-drivers-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: MAINTAINERS: imx: include drivers/firmware/imx path firmware: imx: add misc svc support firmware: imx: add SCU firmware driver support dt-bindings: arm: fsl: add scu binding doc Signed-off-by: Arnd Bergmann <[email protected]>
2018-10-09firmware: xilinx: Add zynqmp IOCTL API for device controlRajan Vaja1-0/+42
Add ZynqMP firmware IOCTL API to control and configure devices like PLLs, SD, Gem, etc. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-10-08firmware: imx: add misc svc supportDong Aisheng2-1/+100
Add SCU MISC SVC support which provides misc control get/set functions. Cc: Shawn Guo <[email protected]> Reviewed-by: Sascha Hauer <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2018-10-08firmware: imx: add SCU firmware driver supportDong Aisheng5-0/+285
The System Controller Firmware (SCFW) is a low-level system function which runs on a dedicated Cortex-M core to provide power, clock, and resource management. It exists on some i.MX8 processors. e.g. i.MX8QM (QM, QP), and i.MX8QX (QXP, DX). This patch implements the SCU firmware IPC function and the common message sending API sc_call_rpc. Cc: Shawn Guo <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Jassi Brar <[email protected]> Reviewed-by: Sascha Hauer <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2018-10-04firmware: Convert to using %pOFn instead of device_node.nameRob Herring1-1/+1
In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Acked-by: Sudeep Holla <[email protected]> Signed-off-by: Rob Herring <[email protected]>
2018-10-02Merge tag 'qcom-drivers-for-4.20' of ↵Arnd Bergmann1-32/+42
git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers Qualcomm ARM Based Driver Updates for v4.20 * Refactor of SCM compatibles and clock requirements * SMEM cleanup * Add LLCC EDAC driver * Fixes for GENI clocks and macros * Fix includes for llcc-slice and smem * String overflow fixes for APR and wcnss_ctrl * Fixup for COMPILE_TEST of qcom driver Kconfigs * Cleanup of Kconfig depends of rpmh, smd_rpm, smsm, and smp2p * Add SCM dependencies to SPM and rmtfs-mem * tag 'qcom-drivers-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: (38 commits) soc: qcom: geni: geni_se_clk_freq_match() should always accept multiples soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get() soc: qcom: geni: Make version macros simpler dt-bindings: firmware: scm: Add MSM8998 and SDM845 firmware: qcom: scm: Refactor clock handling dt-bindings: firmware: scm: Refactor compatibles and clocks soc: qcom: smem: a few last cleanups soc: qcom: smem: verify partition host ids match soc: qcom: smem: small change in global entry loop soc: qcom: smem: verify partition offset_free_uncached soc: qcom: smem: verify partition header size soc: qcom: smem: introduce qcom_smem_partition_header() soc: qcom: smem: require order of host ids to match soc: qcom: smem: verify both host ids in partition header soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions() soc: qcom: smem: always ignore partitions with 0 offset or size soc: qcom: smem: initialize region struct only when successful soc: qcom: smem: rename variable in qcom_smem_get_global() drivers: qcom: rpmh-rsc: clear wait_for_compl after use soc: qcom: rmtfs-mem: Validate that scm is available ... Signed-off-by: Arnd Bergmann <[email protected]>
2018-09-30Merge 4.19-rc6Greg Kroah-Hartman1-3/+6
We want those fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-27Merge tag 'efi-next' of ↵Thomas Gleixner6-46/+141
git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core Pull EFI updates for v4.20 from Ard Biesheuvel: - Add support for enlisting the help of the EFI firmware to create memory reservations that persist across kexec. - Add page fault handling to the runtime services support code on x86 so we can gracefully recover from buggy EFI firmware. - Fix command line handling on x86 for the boot path that omits the stub's PE/COFF entry point. - Other assorted fixes.
2018-09-27firmware: dcdbas: Move dcdbas to drivers/platform/x86Stuart Hayes4-895/+0
Move dcdbas to the more appropriate directory drivers/platform/x86. Signed-off-by: Stuart Hayes <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-09-27firmware: dell_rbu: Move dell_rbu to drivers/platform/x86Stuart Hayes3-766/+0
Move dell_rbu to the more appropriate directory drivers/platform/x86. Signed-off-by: Stuart Hayes <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-09-27firmware: dcdbas: Add support for WSMT ACPI tableStuart Hayes2-6/+127
If the WSMT ACPI table is present and indicates that a fixed communication buffer should be used, use the firmware-specified buffer instead of allocating a buffer in memory for communications between the dcdbas driver and firmare. Signed-off-by: Stuart Hayes <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-09-27firmware: dell_rbu: Make payload memory uncachableStuart Hayes1-0/+8
The dell_rbu driver takes firmware update payloads and puts them in memory so the system BIOS can find them after a reboot. This sometimes fails (though rarely), because the memory containing the payload is in the CPU cache but never gets written back to main memory before the system is rebooted (CPU cache contents are lost on reboot). With this patch, the payload memory will be changed to uncachable to ensure that the payload is actually in main memory before the system is rebooted. Signed-off-by: Stuart Hayes <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-09-26Merge tag 'zynqmp-soc-for-v4.20-v2' of https://github.com/Xilinx/linux-xlnx ↵Arnd Bergmann7-0/+827
into next/drivers arm64: zynqmp: SoC changes for v4.20 - Adding firmware API for SoC with debugfs interface Firmware driver communicates to Platform Management Unit (PMU) by using SMC instructions routed to Arm Trusted Firmware (ATF). Initial version adds support for base firmware driver with query and clock APIs. EEMI spec is available here: https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf * tag 'zynqmp-soc-for-v4.20-v2' of https://github.com/Xilinx/linux-xlnx: firmware: xilinx: Add debugfs for query data API firmware: xilinx: Add debugfs interface firmware: xilinx: Add clock APIs firmware: xilinx: Add query data API firmware: xilinx: Add Zynqmp firmware driver dt-bindings: firmware: Add bindings for ZynqMP firmware Signed-off-by: Arnd Bergmann <[email protected]>
2018-09-26efi/x86: Handle page faults occurring while running EFI runtime servicesSai Praneeth1-0/+8
Memory accesses performed by UEFI runtime services should be limited to: - reading/executing from EFI_RUNTIME_SERVICES_CODE memory regions - reading/writing from/to EFI_RUNTIME_SERVICES_DATA memory regions - reading/writing by-ref arguments - reading/writing from/to the stack. Accesses outside these regions may cause the kernel to hang because the memory region requested by the firmware isn't mapped in efi_pgd, which causes a page fault in ring 0 and the kernel fails to handle it, leading to die(). To save kernel from hanging, add an EFI specific page fault handler which recovers from such faults by 1. If the efi runtime service is efi_reset_system(), reboot the machine through BIOS. 2. If the efi runtime service is _not_ efi_reset_system(), then freeze efi_rts_wq and schedule a new process. The EFI page fault handler offers us two advantages: 1. Avoid potential hangs caused by buggy firmware. 2. Shout loud that the firmware is buggy and hence is not a kernel bug. Tested-by: Bhupesh Sharma <[email protected]> Suggested-by: Matt Fleming <[email protected]> Based-on-code-from: Ricardo Neri <[email protected]> Signed-off-by: Sai Praneeth Prakhya <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> [ardb: clarify commit log] Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi: Make efi_rts_work accessible to efi page fault handlerSai Praneeth1-44/+9
After the kernel has booted, if any accesses by firmware causes a page fault, the efi page fault handler would freeze efi_rts_wq and schedules a new process. To do this, the efi page fault handler needs efi_rts_work. Hence, make it accessible. There will be no race conditions in accessing this structure, because all the calls to efi runtime services are already serialized. Tested-by: Bhupesh Sharma <[email protected]> Suggested-by: Matt Fleming <[email protected]> Based-on-code-from: Ricardo Neri <[email protected]> Signed-off-by: Sai Praneeth Prakhya <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi/efi_test: add exporting ResetSystem runtime serviceIvan Hu2-0/+37
Add exporting the UEFI runtime service ResetSystem for upper application or test tools to use. Signed-off-by: Ivan Hu <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi/libstub: arm: support building with clangAlistair Strachan1-1/+2
When building with CONFIG_EFI and CONFIG_EFI_STUB on ARM, the libstub Makefile would use -mno-single-pic-base without checking it was supported by the compiler. As the ARM (32-bit) clang backend does not support this flag, the build would fail. This changes the Makefile to check the compiler's support for -mno-single-pic-base before using it, similar to c1c386681bd7 ("ARM: 8767/1: add support for building ARM kernel with clang"). Signed-off-by: Alistair Strachan <[email protected]> Reviewed-by: Stefan Agner <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi: add API to reserve memory persistently across kexec rebootArd Biesheuvel1-0/+32
Add kernel plumbing to reserve memory regions persistently on a EFI system by adding entries to the MEMRESERVE linked list. Tested-by: Jeremy Linton <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi/arm: libstub: add a root memreserve config tableArd Biesheuvel1-0/+27
Installing UEFI configuration tables can only be done before calling ExitBootServices(), so if we want to use the new MEMRESRVE config table from the kernel proper, we need to install a dummy entry from the stub. Tested-by: Jeremy Linton <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26efi: honour memory reservations passed via a linux specific config tableArd Biesheuvel1-1/+26
In order to allow the OS to reserve memory persistently across a kexec, introduce a Linux-specific UEFI configuration table that points to the head of a linked list in memory, allowing each kernel to add list items describing memory regions that the next kernel should treat as reserved. This is useful, e.g., for GICv3 based ARM systems that cannot disable DMA access to the LPI tables, forcing them to reuse the same memory region again after a kexec reboot. Tested-by: Jeremy Linton <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-26firmware: xilinx: Add debugfs for query data APIRajan Vaja1-0/+28
Add debugfs file to query platform specific data from firmware using debugfs interface. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-09-26firmware: xilinx: Add debugfs interfaceRajan Vaja5-0/+259
Firmware-debug provides debugfs interface to all APIs. Debugfs can be used to call firmware APIs with required parameters. Usage: * Calling firmware API through debugfs: # echo "<api-name> <arg1> .. <argn>" > /sys/.../zynqmp-firmware/pm * Read output of last called firmware API: # cat /sys/.../zynqmp-firmware/pm Refer ug1200 for more information on these APIs: * https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf Add basic debugfs file to get API version. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-09-26firmware: xilinx: Add clock APIsRajan Vaja1-2/+184
Add clock APIs to control clocks through firmware interface. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-09-26firmware: xilinx: Add query data APIRajan Vaja1-0/+14
Add ZynqMP firmware query data API to query platform specific information(clocks, pins) from firmware. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-09-26firmware: xilinx: Add Zynqmp firmware driverRajan Vaja5-0/+344
This patch is adding communication layer with firmware. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to PMUFW(Platform Management Unit). All requests go through ATF. Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Signed-off-by: Michal Simek <[email protected]>
2018-09-25Merge tag 'drivers_soc_for_4.20' of ↵Olof Johansson1-4/+20
git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/drivers soc: driver soc update for v4.20 - Enable host-id as an optional dt property - Fix minor typo in knav driver * tag 'drivers_soc_for_4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: soc: ti: fix spelling mistake "instace" -> "instance" firmware: ti_sci: Provide host-id as an optional dt parameter Documentation: dt: keystone: ti-sci: Add optional host-id parameter Signed-off-by: Olof Johansson <[email protected]>
2018-09-25Merge tag 'scmi-updates-4.20' of ↵Olof Johansson5-5/+33
git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers SCMI updates for v4.20 1. Addition of interface to fetch estimated power from the firmware corresponding to each OPP of a device 2. Cleanup using strlcpy to ensure NULL-terminated strings for name strings instead of relying on the firmware to do the same * tag 'scmi-updates-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: add a getter for power of performance states firmware: arm_scmi: use strlcpy to ensure NULL-terminated strings Signed-off-by: Olof Johansson <[email protected]>
2018-09-25Merge tag 'v4.19-rc3' into next/driversOlof Johansson1-1/+7
Linux 4.19-rc3
2018-09-25firmware: vpd: fix spelling mistake "partion" -> "partition"Colin Ian King1-1/+1
Trivial fix to spelling mistake in comment Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Only populate devices in coreboot_table_init()Stephen Boyd1-38/+29
This function checks the header for sanity, registers a bus, and populates devices for each coreboot table entry. Let's just populate devices here and pull the other bits up into the caller so that this function can be repurposed for pure device creation and registration. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Cc: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Suggested-by: Julius Werner <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Remap RAM with memremap() instead of ioremap()Stephen Boyd1-21/+19
This is all system memory, so we shouldn't be mapping this all with ioremap() as these aren't I/O regions. Instead, they're memory regions so we should use memremap(). Pick MEMREMAP_WB so we can map memory from RAM directly if that's possible, otherwise it falls back to ioremap_cache() like is being done here already. This also nicely silences the sparse warnings in this code and reduces the need to copy anything around anymore. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Cc: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Collapse platform drivers into bus coreStephen Boyd6-176/+72
The DT based and ACPI based platform drivers here do the same thing; map some memory and hand it over to the coreboot bus to populate devices. The only major difference is that the DT based driver doesn't map the coreboot table header to figure out how large of a region to map for the whole coreboot table and it uses of_iomap() instead of ioremap_cache(). A cached or non-cached mapping shouldn't matter here and mapping some smaller region first before mapping the whole table is just more work but should be OK. In the end, we can remove two files and combine the code all in one place making it easier to reason about things. We leave the old Kconfigs in place for a little while longer but make them hidden and select the previously hidden config option. This way users can upgrade without having to know to reselect this config in the future. Later on we can remove the old hidden configs. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Cc: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Make bus registration symmetricStephen Boyd1-6/+8
The bus is registered in module_init() but is unregistered when the platform driver remove() function calls coreboot_table_exit(). That isn't symmetric and it causes the bus to appear on systems that compile this code in, even when there isn't any coreboot firmware on the device. Let's move the registration to the coreboot_table_init() function so that it matches the exit path. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Cc: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Unmap ioregion after device populationStephen Boyd1-3/+4
Both callers of coreboot_table_init() ioremap the pointer that comes in but they don't unmap the memory on failure. Both of them also fail probe immediately with the return value of coreboot_table_init(), leaking a mapping when it fails. The mapping isn't necessary at all after devices are populated either, so we can just drop the mapping here when we exit the function. Let's do that to simplify the code a bit and plug the leak. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Cc: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Fixes: 570d30c2823f ("firmware: coreboot: Expose the coreboot table as a bus") Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: coreboot: Let OF core populate platform deviceStephen Boyd1-25/+3
Now that the /firmware/coreboot node in DT is populated by the core DT platform code with commit 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") we should and can remove the platform device creation here. Otherwise, the of_platform_device_create() call will fail, the coreboot of driver won't be registered, and this driver will never bind. At the same time, we should move this driver to use MODULE_DEVICE_TABLE so that module auto-load works properly when the coreboot device is auto-populated and we should drop the of_node handling that was presumably placed here to hold a reference to the DT node created during module init that no longer happens. Cc: Wei-Ning Huang <[email protected]> Cc: Julius Werner <[email protected]> Reviewed-by: Brian Norris <[email protected]> Cc: Samuel Holland <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Julius Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: google: make structure gsmi_dev staticColin Ian King1-1/+1
The structure gsmi_dev is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'gsmi_dev' was not declared. Should it be static? Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-09-14firmware: qcom: scm: Refactor clock handlingBjorn Andersson1-32/+42
At one point in time all "future" platforms required three clocks, so the binding and driver was written to treat this as the default case. But new platforms has no clock requirements, which currently makes them all a special case, causing the need for a patch in the binding and driver for each new platform added. This patch reworks the driver logic so that it will attempt to acquire all three clocks and fail based on the given compatible. This allow us to drop the clock requirement from "qcom,scm", in a way that will remain backwards compatible with existing DT files. Specific compatibles are added for apq8084, msm8916 and msm8974 to match the updated binding and although equivalent to qcom,scm both ipq4019 and msm8996 are kept as these have been used without fallback to qcom,scm. The result of this patch is that new platforms, that require no clocks, can be use the fallback compatible of "qcom,scm". Signed-off-by: Bjorn Andersson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Andy Gross <[email protected]>
2018-09-12firmware: meson_sm: Add serial number sysfs entryNeil Armstrong1-0/+56
The Amlogic Meson SoC Secure Monitor implements a call to retrieve an unique SoC ID starting from the GX Family and all new families. The serial number is simply exposed as a sysfs entry under the firmware sysfs directory. Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Kevin Hilman <[email protected]>
2018-09-12efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to yScott Branden1-3/+6
Default EFI_ARMSTUB_DTB_LOADER to y to allow the dtb= command line parameter to function with efi loader. Required for development purposes and to boot on existing bootloaders that do not support devicetree provided by the firmware or by the bootloader. Fixes: 3d7ee348aa41 ("efi/libstub/arm: Add opt-in Kconfig option ...") Signed-off-by: Scott Branden <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2018-09-10firmware: arm_scmi: add a getter for power of performance statesQuentin Perret1-0/+28
The SCMI protocol can be used to get power estimates from firmware corresponding to each performance state of a device. Although these power costs are already managed by the SCMI firmware driver, they are not exposed to any external subsystem yet. Fix this by adding a new get_power() interface to the exisiting perf_ops defined for the SCMI protocol. Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
2018-09-10firmware: arm_scmi: use strlcpy to ensure NULL-terminated stringsSudeep Holla5-5/+5
Replace all the memcpy() for copying name strings from the firmware with strlcpy() to make sure we are bounded by the source buffer size and we also always have NULL-terminated strings. This is needed to avoid out of bounds accesses if the firmware returns a non-terminated string. Reported-by: Olof Johansson <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
2018-09-06firmware: arm_scmi: fix divide by zero when sustained_perf_level is zeroSudeep Holla1-1/+7
Firmware can provide zero as values for sustained performance level and corresponding sustained frequency in kHz in order to hide the actual frequencies and provide only abstract values. It may endup with divide by zero scenario resulting in kernel panic. Let's set the multiplication factor to one if either one or both of them (sustained_perf_level and sustained_freq) are set to zero. Fixes: a9e3fbfaa0ff ("firmware: arm_scmi: add initial support for performance protocol") Reported-by: Ionela Voinescu <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
2018-08-28firmware: ti_sci: Provide host-id as an optional dt parameterNishanth Menon1-4/+20
Texas Instrument's System Control Interface (TISCI) permits the ability for Operating Systems to running in virtual machines to be able to independently communicate with the firmware without the need going through an hypervisor. The "host-id" in effect is the hardware representation of the host (example: VMs locked to a core) as identified to the System Controller. Provide support as an optional parameter implementation and use the compatible data as default if one is not provided by device tree. Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Santosh Shilimkar <[email protected]>