Arnd Bergmann [Mon, 4 Mar 2024 15:59:48 +0000 (16:59 +0100)]
Merge tag 'memory-controller-drv-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.9, part two
1. Renesas RPC-IF: add bindings for R-Car V4M.
2. Tegra MC: correct and extend support for Tegra234 memory controller.
3. STM32: add support for Flexible Memory Controller on MP25 SoC.
4. NXP WEIM bindings: convert to DT schema.
* tag 'memory-controller-drv-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
memory: stm32-fmc2-ebi: keep power domain on
memory: stm32-fmc2-ebi: add MP25 RIF support
memory: stm32-fmc2-ebi: add MP25 support
memory: stm32-fmc2-ebi: check regmap_read return value
dt-bindings: memory-controller: st,stm32: add MP25 support
dt-bindings: bus: imx-weim: convert to YAML
memory: tegra: Fix indentation
memory: tegra: Add BPMP and ICC info for DLA clients
memory: tegra: Correct DLA client names
dt-bindings: memory: renesas,rpc-if: Document R-Car V4M support
Arnd Bergmann [Mon, 4 Mar 2024 15:57:39 +0000 (16:57 +0100)]
Merge tag 'omap-for-v6.9/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/drivers
Driver change for ti-sysc
Just one change to constify struct device_type.
* tag 'omap-for-v6.9/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
bus: ti-sysc: constify the struct device_type usage
Arnd Bergmann [Mon, 4 Mar 2024 15:54:27 +0000 (16:54 +0100)]
Merge tag 'samsung-drivers-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers
Samsung SoC driver changes for v6.9, part two
1. Extend Exynos PMU (Power Management Unit) driver being also the
syscon to main system controller registers block, to support Google
GS101. The Google GS101 has PMU registers protected and writing is
available only via SMC. The Exynos PMU will register its own custom
regmap for such case of mixed MMIO+SMC.
2. Rework Samsung watchdog driver to get the regmap to PMU block not
via syscon API, but from the Exynos PMU driver. This is necessary
for the watchdog driver to work on Google GS101.
* tag 'samsung-drivers-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs
soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs
MAINTAINERS: samsung: gs101: match patches touching Google Tensor SoC
Arnd Bergmann [Mon, 4 Mar 2024 15:52:36 +0000 (16:52 +0100)]
Merge tag 'qcom-drivers-for-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers
Qualcomm driver updates for v6.9
This introduces the Qualcomm Programmable Boot Sequencer (PBS) driver.
The Qualcomm SMEM no longer acquires the hwspinlock during the "get"
operation, to improve the system behavior during the recovery of a
remoteproc that crashed with the hwspinlock held.
The Qualcomm Always On Subsystem (AOSS) message protocol driver gains
tracepoints, printf annotation, and a debugfs interface is introduced
for tweaking system properties during development and debugging.
The Qualcomm socinfo driver gains data for SM8475, QCM8550 and
QCS8550 platforms, and the PM2250 is renamed to PM4125.
Support for controlling the voltage regulator in SPM/SAW2 is introduced.
The gfx.lvl power-domain is dropped for SA8540P, as this resource was
incorrectly inherited from SC8280XP.
Additionally some code cleanup improvements is introduced across APR,
LLCC, SMP2P and SPM.
* tag 'qcom-drivers-for-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (23 commits)
dt-bindings: soc: qcom: qcom,saw2: add msm8226 l2 compatible
soc: qcom: spm: add support for voltage regulator
soc: qcom: spm: remove driver-internal structures from the driver API
dt-bindings: soc: qcom: qcom,saw2: define optional regulator node
dt-bindings: soc: qcom: qcom,saw2: add missing compatible strings
dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
soc: qcom: llcc: Check return value on Broadcast_OR reg read
soc: qcom: socinfo: Add Soc IDs for SM8475 family
dt-bindings: arm: qcom,ids: Add IDs for SM8475 family
soc: qcom: apr: make aprbus const
dt-bindings: soc: qcom: qcom,pmic-glink: document X1E80100 compatible
soc: qcom: add QCOM PBS driver
dt-bindings: soc: qcom: Add qcom,pbs bindings
pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
soc: qcom: socinfo: rename PM2250 to PM4125
soc: qcom: aoss: Add tracepoints in qmp_send()
soc: qcom: socinfo: add SoC Info support for QCM8550 and QCS8550 platform
dt-bindings: arm: qcom,ids: add SoC ID for QCM8550 and QCS8550
soc: qcom: aoss: Add debugfs interface for sending messages
soc: qcom: smem: remove hwspinlock from item get routine
...
Arnd Bergmann [Mon, 4 Mar 2024 15:51:03 +0000 (16:51 +0100)]
Merge tag 'tegra-for-6.9-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
firmware: tegra: Changes for v6.9-rc1
Contains a fix that makes sure we don't unnecessarily call kfree().
* tag 'tegra-for-6.9-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
Arnd Bergmann [Mon, 4 Mar 2024 15:48:15 +0000 (16:48 +0100)]
Merge tag 'tegra-for-6.9-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
soc/tegra: Changes for v6.9-rc1
This set of changes adds ACPI support for the APBMISC driver and cleans
up a few things like dependencies and unused code.
* tag 'tegra-for-6.9-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
soc/tegra: pmc: Add SD wake event for Tegra234
soc/tegra: pmc: Update scratch as an optional aperture
soc/tegra: pmc: Update address mapping sequence for PMC apertures
bus: tegra-aconnect: Update dependency to ARCH_TEGRA
soc/tegra: Fix build failure on Tegra241
soc/tegra: fuse: Fix crash in tegra_fuse_readl()
soc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241
soc/tegra: fuse: Add support for Tegra241
soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234
soc/tegra: fuse: Add function to print SKU info
soc/tegra: fuse: Add function to add lookups
soc/tegra: fuse: Add tegra_acpi_init_apbmisc()
soc/tegra: fuse: Refactor resource mapping
soc/tegra: fuse: Use dev_err_probe for probe failures
mm/util: Introduce kmemdup_array()
soc/tegra: pmc: Remove some old and deprecated functions and constants
Arnd Bergmann [Mon, 4 Mar 2024 14:49:52 +0000 (15:49 +0100)]
Merge tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers
Arm SCMI updates for v6.9
Quite a few changes to extend support to SCMI v3.2 specification,
to enhance notification handling and other miscellaneous updates.
1. Enhancements to notification handling
Until now, trying to register a notifier for an unsuppported
notification returned an error genrating unneeded message exchanges
with the SCMI platform. This can be avoided by looking up in advance
the specific protocol and resources available.
With these changes SCMI driver user will fail to register a notifier
if the related command or resource is not supported (like before)
without the need of exchanging any message.
Perf notifications are also extended to provide the pre-calculated
frequencies corresponding to the level or index carried by the
2. More SCMI v3.2 related updates
One of the main addition includes a centralized support to the SCMI
core to handle v3.2 optional protocol version negotiation, so that
at protocol initialization time, if the platform advertised version
is newer than supported by the kernel and protocol version negotiation
is supported, the SCMI core will attempt to negotiate an older protocol
version.
It also includes the clock get permissions which indicates if any of
the clock operations are forbidden by the platform for the OSPM agent.
It can be used in the clock driver to avoid unnecessary message
exchanges between the kernel and the platform which will always end
up with the failure. It also includes other missing bits of clock
v3.2 protocol so that the supported protocol version can be bumped
to 0x30000 (v3.2).
3. Miscellaneous updates
This includes addition of warning if the domain frequency multiplier
is 0 or rounded off to indicate the actual frequencies are either
wrong ot rounded off, hardening of clock domain info lookups, addition
of multiple protocols registration support within a SCMI driver,
update to SCMI entry in MAINTAINERS to include HWMON driver and
constifying the scmi_bus_type structure.
This also includes couple for fixes to minor issues: double free in
SMC transport cleanup path and struct kernel-doc warnings in optee
transport.
* tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (29 commits)
MAINTAINERS: Update SCMI entry with HWMON driver
firmware: arm_scmi: Update the supported clock protocol version
firmware: arm_scmi: Add standard clock OEM definitions
firmware: arm_scmi: Add clock check for extended config support
firmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION
firmware: arm_scmi: Fix struct kernel-doc warnings in optee transport
firmware: arm_scmi: Report frequencies in the perf notifications
firmware: arm_scmi: Use opps_by_lvl to store opps
firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol
firmware: arm_scmi: Implement is_notify_supported callback in reset protocol
firmware: arm_scmi: Implement is_notify_supported callback in sensor protocol
firmware: arm_scmi: Implement is_notify_supported callback in clock protocol
firmware: arm_scmi: Implement is_notify_supported callback in system power protocol
firmware: arm_scmi: Implement is_notify_supported callback in power protocol
firmware: arm_scmi: Implement is_notify_supported callback in perf protocol
firmware: arm_scmi: Add a common helper to check if a message is supported
firmware: arm_scmi: Check for notification support
firmware: arm_scmi: Make scmi_bus_type const
firmware: arm_scmi: Fix double free in SMC transport cleanup path
firmware: arm_scmi: Implement clock get permissions
...
Arnd Bergmann [Mon, 4 Mar 2024 14:48:38 +0000 (15:48 +0100)]
Merge tag 'ffa-update-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers
Arm FF-A update for v6.9
Another single and simple update to just constify the ffa_bus_type
structure similar to other changes done treewide following the driver
core changes to accomodate the same.
* tag 'ffa-update-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
firmware: arm_ffa: Make ffa_bus_type const
bus: ti-sysc: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
sysc_device_type variable to be a constant structure as well, placing it
into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Message-ID: <20240219-device_cleanup-ti-sysc-v1-1-13b53177d0a5@marliere.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
The FMC2 revision 2 supports security and isolation compliant with
the Resource Isolation Framework (RIF). From RIF point of view,
the FMC2 is composed of several independent resources, listed below,
which can be assigned to different security and compartment domains:
- 0: Common FMC_CFGR register.
- 1: EBI controller for Chip Select 1.
- 2: EBI controller for Chip Select 2.
- 3: EBI controller for Chip Select 3.
- 4: EBI controller for Chip Select 4.
- 5: NAND controller.
Add the support of the revision 2 of FMC2 IP.
- PCSCNTR register has been removed,
- CFGR register has been added,
- the bit used to enable the IP has moved from BCR1 to CFGR,
- the timeout for CEx deassertion has moved from PCSCNTR to BCRx,
- the continuous clock enable has moved from BCR1 to CFGR,
- the clk divide ratio has moved from BCR1 to CFGR.
The MP1 SoCs have only one signal to manage all the controllers (NWAIT).
The MP25 SOC has one RNB signal for the NAND controller and one NWAIT
signal for the memory controller.
Let's use a platform data structure for parameters that will differ
between MP1 and MP25.
dt-bindings: memory-controller: st,stm32: add MP25 support
Add a new compatible string to support MP25 SoC.
On MP1 SoC, RNB signal (NAND controller signal) and NWAIT signal (PSRAM
controller signal) have been integrated together in the SoC. That means
that the NAND controller and the PSRAM controller (if the signal is
used) can not be used at the same time. On MP25 SoC, the 2 signals can
be used outside the SoC, so there is no more restrictions.
MP1 SoC also embeds revision 1.1 of the FMC2 IP when MP25 SoC embeds
revision 2.0 of the FMC2 IP.
MP25 SoC is also using PSCI OS-initiated mode, so allow a single
'power-domains' entry for STM32 FMC2. As MP1 will move on PSCI
OS-initiated mode, add this property as optional for all FMC2 variants.
Peter Griffin [Tue, 20 Feb 2024 22:06:13 +0000 (22:06 +0000)]
watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs
Obtain the PMU regmap using the new API added to exynos-pmu driver rather
than syscon_regmap_lookup_by_phandle(). As this driver no longer depends
on mfd syscon remove that header and Kconfig dependency.
Tested-by: Alexey Klimov <alexey.klimov@linaro.org> Tested-by: Sam Protsenko <semen.protsenko@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link: https://lore.kernel.org/r/20240220220613.797068-3-peter.griffin@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Peter Griffin [Tue, 20 Feb 2024 22:06:12 +0000 (22:06 +0000)]
soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs
Some Exynos based SoCs like Tensor gs101 protect the PMU registers for
security hardening reasons so that they are only write accessible in el3
via an SMC call.
As most Exynos drivers that need to write PMU registers currently obtain a
regmap via syscon (phys, pinctrl, watchdog). Support for the above usecase
is implemented in this driver using a custom regmap similar to syscon to
handle the SMC call. Platforms that don't secure PMU registers, get a mmio
regmap like before. As regmaps abstract out the underlying register access
changes to the leaf drivers are minimal.
A new API exynos_get_pmu_regmap_by_phandle() is provided for leaf drivers
that currently use syscon_regmap_lookup_by_phandle(). This also handles
deferred probing.
Tested-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Alexey Klimov <alexey.klimov@linaro.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link: https://lore.kernel.org/r/20240220220613.797068-2-peter.griffin@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Jon Hunter [Tue, 20 Feb 2024 12:44:28 +0000 (12:44 +0000)]
memory: tegra: Correct DLA client names
Some of the names for the Tegra234 DLA clients are not unique and do not
align with the name of the client ID definitions. Therefore, it is not
possible to determine the exact DLA client from messages that print the
client name. Fix this by correcting the DLA memory client names for
Tegra234 to align with the name of the corresponding memory client ID.
Note that although the client names are also used by the interconnect
framework, interconnect support for the DLA clients has not been added
and so this issue does not impact the interconnect support.
Cristian Marussi [Wed, 14 Feb 2024 18:30:03 +0000 (18:30 +0000)]
firmware: arm_scmi: Add standard clock OEM definitions
Add a common enum to define the standard clock OEM types defined by the
SCMI specification, so as to enable the configuration of such extended
configuration properties with the existent clock protocol operations.
Cristian Marussi [Wed, 14 Feb 2024 18:30:02 +0000 (18:30 +0000)]
firmware: arm_scmi: Add clock check for extended config support
SCMI v3.2 added support to set/get clock custom OEM types; such support is
conditionally present, though, depending on an extended config attribute
bit possibly advertised by the platform server on a per-domain base.
Add a check to verify if OEM types are supported before allowing any kind
of OEM-specific get/set operation. Also add a check around all the new
v3.2 clock features.
Cristian Marussi [Wed, 14 Feb 2024 18:30:01 +0000 (18:30 +0000)]
firmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION
Freshly introduced NEGOTIATE_PROTOCOL_VERSION allows the agent to ascertain
upfront if a specific protocol(usually older) version is supported by the
platform.
It is used by the agent in case the platform has advertised the support of
a newer protocol version than the latest version supported by the agent,
since backward compatibility cannot be automatically assumed.
Emit a warning about possible incompatibility when negotiation was not
possible or just print the successfully negotiated protocol.
Randy Dunlap [Wed, 21 Feb 2024 06:21:57 +0000 (22:21 -0800)]
firmware: arm_scmi: Fix struct kernel-doc warnings in optee transport
Fix the kernel-doc notation for the nested union in struct
scmi_optee_channel to eliminate kernel-doc warnings:
| optee.c:130: warning: Excess struct member 'shmem' description
| in 'scmi_optee_channel'
| optee.c:131: warning: Function parameter or struct member 'req'
| not described in 'scmi_optee_channel'
Markus Elfring [Mon, 25 Dec 2023 19:03:56 +0000 (20:03 +0100)]
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
The kfree() function was called in one case by
the get_filename() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.
Thus return directly after a call of the function “kzalloc” failed
at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
Arnd Bergmann [Tue, 20 Feb 2024 21:04:03 +0000 (22:04 +0100)]
Merge tag 'memory-controller-drv-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.9
1. TI EMIF: Simplify handling CONFIG_DEBUG_FS, CONFIG_OF and
platform_driver_probe().
2. Narrow regex in Nvidia Tegra20 EMC binding.
* tag 'memory-controller-drv-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
dt-bindings: memory-controllers: narrow regex for unit address to hex numbers
memory: emif: Drop usage of platform_driver_probe()
memory: emif: Simplify code handling CONFIG_OF
memory: emif: Simplify code handling CONFIG_DEBUG_FS
Arnd Bergmann [Tue, 20 Feb 2024 21:02:40 +0000 (22:02 +0100)]
Merge tag 'samsung-drivers-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers
Samsung SoC driver changes for v6.9
1. Add bindings for Google GS101 I2C controller and SYSREG sycon block.
2. Remove Tomasz Figa from Samsung clock and pinctrl maintainer entries.
* tag 'samsung-drivers-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
MAINTAINERS: Remove Tomasz from Samsung clock and pinctrl entries
dt-bindings: samsung: exynos-sysreg: gs101-peric0/1 require a clock
dt-bindings: i2c: exynos5: add google,gs101-hsi2c compatible
Arnd Bergmann [Tue, 20 Feb 2024 20:49:18 +0000 (21:49 +0100)]
Merge tag 'mtk-soc-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers
MediaTek soc driver updates for v6.9
The only addition here is the MediaTek SoC Information driver,
registering socinfo for various MediaTek SoCs.
* tag 'mtk-soc-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux:
soc: mediatek: mtk-socinfo: Add extra entry for MT8183
soc: mediatek: mtk-socinfo: Clean up NVMEM cell read
soc: mediatek: mtk-socinfo: Add driver for getting chip information
Cristian Marussi [Mon, 12 Feb 2024 12:32:33 +0000 (12:32 +0000)]
firmware: arm_scmi: Report frequencies in the perf notifications
Extend the perf notification report to include pre-calculated frequencies
corresponding to the reported limits/levels event; such frequencies are
properly computed based on the stored known OPPs information taking into
consideration if the current operating mode is level indexed or not.
Cristian Marussi [Mon, 12 Feb 2024 12:32:32 +0000 (12:32 +0000)]
firmware: arm_scmi: Use opps_by_lvl to store opps
Store all the discovered OPPs into the XArray opps_by_lvl even when
level_indexing mode is not used, since it comes handy to easily retrieve
OPPs by level.
Cristian Marussi [Mon, 12 Feb 2024 12:32:31 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol
Add a preliminary check to verify if the powercap protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:30 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in reset protocol
Add a preliminary check to verify if the reset protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:29 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in sensor protocol
Add a preliminary check to verify if the sensor protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:28 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in clock protocol
Add a preliminary check to verify if the clock protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.
Now that the driver core can properly handle constant struct bus_type,
move the ffa_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cristian Marussi [Mon, 12 Feb 2024 12:32:27 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in system power protocol
Add a preliminary check to verify if the system power protocol related
notify enable commands are supported at all by the SCMI platform, and
then provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain supports
notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:26 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in power protocol
Add a preliminary check to verify if the power related notify enable
commands are supported at all by the SCMI platform, and then provide
the callback needed to allow the core SCMI notification subsytem to do
a fine-grain check if a specific resource domain supports notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:25 +0000 (12:32 +0000)]
firmware: arm_scmi: Implement is_notify_supported callback in perf protocol
Add a preliminary check to verify if the performance related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.
Cristian Marussi [Mon, 12 Feb 2024 12:32:23 +0000 (12:32 +0000)]
firmware: arm_scmi: Check for notification support
When registering protocol events, use the optional .is_notify_supported
callback provided by the protocol to check if that specific notification
type is available for that particular resource on the running system,
marking it as unsupported otherwise.
Then, when a notification enable request is received, return an error if
it was previously marked as unsuppported, so avoiding to send a needless
notification enable command and check the returned value for failure.
Now that the driver core can properly handle constant struct bus_type,
move the scmi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Andre Przywara [Fri, 26 Jan 2024 12:23:25 +0000 (12:23 +0000)]
firmware: arm_scmi: Fix double free in SMC transport cleanup path
When the generic SCMI code tears down a channel, it calls the chan_free
callback function, defined by each transport. Since multiple protocols
might share the same transport_info member, chan_free() might want to
clean up the same member multiple times within the given SCMI transport
implementation. In this case, it is SMC transport. This will lead to a NULL
pointer dereference at the second time:
Peng Fan [Sun, 21 Jan 2024 11:09:00 +0000 (19:09 +0800)]
firmware: arm_scmi: Implement clock get permissions
ARM SCMI v3.2 introduces clock get permission command. To implement the
same let us stash the values of those permissions in the scmi_clock_info.
They indicate if the operation is forbidden or not.
If the CLOCK_GET_PERMISSIONS command is not supported, the default
permissions are set to allow the operations, otherwise they will be set
according to the response of CLOCK_GET_PERMISSIONS from the SCMI
platform firmware.
Cristian Marussi [Thu, 21 Dec 2023 15:11:29 +0000 (15:11 +0000)]
firmware: arm_scmi: Add multiple protocols registration support
Add the capability for a SCMI driver to register to the core SCMI stack
with multiple SCMI protocols. In such a case the SCMI driver probe
function will end up being called once for each registered protocol
which have been also found as implemented on the platform.
Sudeep Holla [Fri, 19 Jan 2024 15:23:37 +0000 (15:23 +0000)]
firmware: arm_scmi: Warn if domain frequency multiplier is 0 or rounded off
When (sustained_freq_khz * 1000) is less than sustained_perf_level, the
multiplier will be less than 1 and hence rounded down as 0. Similarly if
it is not multiple of sustained_perf_level the dom_info->mult_factor will
contain rounded down value and will end up impacting all the frequency
calculations done using it.
Add warning if and when the domain frequency multiplier is 0 or rounded
down so that it gives a clue to get the firmware tables fixed.
Suggested-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/20240119152338.3047620-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
The SPM / SAW2 device also provides a voltage regulator functionality
with optional AVS (Adaptive Voltage Scaling) support. The exact register
sequence and voltage ranges differs from device to device.
The SAW2 device can optionally provide a voltage regulator supplying the
CPU core, cluster or L2 cache. Change the boolean 'regulator' property
into a proper regulator description. This breaks schema compatibility
for the sake of properly describing the regulator.
Define compatible strings for SAW2 units present on MSM8960, IPQ4019
and IPQ8064. There is no need to include SAW version into the compat
string, so just use the SoC and SAW2 kind.
Also add missing L2 SAW2 compatibles for MSM8974 and APQ8084, they
follow the existing CPU SAW2 strings.
dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
The Qualcomm SPM / SAW2 device is described in two bindigns files:
arm/msm/qcom,saw2.txt and soc/qcom/qcom,spm.yaml. Merge the former into
the latter, adding detailed device node description. While we are at it,
also rename qcom,spm.yaml to qcom,saw2.yaml to follow the actual
compatible used for these devices.
The regulator property is retained as is. It will be changed in the
later patches.
soc/tegra: pmc: Update scratch as an optional aperture
Scratch address space register is used to store reboot reason. For
some Tegra234 systems, the scratch space is not available to store
the reboot reason. This is because scratch region on these systems
is not accessible by the kernel as restricted by the Hypervisor.
Such systems would delist scratch aperture from PMC DT node.
Hence this change makes scratch as optional aperture and also avoids
registering reboot notifier if scratch address space isn't mapped.
soc/tegra: pmc: Update address mapping sequence for PMC apertures
On Tegra SoCs prior to Tegra186, PMC has single address range only.
Starting from and after Tegra186, PMC has additional address ranges
apart from base address range. Currently in PMC driver, we try to
map these additional address ranges on all SoCs and if we fail then
we assume that the range is not valid for an SoC. This change makes
it more explicit on which address ranges are expected to be present
on which SoCs and maps the additional address ranges only on SoCs
from and after Tegra186.
Peter Robinson [Fri, 16 Feb 2024 10:02:37 +0000 (10:02 +0000)]
bus: tegra-aconnect: Update dependency to ARCH_TEGRA
Update the architecture dependency to be the generic Tegra
because the driver works on the four latest Tegra generations
not just Tegra210, if you build a kernel with a specific
ARCH_TEGRA_xxx_SOC option that excludes Tegra210 you don't get
this driver.
Fixes: 46a88534afb59 ("bus: Add support for Tegra ACONNECT") Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Cc: Jon Hunter <jonathanh@nvidia.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
soc: qcom: llcc: Check return value on Broadcast_OR reg read
Commit c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support")
introduced a new 4.1 if statement in llcc_update_act_ctrl() without
considering that ret might be overwritten. So, add return value check
after Broadcast_OR register read in llcc_update_act_ctrl().
Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the aprbus variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.
Now that the driver core can properly handle constant struct bus_type,
move the sunxi_rsb_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Tomasz Figa [Thu, 1 Feb 2024 14:01:34 +0000 (23:01 +0900)]
MAINTAINERS: Remove Tomasz from Samsung clock and pinctrl entries
I have been no longer at Samsung for a long time, the platforms
that I am knowledgable about (S3C24xx, S3C64xx, Exynos 4) are no longer
relevant and we have people with better capabilities as maintainers
already, so let me remove myself. Thanks for the nice collaboration
everyone!
Arnd Bergmann [Wed, 3 Jan 2024 10:26:49 +0000 (11:26 +0100)]
soc/tegra: Fix build failure on Tegra241
If all the other SoCs are disabled, the driver fails to build:
drivers/soc/tegra/fuse/fuse-tegra30.c:684:17: error: 'tegra30_fuse_read' undeclared here (not in a function); did you mean 'tegra_fuse_readl'?
684 | .read = tegra30_fuse_read,
| ^~~~~~~~~~~~~~~~~
| tegra_fuse_readl
drivers/soc/tegra/fuse/fuse-tegra30.c:694:17: error: 'tegra30_fuse_init' undeclared here (not in a function); did you mean 'tegra_fuse_info'?
694 | .init = tegra30_fuse_init,
| ^~~~~~~~~~~~~~~~~
Fix the list of SoCs using this function to include the newly added one.
Fixes: dee509eb9cd5 ("soc/tegra: fuse: Add support for Tegra241") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Kartik <kkartik@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Jon Hunter [Mon, 29 Jan 2024 13:46:59 +0000 (13:46 +0000)]
soc/tegra: fuse: Fix crash in tegra_fuse_readl()
Commit c5b2d43e67bb ("soc/tegra: fuse: Add ACPI support for Tegra194 and
Tegra234") updated the Tegra fuse driver to add ACPI support and added a
test to the tegra_fuse_readl() function to check if the device is
booting with device-tree. This test passes 'fuse->dev' variable to
dev_fwnode() but does not check first is 'fuse->dev' is valid. This is
causing a crash to occur in Tegra XUSB PHY driver that calls the
tegra_fuse_readl() function before 'fuse->dev' variable has been
initialised ...
Kartik [Wed, 20 Dec 2023 06:10:13 +0000 (11:40 +0530)]
soc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241
Tegra241 SoC data uses tegra194_soc_attr_group, which is only defined
if config CONFIG_ARCH_TEGRA_194_SOC or CONFIG_ARCH_TEGRA_234_SOC or
both are enabled. This causes a build failure if both of these configs
are disabled and CONFIG_ARCH_TEGRA_241_SOC is enabled.
Define tegra194_soc_attr_group if CONFIG_ARCH_TEGRA_241_SOC is enabled.
Signed-off-by: Kartik <kkartik@nvidia.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Thierry Reding <treding@nvidia.com>
Kartik [Tue, 17 Oct 2023 05:23:21 +0000 (10:53 +0530)]
soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234
Add ACPI support for Tegra194 & Tegra243 SoC's. This requires
following modifications to the probe when ACPI boot is used:
- Initialize soc data.
- Add nvmem lookups.
- Register soc device.
- use devm_clk_get_optional() instead of devm_clk_get() to get
fuse->clk, as fuse clocks are not required when using ACPI boot.
Also, drop '__init' keyword for tegra_soc_device_register() as this is also
used by tegra_fuse_probe() and use dev_err_probe() wherever applicable.
Kartik [Tue, 17 Oct 2023 05:23:20 +0000 (10:53 +0530)]
soc/tegra: fuse: Add function to print SKU info
Add helper function tegra_fuse_print_sku_info() to print Tegra SKU
information. So, it can be shared between tegra_fuse_init() and
ACPI probe which is to be introduced later.
Kartik [Tue, 17 Oct 2023 05:23:19 +0000 (10:53 +0530)]
soc/tegra: fuse: Add function to add lookups
Add helper function tegra_fuse_add_lookups() to register Tegra fuse
nvmem lookups. So, this can be shared between tegra_fuse_init() and
ACPI probe, which is to be introduced later.
Use kmemdup_array to duplicate fuse->soc->lookups.
Kartik [Tue, 17 Oct 2023 05:23:18 +0000 (10:53 +0530)]
soc/tegra: fuse: Add tegra_acpi_init_apbmisc()
In preparation to ACPI support in Tegra fuse driver add function
tegra_acpi_init_apbmisc() to initialize tegra-apbmisc driver.
Also, document the reason of calling tegra_init_apbmisc() at early init.
Note that function tegra_acpi_init_apbmisc() is not placed in the __init
section, because it will be called during probe.
Kartik [Tue, 17 Oct 2023 05:23:17 +0000 (10:53 +0530)]
soc/tegra: fuse: Refactor resource mapping
To prepare for adding ACPI support to the tegra-apbmisc driver,
relocate the code responsible for mapping memory resources from
the function ‘tegra_init_apbmisc’ to the function
‘tegra_init_apbmisc_resources.’ This adjustment will allow the
code to be shared between ‘tegra_init_apbmisc’ and the upcoming
‘tegra_acpi_init_apbmisc’ function.
Kartik [Tue, 17 Oct 2023 05:23:16 +0000 (10:53 +0530)]
soc/tegra: fuse: Use dev_err_probe for probe failures
Currently, in tegra_fuse_probe() if clock/reset get fails, then the
driver prints an error if the error is not caused by -EPROBE_DEFER.
This can be improved by using dev_err_probe() instead.
So, return dev_err_probe() if clock/reset get fails.
Kartik [Tue, 17 Oct 2023 05:23:15 +0000 (10:53 +0530)]
mm/util: Introduce kmemdup_array()
Introduce kmemdup_array() API to duplicate `n` number of elements
from a given array. This internally uses kmemdup to allocate and duplicate
the `src` array.
soc/tegra: pmc: Remove some old and deprecated functions and constants
These TEGRA_IO_RAIL_... functions and constants have been deprecated in
commit 21b499105178 ("soc/tegra: pmc: Add I/O pad voltage support") in
2016-11.
Currently, all Kconfig symbols for R-Car Gen4 SoCs select the
ARCH_RCAR_GEN3 SoC family symbol, which might confuse the casual reader.
Fix this by introducing a new SoC family symbol for R-Car Gen4 SoCs.
For now this just selects ARCH_RCAR_GEN3, to avoid duplication, and to
relax dependencies.
Chen-Yu Tsai [Tue, 30 Jan 2024 09:56:51 +0000 (17:56 +0800)]
soc: mediatek: mtk-socinfo: Clean up NVMEM cell read
The mtk-socinfo grabs the NVMEM device devm_nvmem_device_get(), but then
proceeds to put the device directly with nvmem_device_put() if the read
is successful. If the device fails to probe and goes through the devres
release path, the device would be put a second time, triggering a
use-after-free error from KASAN.
Fix this by dropping the devres part. Since the NVMEM cell data is read
only once, there is no need to keep the reference around.
While at it, clean up the function to directly reference the NVMEM
device node and use that to find the NVMEM device, instead of finding it
by name, which is more fragile. The cell node is always a direct child
of the NVMEM device node, courtesy of the legacy NVMEM cell layout. Thus
of_get_child_by_name() is a better way of finding the cell. Last,
correctly put the device node once its use is over.
Fixes: 423a54da3c7e ("soc: mediatek: mtk-socinfo: Add driver for getting chip information") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20240130095656.3712469-2-wenst@chromium.org Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Bjorn Andersson [Thu, 25 Jan 2024 21:05:10 +0000 (13:05 -0800)]
pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is
handled by an external regulator (max20411). Drop gfx.lvl from the list
of power-domains exposed on this platform.
William-tw Lin [Fri, 22 Dec 2023 08:07:38 +0000 (16:07 +0800)]
soc: mediatek: mtk-socinfo: Add driver for getting chip information
Add driver for socinfo retrieval. This patch includes the following:
1. mtk-socinfo driver for chip info retrieval
2. Related changes to Makefile and Kconfig
Signed-off-by: William-tw Lin <william-tw.lin@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20231222080739.21706-3-william-tw.lin@mediatek.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Dmitry Baryshkov [Sun, 28 Jan 2024 01:32:44 +0000 (03:32 +0200)]
soc: qcom: socinfo: rename PM2250 to PM4125
It seems, the only actual mentions of PM2250 can be found are related to
the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a
PMIC name. Rename PM2250 to PM4125 to follow the documentation.
Bjorn Andersson [Wed, 24 Jan 2024 03:40:33 +0000 (19:40 -0800)]
soc: qcom: aoss: Add tracepoints in qmp_send()
Add tracepoint for tracing the messages being sent and the success
thereof. This is useful as the system has a variety of clients sending
requests to the always-on subsystem.
Bjorn Andersson [Thu, 18 Jan 2024 02:31:52 +0000 (18:31 -0800)]
soc: qcom: aoss: Add debugfs interface for sending messages
In addition to the normal runtime commands, the Always On Processor
(AOP) provides a number of debug commands which can be used during
system debugging for things such as preventing power collapse or placing
floor votes for certain resources. Some of these are documented in the
Robotics RB5 "Debug AOP ADB" linked below.
Provide a debugfs interface for the developer/tester to send some of
these commands to the AOP, which allow the user to override the DDR
frequency, preventing power collapse of cx and ddr, and prevent AOSS
from going to sleep.
Tao Zhang [Tue, 2 Jan 2024 02:25:12 +0000 (07:55 +0530)]
soc: qcom: smem: remove hwspinlock from item get routine
During an SSR(Sub-System Restart) process, the remoteproc driver will
try to read the crash reason from SMEM. The qcom_smem_get() backing such
operations does however take the hwspinlock (tcsr mutex), which might be
held by the dying remoteproc.
The associated timeout on the hwspin_lock_timeout_irqsave() would take
care of the system not hanging forever, but the get operation will fail,
unnecessarily delaying the process for the 'HWSPINLOCK_TIMEOUT' duration
(currently is '1s'), and finally resulting in failure to get crash
information from SMEM.
This timeout can be avoided by removing the hwspinlock in the
qcom_smem_get routine. SMEM ensures that the allocated item will only be
visible after the new item is safe to use by following a specific order
of updates.
In the private partition case, qcom_smem_get_private() will use
'offset_free_uncached' as a loop boundary when looking for existing
allocated items. The corresponding allocation will only update
offset_free_uncached once the item is fully initialized.
Rob Herring [Wed, 24 Jan 2024 19:07:44 +0000 (13:07 -0600)]
dt-bindings: soc/qcom: Add size constraints on "qcom,rpm-msg-ram"
The 'phandle-array' type is a bit ambiguous. It can be either just an
array of phandles or an array of phandles plus args. "qcom,rpm-msg-ram" is
the former and needs to constrain each entry to a single phandle value.