This set of changes adds ACPI support for the APBMISC driver and cleans
up a few things like dependencies and unused code.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmXY1VEACgkQ3SOs138+
s6HqkA//ZtHaCTLiQQI97Go9dd0OnFIhQi1fnp1jwzexTWe5mT6RDJaSH/k+H/8c
wZiSGuZrgedKKAHX4luYJNPrZNIU3u5pEAe/H78N+c29mcS2Ynv0M++Kc3vKn1DW
yfRv6vXge6UaFZsS8zvrsb9F8q5yAouhAW3BosOwYwv41Z6KoqOBzIAnGzSSgfLl
fBErk8IutUscTeQHj9UNxeRZeYmr1M5nin4LwrQ9cZWASN0OBFXL+PpGatlY701z
5uCIJb4obz0z4NV27JxdrX12Z3ej+dd0NE3swwKGGi02ROCMlcQO8Zc9/+seSZGe
M9q6CWzelvJYVEFISGidx0N0l/eexJQac7koDNHJVvqVlVYYpBtY5RG5dsVofXTk
gNc+T0bI/D4h5kHbCFNPhwrwEp2rvkWufh7zgBLlBamjoc/VAkpxSXgJal7Wc6HS
YG0WziUARNsFHdff5s1g3ayh3ssnAT3m/1SNjMo5cqrv421tiy2gwsuL/LbxeBDY
RQ3dUfsVGmsCJUvbiJIetJUBX5VnVDkwIVBSd97i7yez4e3dBKhb1sAP1wWYcFKw
CcfWHPW9XNypDo66vmXtEGXtsero10/d9BhmUjrAQ8iY9/kgCpsyEnL5oYMP8sEM
UwZ6tPoAyPZQcqQpTwjPHwjYtXcXamUKrjx8zIeR7bLa6JYfd+Q=
=8s0Z
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXl7UkACgkQYKtH/8kJ
UifTQxAAqGsI+jW/1MFAokcJ3qOSZddlVl/5E6W1Ds6+okP6HnMN9lrVAuHkbiqc
j2fGRp3b6J0uqNjCKGa1FM+5jnY7C/ym73b43BGm4I5bEhuhE0CseOs3iCtNZa4Y
r2MQa9Ink0H2JDP4MrACTt7ig0mvmQy8favE9ETMc75AxuQSWyxCG/ApgsXTI7Lx
mcGO8s5aggpBksuAZPzSGf2tbxmF1lQemjg69ciRGtGFR7EQ2bIdyrZoH+AzQnje
tgxzk8sPJhqq0wbqbtrrIHbKLzmSH5R+0wXEUdRSvdinbL5VHKWkWOpeGS2ca0k1
umZ/hAQWWVNmZylsEBpF4W3yX13SivpTfUPkmVdNKQfEnTez2GiDYZyOEWVuvbFj
WhNxu2YTY44X4N8bY4lpJ7x9YCAUJm2Z8cuZ0m0lD22fM64rJQaG7dsGhAy9MK5M
jO6S0xmNfehC8v5gn2RBNCikVpp25W1IzhTpfWPjLJi4pYSeM+wRwWsgGbX6QrfI
me6WrRGVwgCFTbmyUgH/d3wgSLHf5J7hP2+NZ4VBjRhGc3ltwzo99crypQFpUlhY
D39wYI3jb+16cLLfryRP4LEik1WND+0h5JrYMMG2x3lswzRVv66A+v/00LAiOSQj
2DFxP0NS8Ig/AgkPR5g5KLBtCn7GvjrYm9+qFmCToZOcRbIqINA=
=j1US
-----END PGP SIGNATURE-----
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
Link: https://lore.kernel.org/r/20240223174849.1509465-1-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmXYA+gACgkQAEG6vDF+
4piTABAAjGSYJr/Dm/lH+yxkkiwxqXrcEzmZO9ADNfdlGZZ+Pau0s3OaQj3TVv+v
/E0vZAj80ZE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T7Xo8tyw5zE0skxx/YcmGuDVR4olYCpkF25ZwFaV6U+9SX6
bT96JDaEoVGF12GaHb4f7eG7YBd7rTP4G1N5doQWnpOVytsJcxZSQV2QoJObEERC
hSn3rCZlxuUoPGGSB6kxhn1fkp/vSDZQC9OTGH5S5kB45XQiLxBfv+o513krAp/+
KMOz7BQc2L+pnIlzsuYkGU+6tACtOpzeI+IgFIwd2zs2Hkl+u0RkSpd4QkyQLQCb
SI9AsmNWoBs3OP7hVUa3PxaNk5ggBBLM9eu4HLAXFTz2tdrLSv1ZqMWTB0xRIZUA
UWE7pW41JFMgx50nCLTdBgKNRiJ1aXjup4uuQAq8DZGXrT0fk8I=
=X90P
-----END PGP SIGNATURE-----
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
...
Link: https://lore.kernel.org/r/20240223033435.118028-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmXX+2AACgkQAEG6vDF+
4ph9fQ/+IgSJ13MyClBrpTcmSgkPc8KIvVI+75kjBeH/OJiqQoiCsQG8MwLHP5u0
xUW7xFaHOaDwi/hxQUIWwCYXh4kSqxyxnfgCqsPzqrtIvZo5Wnin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ROl83atv0mV9
fnZSakl5IlL6yu0FT5emIqb7DCSynpvtUlx/rEijVa/K53aGWUfOjDDiR+j/LweR
UedppB2i7TbZAcNYygR3VFA1xXMfjV7Mowp7iu7rN9uIhMaiLd+z5v6D0p+hxUOf
2Ziu0zXYa0vsbJ7p00Du+Iqtp/t+TeIxp8FCVgL9+EZRGfaFj5Jpg/Xt5/6JXVD3
RPibDDbqsR2KTIl8zlr65dtPr6bDYFNrBqGwIbF8hJTr/44/wIysOf9A5/zRq3X6
Ke14dzveIaxuwIi9k6D3jQcgL8/llhy6zPKITCskM6AEB7Sb4EM=
=w0Sv
-----END PGP SIGNATURE-----
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
Link: https://lore.kernel.org/r/20240223033250.117878-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-5-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-4-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-3-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240221062157.8694-1-rdunlap@infradead.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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>
The only addition here is the MediaTek SoC Information driver,
registering socinfo for various MediaTek SoCs.
-----BEGIN PGP SIGNATURE-----
iJ4EABYKAEYWIQQn3Xxr56ypAcSHzXSaNgTPrZeEeAUCZdNSSygcYW5nZWxvZ2lv
YWNjaGluby5kZWxyZWdub0Bjb2xsYWJvcmEuY29tAAoJEJo2BM+tl4R4jA0A/0Ok
7VsiAyB+G3v+OvkVnsgt1TQF5cRyNfAPSWGwGFynAQDYvSKOx/LeyU0uY1O3i+Yn
1o/y2UPSboYMhR/6xcOmDA==
=nuX6
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXVEE4ACgkQYKtH/8kJ
UicS3Q//VoL/9cK3HdQPmrPcOC04LzZEWJ+cS7WjExXusOCI5HcOCAYvCgEohKIH
CHgbE6eyXHlYtPcPcI49YJvQY7jtPqtzDJxGUNLEOn9VI3HYlySGHZLhiMpGwSfl
AMZW3NIpZSKJgtnerbxP4zXrr5lxVaVSV0K+fDgZnzW9z8wQ2+C+xMTAW8CvHZMi
fQ3v2FfizFotFVdEBaYRWraD+eVJFWnR0ShWqmnRyQOXPE8QgdG/LFHwGuGwdp2c
Gw3oyFqJT0x5vbKraVuFr/Q2Vqvk9iQYfbQkX0fZn9JR+ITi37I/gchcV3ziFmij
XS+Wj4XPqGnuocdW3eBm23zBMzOxTuc5nt0QYU2s2LeXfnv3twn+V0Ube8d3VHRT
04cbptaXtgZMG4cztCXQYmfFZ80tbxEs+LRpZh0T54Z/z8I/LhDcowgAYrNCYjgg
bbHkcTFNcFhTvhVB3yBo8xoEA4wXJZpjtVyyBzbrCJoo+XMXRPJgkvyJMkPgctD+
kM4wza5LkMmBgREXCg55keYDDCIHDWEA7YmCCfl420hCcLL2/urb7ilPf1UgOzJC
C7NlsK7wYyx6qdnaoqkAC5wu+UcXkInHQnXi3FSiXV8W07HKXVtr+MRHvW4SM+Cm
cgojseRIQu8ur1rhTrjWQ7nZiDhhUy6nGt9S/Ez91lPz88Wxg4w=
=zkVA
-----END PGP SIGNATURE-----
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
Link: https://lore.kernel.org/r/20240219131230.157792-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-12-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-11-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-10-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-9-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-8-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240211-bus_cleanup-firmware2-v1-1-1851c92c7be7@marliere.net
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-6-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-5-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-4-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-2-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240211-bus_cleanup-firmware2-v1-2-1851c92c7be7@marliere.net
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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:
| scmi_protocol scmi_dev.1: Enabled polling mode TX channel - prot_id:16
| arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
| arm-scmi firmware:scmi: unable to communicate with SCMI
| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
| Mem abort info:
| ESR = 0x0000000096000004
| EC = 0x25: DABT (current EL), IL = 32 bits
| SET = 0, FnV = 0
| EA = 0, S1PTW = 0
| FSC = 0x04: level 0 translation fault
| Data abort info:
| ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
| CM = 0, WnR = 0, TnD = 0, TagAccess = 0
| GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
| user pgtable: 4k pages, 48-bit VAs, pgdp=0000000881ef8000
| [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
| Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
| Modules linked in:
| CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-00124-g455ef3d016c9-dirty #793
| Hardware name: FVP Base RevC (DT)
| pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
| pc : smc_chan_free+0x3c/0x6c
| lr : smc_chan_free+0x3c/0x6c
| Call trace:
| smc_chan_free+0x3c/0x6c
| idr_for_each+0x68/0xf8
| scmi_cleanup_channels.isra.0+0x2c/0x58
| scmi_probe+0x434/0x734
| platform_probe+0x68/0xd8
| really_probe+0x110/0x27c
| __driver_probe_device+0x78/0x12c
| driver_probe_device+0x3c/0x118
| __driver_attach+0x74/0x128
| bus_for_each_dev+0x78/0xe0
| driver_attach+0x24/0x30
| bus_add_driver+0xe4/0x1e8
| driver_register+0x60/0x128
| __platform_driver_register+0x28/0x34
| scmi_driver_init+0x84/0xc0
| do_one_initcall+0x78/0x33c
| kernel_init_freeable+0x2b8/0x51c
| kernel_init+0x24/0x130
| ret_from_fork+0x10/0x20
| Code: f0004701 910a0021 aa1403e5 97b91c70 (b9400280)
| ---[ end trace 0000000000000000 ]---
Simply check for the struct pointer being NULL before trying to access
its members, to avoid this situation.
This was found when a transport doesn't really work (for instance no SMC
service), the probe routines then tries to clean up, and triggers a crash.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Fixes: 1dc6558062da ("firmware: arm_scmi: Add smc/hvc transport")
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240126122325.2039669-1-andre.przywara@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20240121110901.1414856-1-peng.fan@oss.nxp.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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.
This is especially useful in testing scenarios.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231221151129.325749-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Accessing clock domains descriptors by the index from the SCMI drivers
can potentially lead to out-of-bound violations if the SCMI drivers
misbehaves.
Use a common helper to check the consistency of such accesses.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240110120916.2482603-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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>
Add SD wake event for Tegra234 so that system can be woken up from
suspend when SD card hot-plug/unplug event is detected.
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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>
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!
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Link: https://lore.kernel.org/r/20240201140134.4345-1-tomasz.figa@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
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>
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>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
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.
Signed-off-by: Kartik <kkartik@nvidia.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>