summaryrefslogtreecommitdiff
path: root/drivers/firmware
AgeCommit message (Collapse)Author
2024-09-02Merge tag 'tegra-for-6.12-firmware' of ↵Arnd Bergmann
https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers firmware: tegra: Changes for v6.12-rc1 The changes in this set remove some unused code and simplify error paths using scoped helpers. * tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: bpmp: Use scoped device node handling to simplify error paths firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp() Link: https://lore.kernel.org/r/20240830141004.3195210-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02Merge tag 'scmi-updates-6.12' of ↵Arnd Bergmann
https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm SCMI updates for v6.12 Few main features include: 1. SCMI transport as stand-alone drivers Currently the SCMI transport layer is being built embedded into in the core SCMI stack. Some of these transports, despite being currently part of the main SCMI module, are indeed also registered with different subsystems like optee or virtio, and actively probed also by those. This leads to a few awkward and convoluted tricks to properly handle such interactions at boot time in the SCMI stack. This change adds the new logic to the core SCMI stack so that each existing transport is transitioned to be a standi-alone driver. With that all the probe deferral and awkward retries between the SCMI core stack and the transports has been removed, since no more needed. 2. Support for obtaining transport descriptors from the devicetree SCMI platform firmwares might have different designs depending on the platform. Some of the transport descriptors rely on such design. E.g. the maximum receive channel timeout value might vary depending on the specific underlying hardware and firmware design choices. This change adds support for max-rx-timeout-ms property to describe the transport needs of a specific platform design. It will be extended in the future to obtain other such hardware/firmware dependent transport related descriptors. 3. NXP i.MX95 specific SCMI vendor protocol extensions SCMI specification allows vendor or platform-specific extensions to the interface. NXP i.MX95 System Manager(SM) that implements SCMI extends the interface to implement couple of vendor/platform specific protocol, namely: a. Battery Backed Module(BBM) Protocol This protocol is intended provide access to the battery-backed module. This contains persistent storage (GPR), an RTC, and the ON/OFF button. The protocol can also provide access to similar functions implemented via external board components. b. MISC Protocol for misc settings This includes controls that are misc settings/actions that must be exposed from the SM to agents. They are device specific and are usually define to access bit fields in various mix block control modules, IOMUX_GPR, and other GPR/CSR owned by the SM. 4. SCMI debug/tracking metrics Since SCMI involves interaction with the entity(software, firmware and/or hardware) providing services or features, it is quite useful to track certain metrics(for pure debugging purposes) like how many messages were sent or received, were there any failures, what kind of failures, ..etc. This feature adds support for the same via debugfs. Apart from these main features, there are some miscellaneous updates, fixes and cleanups. * tag 'scmi-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (31 commits) rtc: support i.MX95 BBM RTC input: keyboard: support i.MX95 BBM module firmware: imx: Add i.MX95 MISC driver firmware: arm_scmi: Add initial support for i.MX MISC protocol firmware: arm_scmi: Add initial support for i.MX BBM protocol firmware: arm_scmi: Add NXP i.MX95 SCMI documentation dt-bindings: firmware: Add i.MX95 SCMI Extension protocol firmware: arm_scmi: Replace comma with the semicolon firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node) firmware: arm_scmi: Fix trivial whitespace/coding style issues firmware: arm_scmi: Use max-rx-timeout-ms from devicetree dt-bindings: firmware: arm,scmi: Introduce property max-rx-timeout-ms firmware: arm_scmi: Remove const from transport descriptors firmware: arm_scmi: Simplify with scoped for each OF child loop firmware: arm_scmi: Update various protocols versions firmware: arm_scmi: Remove legacy transport-layer code firmware: arm_scmi: Make VirtIO transport a standalone driver firmware: arm_scmi: Make OPTEE transport a standalone driver firmware: arm_scmi: Make SMC transport a standalone driver firmware: arm_scmi: Make MBOX transport a standalone driver ... Link: https://lore.kernel.org/r/20240830135918.2383664-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02Merge tag 'ffa-updates-6.12' of ↵Arnd Bergmann
https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm FF-A updates for v6.12 The main addition this time is the basic support for FF-A v1.2 specification which includes support for newly added: 1. FFA_MSG_SEND_DIRECT_{REQ,RESP}2 2. FFA_PARTITION_INFO_GET_REGS 3. FFA_YIELD support in direct messaging Apart from these, the changes include support to fetch the Rx/Tx buffer size using FFA_FEATURES, addition of the FF-A FIDs for v1.2 and some coding style cleanups. * tag 'ffa-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Fetch the Rx/Tx buffer size using ffa_features() firmware: arm_ffa: Add support for FFA_YIELD in direct messaging firmware: arm_ffa: Add support for FFA_MSG_SEND_DIRECT_{REQ,RESP}2 firmware: arm_ffa: Add support for FFA_PARTITION_INFO_GET_REGS firmware: arm_ffa: Move the function ffa_features() earlier firmware: arm_ffa: Update the FF-A command list with v1.2 additions firmware: arm_ffa: Some coding style fixes Link: https://lore.kernel.org/r/20240830135759.2383431-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Deduplicate command execution codeMarek Behún
Deduplicate rWTM command execution calls mbox_send_message() wait_for_completion() mox_get_status() to one function mox_rwtm_exec() Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-17-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use ALIGN() instead of hardcodingMarek Behún
Use ALIGN(max, 4) instead of hardcoding ((max + 3) & ~3). Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-16-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use EOPNOTSUPP instead of ENOSYSMarek Behún
Checkpatch warns agains -ENOSYS: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Use EOPNOTSUPP instead. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-15-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use container_of() instead of hwrng .priv memberMarek Behún
Use container_of() to get driver private structure from hwnrg structure, instead of the hwrng's .priv member, as suggested by Herbert for another driver. Link: https://lore.kernel.org/soc/ZmLhQBdmg613KdET@gondor.apana.org.au/ Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-14-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use devm_mutex_init() instead of mutex_init()Marek Behún
Use devm_mutex_init() instead of mutex_init(), to properly call mutex_destroy() on probe failure / driver unbind. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-13-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Drop redundant device pointerMarek Behún
Drop redundant device pointer from driver's private structure. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-12-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use dev_err_probe() where possibleMarek Behún
Use dev_err_probe() where possible in the driver's .probe() method. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-11-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Convert rest to devm_* and get rid of driver ↵Marek Behún
.remove() Use devm resource management for driver's mailbox. This allows us to get rid of the driver's .remove() method and the gotos in .probe(). Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-10-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Simplify debugfs codeMarek Behún
Simplify debugfs code: do not check for errors, as debugfs errors should be ignored, and use devm action for dropping the debugfs directory. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-9-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Don't create own kobject typeMarek Behún
In order to create attribute files in /sys/firmware/turris-mox-rwtm, this driver creates it's own kobject type. Simplify this by dropping this own kobject creation, and instead creating standard device attribute files. For backwards compatibility with sysfs ABI, create a symlink /sys/firmware/turris-mox-rwtm, pointing to this device's sysfs directory. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-8-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use sysfs_emit() instead of sprintf()Marek Behún
Use sysfs_emit() instead of sprintf() in sysfs attribute .show() method. Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-7-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Fix driver includesMarek Behún
Drop including of.h, include several other headers that are used but not included directly. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-6-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Hide signature related constants behind macrosMarek Behún
Hide signature generation related constants behind macros instead of hardcoding the values. Use SHA512_DIGEST_SIZE from crypto/sha2.h instead of hardcoded 64 as the message size. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-5-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use the boolean type where appropriateMarek Behún
Use the boolean type for has_board_info, has_pubkey and last_sig_done members of the driver's private structure. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-4-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use ETH_ALEN instead of hardcoded 6Marek Behún
Use the ETH_ALEN macro instead of hardcoded 6 for MAC address length. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-3-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-02firmware: turris-mox-rwtm: Use macro constant instead of hardcoded 4096Marek Behún
The 4096 bytes limit in mox_hwrng_read() is due to the DMA buffer being allocated to one PAGE_SIZE bytes. Use new local macro constant RWTM_DMA_BUFFER_SIZE at allocation time and when used in mox_hwrng_read(). Use SZ_4K instead of PAGE_SIZE. Although PAGE_SIZE is never set to a larger value on Armada 3720, it theoretically could, and this would be a waste of space. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-2-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-01mm: rework accept memory helpersKirill A. Shutemov
Make accept_memory() and range_contains_unaccepted_memory() take 'start' and 'size' arguments instead of 'start' and 'end'. Remove accept_page(), replacing it with direct calls to accept_memory(). The accept_page() name is going to be used for a different function. Link: https://lkml.kernel.org/r/20240809114854.3745464-6-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Suggested-by: David Hildenbrand <david@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-01Merge tag 'arm-fixes-6.11-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "There is a fairly large number of bug fixes for Qualcomm platforms, most of them addressing issues with the devicetree files for the newly added Snapdragon X1 based laptops to make them more reliable. The Qualcomm driver changes address a few build-time issues as well as runtime problems in the tzmem and scm firmware, the USB Type-C driver, and the cmd-db and pmic_glink soc drivers. The NXP i.MX usually gets a bunch of devicetree fixes that is proportional to the number of supported machines. This includes both warning fixes and correctness for the 64-bit i.MX9, i.MX8 and layerscape platforms, as well as a single fix for a 32-bit i.MX6 based board. The other changes are the usual minor changes, including an update to the MAINTAINERS file, an omap3 dts file and a SoC driver for mpfs (risc-v)" * tag 'arm-fixes-6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (50 commits) firmware: microchip: fix incorrect error report of programming:timeout on success soc: qcom: pd-mapper: Fix singleton refcount firmware: qcom: tzmem: disable sdm670 platform soc: qcom: pmic_glink: Actually communicate when remote goes down usb: typec: ucsi: Move unregister out of atomic section soc: qcom: pmic_glink: Fix race during initialization firmware: qcom: qseecom: remove unused functions firmware: qcom: tzmem: fix virtual-to-physical address conversion firmware: qcom: scm: Mark get_wq_ctx() as atomic call arm64: dts: qcom: x1e80100: Fix Adreno SMMU global interrupt arm64: dts: qcom: disable GPU on x1e80100 by default arm64: dts: imx8mm-phygate: fix typo pinctrcl-0 arm64: dts: imx95: correct L3Cache cache-sets arm64: dts: imx95: correct a55 power-domains arm64: dts: freescale: imx93-tqma9352-mba93xxla: fix typo arm64: dts: freescale: imx93-tqma9352: fix CMA alloc-ranges ARM: dts: imx6dl-yapp43: Increase LED current to match the yapp4 HW design arm64: dts: imx93: update default value for snps,clk-csr arm64: dts: freescale: tqma9352: Fix watchdog reset arm64: dts: imx8mp-beacon-kit: Fix Stereo Audio on WM8962 ...
2024-08-30firmware: qcom: uefisecapp: Fix deadlock in qcuefi_acquire()Dan Carpenter
If the __qcuefi pointer is not set, then in the original code, we would hold onto the lock. That means that if we tried to set it later, then it would cause a deadlock. Drop the lock on the error path. That's what all the callers are expecting. Fixes: 759e7a2b62eb ("firmware: Add support for Qualcomm UEFI Secure Application") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/19829bc4-1b6f-47f7-847a-e90c25749e40@stanley.mountain Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2024-08-30firmware/smccc: Call arch-specific hook on discovering KVM servicesMarc Zyngier
arm64 will soon require its own callback to initialise services that are only available on this architecture. Introduce a hook that can be overloaded by the architecture. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20240830130150.8568-2-will@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
2024-08-30Merge tag 'drm-misc-fixes-2024-08-29' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes A revert for a previous TTM commit causing stuttering, 3 fixes for vmwgfx related to buffer operations, a fix for video/aperture with non-VGA primary devices, and a preemption status fix for v3d Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240829-efficient-swift-from-lemuria-f60c05@houat
2024-08-28firmware: imx: Add i.MX95 MISC driverPeng Fan
The i.MX95 System manager exports SCMI MISC protocol for linux to do various settings, such as set board gpio expander as wakeup source. The driver is to add the support. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20240823-imx95-bbm-misc-v2-v8-5-e600ed9e9271@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28firmware: arm_scmi: Add initial support for i.MX MISC protocolPeng Fan
i.MX95 System Manager(SM) firmware includes a SCMI vendor protocol, SCMI MISC protocol which includes controls that are misc settings/actions that must be exposed from the SM to agents. They are device specific and are usually define to access bit fields in various mix block control modules, IOMUX_GPR, and other General Purpose registers, Control Status Registers owned by the SM. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20240823-imx95-bbm-misc-v2-v8-3-e600ed9e9271@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28firmware: arm_scmi: Add initial support for i.MX BBM protocolPeng Fan
i.MX95 has a battery-backed module(BBM), which has persistent storage (GPR), an RTC, and the ON/OFF button. The System Manager(SM) firmware use SCMI vendor protocol(SCMI BBM) to let agent be able to use GPR, RTC and ON/OFF button. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20240823-imx95-bbm-misc-v2-v8-2-e600ed9e9271@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28firmware: arm_scmi: Add NXP i.MX95 SCMI documentationPeng Fan
Add NXP i.MX95 System Control Management Interface(SCMI) vendor extensions protocol documentation. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20240823-imx95-bbm-misc-v2-v8-4-e600ed9e9271@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28Merge tag 'riscv-soc-fixes-for-v6.11-rc6' of ↵Arnd Bergmann
https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes RISC-V soc fixes for v6.11-rc6 Prevent an erroneous unconditional report of a timeout during firmware upload in the mpfs-auto-update driver. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> * tag 'riscv-soc-fixes-for-v6.11-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: firmware: microchip: fix incorrect error report of programming:timeout on success Link: https://lore.kernel.org/r/20240828-fidelity-almighty-18d5434aaef0@spud Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-08-28Merge tag 'qcom-drivers-fixes-for-6.11' of ↵Arnd Bergmann
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm driver fixes for v6.11 This corrects the tzmem virt-to-phys conversion, which caused issues for the uefisecapp implementation of EFI variable access. SDM670 is excluded from tzmem usage due to reported issues. The SCM get wait queue context call is corrected to be marked ATOMIC and some dead code in qseecom, following the tzmem conversion, is removed. The memory backing command DB is remapped writecombined, to avoid XPU violations when Linux runs without the Qualcomm hypervisor. Two compile fixes are added for pd-mapper, and the broken reference count is corrected, to make pd-mapper deal with remoteprocs going away. In pmic_glink a race condition where the client callbacks might be called before we returned the client handle is corrected. The broken conditions for when to signal that the firmware is going down is also corrected. In the pmic_glink UCSI driver, the ucsi_unregister() is moved out of the pdr callback, as this is being invoked in atomic context. Konrad's email address is updated in MAINTAINERS, and related mailmap entries are added. * tag 'qcom-drivers-fixes-for-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: soc: qcom: pd-mapper: Fix singleton refcount firmware: qcom: tzmem: disable sdm670 platform soc: qcom: pmic_glink: Actually communicate when remote goes down usb: typec: ucsi: Move unregister out of atomic section soc: qcom: pmic_glink: Fix race during initialization firmware: qcom: qseecom: remove unused functions firmware: qcom: tzmem: fix virtual-to-physical address conversion firmware: qcom: scm: Mark get_wq_ctx() as atomic call MAINTAINERS: Update Konrad Dybcio's email address mailmap: Add an entry for Konrad Dybcio soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused soc: qcom: cmd-db: Map shared memory as WC, not WB soc: qcom: pd-mapper: Depend on ARCH_QCOM || COMPILE_TEST Link: https://lore.kernel.org/r/20240826145209.1646159-1-andersson@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-08-28firmware: arm_scmi: Replace comma with the semicolonSudeep Holla
Replace the typo comma with the semicolon. No functional change. Message-Id: <20240827143838.1465913-4-sudeep.holla@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node)Sudeep Holla
Use __free for device_node values, and thus drop calls to of_node_put. The goal is simplify of_node reference cleanup by using this scope-based of_node_put() cleanup to simplify function exit handling. When using __free a resource is allocated within a block, it is automatically freed at the end of the block. This cleanup aligns well with the recent change in shmem.c to use __free instead of explicit of_node_put() calls. Message-Id: <20240827143838.1465913-3-sudeep.holla@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28firmware: arm_scmi: Fix trivial whitespace/coding style issuesSudeep Holla
Fix couple of unnecessary multiple blank lines and spaces instead of tabs. No functional change. Message-Id: <20240827143838.1465913-2-sudeep.holla@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-27firmware: tegra: bpmp: Use scoped device node handling to simplify error pathsKrzysztof Kozlowski
Obtain the device node reference with scoped/cleanup.h to reduce error handling and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
2024-08-27firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp()Krzysztof Kozlowski
mbox_client_to_bpmp() is not used, W=1 builds: drivers/firmware/tegra/bpmp.c:28:1: error: unused function 'mbox_client_to_bpmp' [-Werror,-Wunused-function] Fixes: cdfa358b248e ("firmware: tegra: Refactor BPMP driver") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
2024-08-27efi/cper: Print correctable AER informationYazen Ghannam
Currently, cper_print_pcie() only logs Uncorrectable Error Status, Mask and Severity registers along with the TLP header. If a correctable error is received immediately preceding or following an Uncorrectable Fatal Error, its information is lost since Correctable Error Status and Mask registers are not logged. As such, to avoid skipping any possible error information, Correctable Error Status and Mask registers should also be logged. Additionally, ensure that AER information is also available through cper_print_pcie() for Correctable and Uncorrectable Non-Fatal Errors. Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Tested-by: Avadhut Naik <avadhut.naik@amd.com> Signed-off-by: Avadhut Naik <avadhut.naik@amd.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-08-26video/aperture: optionally match the device in sysfb_disable()Alex Deucher
In aperture_remove_conflicting_pci_devices(), we currently only call sysfb_disable() on vga class devices. This leads to the following problem when the pimary device is not VGA compatible: 1. A PCI device with a non-VGA class is the boot display 2. That device is probed first and it is not a VGA device so sysfb_disable() is not called, but the device resources are freed by aperture_detach_platform_device() 3. Non-primary GPU has a VGA class and it ends up calling sysfb_disable() 4. NULL pointer dereference via sysfb_disable() since the resources have already been freed by aperture_detach_platform_device() when it was called by the other device. Fix this by passing a device pointer to sysfb_disable() and checking the device to determine if we should execute it or not. v2: Fix build when CONFIG_SCREEN_INFO is not set v3: Move device check into the mutex Drop primary variable in aperture_remove_conflicting_pci_devices() Drop __init on pci sysfb_pci_dev_is_enabled() Fixes: 5ae3716cfdcd ("video/aperture: Only remove sysfb on the default vga pci device") Cc: Javier Martinez Canillas <javierm@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Helge Deller <deller@gmx.de> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240821191135.829765-1-alexander.deucher@amd.com
2024-08-26firmware: qcom: scm: Allow QSEECOM on Surface Laptop 7 modelsKonrad Dybcio
Add the aforementioned machines to the list to get e.g. efivars up. Signed-off-by: Konrad Dybcio <quic_kdybcio@quicinc.com> Link: https://lore.kernel.org/r/20240826-topic-sl7-v2-2-c32ebae78789@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2024-08-22firmware: microchip: fix incorrect error report of programming:timeout on ↵Steve Wilkins
success After successfully programming the SPI flash with an MFPS auto update image, the error sysfs attribute reports programming:timeout. This is caused by an incorrect check on the return value from wait_for_completion_timeout() in mpfs_auto_update_poll_complete(). Fixes: ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support") Signed-off-by: Steve Wilkins <steve.wilkins@raymarine.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2024-08-21firmware: qcom: tzmem: disable sdm670 platformRichard Acayan
The Pixel 3a returns 4291821499 (-3145797 or 0xFFCFFFBB) when attempting to load the GPU firmware if tzmem is allowed. Disable it on SDM670 so the GPU can successfully probe. Signed-off-by: Richard Acayan <mailingradian@gmail.com> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20240730013834.41840-2-mailingradian@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2024-08-20firmware: arm_ffa: Fetch the Rx/Tx buffer size using ffa_features()Sudeep Holla
An endpoint can discover the minimum size, maximum size and alignment boundary for the Rx/Tx buffers by passing the function ID of the FFA_RXTX_MAP ABI as input in the FFA_FEATURES interface. The maximum size is an optional field and a value of 0 means that the partition manager or the hypervisor does not enforce a maximum size. Use the discovery mechanism and remove the hardcoded 4kB buffer size. If the discovery fails, it still defaults to 4kB. Message-Id: <20240820-ffa_v1-2-v2-7-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Add support for FFA_YIELD in direct messagingSudeep Holla
Successful completion of both direct messaging function can be indicated through an invocation of FFA_YIELD or GGA_INTERRUPT by the callee. FFA_INTERRUPT indicates that the direct request was interrupted and must be resumed through the FFA_RUN interface which is already done in the driver. FFA_YIELD indicates that the receiver endpoint has transitioned to the blocked runtime state and must be resumed through the FFA_RUN interface. However, the way receiver endpoint gets unblocked is implementation defined. So, the driver just sleeps for 1 - 2ms and issues FFA_RUN. It can return to the caller with FFA_YIELD is the receiver endpoint is still blocked. Message-Id: <20240820-ffa_v1-2-v2-6-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Add support for FFA_MSG_SEND_DIRECT_{REQ,RESP}2Sudeep Holla
FFA_MSG_SEND_DIRECT_{REQ,RESP} supported only x3-x7 to pass implementation defined values as part of the message. This may not be sufficient sometimes and also it would be good to use all the registers supported by SMCCC v1.2 (x0-x17) for such register based communication. Also another limitation with the FFA_MSG_SEND_DIRECT_{REQ,RESP} is the ability to target a specific service within the partition based on it's UUID. In order to address both of the above limitation, FF-A v1.2 introduced FFA_MSG_SEND_DIRECT_{REQ,RESP}2 which has the ability to target the message to a specific service based on its UUID within a partition as well as utilise all the available registers(x4-x17 specifically) for the communication. This change adds support for FFA_MSG_SEND_DIRECT_REQ2 and FFA_MSG_SEND_DIRECT_RESP2. Message-Id: <20240820-ffa_v1-2-v2-5-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Add support for FFA_PARTITION_INFO_GET_REGSSudeep Holla
FF-A v1.2 introduced FFA_PARTITION_INFO_GET_REGS which is similar to FFA_PARTITION_INFO_GET except that the former uses the registers to get the required information instead of the Rx buffer which the latter uses. We need to first check if the platform supports this new API using FFA_FEATURES so that we can fallback to the FFA_PARTITION_INFO_GET (which is mandatory) if FFA_PARTITION_INFO_GET_REGS is not implemented. Message-Id: <20240820-ffa_v1-2-v2-4-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Move the function ffa_features() earlierSudeep Holla
We need to use ffa_features() in ffa_partition_probe() to detect if the newer FFA_PARTITION_INFO_GET_REGS API is supported in the platform or not. To avoid unnecessary forward declaration within the file, let us just move this ffa_features() earlier. No funtional change. Message-Id: <20240820-ffa_v1-2-v2-3-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Update the FF-A command list with v1.2 additionsSudeep Holla
Arm Firmware Framework for A-profile(FFA) v1.2 introduces register based discovery mechanism and direct messaging extensions that enables to target specific UUID within a partition. Let us add all the newly supported FF-A function IDs in the spec. Also update to the error values and associated handling. Message-Id: <20240820-ffa_v1-2-v2-2-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-20firmware: arm_ffa: Some coding style fixesSudeep Holla
These changes fixes a set of below coding style issues: 1. spaces required around that '=' (ctx:VxW) 2. possible unnecessary 'out of memory' message 3. unnecessary for single statement blocks Message-Id: <20240820-ffa_v1-2-v2-1-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-18firmware: arm_scmi: Use max-rx-timeout-ms from devicetreeCristian Marussi
Override default maximum RX timeout with the value picked from the devicetree, when provided. Suggested-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 19x19 EVK Message-Id: <20240730144707.1647025-4-cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-18firmware: arm_scmi: Remove const from transport descriptorsCristian Marussi
The descriptor structure scmi_desc contains a variety of fields related to the transport functionalities and it is defined by the transport drivers themselves; such elements, though, serve varied purposes and have different lifetime. In particular, while there are some of those elements that provide a description of transport features that are supposed to be immutable, on the other side there are present also some other characteristics that are instead supposed to be configurable on a per-platform base since they represent configuration features tied to the specific hardware/firmware system. The immutable fields are already qualified as const on the their own; get rid of the structure-level const qualifier which is not needed, so as to enable possible runtime customization of the mutable configuration features. No functional change. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 19x19 EVK Message-Id: <20240730144707.1647025-2-cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-18firmware: arm_scmi: Simplify with scoped for each OF child loopKrzysztof Kozlowski
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Message-Id: <20240816151407.155034-1-krzysztof.kozlowski@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>