Commit Graph

19455 Commits

Author SHA1 Message Date
Thierry Reding
fe57ff5365 arm64: tegra: Rename thermal zones nodes
The DT schema requires that nodes representing thermal zones include a
"-thermal" suffix in their name.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
fce5d07316 arm64: tegra: Sort Tegra132 XUSB clocks correctly
Make the order of the clocks and clock-names properties match the order
in the device tree bindings. This isn't strictly necessary from a point
of view of the operating system because matching will be done based on
the clock-names, but it makes it easier to validate the device trees
against the DT schema.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
9f27a6c421 arm64: tegra: Drop unused AHCI clocks on Tegra132
The CML1 and PLL_E clocks are never explicitly used by the AHCI
controller found on Tegra132, so drop them from the corresponding device
tree node.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
92564257d7 arm64: tegra: Fix Tegra132 I2C compatible string list
The I2C controller found on Tegra124 is not fully compatible with the
Tegra114 version, so drop the fallback compatible string from the list.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
ed9e9a6eb1 arm64: tegra: Add OPP tables on Tegra132
Add peripheral OPP tables on Tegra132 and wire them up to ACTMON and the
EMC. While at it, add the missing "#interconnect-cells" properties to
the memory controller and external memory controller nodes. Also set the
"#reset-cells" property for the memory controller because it exports the
hotflush reset controls.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
bb43b219c8 arm64: tegra: Fix compatible string for Tegra132 timer
The TKE (time-keeping engine) found on Tegra132 is not backwards
compatible with the version found on Tegra20, so update the compatible
string list accordingly.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
64b4078276 arm64: tegra: Remove unsupported properties on Norrin
The Tegra PMC device tree bindings don't support the "#wake-cells" and
"nvidia,reset-gpio" properties, so remove them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
2c6fd24dcb arm64: tegra: Fix unit-addresses on Norrin
The AS3722 pinmux device tree node doesn't have a "reg" property and
therefore must not have a unit-address, so drop it.

While at it, add missing unit-addresses for the charger and smart
battery IC's on the ChromeOS embedded controller's I2C tunnel bus.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
bd1fefcbdd arm64: tegra: Add native timer support on Tegra186
The native timers IP block found on NVIDIA Tegra SoCs implements a
watchdog timer that can be used to recover from system hangs. Add the
device tree node on Tegra186.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
097e01c610 arm64: tegra: Rename top-level regulators
Regulators defined at the top level in device tree are no longer part of
a simple bus and therefore don't have a reg property. Nodes without a
reg property shouldn't have a unit-address either, so drop the unit
address from the node names. To ensure nodes aren't duplicated (in which
case they would end up merged in the final DTB), append the name of the
regulator to the node name.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
4cc3e3e164 arm64: tegra: Rename top-level clocks
Clocks defined at the top level in device tree are no longer part of a
simple bus and therefore don't have a reg property. Nodes without a reg
property shouldn't have a unit-address either, so drop the unit address
from the node names. To ensure nodes aren't duplicated (in which case
they would end up merged in the final DTB), append the name of the clock
to the node name.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Jon Hunter
e762232f94 arm64: tegra: Add ISO SMMU controller for Tegra194
The display controllers are attached to a separate ARM SMMU instance
that is dedicated to servicing isochronous memory clients. Add this ISO
instance of the ARM SMMU to device tree.

Please note that the display controllers are not hooked up to this SMMU
yet, because we are still missing a means to transition framebuffers
used by the bootloader to the kernel.

This based upon an initial patch by Thierry Reding <treding@nvidia.com>.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Jon Hunter
f7eb278572 arm64: tegra: Add NVENC and NVJPG nodes for Tegra186 and Tegra194
Populate the device-tree nodes for NVENC and NVJPG Host1x engines on
Tegra186 and Tegra194.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Prathamesh Shete
ff21087e61 arm64: tegra: Add support to enumerate SD in UHS mode
Add support to enumerate SD in UHS mode on Tegra194. Add required
device-tree properties in SDMMC1 and SDMMC3 instances to enable dynamic
pad voltage switching and enumerate SD card in UHS-I modes.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Mikko Perttunen
533337d5c8 arm64: tegra: Add NVIDIA Jetson AGX Orin Developer Kit support
The Jetson AGX Orin Developer Kit is a continuation of the Jetson
Developer Kit line using the new NVIDIA Tegra234 (Orin) SoC.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
a12cf5c339 arm64: tegra: Describe Tegra234 CPU hierarchy
The NVIDIA Tegra234 SoC has 3 clusters of 4 Cortex-A78AE CPU cores each,
for a total of 12 CPUs. Each CPU has 64 KiB instruction and data caches
with each cluster having an additional 256 KiB unified L2 cache and a 2
MiB L3 cache.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Thierry Reding
f0e1266818 arm64: tegra: Add main and AON GPIO controllers on Tegra234
These two controllers expose general purpose I/O pins that can be used
to control or monitor a variety of signals.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Mikko Perttunen
06ad2ec4e5 arm64: tegra: Add Tegra234 TCU device
Add a device for TCU (Tegra Combined UART) used for serial console.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:01 +01:00
Mikko Perttunen
e086d82d4f arm64: tegra: Fill in properties for Tegra234 eMMC
Add missing properties to the eMMC controller, as required to use it on
actual hardware.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:00 +01:00
Mikko Perttunen
98094be152 arm64: tegra: Update Tegra234 BPMP channel addresses
On final Tegra234 systems, shared memory for communication with BPMP is
located at offset 0x70000 in SYSRAM.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:00 +01:00
Mikko Perttunen
e537adde13 arm64: tegra: Add clock for Tegra234 RTC
The RTC device requires a clock. Add it.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:00 +01:00
Thierry Reding
7fa307524a arm64: tegra: Fixup SYSRAM references
The json-schema bindings for SRAM expect the nodes to be called "sram"
rather than "sysram" or "shmem". Furthermore, place the brackets around
the SYSRAM references such that a two-element array is created rather
than a two-element array nested in a single-element array. This is not
relevant for device tree itself, but allows the nodes to be properly
validated against json-schema bindings.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-12-16 16:51:00 +01:00
Biju Das
d563f4bac9 arm64: dts: renesas: rzg2l-smarc-som: Add vdd core regulator
Add vdd core regulator (1.1 V).

This patch add regulator support for gpu.

The H/W manual mentions nothing about a gpu regulator. So using vdd
core regulator for gpu.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211208104026.421-4-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-16 15:37:10 +01:00
Biju Das
b6db8f72dd arm64: dts: renesas: r9a07g044: Add Mali-G31 GPU node
Add Mali-G31 GPU node to SoC DTSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211208104026.421-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-16 15:37:10 +01:00
Arnd Bergmann
4a097f29fb SoCFPGA dts updates for v5.17
- Update N5X to include qspi, usb and ethernet
 - Adjust NAND partition size for Agilex and Stratix10
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAyFiEEoHhMeiyk5VmwVMwNGZQEC4GjKPQFAmG6GWEUHGRpbmd1eWVu
 QGtlcm5lbC5vcmcACgkQGZQEC4GjKPQWtA/3UtiYPmxs/lyKs4Um+jSpSztah7mP
 /sBQzl7maB9ILI0oHhMcflEthr38HVpbkuhcSH0PCgB7mW9Lw3MM7yLXDfgiYt1o
 N0D6Jcu7Vku5CZmHX+l7iH0t9oYQ+RkPQDKs8MkhxUwS3N6OtG5wvjYog1QArJsy
 qhpOEPN26WLtVkL/I+I5tQq3poghjTGIwbWjhZYQJy+Rj0/Z4wm2514VkGGkYDax
 rdA2RzZidwwEnoqocFhntBymXqQ75fP+UWm9EK+6e3XL9zgYBs5hpD9iiotHhL8r
 THOV+1VPWaUeP58xJPcPspPr+irzG5kxQW7orwU33xieta04PbFQRZRAke7unBiU
 J8KoIjuIcWjewYTJg5KdfapApFcYDYMfHIvIPjs5szE4NkumpxuUVy1qMDMHe1bP
 zhUIK1+8K/N/8ki+7Trkg/mgcJF0ISvs0pXFX0NVtQlJn+u0Nq5i3NQZcDpZpy6Y
 6RJJ57XfGAHBfRVrbRIZLrXpea6n/EI0KcXhDKaAv45K+qKDNVXoSP6T4QpHHaBS
 wrzqUoW0PSXbtSQhTTnCiW1G2uT1whJ4aeEdM9UdN3vtsrBNgwWtyZuPwOrCLjIW
 k4vUBoAPmd8Yc7NBlsgSGQE5uJP9vy+eD4Dc0abYPe01bG1Eepf/ioUwx/scfVkR
 tSefPe1L1K9Dtw==
 =5jLo
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG7RG8ACgkQmmx57+YA
 GNkimQ//QJV7VGxrb1AW8c/tiIRTJjGEb8rTzAYK5QCC/5Ye2cx0A07Buf7K7yqH
 +rIe+xjdc5qf9v2BxstWuKXFqmgFAKSHd3ByRt82ULTzHRtfSwEWFkluKUY6KqAO
 6go5wkDt89OgqhmV9muAwTkzgwMcnVxLaQHx26QzjwZxhBNeOc9J2eDeTvZUfhOk
 4ffS1CkJeeZ9AXuzhWJIwZG4bFkSCtCcrCma3mOYjJczZyvIxzEUuZEgXpaoFouJ
 NveQ8U3xvpa272ixiJi4ee/rk3t1qpaQdM8gaBhMBNY/PhuAsGeQHIpe/8CsWQI9
 WV9LAgKwFNSOMsQoZFJaoFVg6Nu6gtTgI139GlGbypBv3Osb7AeJFYjvz5SQ5RYx
 Z4MJlMeujjQ6c6nsMAkCywzntBgL59/hLoNNF9x1iTCjB8f3OFL+vGKZA/H1T0XM
 4z0IMdL342ZVWz5kEQq3cR/Zm5Kg4VKpKc1xUX+VB+lh9KS838ZT58OXsg/iQ0h1
 suZHveXwmhlj6L2O5GSBrPdnMLIAeNdrsIRot/a0dtTkM2wViAllGwQgid2w464T
 AEXkZJlNHQTHIPlHtXxKTc8RJseq7PtMgnKHTgJt4CX8528DaRArc59V8ikkjP3C
 JVnlKDiSvWqnO9YxtIWwEvIUW+bUTgJVMPN90vDi1a+BRpQabMc=
 =b6RL
 -----END PGP SIGNATURE-----

Merge tag 'socfpga_dts_update_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/dt

SoCFPGA dts updates for v5.17
- Update N5X to include qspi, usb and ethernet
- Adjust NAND partition size for Agilex and Stratix10

* tag 'socfpga_dts_update_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  arm64: dts: Update NAND MTD partition for Agilex and Stratix 10
  arm64: dts: n5x: add qspi, usb, and ethernet support

Link: https://lore.kernel.org/r/20211215164545.300273-1-dinguyen@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-16 14:51:43 +01:00
Marc Zyngier
43d8ac2212 Merge branch kvm-arm64/pkvm-hyp-sharing into kvmarm-master/next
* kvm-arm64/pkvm-hyp-sharing:
  : .
  : Series from Quentin Perret, implementing HYP page share/unshare:
  :
  : This series implements an unshare hypercall at EL2 in nVHE
  : protected mode, and makes use of it to unmmap guest-specific
  : data-structures from EL2 stage-1 during guest tear-down.
  : Crucially, the implementation of the share and unshare
  : routines use page refcounts in the host kernel to avoid
  : accidentally unmapping data-structures that overlap a common
  : page.
  : [...]
  : .
  KVM: arm64: pkvm: Unshare guest structs during teardown
  KVM: arm64: Expose unshare hypercall to the host
  KVM: arm64: Implement do_unshare() helper for unsharing memory
  KVM: arm64: Implement __pkvm_host_share_hyp() using do_share()
  KVM: arm64: Implement do_share() helper for sharing memory
  KVM: arm64: Introduce wrappers for host and hyp spin lock accessors
  KVM: arm64: Extend pkvm_page_state enumeration to handle absent pages
  KVM: arm64: pkvm: Refcount the pages shared with EL2
  KVM: arm64: Introduce kvm_share_hyp()
  KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2
  KVM: arm64: Hook up ->page_count() for hypervisor stage-1 page-table
  KVM: arm64: Fixup hyp stage-1 refcount
  KVM: arm64: Refcount hyp stage-1 pgtable pages
  KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-12-16 13:06:09 +00:00
Quentin Perret
52b28657eb KVM: arm64: pkvm: Unshare guest structs during teardown
Make use of the newly introduced unshare hypercall during guest teardown
to unmap guest-related data structures from the hyp stage-1.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-15-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
b8cc6eb5bd KVM: arm64: Expose unshare hypercall to the host
Introduce an unshare hypercall which can be used to unmap memory from
the hypervisor stage-1 in nVHE protected mode. This will be useful to
update the EL2 ownership state of pages during guest teardown, and
avoids keeping dangling mappings to unreferenced portions of memory.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-14-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
376a240f03 KVM: arm64: Implement do_unshare() helper for unsharing memory
Tearing down a previously shared memory region results in the borrower
losing access to the underlying pages and returning them to the "owned"
state in the owner.

Implement a do_unshare() helper, along the same lines as do_share(), to
provide this functionality for the host-to-hyp case.

Reviewed-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-13-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
1ee32109fd KVM: arm64: Implement __pkvm_host_share_hyp() using do_share()
__pkvm_host_share_hyp() shares memory between the host and the
hypervisor so implement it as an invocation of the new do_share()
mechanism.

Note that double-sharing is no longer permitted (as this allows us to
reduce the number of page-table walks significantly), but is thankfully
no longer relied upon by the host.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-12-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
e82edcc75c KVM: arm64: Implement do_share() helper for sharing memory
By default, protected KVM isolates memory pages so that they are
accessible only to their owner: be it the host kernel, the hypervisor
at EL2 or (in future) the guest. Establishing shared-memory regions
between these components therefore involves a transition for each page
so that the owner can share memory with a borrower under a certain set
of permissions.

Introduce a do_share() helper for safely sharing a memory region between
two components. Currently, only host-to-hyp sharing is implemented, but
the code is easily extended to handle other combinations and the
permission checks for each component are reusable.

Reviewed-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-11-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
61d99e33e7 KVM: arm64: Introduce wrappers for host and hyp spin lock accessors
In preparation for adding additional locked sections for manipulating
page-tables at EL2, introduce some simple wrappers around the host and
hypervisor locks so that it's a bit easier to read and bit more difficult
to take the wrong lock (or even take them in the wrong order).

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-10-qperret@google.com
2021-12-16 12:58:57 +00:00
Will Deacon
3d467f7b8c KVM: arm64: Extend pkvm_page_state enumeration to handle absent pages
Explicitly name the combination of SW0 | SW1 as reserved in the pte and
introduce a new PKVM_NOPAGE meta-state which, although not directly
stored in the software bits of the pte, can be used to represent an
entry for which there is no underlying page. This is distinct from an
invalid pte, as stage-2 identity mappings for the host are created
lazily and so an invalid pte there is the same as a valid mapping for
the purposes of ownership information.

This state will be used for permission checking during page transitions
in later patches.

Reviewed-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-9-qperret@google.com
2021-12-16 12:58:56 +00:00
Quentin Perret
a83e2191b7 KVM: arm64: pkvm: Refcount the pages shared with EL2
In order to simplify the page tracking infrastructure at EL2 in nVHE
protected mode, move the responsibility of refcounting pages that are
shared multiple times on the host. In order to do so, let's create a
red-black tree tracking all the PFNs that have been shared, along with
a refcount.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-8-qperret@google.com
2021-12-16 12:58:56 +00:00
Quentin Perret
3f868e142c KVM: arm64: Introduce kvm_share_hyp()
The create_hyp_mappings() function can currently be called at any point
in time. However, its behaviour in protected mode changes widely
depending on when it is being called. Prior to KVM init, it is used to
create the temporary page-table used to bring-up the hypervisor, and
later on it is transparently turned into a 'share' hypercall when the
kernel has lost control over the hypervisor stage-1. In order to prepare
the ground for also unsharing pages with the hypervisor during guest
teardown, introduce a kvm_share_hyp() function to make it clear in which
places a share hypercall should be expected, as we will soon need a
matching unshare hypercall in all those places.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-7-qperret@google.com
2021-12-16 12:58:56 +00:00
Will Deacon
82bb02445d KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2
Implement kvm_pgtable_hyp_unmap() which can be used to remove hypervisor
stage-1 mappings at EL2.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-6-qperret@google.com
2021-12-16 12:58:56 +00:00
Will Deacon
34ec7cbf1e KVM: arm64: Hook up ->page_count() for hypervisor stage-1 page-table
kvm_pgtable_hyp_unmap() relies on the ->page_count() function callback
being provided by the memory-management operations for the page-table.

Wire up this callback for the hypervisor stage-1 page-table.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-5-qperret@google.com
2021-12-16 12:58:56 +00:00
Quentin Perret
d6b4bd3f48 KVM: arm64: Fixup hyp stage-1 refcount
In nVHE-protected mode, the hyp stage-1 page-table refcount is broken
due to the lack of refcount support in the early allocator. Fix-up the
refcount in the finalize walker, once the 'hyp_vmemmap' is up and running.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-4-qperret@google.com
2021-12-16 12:58:56 +00:00
Quentin Perret
2ea2ff91e8 KVM: arm64: Refcount hyp stage-1 pgtable pages
To prepare the ground for allowing hyp stage-1 mappings to be removed at
run-time, update the KVM page-table code to maintain a correct refcount
using the ->{get,put}_page() function callbacks.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-3-qperret@google.com
2021-12-16 12:58:55 +00:00
Quentin Perret
1fac3cfb9c KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator
In nVHE protected mode, the EL2 code uses a temporary allocator during
boot while re-creating its stage-1 page-table. Unfortunately, the
hyp_vmmemap is not ready to use at this stage, so refcounting pages
is not possible. That is not currently a problem because hyp stage-1
mappings are never removed, which implies refcounting of page-table
pages is unnecessary.

In preparation for allowing hypervisor stage-1 mappings to be removed,
provide stub implementations for {get,put}_page() in the early allocator.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-2-qperret@google.com
2021-12-16 12:58:55 +00:00
Marc Zyngier
ce5b5b05c1 Merge branch kvm-arm64/vgic-fixes-5.17 into kvmarm-master/next
* kvm-arm64/vgic-fixes-5.17:
  : .
  : A few vgic fixes:
  : - Harden vgic-v3 error handling paths against signed vs unsigned
  :   comparison that will happen once the xarray-based vcpus are in
  : - Demote userspace-triggered console output to kvm_debug()
  : .
  KVM: arm64: vgic: Demote userspace-triggered console prints to kvm_debug()
  KVM: arm64: vgic-v3: Fix vcpu index comparison

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-12-16 12:54:12 +00:00
Marc Zyngier
440523b92b KVM: arm64: vgic: Demote userspace-triggered console prints to kvm_debug()
Running the KVM selftests results in these messages being dumped
in the kernel console:

[  188.051073] kvm [469]: VGIC redist and dist frames overlap
[  188.056820] kvm [469]: VGIC redist and dist frames overlap
[  188.076199] kvm [469]: VGIC redist and dist frames overlap

Being amle to trigger this from userspace is definitely not on,
so demote these warnings to kvm_debug().

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216104507.1482017-1-maz@kernel.org
2021-12-16 10:47:48 +00:00
Marc Zyngier
c95b1d7ca7 KVM: arm64: vgic-v3: Fix vcpu index comparison
When handling an error at the point where we try and register
all the redistributors, we unregister all the previously
registered frames by counting down from the failing index.

However, the way the code is written relies on that index
being a signed value. Which won't be true once we switch to
an xarray-based vcpu set.

Since this code is pretty awkward the first place, and that the
failure mode is hard to spot, rewrite this loop to iterate
over the vcpus upwards rather than downwards.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216104526.1482124-1-maz@kernel.org
2021-12-16 10:47:24 +00:00
Xiaoliang Yang
0bc3e333a0 arm64: dts: imx8mp-evk: configure multiple queues on eqos
Eqos ethernet support five queues on hardware, enable these queues and
configure the priority of each queue. Uses Strict Priority as scheduling
algorithms to ensure that the TSN function works.

The priority of each queue is a bitmask value that maps VLAN tag
priority to the queue. Since the hardware only supports five queues,
this patch maps priority 0-4 to queues one by one, and priority 5-7 to
queue 4.

The total fifo size of 5 queues is 8192 bytes, if enable 5 queues with
store-and-forward mode, it's not enough for large packets, which would
trigger fifo overflow frequently. This patch set DMA to thresh mode to
enable all 5 queues.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Reviewed-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 18:14:25 +08:00
Alex Marginean
e426d63e75 arm64: dts: ls1028a-qds: add overlays for various serdes protocols
Add overlays for various serdes protocols on LS1028A QDS board using
different PHY cards.  These should be applied at boot, based on serdes
configuration.  If no overlay is applied, only the RGMII interface on
the QDS is available in Linux.

Building device tree fragments requires passing the "-@" argument to
dtc, which increases the base dtb size and might cause some platforms to
fail to store the new binary. To avoid that, it would be nice to only
pass "-@" for the platforms where fragments will be used, aka
LS1028A-QDS. One approach suggested by Rob Herring is used here:

https://lore.kernel.org/patchwork/patch/821645/

Also moved the enet* override nodes in dts file to be in alphabetic order.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:58:01 +08:00
Vabhav Sharma
52b9848117 arm64: dts: ls1028a-qds: enable lpuart1
LPUART nodes by default are disabled in LS1028A device
tree, Enabling LPUART1 node.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:58:01 +08:00
Biwen Li
cbe9d948ea arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus
The i2c rtc is on i2c2 bus not i2c1 bus, so fix it in dts.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Li Yang <leoyang.lil@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:58:01 +08:00
Biwen Li
b2e2d3e02f arm64: dts: ls1028a-rdb: enable pwm0
Enable pwm0 on ls1028a-rdb board which uses flextimer1.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:57:14 +08:00
Biwen Li
71799672ea arm64: dts: ls1028a: add flextimer based pwm nodes
Add pwm nodes using flextimer controller.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:57:11 +08:00
Biwen Li
dd3d936a1b arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source
Add flextimer2 based ftm_alarm1 node and enable it to be the default rtc
wakeup source for rdb and qds boards instead of the original flextimer1
which is used by PWM.  The ftm_alarm0 node hence is disabled by default.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:57:08 +08:00
Xiaowei Bao
e84e22c0c3 arm64: dts: ls1028a: Add PCIe EP nodes
Add PCIe EP nodes for ls1028a to support EP mode.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:56:56 +08:00
Biwen Li
cc03211c74 arm64: dts: lx2162a-qds: add interrupt line for RTC node
Add interrupt line for RTC node on lx2162a-qds

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:29:35 +08:00
Yangbo Lu
23817c8396 arm64: dts: lx2162a-qds: support SD UHS-I and eMMC HS400 modes
The default NXP SDHC adapter cards for LX2162AQDS are SD 2.0/3.0
adapter card for eSDHC1, and eMMC 5.1 adapter card for eSDHC2.
Add speed modes properties supported by the two adapters in device
tree node.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:28:51 +08:00
Ran Wang
a5b13770fa arm64: dts: lx2160a: enable usb3-lpm-capable for usb3 nodes
Enable USB3 HW LPM feature for lx2160a.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:28:11 +08:00
Pankaj Bansal
eb70c4a3b1 arm64: dts: lx2160a-qds: Add mdio mux nodes
The two external MDIO buses used to communicate with phy devices that
are external to SOC are muxed in LX2160AQDS board.  These buses can be
routed to any one of the eight IO slots on LX2160AQDS board depending on
value in fpga register 0x54.  Additionally the external MDIO1 is used to
communicate to the onboard RGMII phy devices.  The mdio1 is controlled
by bits 4-7 of fpga register and mdio2 is controlled by bits 4-7 of fpga
register.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:27:39 +08:00
Pankaj Gupta
519bace37b arm64: dts: lx2160a: add optee-tz node
Disabled by default in SoC dtsi and enables in board dts files.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:25:58 +08:00
Ioana Radulescu
674d63dfad arm64: dts: lx2160a-rdb: Add Inphi PHY node
DPMAC5 and DPMAC6 are connected to 25G Inphi PHY

Signed-off-by: Vicentiu Galanopulo <vicentiu.galanopulo@nxp.com>
Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:25:45 +08:00
Zhang Ying-22455
849e087ba6 arm64: dts: lx2160a: fix scl-gpios property name
Fix the typo in the property name.

Fixes: d548c217c6 ("arm64: dts: add QorIQ LX2160A SoC support")
Signed-off-by: Zhang Ying <ying.zhang22455@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 17:24:41 +08:00
Lucas Stach
842912c42e arm64: dts: imx8mm: don't assign PLL2 in SoC dtsi
The base i.MX8MM dtsi changes the audio PLL2 rate, which gets in the
way if it should be used for anything else than audio. As this PLL doesn't
seem to be used by any upstream supported board, just remove the rate
configuration to allow boards to set it up as they wish.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 16:08:03 +08:00
Jernej Skrabec
0baddea60e
arm64: dts: allwinner: h6: Add Hantro G2 node
H6 SoC has a second VPU, dedicated to VP9 decoding. It's a slightly
older design, though.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20211129182633.480021-10-jernej.skrabec@gmail.com
2021-12-16 08:47:17 +01:00
Lucas Stach
92d2c17edb arm64: dts: nitrogen8-som: correct i2c1 pad-ctrl
The slew rate and drive-strength of the i2c1 pads were much too
high. Bring them down to avoid signal quality issues.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 13:54:33 +08:00
Lucas Stach
ee47d510b4 arm64: dts: nitrogen8-som: correct network PHY reset
Add the missing reset-gpios property to allow Linux to fully reset
the network PHY and fix the pinmux to add the neccessary pull-ups
for the PHY strap configuration.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-16 13:44:51 +08:00
Dmitry Baryshkov
bf0a257a94 arm64: dts: qcom: sm8450: add i2c13 and i2c14 device nodes
Add device tree nodes for two i2c blocks: i2c13 and i2c14.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-12-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vladimir Zapolskiy
015a89f0d3 arm64: dts: qcom: sm8450: add cpufreq support
The change adds a description of a SM8450 cpufreq-epss controller and
references to it from CPU nodes.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-11-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Dmitry Baryshkov
61eba74e47 arm64: dts: qcom: sm8450: Add rpmhpd node
This adds RPMH power domain found in SM8450 SoC

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-10-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vinod Koul
8f8f98c881 arm64: dts: qcom: sm8450-qrd: enable ufs nodes
Enable the UFS and phy node and add the regulators used by them.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-9-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vinod Koul
07fa917a33 arm64: dts: qcom: sm8450: add ufs nodes
Add the UFS and QMP PHY node for SM8450 SoC

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-8-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vinod Koul
128914ad23 arm64: dts: qcom: sm8450-qrd: Add rpmh regulator nodes
Add the RPMH regulators found in QRD-SM8450 platform

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-7-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vinod Koul
24de05c38e arm64: dts: qcom: Add base SM8450 QRD DTS
Add DTS for Qualcomm QRD platform which uses SM8450 SoC and mark the
reserved nodes.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-6-vkoul@kernel.org
2021-12-15 16:30:58 -06:00
Vinod Koul
892d539539 arm64: dts: qcom: sm8450: add smmu nodes
Add the apps smmu node as found in the SM8450 SoC

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Acked-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-5-vkoul@kernel.org
2021-12-15 16:30:14 -06:00
Vinod Koul
285f97bc4b arm64: dts: qcom: sm8450: Add reserved memory nodes
Add the reserved memory nodes for SM8450. This is based on the downstream
documentation.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-4-vkoul@kernel.org
2021-12-15 16:30:14 -06:00
Vinod Koul
ec950d5572 arm64: dts: qcom: sm8450: Add tlmm nodes
Add tlmm node found in SM8450 SoC and uart pin configuration

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-3-vkoul@kernel.org
2021-12-15 16:30:14 -06:00
Vinod Koul
5188049c9b arm64: dts: qcom: Add base SM8450 DTSI
This add based DTSI for SM8450 SoC and includes base description of
CPUs, GCC, RPMHCC, UART, interuupt-controller which helps to boot to
shell with console on boards with this SoC

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211215043440.605624-2-vkoul@kernel.org
2021-12-15 16:30:14 -06:00
Baruch Siach
72cb4c48a4 arm64: dts: qcom: ipq6018: Fix gpio-ranges property
There must be three parameters in gpio-ranges property. Fixes this not
very helpful error message:

  OF: /soc/pinctrl@1000000: (null) = 3 found 3

Fixes: 1e8277854b ("arm64: dts: Add ipq6018 SoC and CP01 board support")
Cc: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/8a744cfd96aff5754bfdcf7298d208ddca5b319a.1638862030.git.baruch@tkos.co.il
2021-12-15 16:20:27 -06:00
David Heidelberg
c8b9d64bb2 arm64: dts: qcom: sdm845: add QFPROM chipset specific compatible
Use correct compatible according to dt-binding.

Fixes + few other lines of `make qcom/sdm845-oneplus-fajita.dtb`:
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: qfprom@784000: compatible: ['qcom,qfprom'] is too short
        From schema: Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213190228.106924-1-david@ixit.cz
2021-12-15 16:20:27 -06:00
Bjorn Andersson
d5e12f3823 arm64: dts: qcom: sdm845: mtp: Add vadc channels and thermal zones
Downstream defines four ADC channels related to thermal sensors external
to the PM8998 and two channels for internal voltage measurements.

Add these to the upstream SDM845 MTP, describe the thermal monitor
channels and add thermal_zones for these.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20211005032531.2251928-5-bjorn.andersson@linaro.org
2021-12-15 16:20:27 -06:00
Bjorn Andersson
4cc7c85ccc arm64: dts: qcom: pm8998: Add ADC Thermal Monitor node
Add a node for the ADC Thermal Monitor found in the PM8998 PMIC. This is
used to connect thermal zones with ADC channels.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20211005032531.2251928-4-bjorn.andersson@linaro.org
2021-12-15 16:20:27 -06:00
David Heidelberg
409fd3f10c arm64: qcom: dts: drop legacy property #stream-id-cells
Property #stream-id-cells is legacy leftover and isn't currently
documented nor used.

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211208184707.100716-1-david@ixit.cz
2021-12-15 16:20:27 -06:00
Konrad Dybcio
202f69cd4e Revert "arm64: dts: qcom: sm8350: Specify clock-frequency for arch timer"
This reverts commit ed9500c1df.

The clock-frequency property was meant to aid platforms with broken firmwares
that don't set up the timer properly on their own. Don't include it where it is
not the case.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211202004328.459899-1-konrad.dybcio@somainline.org
2021-12-15 16:20:27 -06:00
Srinivas Kandagatla
ef10e1b895 arm64: dts: qcom: c630: add headset jack and button detection support
Add MBHC support available in WCD934X codec.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211209175342.20386-3-srinivas.kandagatla@linaro.org
2021-12-15 16:20:19 -06:00
Srinivas Kandagatla
c02b360ca6 arm64: dts: qcom: c630: Fix soundcard setup
Currently Soundcard has 1 rx device for headset and SoundWire Speaker Playback.

This setup has issues, ex if we try to play on headset the audio stream is
also sent to SoundWire Speakers and we will hear sound in both headsets and speakers.

Make a separate device for Speakers and Headset so that the streams are
different and handled properly.

Fixes: 45021d35fc ("arm64: dts: qcom: c630: Enable audio support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211209175342.20386-2-srinivas.kandagatla@linaro.org
2021-12-15 16:18:15 -06:00
Sam Shih
f40c0f800f arm64: dts: mediatek: add pinctrl support for mt7986b
Add mt7986b pinctrl node

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Link: https://lore.kernel.org/r/20211122123552.8218-3-sam.shih@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-12-15 21:06:35 +01:00
Sam Shih
c3a064a32e arm64: dts: mediatek: add pinctrl support for mt7986a
Add mt7986a pinctrl node, and update pinmux setting for mt7986a

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Link: https://lore.kernel.org/r/20211122123552.8218-2-sam.shih@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-12-15 21:06:35 +01:00
Prashant Malani
fd31f778da arm64: dts: mt8183: kukui: Add Type C node
Add a node describing the USB Type C connector, in order to utilize the
Chromium OS USB Type-C driver that enumerates Type-C ports and connected
cables/peripherals and makes them visible to userspace.

Cc: Alexandru M Stan <amstan@chromium.org>
Cc: Benson Leung <bleung@chromium.org>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20211209195112.366176-1-pmalani@chromium.org
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-12-15 21:02:27 +01:00
Sam Shih
50137c150f arm64: dts: mediatek: add basic mt7986 support
Add basic chip support for Mediatek mt7986, include
basic uart nodes, rng node and watchdog node.

Add cpu node, timer node, gic node, psci and reserved-memory node
for ARM Trusted Firmware.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Link: https://lore.kernel.org/r/20211122123222.8016-3-sam.shih@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-12-15 20:30:34 +01:00
Arnd Bergmann
5f424ff299 Apple SoC DT updates for 5.17, round 2:
- Various cleanups (removing useless props, sorting nodes, renaming
   things)
 - Add PMGR min-state binding & props (see PMGR pull for driver change)
 - Initial compatibles for t600x machines (M1 Pro/Max). This covers the
   bindings that just need compatible bumps & minor tweaks, no driver
   changes.
 - Add watchdog node (driver not merged yet, hopefully will be; binding
   went in the previous pull)
 - Add missing power-domains property to the mailbox binding
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSU7I7lUkZru3Mt15+lhN6SrnTN2AUCYbn3nQAKCRClhN6SrnTN
 2BllAP47kTDqaFjphvPlwtqLQNkNLdGwA41raizbDb1bN37CLAD+Prd8qZMC06Jg
 5hisgJXYIjqc1BcU99RaWIsbcwA6lgI=
 =D74S
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG6AigACgkQmmx57+YA
 GNmjcRAAsD0DxGIClPBrTV7rxhyrKdG753P93BOWtztVHMt6Nn4FEn9e5bqGZg5G
 NPR9dJ83N+cOzZaLjispwId+WA4WdJCNNV8xy/MzwvvN+X1NNrk/9/pun/xnyaGk
 IfpBrHn5kxsa4iV8pWasVGAdW/JvoKZ2TLhToAFSKX9mJQGwwbmdxdU2QlnH/BHC
 sxM24zZglzNYYIxZetpkr/V7mMSoB+pT4xp2w8Rh+z8S13qNVj8lMpH05UJJYGmG
 eUpFeWmOsPWuNTO6SPKqQUjiA94E57fUYTDv//bIBYfqb0iUXsW4e3Gwh94rqtmz
 dCpc+3WmHqc7ODjEvoXleUah8lAY5VOUbgDMS75lECsmNs5s7Y3/753SbXZBl+oh
 VwKrdPfgumjHT7NNvd6IJwG0V8VSDWm6/PihUkRdatJn1lZblgrKVRfu83hZG/7V
 Zrp7A5C1E3XGIKeT2FjpXaOu547el33XHfro3qkFi72SYTz2+C5VRzRRF6IZ/fqd
 oZYrmpQxFQeudAtRIiNKq9GeHNvsMysc03aQxUhkSqvDKy90MhTRA6QyPjsGqZo/
 DFwOQej7mMfNPtdLR5m57VYRWh6iMQ0QY2KHpI6appAYvhia+zPraykr25OFebSE
 ycTbPrSE5Mv7cp/9pzsDLHud9saXUPLzREhLmwjlBs1yfYiyK8E=
 =BbdH
 -----END PGP SIGNATURE-----

Merge tag 'asahi-soc-dt-5.17-v2' of https://github.com/AsahiLinux/linux into arm/dt

Apple SoC DT updates for 5.17, round 2:

- Various cleanups (removing useless props, sorting nodes, renaming
  things)
- Add PMGR min-state binding & props (see PMGR pull for driver change)
- Initial compatibles for t600x machines (M1 Pro/Max). This covers the
  bindings that just need compatible bumps & minor tweaks, no driver
  changes.
- Add watchdog node (driver not merged yet, hopefully will be; binding
  went in the previous pull)
- Add missing power-domains property to the mailbox binding

* tag 'asahi-soc-dt-5.17-v2' of https://github.com/AsahiLinux/linux:
  dt-bindings: mailbox: apple,mailbox: Add power-domains property
  arm64: dts: apple: t8103: Sort nodes by address
  arm64: dts: apple: t8103: Rename clk24 to clkref
  arm64: dts: apple: t8103: Add watchdog node
  dt-bindings: pinctrl: apple,pinctrl: Add apple,t6000-pinctrl compatible
  dt-bindings: pci: apple,pcie: Add t6000 support
  dt-bindings: i2c: apple,i2c: Add apple,t6000-i2c compatible
  dt-bindings: arm: apple: Add t6000/t6001 MacBook Pro 14/16" compatibles
  arm64: dts: apple: t8103: Add apple,min-state to DCP PMGR nodes
  dt-bindings: power: apple,pmgr-pwrstate: Add apple,min-state prop
  arm64: dts: apple: t8103: Remove PCIe max-link-speed properties

Link: https://lore.kernel.org/r/a24faafd-f2ae-c3a7-5327-b27da7d9e34b@marcan.st
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-15 15:56:40 +01:00
Marc Zyngier
7b6871f670 Merge branch kvm-arm64/pkvm-cleanups-5.17 into kvmarm-master/next
* kvm-arm64/pkvm-cleanups-5.17:
  : .
  : pKVM cleanups from Quentin Perret:
  :
  : This series is a collection of various fixes and cleanups for KVM/arm64
  : when running in nVHE protected mode. The first two patches are real
  : fixes/improvements, the following two are minor cleanups, and the last
  : two help satisfy my paranoia so they're certainly optional.
  : .
  KVM: arm64: pkvm: Make kvm_host_owns_hyp_mappings() robust to VHE
  KVM: arm64: pkvm: Stub io map functions
  KVM: arm64: Make __io_map_base static
  KVM: arm64: Make the hyp memory pool static
  KVM: arm64: pkvm: Disable GICv2 support
  KVM: arm64: pkvm: Fix hyp_pool max order

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-12-15 14:21:23 +00:00
Quentin Perret
64a1fbda59 KVM: arm64: pkvm: Make kvm_host_owns_hyp_mappings() robust to VHE
The kvm_host_owns_hyp_mappings() function should return true if and only
if the host kernel is responsible for creating the hypervisor stage-1
mappings. That is only possible in standard non-VHE mode, or during boot
in protected nVHE mode. But either way, none of this makes sense in VHE,
so make sure to catch this case as well, hence making the function
return sensible values in any context (VHE or not).

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-7-qperret@google.com
2021-12-15 14:18:31 +00:00
Quentin Perret
bff01cb6b1 KVM: arm64: pkvm: Stub io map functions
Now that GICv2 is disabled in nVHE protected mode there should be no
other reason for the host to use create_hyp_io_mappings() or
kvm_phys_addr_ioremap(). Add sanity checks to make sure that assumption
remains true looking forward.

Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-6-qperret@google.com
2021-12-15 14:17:31 +00:00
Quentin Perret
473a3efbaf KVM: arm64: Make __io_map_base static
The __io_map_base variable is used at EL2 to track the end of the
hypervisor's "private" VA range in nVHE protected mode. However it
doesn't need to be used outside of mm.c, so let's make it static to keep
all the hyp VA allocation logic in one place.

Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-5-qperret@google.com
2021-12-15 14:17:30 +00:00
Quentin Perret
53a563b01f KVM: arm64: Make the hyp memory pool static
The hyp memory pool struct is sized to fit exactly the needs of the
hypervisor stage-1 page-table allocator, so it is important it is not
used for anything else. As it is currently used only from setup.c,
reduce its visibility by marking it static.

Signed-off-by: Quentin Perret <qperret@google.com>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-4-qperret@google.com
2021-12-15 14:17:01 +00:00
Quentin Perret
a770ee80e6 KVM: arm64: pkvm: Disable GICv2 support
GICv2 requires having device mappings in guests and the hypervisor,
which is incompatible with the current pKVM EL2 page ownership model
which only covers memory. While it would be desirable to support pKVM
with GICv2, this will require a lot more work, so let's make the
current assumption clear until then.

Co-developed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-3-qperret@google.com
2021-12-15 14:16:28 +00:00
Quentin Perret
34b43a8849 KVM: arm64: pkvm: Fix hyp_pool max order
The EL2 page allocator in protected mode maintains a per-pool max order
value to optimize allocations when the memory region it covers is small.
However, the max order value is currently under-estimated whenever the
number of pages in the region is a power of two. Fix the estimation.

Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-2-qperret@google.com
2021-12-15 14:16:28 +00:00
Hector Martin
8adf987ce0 arm64: dts: apple: t8103: Sort nodes by address
We decided to keep SoC nodes sorted by address for sanity; fix a couple
that slipped into the wrong place.

Reviewed-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-15 20:20:28 +09:00
Hector Martin
57337b2524 arm64: dts: apple: t8103: Rename clk24 to clkref
We now know that this frequency comes from the external reference
oscillator and is used for various SoC blocks, and isn't just a random
24MHz clock, so let's call it something more appropriate.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-15 20:20:17 +09:00
Mark Rutland
c2c529b27c arm64: remove __dma_*_area() aliases
The __dma_inv_area() and __dma_clean_area() aliases make cache.S harder
to navigate, but don't gain us anything in practice.

For clarity, let's remove them along with their redundant comments. The
only users are __dma_map_area() and __dma_unmap_area(), which need to be
position independent, and can call __pi_dcache_inval_poc() and
__pi_dcache_clean_poc() directly.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Fuad Tabba <tabba@google.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20211206124715.4101571-4-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-15 11:19:41 +00:00
Krzysztof Kozlowski
0257bc5cce Merge branch 'for-v5.17/dt-usi' into next/dt64 2021-12-15 08:34:58 +01:00
Katherine Perez
c16160cfa5 arm64: dts: qcom: add minimal DTS for Microsoft Surface Duo 2
This is a minimal devicetree for Microsoft Surface Duo 2 with SM8350
Chipset

Signed-off-by: Katherine Perez <kaperez@linux.microsoft.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211209183246.842880-2-kaperez@linux.microsoft.com
2021-12-14 21:31:22 -06:00
Caleb Connolly
8e6de09c71 arm64: dts: qcom: sdm845-oneplus-*: add msm-id and board-id
The msm-id and board-id can be used to select the correct dtb when
multiple are provided to the bootloader.

Multiple DTBs can be provided on sdm845 devices using boot image header
v1 by appending them all to the kernel image before creating the boot
image. The bootloader then selects them like this:

Best match DTB tags 321/00000008/0x00000000/20001/20014/20115/20018/0/(offset)0x79998E27/(size)0x000173CD
Using pmic info 0x20014/0x20115/0x20018/0x0 for device 0x20014/0x20115/0x20018/0x0

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211209225938.2427342-1-caleb.connolly@linaro.org
2021-12-14 21:31:16 -06:00
Kefeng Wang
dd03762ab6 arm64: Enable KCSAN
This patch enables KCSAN for arm64, with updates to build rules
to not use KCSAN for several incompatible compilation units.

Recent GCC version(at least GCC10) made outline-atomics as the
default option(unlike Clang), which will cause linker errors
for kernel/kcsan/core.o. Disables the out-of-line atomics by
no-outline-atomics to fix the linker errors.

Meanwhile, as Mark said[1], some latent issues are needed to be
fixed which isn't just a KCSAN problem, we make the KCSAN depends
on EXPERT for now.

Tested selftest and kcsan_test(built with GCC11 and Clang 13),
and all passed.

[1] https://lkml.kernel.org/r/YadiUPpJ0gADbiHQ@FVFF77S0Q05N

Acked-by: Marco Elver <elver@google.com> # kernel/kcsan
Tested-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/20211211131734.126874-1-wangkefeng.wang@huawei.com
[catalin.marinas@arm.com: added comment to justify EXPERT]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:54:34 +00:00
Mark Brown
12b792e5e2 arm64/fp: Add comments documenting the usage of state restore functions
Add comments to help people figure out when fpsimd_bind_state_to_cpu() and
fpsimd_update_current_state() are used.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211207163250.1373542-1-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:36:19 +00:00
Mark Brown
30c43e73b3 arm64/sve: Generalise vector length configuration prctl() for SME
In preparation for adding SME support update the bulk of the implementation
for the vector length configuration prctl() calls to be independent of
vector type.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211210184133.320748-3-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:33:44 +00:00
Mark Brown
97bcbee404 arm64/sve: Make sysctl interface for SVE reusable by SME
The vector length configuration for SME is very similar to that for SVE
so in order to allow reuse refactor the SVE configuration so that it takes
the vector type from the struct ctl_table. Since there's no dedicated space
for this we repurpose the extra1 field to store the vector type, this is
otherwise unused for integer sysctls.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211210184133.320748-2-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:33:44 +00:00
Will Deacon
1609c22a8a Merge branch 'for-next/perf-cpu' into for-next/perf
* for-next/perf-cpu:
  arm64: perf: Support new DT compatibles
  arm64: perf: Simplify registration boilerplate
  arm64: perf: Support Denver and Carmel PMUs
2021-12-14 18:13:25 +00:00
Mark Brown
742a15b1a2 arm64: Use BTI C directly and unconditionally
Now we have a macro for BTI C that looks like a regular instruction change
all the users of the current BTI_C macro to just emit a BTI C directly and
remove the macro.

This does mean that we now unconditionally BTI annotate all assembly
functions, meaning that they are worse in this respect than code generated
by the compiler. The overhead should be minimal for implementations with a
reasonable HINT implementation.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20211214152714.2380849-4-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:12:58 +00:00
Mark Brown
481ee45ce9 arm64: Unconditionally override SYM_FUNC macros
Currently we only override the SYM_FUNC macros when we need to insert
BTI C into them, do this unconditionally to make it more likely that we'll
notice bugs in our override.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20211214152714.2380849-3-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:12:58 +00:00
Mark Brown
9be34be87c arm64: Add macro version of the BTI instruction
BTI is only available from v8.5 so we need to encode it using HINT in
generic code and for older toolchains. Add an assembler macro based on
one written by Mark Rutland which lets us use the mnemonic and update
the existing users.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20211214152714.2380849-2-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 18:12:58 +00:00
Catalin Marinas
580b536b50 Merge 'arm64/for-next/fixes' into for-next/bti
Needed for the arch/arm64/kernel/entry-ftrace.S fix.

* commit 'arm64/for-next/fixes^^':
  arm64: ftrace: add missing BTIs
  arm64: kexec: use __pa_symbol(empty_zero_page)
  arm64: update PAC description for kernel
2021-12-14 18:11:52 +00:00
Robin Murphy
893c34b60a arm64: perf: Support new DT compatibles
Wire up the new DT compatibles so we can present appropriate
PMU names to userspace for the latest and greatest CPUs.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/62d14ba12d847ec7f1fba7cb0b3b881b437e1cc5.1639490264.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-12-14 18:05:11 +00:00
Robin Murphy
6ac9f30bd4 arm64: perf: Simplify registration boilerplate
With the trend for per-core events moving to userspace JSON, registering
names for PMUv3 implementations is increasingly a pure boilerplate
exercise. Let's wrap things a step further so we can generate the basic
PMUv3 init function with a macro invocation, and reduce further new
addition to just 2 lines each.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/b79477ea3b97f685d00511d4ecd2f686184dca34.1639490264.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-12-14 18:05:11 +00:00
Thierry Reding
d4c4844a9b arm64: perf: Support Denver and Carmel PMUs
Add support for the NVIDIA Denver and Carmel PMUs using the generic
PMUv3 event map for now.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
[ rm: reorder entries alphabetically ]
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/5f0f69d47acca78a9e479501aa4d8b429e23cf11.1639490264.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-12-14 18:05:11 +00:00
Mark Rutland
053f58bab3 arm64: atomics: lse: define RETURN ops in terms of FETCH ops
The FEAT_LSE atomic instructions include LD* instructions which return
the original value of a memory location can be used to directly
implement FETCH opertations. Each RETURN op is implemented as a copy of
the corresponding FETCH op with a trailing instruction to generate the
new value of the memory location. We only directly implement
*_fetch_add*(), for which we have a trailing `add` instruction.

As the compiler has no visibility of the `add`, this leads to less than
optimal code generation when consuming the result.

For example, the compiler cannot constant-fold the addition into later
operations, and currently GCC 11.1.0 will compile:

       return __lse_atomic_sub_return(1, v) == 0;

As:

	mov     w1, #0xffffffff
	ldaddal w1, w2, [x0]
	add     w1, w1, w2
	cmp     w1, #0x0
	cset    w0, eq  // eq = none
	ret

This patch improves this by replacing the `add` with C addition after
the inline assembly block, e.g.

	ret += i;

This allows the compiler to manipulate `i`. This permits the compiler to
merge the `add` and `cmp` for the above, e.g.

	mov     w1, #0xffffffff
	ldaddal w1, w1, [x0]
	cmp     w1, #0x1
	cset    w0, eq  // eq = none
	ret

With this change the assembly for each RETURN op is identical to the
corresponding FETCH op (including barriers and clobbers) so I've removed
the inline assembly and rewritten each RETURN op in terms of the
corresponding FETCH op, e.g.

| static inline void __lse_atomic_add_return(int i, atomic_t *v)
| {
|       return __lse_atomic_fetch_add(i, v) + i
| }

The new construction does not adversely affect the common case, and
before and after this patch GCC 11.1.0 can compile:

	__lse_atomic_add_return(i, v)

As:

	ldaddal w0, w2, [x1]
	add     w0, w0, w2

... while having the freedom to do better elsewhere.

This is intended as an optimization and cleanup.
There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211210151410.2782645-6-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 13:00:33 +00:00
Mark Rutland
8a578a759a arm64: atomics: lse: improve constraints for simple ops
We have overly conservative assembly constraints for the basic FEAT_LSE
atomic instructions, and using more accurate and permissive constraints
will allow for better code generation.

The FEAT_LSE basic atomic instructions have come in two forms:

	LD{op}{order}{size} <Rs>, <Rt>, [<Rn>]
	ST{op}{order}{size} <Rs>, [<Rn>]

The ST* forms are aliases of the LD* forms where:

	ST{op}{order}{size} <Rs>, [<Rn>]
Is:
	LD{op}{order}{size} <Rs>, XZR, [<Rn>]

For either form, both <Rs> and <Rn> are read but not written back to,
and <Rt> is written with the original value of the memory location.
Where (<Rt> == <Rs>) or (<Rt> == <Rn>), <Rt> is written *after* the
other register value(s) are consumed. There are no UNPREDICTABLE or
CONSTRAINED UNPREDICTABLE behaviours when any pair of <Rs>, <Rt>, or
<Rn> are the same register.

Our current inline assembly always uses <Rs> == <Rt>, treating this
register as both an input and an output (using a '+r' constraint). This
forces the compiler to do some unnecessary register shuffling and/or
redundant value generation.

For example, the compiler cannot reuse the <Rs> value, and currently GCC
11.1.0 will compile:

	__lse_atomic_add(1, a);
	__lse_atomic_add(1, b);
	__lse_atomic_add(1, c);

As:

	mov     w3, #0x1
	mov     w4, w3
	stadd   w4, [x0]
	mov     w0, w3
	stadd   w0, [x1]
	stadd   w3, [x2]

We can improve this with more accurate constraints, separating <Rs> and
<Rt>, where <Rs> is an input-only register ('r'), and <Rt> is an
output-only value ('=r'). As <Rt> is written back after <Rs> is
consumed, it does not need to be earlyclobber ('=&r'), leaving the
compiler free to use the same register for both <Rs> and <Rt> where this
is desirable.

At the same time, the redundant 'r' constraint for `v` is removed, as
the `+Q` constraint is sufficient.

With this change, the above example becomes:

	mov     w3, #0x1
	stadd   w3, [x0]
	stadd   w3, [x1]
	stadd   w3, [x2]

I've made this change for the non-value-returning and FETCH ops. The
RETURN ops have a multi-instruction sequence for which we cannot use the
same constraints, and a subsequent patch will rewrite hte RETURN ops in
terms of the FETCH ops, relying on the ability for the compiler to reuse
the <Rs> value.

This is intended as an optimization.
There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211210151410.2782645-5-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 13:00:23 +00:00
Mark Rutland
5e9e43c987 arm64: atomics: lse: define ANDs in terms of ANDNOTs
The FEAT_LSE atomic instructions include atomic bit-clear instructions
(`ldclr*` and `stclr*`) which can be used to directly implement ANDNOT
operations. Each AND op is implemented as a copy of the corresponding
ANDNOT op with a leading `mvn` instruction to apply a bitwise NOT to the
`i` argument.

As the compiler has no visibility of the `mvn`, this leads to less than
optimal code generation when generating `i` into a register. For
example, __lse_atomic_fetch_and(0xf, v) can be compiled to:

	mov     w1, #0xf
	mvn     w1, w1
	ldclral w1, w1, [x2]

This patch improves this by replacing the `mvn` with NOT in C before the
inline assembly block, e.g.

	i = ~i;

This allows the compiler to generate `i` into a register more optimally,
e.g.

	mov     w1, #0xfffffff0
	ldclral w1, w1, [x2]

With this change the assembly for each AND op is identical to the
corresponding ANDNOT op (including barriers and clobbers), so I've
removed the inline assembly and rewritten each AND op in terms of the
corresponding ANDNOT op, e.g.

| static inline void __lse_atomic_and(int i, atomic_t *v)
| {
| 	return __lse_atomic_andnot(~i, v);
| }

This is intended as an optimization and cleanup.
There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211210151410.2782645-4-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 13:00:23 +00:00
Mark Rutland
ef53245060 arm64: atomics lse: define SUBs in terms of ADDs
The FEAT_LSE atomic instructions include atomic ADD instructions
(`stadd*` and `ldadd*`), but do not include atomic SUB instructions, so
we must build all of the SUB operations using the ADD instructions. We
open-code these today, with each SUB op implemented as a copy of the
corresponding ADD op with a leading `neg` instruction in the inline
assembly to negate the `i` argument.

As the compiler has no visibility of the `neg`, this leads to less than
optimal code generation when generating `i` into a register. For
example, __les_atomic_fetch_sub(1, v) can be compiled to:

	mov     w1, #0x1
	neg     w1, w1
	ldaddal w1, w1, [x2]

This patch improves this by replacing the `neg` with negation in C
before the inline assembly block, e.g.

	i = -i;

This allows the compiler to generate `i` into a register more optimally,
e.g.

	mov     w1, #0xffffffff
	ldaddal w1, w1, [x2]

With this change the assembly for each SUB op is identical to the
corresponding ADD op (including barriers and clobbers), so I've removed
the inline assembly and rewritten each SUB op in terms of the
corresponding ADD op, e.g.

| static inline void __lse_atomic_sub(int i, atomic_t *v)
| {
| 	__lse_atomic_add(-i, v);
| }

For clarity I've moved the definition of each SUB op immediately after
the corresponding ADD op, and used a single macro to create the RETURN
forms of both ops.

This is intended as an optimization and cleanup.
There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211210151410.2782645-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 13:00:23 +00:00
Mark Rutland
8e6082e94a arm64: atomics: format whitespace consistently
The code for the atomic ops is formatted inconsistently, and while this
is not a functional problem it is rather distracting when working on
them.

Some have ops have consistent indentation, e.g.

| #define ATOMIC_OP_ADD_RETURN(name, mb, cl...)                           \
| static inline int __lse_atomic_add_return##name(int i, atomic_t *v)     \
| {                                                                       \
|         u32 tmp;                                                        \
|                                                                         \
|         asm volatile(                                                   \
|         __LSE_PREAMBLE                                                  \
|         "       ldadd" #mb "    %w[i], %w[tmp], %[v]\n"                 \
|         "       add     %w[i], %w[i], %w[tmp]"                          \
|         : [i] "+r" (i), [v] "+Q" (v->counter), [tmp] "=&r" (tmp)        \
|         : "r" (v)                                                       \
|         : cl);                                                          \
|                                                                         \
|         return i;                                                       \
| }

While others have negative indentation for some lines, and/or have
misaligned trailing backslashes, e.g.

| static inline void __lse_atomic_##op(int i, atomic_t *v)                        \
| {                                                                       \
|         asm volatile(                                                   \
|         __LSE_PREAMBLE                                                  \
| "       " #asm_op "     %w[i], %[v]\n"                                  \
|         : [i] "+r" (i), [v] "+Q" (v->counter)                           \
|         : "r" (v));                                                     \
| }

This patch makes the indentation consistent and also aligns the trailing
backslashes. This makes the code easier to read for those (like myself)
who are easily distracted by these inconsistencies.

This is intended as a cleanup.
There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211210151410.2782645-2-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 13:00:23 +00:00
Ard Biesheuvel
2c54b423cf arm64/xor: use EOR3 instructions when available
Use the EOR3 instruction to implement xor_blocks() if the instruction is
available, which is the case if the CPU implements the SHA-3 extension.
This is about 20% faster on Apple M1 when using the 5-way version.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20211213140252.2856053-1-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-14 12:14:26 +00:00
Rob Herring
83a7a4d643 arm64: perf: Enable PMU counter userspace access for perf event
Arm PMUs can support direct userspace access of counters which allows for
low overhead (i.e. no syscall) self-monitoring of tasks. The same feature
exists on x86 called 'rdpmc'. Unlike x86, userspace access will only be
enabled for thread bound events. This could be extended if needed, but
simplifies the implementation and reduces the chances for any
information leaks (which the x86 implementation suffers from).

PMU EL0 access will be enabled when an event with userspace access is
part of the thread's context. This includes when the event is not
scheduled on the PMU. There's some additional overhead clearing
dirty counters when access is enabled in order to prevent leaking
disabled counter data from other tasks.

Unlike x86, enabling of userspace access must be requested with a new
attr bit: config1:1. If the user requests userspace access with 64-bit
counters, then the event open will fail if the h/w doesn't support
64-bit counters. Chaining is not supported with userspace access. The
modes for config1 are as follows:

config1 = 0 : user access disabled and always 32-bit
config1 = 1 : user access disabled and always 64-bit (using chaining if needed)
config1 = 2 : user access enabled and always 32-bit
config1 = 3 : user access enabled and always 64-bit

Based on work by Raphael Gault <raphael.gault@arm.com>, but has been
completely re-written.

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-perf-users@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211208201124.310740-5-robh@kernel.org
[will: Made armv8pmu_proc_user_access_handler() static]
Signed-off-by: Will Deacon <will@kernel.org>
2021-12-14 11:40:59 +00:00
Rob Herring
e201260081 arm64: perf: Add userspace counter access disable switch
Like x86, some users may want to disable userspace PMU counter
altogether. Add a sysctl 'perf_user_access' file to control userspace
counter access. The default is '0' which is disabled. Writing '1'
enables access.

Note that x86 supports globally enabling user access by writing '2' to
/sys/bus/event_source/devices/cpu/rdpmc. As there's not existing
userspace support to worry about, this shouldn't be necessary for Arm.
It could be added later if the need arises.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-perf-users@vger.kernel.org
Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211208201124.310740-4-robh@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-12-14 11:30:54 +00:00
Biju Das
88404c56fd arm64: dts: renesas: r9a07g044: Create thermal zone to support IPA
Setup a thermal zone driven by SoC temperature sensor.
Create passive trip points and bind them to CPUFreq cooling
device that supports power extension.

Based on the work done by Dien Pham <dien.pham.ry@renesas.com>
and others for r8a77990 SoC.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211208142729.2456-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-14 12:29:17 +01:00
Biju Das
844dd43784 arm64: dts: renesas: r9a07g044: Add TSU node
Add TSU node to RZ/G2L SoC DTSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211208142729.2456-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-14 12:29:17 +01:00
Kieran Bingham
5a6bca1ff7 arm64: dts: renesas: falcon-cpu: Add DSI display output
Provide the display output using the sn65dsi86 MIPI DSI bridge.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20211130164311.2909616-3-kieran.bingham+renesas@ideasonboard.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-14 12:29:09 +01:00
Kieran Bingham
b2db714bc9 arm64: dts: renesas: r8a779a0: Add DSI encoders
Provide the two MIPI DSI encoders on the V3U and connect them to the DU
accordingly.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20211130164311.2909616-2-kieran.bingham+renesas@ideasonboard.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-12-14 12:19:43 +01:00
Ariel D'Alessandro
bd4372f056 arm64: dts: imx8mn-bsh-smm-s2/pro: Add iMX8MN BSH SMM S2 boards
Introduce BSH SystemMaster (SMM) S2 board family, which consists of:
iMX8MN SMM S2 and iMX8MN SMM S2 PRO boards.

Add support for iMX8MN BSH SMM S2 board:

- 256 MiB DDR3 RAM
- 512 MiB NAND
- Megabit Ethernet PHY
- Wi-Fi 802.11 a/b/g/n/ac with Bluetooth 5.0
- USB-OTG (peripheral mode)

Add support for iMX8MN BSH SMM S2 PRO board:

- 512 MiB DDR3 RAM
- 8 GiB eMMC
- Megabit Ethernet PHY
- Wi-Fi 802.11 a/b/g/n/ac with Bluetooth 5.0
- USB-OTG (peripheral mode)

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:42:24 +08:00
Fabio Estevam
aafac22d6b arm64: dts: imx8mm/n: Remove the 'pm-ignore-notify' property
The 'pm-ignore-notify' property is not a valid property and there is
no documentation for it.

Drop such invalid property.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:14 +08:00
Peng Fan
03eb813dac arm64: dts: imx8ulp: add power domain entry for usdhc
Add power domain for USDHC node.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Peng Fan
a38771d7a4 arm64: dts: imx8ulp: add scmi firmware node
i.MX8ULP use scmi firmware based power domain and sensor support.
So add the firmware node and the sram it uses.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Adam Ford
1a42daaa3c arm64: dts: imx8mq-evk: link regulator to VPU domain
The SW1C regulator powers the VPU and the state isn't guaranteed
to always be on.  Link the VPU power-domain to the regulator to
ensure it is turned on before using the power domain.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Li Yang
a3d5b4e2af arm64: dts: ls1088a: add snps incr burst type adjustment for usb1
This property could fix the defect that external usb device
always prints this error log --- 'reset SuperSpeed USB device number n
using xhci_hcd' when system power on.

Signed-off-by: Pengbo Mu <pengbo.mu@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Li Yang
22e9e261bf arm64: dts: ls1088a: Add reboot nodes
ls1088a has a separate reset register block.  Define it in dts and use
it for reboot.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Vladimir Oltean
bd8a9cd624 arm64: dts: ls1028a-rdb: update copyright
Company policy requires that copyright is updated when a file is
touched. Keeping the copyright change separate to reduce the noise in
other patches.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Vladimir Oltean
96ad273759 arm64: dts: ls1028a-rdb: add aliases for the Ethernet ports
These are used by U-Boot, and are required for keeping the device trees
in sync.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Vladimir Oltean
d18c7980d4 arm64: dts: ls1028a-rdb: add an alias for the FlexSPI controller
This is used by U-Boot and is required for keeping the device trees in
sync.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Vladimir Oltean
6c5d66cb28 arm64: dts: ls1028a-rdb: sort nodes alphabetically by label
In preparation for this board's device tree synchronization with U-Boot,
we must find a common node ordering pattern. Alphabetical sounds about
right.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:33:02 +08:00
Peng Fan
97416aab15 arm64: defconfig: enable drivers for booting i.MX8ULP
Select i.MX8ULP CLK and PINCTRL driver to make it boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-14 16:17:36 +08:00
Arnd Bergmann
1c8e994f16 Amlogic ARM64 DT changes for v5.17:
- Add missing cec nodes for Odroid-C4 & HC4
 - Fix thermal-zones indent for G12/SM1 SoCs dtsi
 - Fix GPU OPP table node name for G12/SM1 SoCs dtsi
 - Fix SPI NOR Flash node name for Odroid-N2/N2+
 - Fixes for GXBB Wetek boards:
  - Fix HDMI supply
  - Add missing gpio bindings include
  - Switch to new LED bindings
 - P241 additions:
  - Add VCC 5v regulator
  - Add sound nodes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmG3Sg0ACgkQd9zb2sjI
 SdHF2A//ZZFoJYUDWmHutRV57oCWbSNyX43z+6HiJe01jHn5x3wUR5DZNIPm3PAr
 yttWQtzAGBronEtCbWykMsxpbNWtHuLnfIb0sYMI7bg2DtJUYh08i+AF+Kqxjw6P
 UTwiebetLP5pFhFlHFHOBCC5MNVL4oS/dbrB1wCX3D3hYAY5XSHK4mnjdeYV+3/u
 oJCD87h/a0EUA7jU8bjiuAiPADlh+cQ8EPTptGU3JsVCT85el2VTBACNHu14so35
 lM9ikc68SA30/BVc87jytVCdydIx7WHYXVnagporvu3IOpUwd6qBhbP851J69I7V
 ZZDdMRm9XWh7QySzhuW+E1r5J5T1/YWuPgGSYU5kRsKbcNfyQaWFWAKp4+0b97Iu
 BzXfgp3HHBg83ntBiBgWQUEilGypq0QKDfdZJd7PhRgtSCjsD2+ZM7Jokg1d3Q7R
 YX0woVv818k3vEOfuq2O6gPR3mx8Of1vtBR0gqKscAIu0GdEGcm+mRqtemH177DZ
 UuIJp1FFGxajftscZZO3qfPZIWjO76fBJHywqax64J5aZx1f6kbMNGDwwYU218nv
 RtUzGcKOCZZfcExjtQb/FYc6WsMSenr1clz2EXx6S5CN8oNJ9vrAt+x5rMrm4fGr
 /NZtFCi8UytziDFyRVv/OR6JNLMDSFmwDpiFNYRNMsZUKrvKRFc=
 =j3KZ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG30/EACgkQmmx57+YA
 GNlGARAAwYcCt9IbAZE/qj7TbgZBLuCAukM67WIohTbcFqY886HctKNBnEm/D+1h
 xBuR0ct+lj+Wfv+5LaztDxVDmjzr3o+aamKWK9zRJbGrjC5mC4C9k0VCJEdqxn+e
 8gfeN+gtI8l54U4SpC2Ah5FrC0Ww5uHrCA2tAseM5ww0IaE5h2sIw859GLKijO14
 CnzFzFpQDiBCKZDm0j6r0Ztxs+O0X2FwiAaWlV8JsQUUKOWVZNrUzxSiCinbdVPl
 zO/vBDsYcfMI/v+5y96DZB3cw66835lkxRAQ59lpTx5Xj8EJQ33OiEvjZUvRHb+e
 2t6AumEkSQe54XJfbCrnZpvjWb00YItujIYfOdeRDNf7v3vqU+FJzgzY6RVIyVuZ
 w65HF3+/+OyrVosF9gVSSAF+rmWL1vGOQ7sIrVQSB2+8KuGDxWCzjcBlWxlyrpRB
 PmxNPTkHtz2FK4G0ZIVLFslMeIczYbyw649LoiUWQX4tiAoYp+HMMaUM99Jcy0ao
 t6TiYv1dNNS/DYOXsx94oqUx1o6P/FJHw3wpyPJ1j/pTuAt8iGhBl5ixB52LBQ6h
 mHp3sZ6ppOJI7YmIZjgPpM1DrQ9Q5IgkyY3sEaWuiFCJE5/SOocYIMb7/5wOF45w
 Tjmv+w0Qt401Eym8v0cmtRsHYRlN0gW3GzADPTLHipG84dT3BZQ=
 =jMrR
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-arm64-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt

Amlogic ARM64 DT changes for v5.17:
- Add missing cec nodes for Odroid-C4 & HC4
- Fix thermal-zones indent for G12/SM1 SoCs dtsi
- Fix GPU OPP table node name for G12/SM1 SoCs dtsi
- Fix SPI NOR Flash node name for Odroid-N2/N2+
- Fixes for GXBB Wetek boards:
 - Fix HDMI supply
 - Add missing gpio bindings include
 - Switch to new LED bindings
- P241 additions:
 - Add VCC 5v regulator
 - Add sound nodes

* tag 'amlogic-arm64-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  arm64: dts: meson: p241: add sound support
  arm64: dts: meson: p241: add vcc_5v regulator
  arm64: dts: meson-gxbb-wetek: use updated LED bindings
  arm64: dts: meson-gxbb-wetek: fix missing GPIO binding
  arm64: dts: meson-gxbb-wetek: fix HDMI in early boot
  arm64: dts: amlogic: Fix SPI NOR flash node name for ODROID N2/N2+
  arm64: dts: amlogic: meson-g12: Fix GPU operating point table node name
  arm64: dts: amlogic: meson-g12: Fix thermal-zones indent
  arm64: dts: meson-sm1-odroid: add cec nodes

Link: https://lore.kernel.org/r/f47b9b95-6cde-d2f8-eb36-78777d449920@baylibre.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-14 00:14:57 +01:00
Luca Weiss
bc279dc04e arm64: dts: qcom: sm7225-fairphone-fp4: Enable ADSP, CDSP & MPSS
Enable the remoteprocs found on the SoC and add a qcom,rmtfs-mem node.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213082208.21492-9-luca.weiss@fairphone.com
2021-12-13 17:05:40 -06:00
Arnd Bergmann
f3141df041 Improvements on a number of boards:
- helios64: hdd-power, pcie, 2.5GbE nic
 - spi for rk356x and on the Quartz-A board
 - headphone, bluetooth support on Rock Pi4
 And some misc soc improvements:
 - missing dsi compatible on px30
 - pwm pinctrl name on rk356x
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmG3IO8QHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgQBQB/0cZ22l3mIAxiFdk0ZJ9jojuZiCXz4A2AUc
 WYY8J2m5F+3jGJ50FuXLHw+WZKUqMHs5g0ISmmmqUjnU1nQPcJbpzcj4QkfRmlRJ
 GNaMX4K5fxxsW2HQ/e0M5CWSQ5IYbEsEWAnlrW+LYzL+f5Mlwf13SI+kSZdLoZdP
 4ZIPfVWovzIdiNlPuqht5tMB7pHvOC5UPIDMbNs8DamOF0VIppRgDODsgpZQ1wkq
 D/x5g5dQBh8PGDl758hNSy5uU2fHS2Ghn8ooeGjakax8XhHTfUYEieCp5JI4fr7Y
 X336aXG34TGpKivVtowcj+LtGZ+w2A56ZjBsWwxYkh/2GfzPJiRK
 =37E1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG30ZEACgkQmmx57+YA
 GNn6tQ/8CEp8o2w2IvexSnLNt0aPjjuyHDV2psC0mMU9nMFWD4+RMlzX5N02KiG9
 RePQZSJtVxBQQu47adrG3BSTQo7Pxy53vmitDbbiy0SQvZrf1QsR3FAE0BTZdxPs
 WmC52/JqbhlBbKfe+h2tmPRMM99kcUNgiZoS4YFo2lvU0PRCU2Hx9yNrvjgHa4ZJ
 NVlVueAFCyEemyTCUTkVDe3ZJc0kklZSJvHvTmn8z5zc7dfA9tEtgt4zk7VnF3V7
 4+QNnm+NF6jl6NZVRkJl5CXt8hNYqJQjfjVp7jqUZzlG0Sqzy2fKrpnr11yrwcH4
 et52GH+Ej91awT9Csw3Jhx40YyT+/IYuI9HB+UUqa17njKv0krsGA4IfZaqSkuoG
 aRkBeKB5B4wLZ1EyLjn6kXV+FzMp8EDKWbz9jQ4yoZwiaaT655SjvE7j02gLFURh
 6B8QLcFO0gCDNu2yZBAxYWllLyFcyb6MfDOUDFkta5So1mxe27f048B76osM+d/d
 wge2Z6TYFZO7gfXF3E5T/Af2fp+jE10KrhAzNgn9IN5kfUvdc0TOvoxWz3P9gg6n
 Z0XpPhz0LEAY0xDHGg5rTx0sLZpA7m/7kfA2ZbXJWhcHbjsyeVkwQc1HgBaWuoTx
 UsRHBg+rmRJO6um4qH2SKaQYZEuZzPC1aNVsPDJC4uKJUHMYST0=
 =Qxh/
 -----END PGP SIGNATURE-----

Merge tag 'v5.17-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt

Improvements on a number of boards:
- helios64: hdd-power, pcie, 2.5GbE nic
- spi for rk356x and on the Quartz-A board
- headphone, bluetooth support on Rock Pi4
And some misc soc improvements:
- missing dsi compatible on px30
- pwm pinctrl name on rk356x

* tag 'v5.17-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards
  arm64: dts: rockchip: Add missing secondary compatible for PX30 DSI
  arm64: dts: rockchip: Add spi1 pins on Quartz64 A
  arm64: dts: rockchip: Add spi nodes on rk356x
  arm64: dts: rockchip: Change pwm pinctrl-name to "default" on rk356x
  arm64: dts: rockchip: Enable HDD power on helios64
  arm64: dts: rockchip: add variables for pcie completion to helios64
  arm64: dts: rockchip: define usb hub and 2.5GbE nic on helios64
  arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec

Link: https://lore.kernel.org/r/3637342.7akbv5NDAT@phil
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-14 00:04:49 +01:00
Luca Weiss
8eb5287e8a arm64: dts: qcom: sm6350: Add CDSP nodes
Add the required nodes for booting the CDSP on sm6350.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213082208.21492-8-luca.weiss@fairphone.com
2021-12-13 17:04:47 -06:00
Luca Weiss
efc33c969f arm64: dts: qcom: sm6350: Add ADSP nodes
Add the required nodes for booting the ADSP on sm6350.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213082208.21492-6-luca.weiss@fairphone.com
2021-12-13 17:04:47 -06:00
Luca Weiss
489be59b63 arm64: dts: qcom: sm6350: Add MPSS nodes
Add the required nodes for booting the MPSS on sm6350.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213082208.21492-4-luca.weiss@fairphone.com
2021-12-13 17:04:47 -06:00
Luca Weiss
f56498fc6a arm64: dts: qcom: sm6350: Fix validation errors
Sort clocks and interrupts as specified in the docs and remove the stray
property #power-domain-cells from aoss_qmp to solve dtbs_check
validation errors.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211213082614.22651-11-luca.weiss@fairphone.com
2021-12-13 16:56:10 -06:00
Arnd Bergmann
7f0ef89c0f Apple SoC DT updates for 5.17:
- Separate DTs for all t8103 platforms
 - Add i2c and cd321x nodes
 - Bindings for apple,wdt
 - PMGR bindings and DT updates to instantiate it
 - WiFi MAC address DT handling
 
 This also includes the MAINTAINERS change for the PMGR driver itself, to
 avoid merge issues; the driver will be sent in a different pull.
 
 Manual fixups: Added i2c power domain references to the PMGR DT commit,
 since a prior commit added the i2c nodes.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSU7I7lUkZru3Mt15+lhN6SrnTN2AUCYa7mWAAKCRClhN6SrnTN
 2OcWAP0SeheFWsBVf4H2ePIrHQ87NzCYi9Nb35SSSgBFVRsGXgEAu+H8kTbUMVVh
 kPJyeAwtuksqf2W5t45ziIWz+W4k5wI=
 =Wxou
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3zdoACgkQmmx57+YA
 GNlqiw/8Ccuvpn9tI36IXgLjYi3T6Mw8FBMS2N8ng5vH8qP5xQrp0r++enmIL7JO
 5iG18NhPVPRiUZdyydcu8dYOC4/1sN/PJF+TNepJnz5x+P3xHsJHRHbDWKUq8Lsq
 uuMuKI1lAbI1ChkLhlQreGEoUqGf/1nMOc5YRLe5gNJwZmpWgjbuoqWZpOz37/zH
 ZZj7dg2HEN4SqkD2fSbcNAiCjXg0xKwd+3XRQZ/7geHeS6uBgpHltDUswtrEqSmh
 9TSnO/Tpvka9TGn95QG5fCtnaVAgg8f2B1i66DtlvOchD9Egf/500X0YklUV4BS7
 BADYpWX2cwm1y5uUZPiFrw8Z3zJeyqF0DQR6Zofr83+PMxQI5n5pwPCQnlXbgLL7
 NrzNLT79QRkInLgkZ3SnPZ8wUYv6Xdhde01O+aUlpZCBs983U1Abu44g3Z7dwnXN
 y7euv3pORuurgInCB51Ys/mDPnGzUT7joYvr2qGG7kuwWmgGNoi3EMASTcILMPL7
 c02D9EsjSi3Kau5AAQaj2CxDbPaSmKHakOcm2Xcmhn0CrtbE2Yck8bSiNwIVUV9H
 2p5LEZDMFSlO4hN8SdZKrntygcBf1lbsECpi47k5mWXUDYjYuo7qJYIXx5xfkcvc
 +tMPbVRfEPoX0s3LQASRS2GVBSNqu6o+ChbA97m4KPy+Ccv00K0=
 =QggY
 -----END PGP SIGNATURE-----

Merge tag 'asahi-soc-dt-5.17' of https://github.com/AsahiLinux/linux into arm/dt

Apple SoC DT updates for 5.17:

- Separate DTs for all t8103 platforms
- Add i2c and cd321x nodes
- Bindings for apple,wdt
- PMGR bindings and DT updates to instantiate it
- WiFi MAC address DT handling

This also includes the MAINTAINERS change for the PMGR driver itself, to
avoid merge issues; the driver will be sent in a different pull.

Manual fixups: Added i2c power domain references to the PMGR DT commit,
since a prior commit added the i2c nodes.

* tag 'asahi-soc-dt-5.17' of https://github.com/AsahiLinux/linux:
  arm64: dts: apple: t8103: Expose PCI node for the WiFi MAC address
  arm64: dts: apple: t8103: Add UART2
  arm64: dts: apple: t8103: Add PMGR nodes
  dt-bindings: arm: apple: Add apple,pmgr binding
  dt-bindings: power: Add apple,pmgr-pwrstate binding
  MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
  dt-bindings: watchdog: Add Apple Watchdog
  dt-bindings: interrupt-controller: apple,aic: Add power-domains property
  dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
  dt-bindings: iommu: apple,dart: Add power-domains property
  dt-bindings: i2c: apple,i2c: Add power-domains property
  arm64: dts: apple: t8103: Add cd321x nodes
  arm64: dts: apple: t8103: Add i2c nodes
  arm64: dts: apple: Add missing M1 (t8103) devices
  dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings
  arm64: dts: apple: add #interrupt-cells property to pinctrl nodes
  dt-bindings: i2c: apple,i2c: allow multiple compatibles
  arm64: dts: apple: change ethernet0 device type to ethernet

Link: https://lore.kernel.org/r/e18b476c-7b1f-de73-53a2-0e21fb5cd283@marcan.st
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 23:48:58 +01:00
Arnd Bergmann
ee58c0a4d7 Renesas ARM DT updates for v5.17
- Serial, SPI, timer, watchdog, operating points, and QSPI FLASH
     support for the RZ/G2L SoC and the RZ/G2L SMARC EVK development
     board,
   - SDHI SDnH clocks for the R-Car Gen3 and RZ/G2 SoCs,
   - Display Unit support for the R-Car V3U SoC,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCYanw/AAKCRCKwlD9ZEnx
 cG7ZAQCFO3hNw7+CddeFyWUPYC0x9b5HdltoUAMR5PHlcloGLwD/QhQ0jLvBL6dO
 v0eDzojuXuoL+hOaFy/Gx/fqOCGHfQo=
 =wEq9
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3pU0ACgkQmmx57+YA
 GNmwhA//SWMFcs+GqXDfaxC6L8OnBeI43nHupf1vY/F0HpTethHixCN9cgC4isc/
 EWp2RnWLZc1b0UaCXv8T2yNRo6Ey7obcxR+6ReyFyH/Oovd6f61b9hl8kEvESko9
 n9Jfr4Mz0nMesSTycracK+TOTG/FKIjRtGB7VGo1+BmLHHyNLpG500ebItbFW4ht
 d79/z3Ts2u37EqpsGEbX6KeR9WG7UPTWzxFv8TdlluqLe27MlZKuZ1PcSXt+Vx0I
 vXs/aWvGqT/enWeMF22OjkdDo5+4YBEvfSY7SEwzLNm8U1NNr6gopbw1k8BFbjBB
 i4Va1KBjRdQHO5WFPZtL9eMjOWLapoSx6f/AAScTSk9/ylFcMjbziRzsOYTFCNae
 HJTgxynJMDVY90G8oFrLKOgMaqz7F3gM35IH6K7UDu8WCANlQV5Pih+kp3TDF8Sz
 84eYzKIVQ+E+EktU7xM7rxmclNSqBeC7/x1jHAMcJEmJ3/7VVeUhnYGcitp5Afzl
 QtOveCESlfCMK29E+3SKrv0/StXOyNy2bs3QdiiTmaizSs7CGlpY9TzcsGliqUCt
 s4+ABhs90b8ssiBMybEixxvIQD2PvgKv7LamE1neV/EMwC4eBtUKJMnnZkgK5cYC
 8a1mPstIasR4dk20pkGCIERvGX//cIPC9JIX7l+qXDi5f9Mn8aE=
 =Vjlr
 -----END PGP SIGNATURE-----

Merge tag 'renesas-arm-dt-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt

Renesas ARM DT updates for v5.17

  - Serial, SPI, timer, watchdog, operating points, and QSPI FLASH
    support for the RZ/G2L SoC and the RZ/G2L SMARC EVK development
    board,
  - SDHI SDnH clocks for the R-Car Gen3 and RZ/G2 SoCs,
  - Display Unit support for the R-Car V3U SoC,
  - Miscellaneous fixes and improvements.

* tag 'renesas-arm-dt-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (21 commits)
  arm64: dts: renesas: r8a779a0: Add DU support
  arm64: dts: renesas: salvator-common: Merge hdmi0_con
  arm64: dts: renesas: ulcb: Merge hdmi0_con
  arm64: dts: renesas: r9a07g044: Add OPP table
  arm64: dts: renesas: Fix operating point table node names
  arm64: dts: renesas: rzg2l-smarc-som: Enable watchdog
  arm64: dts: renesas: r9a07g044: Add WDT nodes
  arm64: dts: renesas: r9a07g044: Rename SDHI clocks
  arm64: dts: renesas: rzg2l-smarc-som: Enable serial NOR flash
  arm64: dts: renesas: rzg2l-smarc-som: Enable OSTM
  arm64: dts: renesas: r9a07g044: Add OSTM nodes
  arm64: dts: renesas: r9a07g044: Sort psci node
  arm64: dts: renesas: rzg2l-smarc: Enable RSPI1 on carrier board
  arm64: dts: renesas: r9a07g044: Add RSPI{0,1,2} nodes
  arm64: dts: renesas: cat875: Add rx/tx delays
  arm64: dts: reneas: rcar-gen3: Add SDnH clocks
  arm64: dts: reneas: rzg2: Add SDnH clocks
  arm64: dts: renesas: r9a07g044: Add SCI[0-1] nodes
  arm64: dts: renesas: rzg2l-smarc: Enable SCIF2 on carrier board
  arm64: dts: renesas: r9a07g044: Add SCIF[1-4] nodes
  ...

Link: https://lore.kernel.org/r/cover.1638530606.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 20:55:57 +01:00
Joey Gouly
1175011a7d arm64: cpufeature: add HWCAP for FEAT_RPRES
Add a new HWCAP to detect the Increased precision of Reciprocal Estimate
and Reciprocal Square Root Estimate feature (FEAT_RPRES), introduced in Armv8.7.

Also expose this to userspace in the ID_AA64ISAR2_EL1 feature register.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211210165432.8106-4-joey.gouly@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-13 18:53:00 +00:00
Joey Gouly
9e45365f14 arm64: add ID_AA64ISAR2_EL1 sys register
This is a new ID register, introduced in 8.7.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Reiji Watanabe <reijiw@google.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211210165432.8106-3-joey.gouly@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-13 18:53:00 +00:00
Joey Gouly
5c13f042e7 arm64: cpufeature: add HWCAP for FEAT_AFP
Add a new HWCAP to detect the Alternate Floating-point Behaviour
feature (FEAT_AFP), introduced in Armv8.7.

Also expose this to userspace in the ID_AA64MMFR1_EL1 feature register.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211210165432.8106-2-joey.gouly@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-13 18:52:59 +00:00
Mark Rutland
07b742a4d9 arm64: mm: log potential KASAN shadow alias
When the kernel is built with KASAN_GENERIC or KASAN_SW_TAGS, shadow
memory is allocated and mapped for all legitimate kernel addresses, and
prior to a regular memory access instrumentation will read from the
corresponding shadow address.

Due to the way memory addresses are converted to shadow addresses, bogus
pointers (e.g. NULL) can generate shadow addresses out of the bounds of
allocated shadow memory. For example, with KASAN_GENERIC and 48-bit VAs,
NULL would have a shadow address of dfff800000000000, which falls
between the TTBR ranges.

To make such cases easier to debug, this patch makes die_kernel_fault()
dump the real memory address range for any potential KASAN shadow access
using kasan_non_canonical_hook(), which results in fault information as
below when KASAN is enabled:

| Unable to handle kernel paging request at virtual address dfff800000000017
| KASAN: null-ptr-deref in range [0x00000000000000b8-0x00000000000000bf]
| Mem abort info:
|   ESR = 0x96000004
|   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
|   CM = 0, WnR = 0
| [dfff800000000017] address between user and kernel address ranges

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Will Deacon <will@kernel.org>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211207183226.834557-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-13 18:47:09 +00:00
Mark Rutland
6f6cfa5867 arm64: mm: use die_kernel_fault() in do_mem_abort()
If we take an unhandled fault from EL1, either:

a) The xFSC handler calls die_kernel_fault() directly. In this case,
   die_kernel_fault() calls:

   pr_alert(..., msg, addr);
   mem_abort_decode(esr);
   show_pte(addr);
   die();
   bust_spinlocks(0);
   do_exit(SIGKILL);

b) The xFSC handler returns to do_mem_abort(), indicating failure. In
   this case, do_mem_abort() calls:

   pr_alert(..., addr);
   mem_abort_decode(esr);
   show_pte(addr);
   arm64_notify_die() {
     die();
   }

This inconstency is unfortunatem, and in theory in case (b) registered
notifiers can prevent us from terminating the faulting thread by
returning NOTIFY_STOP, whereupon we'll end up returning from the fault,
replaying, and almost certainly get stuck in a livelock spewing errors
into dmesg. We don't expect notifers to fix things up, since we dump
state to dmesg before invoking them, so it would be more sensible to
consistently terminate the thread in this case.

This patch has do_mem_abort() call die_kernel_fault() for unhandled
faults taken from EL1. Where we would previously have logged a messafe
of the form:

| Unhandled fault at ${ADDR}

... we will now log a message of the form:

| Unable to handle kernel ${FAULT_NAME} at virtual address ${ADDR}

... and we will consistently terminate the thread from which the fault
was taken.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211207183226.834557-2-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-13 18:47:09 +00:00
Eric W. Biederman
0e25498f8c exit: Add and use make_task_dead.
There are two big uses of do_exit.  The first is it's design use to be
the guts of the exit(2) system call.  The second use is to terminate
a task after something catastrophic has happened like a NULL pointer
in kernel code.

Add a function make_task_dead that is initialy exactly the same as
do_exit to cover the cases where do_exit is called to handle
catastrophic failure.  In time this can probably be reduced to just a
light wrapper around do_task_dead. For now keep it exactly the same so
that there will be no behavioral differences introducing this new
concept.

Replace all of the uses of do_exit that use it for catastraphic
task cleanup with make_task_dead to make it clear what the code
is doing.

As part of this rename rewind_stack_do_exit
rewind_stack_and_make_dead.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2021-12-13 12:04:45 -06:00
Aswath Govindraju
effb32e931 arch: arm64: ti: Add support J721S2 Common Processor Board
The EVM architecture for J721S2 is similar to that of J721E and J7200. It
is as follows,

+------------------------------------------------------+
|   +-------------------------------------------+      |
|   |                                           |      |
|   |        Add-on Card 1 Options              |      |
|   |                                           |      |
|   +-------------------------------------------+      |
|                                                      |
|                                                      |
|                     +-------------------+            |
|                     |                   |            |
|                     |   SOM             |            |
|  +--------------+   |                   |            |
|  |              |   |                   |            |
|  |  Add-on      |   +-------------------+            |
|  |  Card 2      |                                    |    Power Supply
|  |  Options     |                                    |    |
|  |              |                                    |    |
|  +--------------+                                    | <---
+------------------------------------------------------+
                                 Common Processor Board

Common Processor board is the baseboard that contains most of the actual
connectors, power supply etc. The System on Module (SoM) is plugged on to
the common processor baord. Therefore, add support for peripherals brought
out in the common processor board.

Common Processor Board: https://www.ti.com/tool/J721EXCPXEVM

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Link: https://lore.kernel.org/r/20211207080904.14324-6-a-govindraju@ti.com
2021-12-13 23:21:22 +05:30
Aswath Govindraju
d502f852d2 arm64: dts: ti: Add initial support for J721S2 System on Module
A System on Module (SoM) contains the SoC, PMIC, DDR and basic high speed
components necessary for functionality. Therefore, add support for the
components present on the SoM.

SoM: https://www.ti.com/lit/zip/sprr439

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Link: https://lore.kernel.org/r/20211207080904.14324-5-a-govindraju@ti.com
2021-12-13 23:21:22 +05:30
Aswath Govindraju
b8545f9d3a arm64: dts: ti: Add initial support for J721S2 SoC
The J721S2 SoC belongs to the K3 Multicore SoC architecture platform,
providing advanced system integration in automotive ADAS applications and
industrial applications requiring AI at the network edge. This SoC extends
the Jacinto 7 family of SoCs with focus on lowering system costs and power
while providing interfaces, memory architecture and compute performance for
single and multi-sensor applications.

Some highlights of this SoC are:

* Dual Cortex-A72s in a single cluster, three clusters of lockstep capable
dual Cortex-R5F MCUs, Deep-learning Matrix Multiply Accelerator(MMA), C7x
floating point Vector DSP.
* 3D GPU: Automotive grade IMG BXS-4-64
* Vision Processing Accelerator (VPAC) with image signal processor and
Depth and Motion Processing Accelerator (DMPAC)
* Two CSI2.0 4L RX plus one eDP/DP, two DSI Tx, and one DPI interface.
* Two Ethernet ports with RGMII support.
* Single 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role device subsystems,
* Up to 20 MCANs, 5 McASP, eMMC and SD, OSPI/HyperBus memory controller,
QSPI, I3C and I2C, eCAP/eQEP, eHRPWM, MLB among other peripherals.
* Hardware accelerator blocks containing AES/DES/SHA/MD5 called SA2UL
management.
* Chips and Media Wave521CL H.264/H.265 encode/decode engine

See J721S2 Technical Reference Manual (SPRUJ28 – NOVEMBER 2021)
for further details: http://www.ti.com/lit/pdf/spruj28

Introduce basic support for the J721S2 SoC.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Link: https://lore.kernel.org/r/20211207080904.14324-4-a-govindraju@ti.com
2021-12-13 23:21:22 +05:30
Julian Ribbeck
bd943653b1 arm64: dts: qcom: Add device tree for Samsung J5 2015 (samsung-j5)
Samsung J5 2015 is a MSM8916 based Smartphone. It is similar to some of the
other MSM8916 devices, especially the Samsung ones.

With this patch initial support for the following is added:
  - eMMC/SD card
  - Buttons
  - USB (although no suiting MUIC driver currently)
  - UART (untested for lack of equipment)
  - WiFi/Bluetooth (WCNSS)

It is worth noting that Samsung J5 with MSM8916 exists in different
generations (e.g Samsung J5 2015 and Samsung J5 2016) which each have
different models (e.g. samsung-j5nlte, samsung-j5xnlte, etc). This patch
is only regarding the 2015 generation, but should work with all of it's
models, as far as we could test.

Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Julian Ribbeck <julian.ribbeck@gmx.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211116200734.73920-1-julian.ribbeck@gmx.de
2021-12-13 10:24:42 -06:00
Jayesh Choudhary
277ee96f89 arm64: dts: ti: iot2050: Disable mcasp nodes at dtsi level
Disable mcasp nodes 0-2 because several required properties
are not present in the dtsi file as they are board specific.
These nodes can be enabled via an overlay whenever required.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Link: https://lore.kernel.org/r/20211117053806.10095-1-j-choudhary@ti.com
2021-12-13 20:21:53 +05:30
Arnd Bergmann
d823bf891a Fixes for some board-level issues (regulators, mmc, poweroff, audio)
-----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmG3GdMQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgYCnCACAHgF9eQ5Z8pPXvkybpzyYbh2FFC0kP50+
 Sei1eH5jXpym9oQ+8wI0HhU6mN5IhtnEI+F/2+VNdVSdP+mMXZgFsT7Rj2KLzcYI
 6KMGwnbiZj30b2W+rm81eHAF1RQ/J3Ngt3htBkkiJCxf0fNM/7shX0na4GMMJhcL
 GnNFO9KfUbHzXUU8ekuwGKb0Z7csERch5keJ2LDXub8dpCYtRZJactWShgRdoT38
 Ga+qI24Fp//5XQfClVhNs+Rk5f5nXlNxdzveF/y+N24kbSoGM39DoTsAyXA/tzed
 Zn01j6vg8XwGjG1IToqqTaSqLZcj1DU7FRT+Iz+D6dkMlibvhyKx
 =TQ5c
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3VVMACgkQmmx57+YA
 GNlETxAAudhW26VINEiOiOt8LL2K/PKcvZQLM3mA0Nr5+9dQyu7/5mWa53CoFnmK
 AiCFpLo25aQmAFnWYR5/iYiRUo939VpMSujaV1blEvDDqajZMGNF+ehVsnDTTKdW
 IbuVOk06L20frHqdBwtiiDayvPnJ2IO0IQ+Q0gquPinXP9R7lB2/QtYYg8WNIVUG
 CJrb2DUTzFEIWJQUWE5xOZVoFJE2PxRgSkcWYfj5JX0M0dLA/+4N76sABZJO3ata
 DWNqPi+y66w90Y024d0z2xLyFlbICvK2Q5+vj7qjlL1914NxJXFh0TOei4Atbz4b
 /k9hBNVlAeKLuWtJXhN7UwQxR5Qu0R3YRJMUVq3CgzraCeKWc4aUF86E0fGGYrCg
 oSxeKuBt+wue1Ds1nGXNu6c9Ni3blm7nWD2PEAU2gbOQxrZW6qas0pFEKiMyRp/R
 XNUofSHxujMZrtLmKO7X4+RVtIos5A/TbcaPXaCjtGCKJgiiEZjM2eYprlBPuGAM
 8QPm+4A65tG1UpcaQwarGDl2Fnf7YMwkmu9xJRmfbX6J6OTIJxcYQ5vAjwhqYUIv
 2IZIAGsVGGnhWgD/BT+hTCLSDeZox7pPWoZ2UC+lk5HqzNty9noCYw4B5eO/gpv5
 NWz83jb1PnZlmElJhng5DolBX6PLlIZQxZ0luQBziZRhi12l6SQ=
 =0reg
 -----END PGP SIGNATURE-----

Merge tag 'v5.16-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes

Fixes for some board-level issues (regulators, mmc, poweroff, audio)

* tag 'v5.16-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: fix poweroff on helios64
  arm64: dts: rockchip: fix audio-supply for Rock Pi 4
  arm64: dts: rockchip: fix rk3399-leez-p710 vcc3v3-lan supply
  arm64: dts: rockchip: fix rk3308-roc-cc vcc-sd supply
  arm64: dts: rockchip: remove mmc-hs400-enhanced-strobe from rk3399-khadas-edge

Link: https://lore.kernel.org/r/3072346.MIvVl8DfR5@phil
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 15:14:42 +01:00
Arnd Bergmann
e3c68ab17b i.MX fixes for 5.16, round 2:
- One fix on imx8m-blk-ctrl driver to get i.MX8MM MIPI reset work
   properly
 - Fix CSI_DATA07__ESAI_TX0 pad name in i.MX7ULL pin function header
 - Remove interconnect property from i.MX8MQ LCDIF device to fix the
   regression that LCDIF driver stops probe, because interconnect
   provider driver (imx-bus) hasn't been fully working.
 - Fix soc-imx driver to register SoC device only on i.MX platform.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmG0BOsUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM6BFAgArJtx8QmpSgBGPXfWtvu5F63J2lfy
 aTBuXvLQACly80yWwTsm0GLvtc8nKDsPIU6PodfL8OPHEG1IqqgOkUP2rP6JTh2f
 IoIXMYBITdSfETW99GO4Yd7RDQ2KXvPkfHlDUTvgWV+8NJPrttSNgP4lCeNR9Me+
 wM/OhWNQGssKvEs2/Myr3Nq9QutCfGxJYdODu3hOHBfvASwpZCiRAFB2RJefshJq
 1S9ML8cDkQYNRys7LN2Ynby0Hpa8MdXLn6/JEA/C+jrBjxEL8KE+pFCHeptXWzZY
 Yj+9DEdRTAt9rhpojXjfGdssJwlOK/IYlrjLfNsplYKM0PNLzqdj/s9i/g==
 =w2VR
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3VRQACgkQmmx57+YA
 GNl/vw/9GZ+hk1r0szJvEAdI2gTqlMf6ZkrEoxI0VGei8Wky6wg2Dni1nrTiddKU
 pd+9PtD3DZALuypIvrWeu2VfJfLLF5ifUNyUpTFcOpj8BVXIteGuoDzNMhIrpNO7
 a4MzsZZTp5o782IkRjyZv/oxr4ANleCZsICeGfpyhCwvRi6ZGig+5Bf6LEvVZRyW
 8cjcW1n6Pi9EjiPdLqgc1LFI3IHx/nZ1TX/3ioeoDzWv1vPS/1Q2U0deR4jfjFOt
 /Ji7IS6DvOAvsTzUyV97VndPTyauDP9/8poga1odmCiwagCyzb7BNiNT3oo91YxN
 6WHiMber30uVVsnqsqcwnegY/PG5Lmfl3GfchnVVlzTjviTnV2coyGhJU2kelPvz
 8XisIbTSRa/uxEK/+43/Zuqxb/2bBwJANPqDO8FGdhEaowhCFT4+aCAYZ83hRoBV
 1XWMYksO77Sp0cghFQB36XzEyBkhQnhcbVvW1bZ7PBjdS2rJ/u0HoyVM2XQghu+a
 XYts4Shclg3RWKWNklzmgJ0UeNwgIlLNq2kgEEUI6Be8HI6K8z5XmuiMa27knXuc
 ONGfvekOgJv/Gz828l+e4T1MhqC42M17uGdh1D/G/B2uDJZJO7qwj4zXKeQmg5i/
 SU0A7VyXJRTc4jb6S5iSEE9LPKgj2Nwgmbsh2ARmQbevT21ccZM=
 =B220
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 5.16, round 2:

- One fix on imx8m-blk-ctrl driver to get i.MX8MM MIPI reset work
  properly
- Fix CSI_DATA07__ESAI_TX0 pad name in i.MX7ULL pin function header
- Remove interconnect property from i.MX8MQ LCDIF device to fix the
  regression that LCDIF driver stops probe, because interconnect
  provider driver (imx-bus) hasn't been fully working.
- Fix soc-imx driver to register SoC device only on i.MX platform.

* tag 'imx-fixes-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  soc: imx: Register SoC device only on i.MX boards
  soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
  ARM: dts: imx6ull-pinfunc: Fix CSI_DATA07__ESAI_TX0 pad name
  arm64: dts: imx8mq: remove interconnect property from lcdif

Link: https://lore.kernel.org/r/20211211015625.GK4216@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 15:13:40 +01:00
Javier Martinez Canillas
4bc5e64e6c efi: Move efifb_setup_from_dmi() prototype from arch headers
Commit 8633ef82f1 ("drivers/firmware: consolidate EFI framebuffer setup
for all arches") made the Generic System Framebuffers (sysfb) driver able
to be built on non-x86 architectures.

But it left the efifb_setup_from_dmi() function prototype declaration in
the architecture specific headers. This could lead to the following
compiler warning as reported by the kernel test robot:

   drivers/firmware/efi/sysfb_efi.c:70:6: warning: no previous prototype for function 'efifb_setup_from_dmi' [-Wmissing-prototypes]
   void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
        ^
   drivers/firmware/efi/sysfb_efi.c:70:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void efifb_setup_from_dmi(struct screen_info *si, const char *opt)

Fixes: 8633ef82f1 ("drivers/firmware: consolidate EFI framebuffer setup for all arches")
Reported-by: kernel test robot <lkp@intel.com>
Cc: <stable@vger.kernel.org> # 5.15.x
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20211126001333.555514-1-javierm@redhat.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2021-12-13 15:07:16 +01:00
Arnd Bergmann
f6bdc61067 Asahi SoC DT/binding fixes for 5.16.
Just some minor DT fixups we found after things got merged.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSU7I7lUkZru3Mt15+lhN6SrnTN2AUCYaeDMwAKCRClhN6SrnTN
 2GjoAQDSXE8T2VEeesw1JimIe/gi05870YR5uCw+yW0PbtapQgD9HejF9qp96jqx
 VLRUJHCeoPm1f7dXmxr6O2Q5yeBKtws=
 =QELQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3UswACgkQmmx57+YA
 GNmdDA//UeFxn8tKKzVCJJ6l7DmEn65MqYKufFgEeN0FRLr5l+Tv2ntNzgmqDeZ4
 nr71QO6LeEjEiXb5sJrR5ID8tayJFohNYQJniJgUXv2vqLFaM6WA0ZEfn/zL7lvP
 7Rs3ZjKPJpuaDR+AgQ3UnBZe+rq7QRU2/34cnKbzN7MckLrx3IiJIRJQNFW5qD0f
 8bZz/sGdtUwCdhyjlOFcvOfAjY1t0bUKbmo0d2Tkn02HCWjU9u3SZXJ0wfRR8zyk
 GiRqVg0cV+duZGt2cP+CfgPL4YbT1quDlEADaFsb4nNW4uDeqUjswji13CVhoypP
 axVNyrdZosg9K4h8KfD5kIdxcrkpzceex/IURq/jOwAaldB20kjfzxYwZkZNLRIW
 j5oudutb9fjdpVqqTZRZyXEJqcLzlv2DGGaF/4DsBi+mo0HFAEodB4FFyR8pJw79
 QD5543/XJOsy+yeEPJrHVDmtDBww73wKXoXYSpSkNQ2oL6Bx8dnFL4OPMCSA4pmu
 OHuGdosLjn0xiG6Q0BrPHAzO6cKaqa+ECGBeQ0ii9z1lowY4/65zTT33dUjLPnNG
 GNLsdzV9tylHkIgrg5liHDUzKsnk7OD/DRWlGto2nSFmCgRKj9wV5A/0KKjd5kCc
 xHIO+mYOZPEz/L+Y6mNevJn4IZ8qtsb7HiYTrzKaLtvATDm928M=
 =j9OT
 -----END PGP SIGNATURE-----

Merge tag 'asahi-soc-fixes-5.16' of https://github.com/AsahiLinux/linux into arm/fixes

Asahi SoC DT/binding fixes for 5.16.

Just some minor DT fixups we found after things got merged.

* tag 'asahi-soc-fixes-5.16' of https://github.com/AsahiLinux/linux:
  arm64: dts: apple: add #interrupt-cells property to pinctrl nodes
  dt-bindings: i2c: apple,i2c: allow multiple compatibles
  arm64: dts: apple: change ethernet0 device type to ethernet

Link: https://lore.kernel.org/r/cc9a1a67-3b2d-ae9f-5733-859111eb78c1@marcan.st
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 15:03:56 +01:00
Arnd Bergmann
b257c5f035
Merge branch 'v5.16/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/fixes
* 'v5.16/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  arm64: meson: remove COMMON_CLK
  arm64: meson: fix dts for JetHub D1

Link: https://lore.kernel.org/r/ab9f066f-480b-84b2-248e-953f2f2b5f59@baylibre.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 15:01:11 +01:00
Arnd Bergmann
708038dc37 i.MX fixes for 5.16:
- A series from Vladimir Oltean to update SJA1105 switch RGMII delay for
   a few boards, so that kernel doesn't warn on the legacy bindings.
 - Remove redundant interrupt declaration for gpio-keys on board
   ls1088a-ten64, as this causes an IRQ reclaiming error on kernel v5.15
   and later.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmGgsRAUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7cvAgAqnWK9OcpXErsi/ACWOqJ64F4yT8k
 ePzcGPvzFeNbuk2bm8l/zz7WueoKzM5tvk9bocwyUveXDwIIBIC6CoDU0yiHHh9P
 x9hhoU9VaY0GhFKzBfCuMXb7i0r5QIMOH++TJ1muFP+wRgBkGdPhyL+ijvd1EhQK
 K0QB+izgdcI1TvCypC2eZMY5vsyOCmnqE3EpQVzJSDfzJeFa48jFZ2eybGd6l9AQ
 /3W4nWQwS/930TbMSM1hh24v8gGxwei+GWbwPREKT2Fu/Rj9jctX2s01/nsMu73Q
 0bpf7nXx+uxS3CaN8vWIKEDRHsOeHPIIJ7wwBShIwh3XQtLb6lmS546rXA==
 =8XSh
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmG3T/wACgkQmmx57+YA
 GNkIGRAAm0DCZO+PQoErzjvon+Wb5E5XcrkRe/X0Y+X6NTbgPHm5NbOQDyDeduOH
 H6+89jYytzD4j8SogbwlZCyt14dZ5X83v1kpjpgl7ibBiR+/7aLJKfXkqb9yMBWd
 ndViTflQSexJzJSPLA47XLg/BCc7rZzz3HB20cdBfASqKN+nvz8012LebLWmO+6U
 Jbz+x3T2bXqmnCy52Na48OelwxNxy0hUMOdHUEB5GG4rLbgDaf9JFXzQGggzVRsA
 QROP7MqrGMrLxcwqvzEDPccZv387VJc33YCPDy4kfSeHb/KkrrLTccLeXRmKAx0p
 tXYxa5vU4PIMNb86AoNZ9H+jWYF7xMmMmz4zvtjSKyNydT7ZMY3XgKgWztSwy37a
 cKguckLQnz1jmxpxZOxu+N+fwkR/0ZE7sL10ia5t02vjGZfeJSY1V/8v/7K6UnQo
 0nVAQzcBBGqaw64Z/QMxYCepRY0Eb4/6ZX2FaqdZeEhgKu0LiADXMr3QaizeL0q6
 Qscg031L9eQ1uSnp6YCP1lYiafH2n84d7XrjB2jL2TZ186WKy+OqgeG9ZJKDebuK
 9OveVjbUUNZ1RlHHWnBBbbz3C0dgGuDZ4IDmso2IET9i0LtL57MVKefYRdHoE9ZH
 livdCYlfujRPkWIM7PS/D07feMoFsW5VW/nSxCp7szvZCMlmDrI=
 =3mvY
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 5.16:

- A series from Vladimir Oltean to update SJA1105 switch RGMII delay for
  a few boards, so that kernel doesn't warn on the legacy bindings.
- Remove redundant interrupt declaration for gpio-keys on board
  ls1088a-ten64, as this causes an IRQ reclaiming error on kernel v5.15
  and later.

* tag 'imx-fixes-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: ten64: remove redundant interrupt declaration for gpio-keys
  arm64: dts: lx2160abluebox3: update RGMII delays for sja1105 switch
  ARM: dts: ls1021a-tsn: update RGMII delays for sja1105 switch
  ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch

Link: https://lore.kernel.org/r/20211126100716.GF4216@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-12-13 14:51:55 +01:00
Chanho Park
7836149e15 arm64: dts: exynos: convert serial_0 to USI on ExynosAutov9
According to USI v2 driver change[1], serial_0 node should be converted to
use the USI node hierarchy. syscon_peric0 will be used as a syscon node
to control the USI00_USI_SW_CONF register.
This also changes the serial node name from uart@ to serial@.

[1]: https://lore.kernel.org/linux-samsung-soc/20211204195757.8600-2-semen.protsenko@linaro.org/

Cc: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Link: https://lore.kernel.org/r/20211208091853.8557-1-chanho61.park@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-12-13 12:06:28 +01:00
Ingo Molnar
6773cc31a9 Linux 5.16-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmG2fU0eHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGC7EH/3R7Rt+OD8Wn8Ss3
 w8V+dBxVwa2u2oMTyUHPxaeOXZ7bi38XlUdLFPOK/76bGwO0a5TmYZqsWdRbGyT0
 HfcYjHsQ0lbJXk/nh2oM47oJxJXVpThIHXJEk0FZ0Y5t+DYjIYlNHzqZymUyhLem
 St74zgWcyT+MXuqY34vB827FJDUnOxhhhi85tObeunaSPAomy9aiYidSC1ARREnz
 iz2VUntP/QnRnKVvL2nUZNzcz1xL5vfCRSKsRGRSv3qW1Y/1M71ylt6JVmSftWq+
 VmMdFxFhdrb1OK/1ct/930Un/UP2NG9EJsWxote2XYlnVSZHzDqH7lUhbqgdCcLz
 1m2tVNY=
 =7wRd
 -----END PGP SIGNATURE-----

Merge tag 'v5.16-rc5' into locking/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2021-12-13 10:48:46 +01:00
Jagan Teki
f471b1b2db arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards
This patch fixes the Bluetooth on ROCK Pi 4 boards.

ROCK Pi 4 boards has BCM4345C5 and now it is supported
on Mainline Linux, brcm,bcm43438-bt still working but
observed the BT Audio issues with latest test.

So, use the BCM4345C5 compatible and its associated
properties like clock-names as lpo and max-speed.

Attach vbat and vddio supply rails as well.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Link: https://lore.kernel.org/r/20211112142359.320798-1-jagan@amarulasolutions.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-12-12 13:50:22 +01:00
David Heidelberg
a39891a6e4 arm64: dts: rockchip: Add missing secondary compatible for PX30 DSI
Add second DSI compatible to comply with DT schema validation
comming in the second patch.

Signed-off-by: David Heidelberg <david@ixit.cz>
Link: https://lore.kernel.org/r/20211211233818.88482-1-david@ixit.cz
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-12-12 13:07:29 +01:00
Sven Peter
b4d11106d7 arm64: dts: apple: t8103: Add watchdog node
Add the watchdog node which also enables reboot support on the t8103.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-12 10:34:39 +09:00
Hector Martin
34e5719e1c arm64: dts: apple: t8103: Add apple,min-state to DCP PMGR nodes
This is required for DCP to boot successfully; it seems if power gating
is allowed, they do not wake up properly.

Reviewed-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-12 10:25:40 +09:00
Nicolas Frattaroli
ea1847c09c arm64: dts: rockchip: Add spi1 pins on Quartz64 A
The Quartz64 Model A has the SPI pins broken out on its pin
header. The actual pins being used though are not the m0
variant, but the m1 variant, which also lacks the cs1 pin.

This commit overrides pinctrl-0 accordingly for this board.

spi1 is intentionally left disabled, as anyone wishing to add
SPI devices needs to edit the dts anyway, and the pins are more
useful as GPIOs for the rest of the users.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211127141910.12649-4-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-12-11 11:59:12 +01:00
Nicolas Frattaroli
aaa552d845 arm64: dts: rockchip: Add spi nodes on rk356x
This adds the four spi nodes (spi0, spi1, spi2, spi3) to the
rk356x dtsi. These are from the downstream device tree, though
I have double-checked that their interrupts and DMA numbers are
correct. I have also tested spi1 with an SPI device.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211127141910.12649-3-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-12-11 11:59:11 +01:00
Sascha Hauer
2e4dbcf717 arm64: dts: rockchip: Change pwm pinctrl-name to "default" on rk356x
The pinctrl state "active" is neither documented nor used by the PWM
driver. Rename it to "default"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20211208120312.3300390-1-s.hauer@pengutronix.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-12-11 11:47:47 +01:00
Jakub Kicinski
be3158290d Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Andrii Nakryiko says:

====================
bpf-next 2021-12-10 v2

We've added 115 non-merge commits during the last 26 day(s) which contain
a total of 182 files changed, 5747 insertions(+), 2564 deletions(-).

The main changes are:

1) Various samples fixes, from Alexander Lobakin.

2) BPF CO-RE support in kernel and light skeleton, from Alexei Starovoitov.

3) A batch of new unified APIs for libbpf, logging improvements, version
   querying, etc. Also a batch of old deprecations for old APIs and various
   bug fixes, in preparation for libbpf 1.0, from Andrii Nakryiko.

4) BPF documentation reorganization and improvements, from Christoph Hellwig
   and Dave Tucker.

5) Support for declarative initialization of BPF_MAP_TYPE_PROG_ARRAY in
   libbpf, from Hengqi Chen.

6) Verifier log fixes, from Hou Tao.

7) Runtime-bounded loops support with bpf_loop() helper, from Joanne Koong.

8) Extend branch record capturing to all platforms that support it,
   from Kajol Jain.

9) Light skeleton codegen improvements, from Kumar Kartikeya Dwivedi.

10) bpftool doc-generating script improvements, from Quentin Monnet.

11) Two libbpf v0.6 bug fixes, from Shuyi Cheng and Vincent Minet.

12) Deprecation warning fix for perf/bpf_counter, from Song Liu.

13) MAX_TAIL_CALL_CNT unification and MIPS build fix for libbpf,
    from Tiezhu Yang.

14) BTF_KING_TYPE_TAG follow-up fixes, from Yonghong Song.

15) Selftests fixes and improvements, from Ilya Leoshkevich, Jean-Philippe
    Brucker, Jiri Olsa, Maxim Mikityanskiy, Tirthendu Sarkar, Yucong Sun,
    and others.

* https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (115 commits)
  libbpf: Add "bool skipped" to struct bpf_map
  libbpf: Fix typo in btf__dedup@LIBBPF_0.0.2 definition
  bpftool: Switch bpf_object__load_xattr() to bpf_object__load()
  selftests/bpf: Remove the only use of deprecated bpf_object__load_xattr()
  selftests/bpf: Add test for libbpf's custom log_buf behavior
  selftests/bpf: Replace all uses of bpf_load_btf() with bpf_btf_load()
  libbpf: Deprecate bpf_object__load_xattr()
  libbpf: Add per-program log buffer setter and getter
  libbpf: Preserve kernel error code and remove kprobe prog type guessing
  libbpf: Improve logging around BPF program loading
  libbpf: Allow passing user log setting through bpf_object_open_opts
  libbpf: Allow passing preallocated log_buf when loading BTF into kernel
  libbpf: Add OPTS-based bpf_btf_load() API
  libbpf: Fix bpf_prog_load() log_buf logic for log_level 0
  samples/bpf: Remove unneeded variable
  bpf: Remove redundant assignment to pointer t
  selftests/bpf: Fix a compilation warning
  perf/bpf_counter: Use bpf_map_create instead of bpf_create_map
  samples: bpf: Fix 'unknown warning group' build warning on Clang
  samples: bpf: Fix xdp_sample_user.o linking with Clang
  ...
====================

Link: https://lore.kernel.org/r/20211210234746.2100561-1-andrii@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-10 15:56:13 -08:00
Linus Torvalds
b8a98b6bf6 pci-v5.16-fixes-2
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmGzf4IUHGJoZWxnYWFz
 QGdvb2dsZS5jb20ACgkQWYigwDrT+vwjcBAAiWel9P5H947jR9sTbz4ya6wH1biD
 k2w97VDa65DyH/LBJSgNwmblnXs7yIUuGTd+mRq9bhlpE8CQi9BfeCehP1vCfTeQ
 JtMH62dW8KBLkvIHU83H1SSZZNKQgDn7hqUsrrMa0HD+Z+ovbuQYp4M1Oh6xRAEM
 TTBTKb0KivA8bFwvtgj/mu7K7sVJH+cVMilD9ABoVeGmCWfUSO48ovEjWB+vmBFs
 UyTCU5CUg/FkjvVmZTOv5GY4EL83FA9Jdtzy8inRA+hSWY6ImXHTzmQlAzvA+Rkv
 k344ZQM9GNvbvwKfBa9iW2g+B2y/OJXafGoVL0NBUcj/eiY5dnAX0/tZHvx0aXFy
 G1Txy2utaG2MSkfZzchEKbRvS0tV7kiFiTmqp9lNmffTZiP72k4+kFJHQC5AzvZb
 O7Ce/XSQifQ1Z3f5B+Ymx6EOgKYJUaWO9B1U1KF0EKGMe5GB0TBiXh/tS2EmV1O8
 1hkUJm032Bbf1Bv5R6BLdgKVz4I3UsqmGKH5gg3blyylAQ1oHsioaUKeV6iHSq40
 u9rNZaKGC3SweYZVISNE1uoII4qzEgLOHggHpZvWxhQy35cFBz8ZsNfLwBD3/8z9
 UfFuLSLHjx+hv3Ev5mgDWH1mzAlzyq5KkDT0bodBix07s5mviDH+57yyw3JtHUuL
 F+tMrYjUHK9ArC8=
 =BWkT
 -----END PGP SIGNATURE-----

Merge tag 'pci-v5.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

 - Revert emulation of Marvell Armada A3720 expansion ROM because it
   doesn't work as expected (Marek Behún)

 - Assert PERST# in Apple M1 driver to fix initialization when booting
   from bootloaders using PCIe, such as U-Boot (Marc Zyngier)

 - Describe PERST# as active low in Apple T8103 DT and update driver to
   match (Marc Zyngier)

* tag 'pci-v5.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: apple: Fix PERST# polarity
  arm64: dts: apple: t8103: Mark PCIe PERST# polarity active low in DT
  PCI: apple: Follow the PCIe specifications when resetting the port
  Revert "PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge"
2021-12-10 11:56:05 -08:00
Yunfeng Ye
386a74677b arm64: mm: Use asid feature macro for cheanup
The commit 95b54c3e4c ("KVM: arm64: Add feature register flag
definitions") introduce the ID_AA64MMFR0_ASID_8 and ID_AA64MMFR0_ASID_16
macros.

We can use these macros for cheanup in get_cpu_asid_bits().

No functional change.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/f71c75d3-735e-b32a-8414-b3e513c77240@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 18:24:20 +00:00
Yunfeng Ye
a3a5b76341 arm64: mm: Rename asid2idx() to ctxid2asid()
The commit 0c8ea531b7 ("arm64: mm: Allocate ASIDs in pairs") introduce
the asid2idx and idx2asid macro, but these macros are not really useful
after the commit f88f42f853 ("arm64: context: Free up kernel ASIDs if
KPTI is not in use").

The code "(asid & ~ASID_MASK)" can be instead by a macro, which is the
same code with asid2idx(). So rename it to ctxid2asid() for a better
understanding.

Also we add asid2ctxid() macro, the contextid can be generated based on
the asid and generation through this macro.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/c31516eb-6d15-94e0-421c-305fc010ea79@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 18:24:19 +00:00
Mark Rutland
d2d1d2645c arm64: Make some stacktrace functions private
Now that open-coded stack unwinds have been converted to
arch_stack_walk(), we no longer need to expose any of unwind_frame(),
walk_stackframe(), or start_backtrace() outside of stacktrace.c.

Make those functions private to stacktrace.c, removing their prototypes
from <asm/stacktrace.h> and marking them static.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Link: https://lore.kernel.org/r/20211129142849.3056714-10-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:04 +00:00
Madhavan T. Venkataraman
2dad6dc17b arm64: Make dump_backtrace() use arch_stack_walk()
To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic.

Currently, dump_backtrace() walks the stack of the current task or a
blocked task by calling stact_backtrace() and iterating unwind steps
using unwind_frame(). This can be written more simply in terms of
arch_stack_walk(), considering three distinct cases:

1) When unwinding a blocked task, start_backtrace() is called with the
   blocked task's saved PC and FP, and the unwind proceeds immediately
   from this point without skipping any entries. This is functionally
   equivalent to calling arch_stack_walk() with the blocked task, which
   will start with the task's saved PC and FP.

   There is no functional change to this case.

2) When unwinding the current task without regs, start_backtrace() is
   called with dump_backtrace() as the PC and __builtin_frame_address(0)
   as the next frame, and the unwind proceeds immediately without
   skipping. This is *almost* functionally equivalent to calling
   arch_stack_walk() for the current task, which will start with its
   caller (i.e. an offset into dump_backtrace()) as the PC, and the
   callers frame record as the next frame.

   The only difference being that dump_backtrace() will be reported with
   an offset (which is strictly more correct than currently). Otherwise
   there is no functional cahnge to this case.

3) When unwinding the current task with regs, start_backtrace() is
   called with dump_backtrace() as the PC and __builtin_frame_address(0)
   as the next frame, and the unwind is performed silently until the
   next frame is the frame pointed to by regs->fp. Reporting starts
   from regs->pc and continues from the frame in regs->fp.

   Historically, this pre-unwind was necessary to correctly record
   return addresses rewritten by the ftrace graph calller, but this is
   no longer necessary as these are now recovered using the FP since
   commit:

   c6d3cd32fd ("arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR")

   This pre-unwind is not necessary to recover return addresses
   rewritten by kretprobes, which historically were not recovered, and
   are now recovered using the FP since commit:

   cd9bc2c925 ("arm64: Recover kretprobe modified return address in stacktrace")

   Thus, this is functionally equivalent to calling arch_stack_walk()
   with the current task and regs, which will start with regs->pc as the
   PC and regs->fp as the next frame, without a pre-unwind.

This patch makes dump_backtrace() use arch_stack_walk(). This simplifies
dump_backtrace() and will permit subsequent changes to the unwind code.

Aside from the improved reporting when unwinding current without regs,
there should be no functional change as a result of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
[Mark: elaborate commit message]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-9-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:04 +00:00
Madhavan T. Venkataraman
22ecd975b6 arm64: Make profile_pc() use arch_stack_walk()
To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic outside of stacktrace.c.

Currently profile_pc() walks the stack of an interrupted context by
calling start_backtrace() with the context's PC and FP, and iterating
unwind steps using walk_stackframe(). This is functionally equivalent to
calling arch_stack_walk() with the interrupted context's pt_regs, which
will start with the PC and FP from the regs.

Make profile_pc() use arch_stack_walk(). This simplifies profile_pc(),
and in future will alow us to make walk_stackframe() private to
stacktrace.c.

At the same time, we remove the early return for when regs->pc is not in
lock functions, as this will be handled by the first call to the
profile_pc_cb() callback.

There should be no functional change as a result of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Mark: remove early return, elaborate commit message, fix includes]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-8-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:04 +00:00
Madhavan T. Venkataraman
39ef362d2d arm64: Make return_address() use arch_stack_walk()
To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic outside of stacktrace.c.

Currently return_address() walks the stack of the current task by
calling start_backtrace() with return_address as the PC and the frame
pointer of return_address() as the next frame, iterating unwind steps
using walk_stackframe(). This is functionally equivalent to calling
arch_stack_walk() for the current stack, which will start from its
caller (i.e. return_address()) as the PC and it's caller's frame record
as the next frame.

Make return_address() use arch_stackwalk(). This simplifies
return_address(), and in future will alow us to make walk_stackframe()
private to stacktrace.c.

There should be no functional change as a result of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Mark: elaborate commit message, fix includes]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20211129142849.3056714-7-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:04 +00:00
Madhavan T. Venkataraman
4f62bb7cb1 arm64: Make __get_wchan() use arch_stack_walk()
To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic outside of stacktrace.c.

Currently, __get_wchan() walks the stack of a blocked task by calling
start_backtrace() with the task's saved PC and FP values, and iterating
unwind steps using unwind_frame(). The initialization is functionally
equivalent to calling arch_stack_walk() with the blocked task, which
will start with the task's saved PC and FP values.

Currently __get_wchan() always performs an initial unwind step, which
will stkip __switch_to(), but as this is now marked as a __sched
function, this no longer needs special handling and will be skipped in
the same way as other sched functions.

Make __get_wchan() use arch_stack_walk(). This simplifies __get_wchan(),
and in future will alow us to make unwind_frame() private to
stacktrace.c. At the same time, we can simplify the try_get_task_stack()
check and avoid the unnecessary `stack_page` variable.

The change to the skipping logic means we may terminate one frame
earlier than previously where there are an excessive number of sched
functions in the trace, but this isn't seen in practice, and wchan is
best-effort anyway, so this should not be a problem.

Other than the above, there should be no functional change as a result
of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
[Mark: rebase atop wchan changes, elaborate commit message, fix includes]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-6-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:04 +00:00
Madhavan T. Venkataraman
ed876d35a1 arm64: Make perf_callchain_kernel() use arch_stack_walk()
To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic outside of stacktrace.c.

Currently perf_callchain_kernel() walks the stack of an interrupted
context by calling start_backtrace() with the context's PC and FP, and
iterating unwind steps using walk_stackframe(). This is functionally
equivalent to calling arch_stack_walk() with the interrupted context's
pt_regs, which will start with the PC and FP from the regs.

Make perf_callchain_kernel() use arch_stack_walk(). This simplifies
perf_callchain_kernel(), and in future will alow us to make
walk_stackframe() private to stacktrace.c.

At the same time, we update the callchain_trace() callback to check the
return value of perf_callchain_store(), which indicates whether there is
space for any further entries. When a non-zero value is returned,
further calls will be ignored, and are redundant, so we can stop the
unwind at this point.

We also remove the stale and confusing comment for callchain_trace.

There should be no functional change as a result of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Mark: elaborate commit message, remove comment, fix includes]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20211129142849.3056714-5-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:03 +00:00
Mark Rutland
86bcbafcb7 arm64: Mark __switch_to() as __sched
Unlike most architectures (and only in keeping with powerpc), arm64 has
a non __sched() function on the path to our cpu_switch_to() assembly
function.

It is expected that for a blocked task, in_sched_functions() can be used
to skip all functions between the raw context switch assembly and the
scheduler functions that call into __switch_to(). This is the behaviour
expected by stack_trace_consume_entry_nosched(), and the behaviour we'd
like to have such that we an simplify arm64's __get_wchan()
implementation to use arch_stack_walk().

This patch mark's arm64's __switch_to as __sched. This *will not* change
the behaviour of arm64's current __get_wchan() implementation, which
always performs an initial unwind step which skips __switch_to(). This
*will* change the behaviour of stack_trace_consume_entry_nosched() and
stack_trace_save_tsk() to match their expected behaviour on blocked
tasks, skipping all scheduler-internal functions including
__switch_to().

Other than the above, there should be no functional change as a result
of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-4-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:03 +00:00
Mark Rutland
1e5428b2b7 arm64: Add comment for stack_info::kr_cur
We added stack_info::kr_cur in commit:

  cd9bc2c925 ("arm64: Recover kretprobe modified return address in stacktrace")

... but didn't add anything in the corresponding comment block.

For consistency, add a corresponding comment.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviwed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:03 +00:00
Peter Zijlstra
1614b2b11f arch: Make ARCH_STACKWALK independent of STACKTRACE
Make arch_stack_walk() available for ARCH_STACKWALK architectures
without it being entangled in STACKTRACE.

Link: https://lore.kernel.org/lkml/20211022152104.356586621@infradead.org/
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
[Mark: rebase, drop unnecessary arm change]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20211129142849.3056714-2-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 14:06:03 +00:00
Rongwei Wang
7afccde389 arm64: kexec: reduce calls to page_address()
In kexec_page_alloc(), page_address() is called twice.
This patch add a new variable to help to reduce calls
to page_address().

Signed-off-by: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211125170600.1608-3-rongwei.wang@linux.alibaba.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-12-10 13:57:25 +00:00
Jakub Kicinski
3150a73366 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-09 13:23:02 -08:00
David Woodhouse
d8f6ef45a6 KVM: arm64: Use Makefile.kvm for common files
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Marc Zyngier <maz@kernel.org>
Message-Id: <20211121125451.9489-8-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-09 13:06:19 -05:00
Marc Zyngier
142ff9bddb KVM: arm64: Drop unused workaround_flags vcpu field
workaround_flags is a leftover from our earlier Spectre-v4 workaround
implementation, and now serves no purpose.

Get rid of the field and the corresponding asm-offset definition.

Fixes: 29e8910a56 ("KVM: arm64: Simplify handling of ARCH_WORKAROUND_2")
Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-12-08 14:54:07 +00:00
Joakim Zhang
44d0dfee53 arm64: dts: imx8mp: add mac address for EQOS
Add mac address in efuse, so that EQOS driver can parse it from nvmem
cell.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
baf55c1509 arm64: dts: imx8m: remove unused "nvmem_macaddr_swap" property for FEC
Remove unused "nvmem_macaddr_swap" property for FEC, there is no info in both
dt-binding and driver, so it's safe to remove it.

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
311ad460c4 arm64: dts: imx8mp-evk: disable CLKOUT clock for ENET PHY
According to commit 0a4355c2b7 ("net: phy: realtek: add dt property to
disable CLKOUT clock"), diable CLKOUT clock for FEC PHY to save power on
i.MX8MP EVK board.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
09e5ccdd86 arm64: dts: imx8m: configure FEC PHY VDDIO voltage
As commit 2f664823a4 ("net: phy: at803x: add device tree binding")
described, configure FEC PHY VDDIO voltage according to board design.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
20b6559ecf arm64: dts: imx8m: disable smart eee for FEC PHY
As commit 390b4cad81 ("net: phy: at803x: add support for configuring SmartEEE")
described, disable PHY smart eee by default.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
e0aa402b40 arm64: dts: imx8mp-evk: add hardware reset for EQOS PHY
As commit 798a1807ab ("arm64: dts: imx8mp-evk: Improve the Ethernet PHY
description") described, add hardware reset for EQOS PHY.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Joakim Zhang
6133d84228 arm64: dts: imx8mn-evk: add hardware reset for FEC PHY
Add hardware reset for FEC PHY.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:25:24 +08:00
Paolo Bonzini
93b350f884 Merge branch 'kvm-on-hv-msrbm-fix' into HEAD
Merge bugfix for enlightened MSR Bitmap, before adding support
to KVM for exposing the feature to nested guests.
2021-12-08 05:30:48 -05:00
Sean Christopherson
d92a5d1c6c KVM: Add helpers to wake/query blocking vCPU
Add helpers to wake and query a blocking vCPU.  In addition to providing
nice names, the helpers reduce the probability of KVM neglecting to use
kvm_arch_vcpu_get_wait().

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-20-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-08 04:24:54 -05:00
Sean Christopherson
91b99ea706 KVM: Rename kvm_vcpu_block() => kvm_vcpu_halt()
Rename kvm_vcpu_block() to kvm_vcpu_halt() in preparation for splitting
the actual "block" sequences into a separate helper (to be named
kvm_vcpu_block()).  x86 will use the standalone block-only path to handle
non-halt cases where the vCPU is not runnable.

Rename block_ns to halt_ns to match the new function name.

No functional change intended.

Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-08 04:24:51 -05:00
Sean Christopherson
005467e06b KVM: Drop obsolete kvm_arch_vcpu_block_finish()
Drop kvm_arch_vcpu_block_finish() now that all arch implementations are
nops.

No functional change intended.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-08 04:24:50 -05:00
Sean Christopherson
6109c5a6ab KVM: arm64: Move vGIC v4 handling for WFI out arch callback hook
Move the put and reload of the vGIC out of the block/unblock callbacks
and into a dedicated WFI helper.  Functionally, this is nearly a nop as
the block hook is called at the very beginning of kvm_vcpu_block(), and
the only code in kvm_vcpu_block() after the unblock hook is to update the
halt-polling controls, i.e. can only affect the next WFI.

Back when the arch (un)blocking hooks were added by commits 3217f7c25b
("KVM: Add kvm_arch_vcpu_{un}blocking callbacks) and d35268da66
("arm/arm64: KVM: arch_timer: Only schedule soft timer on vcpu_block"),
the hooks were invoked only when KVM was about to "block", i.e. schedule
out the vCPU.  The use case at the time was to schedule a timer in the
host based on the earliest timer in the guest in order to wake the
blocking vCPU when the emulated guest timer fired.  Commit accb99bcd0
("KVM: arm/arm64: Simplify bg_timer programming") reworked the timer
logic to be even more precise, by waiting until the vCPU was actually
scheduled out, and so move the timer logic from the (un)blocking hooks to
vcpu_load/put.

In the meantime, the hooks gained usage for enabling vGIC v4 doorbells in
commit df9ba95993 ("KVM: arm/arm64: GICv4: Use the doorbell interrupt
as an unblocking source"), and added related logic for the VMCR in commit
5eeaf10eec ("KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block").

Finally, commit 07ab0f8d9a ("KVM: Call kvm_arch_vcpu_blocking early
into the blocking sequence") hoisted the (un)blocking hooks so that they
wrapped KVM's halt-polling logic in addition to the core "block" logic.

In other words, the original need for arch hooks to take action _only_
in the block path is long since gone.

Cc: Oliver Upton <oupton@google.com>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-11-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-08 04:24:49 -05:00
Maciej S. Szmigiero
a54d806688 KVM: Keep memslots in tree-based structures instead of array-based ones
The current memslot code uses a (reverse gfn-ordered) memslot array for
keeping track of them.

Because the memslot array that is currently in use cannot be modified
every memslot management operation (create, delete, move, change flags)
has to make a copy of the whole array so it has a scratch copy to work on.

Strictly speaking, however, it is only necessary to make copy of the
memslot that is being modified, copying all the memslots currently present
is just a limitation of the array-based memslot implementation.

Two memslot sets, however, are still needed so the VM continues to run
on the currently active set while the requested operation is being
performed on the second, currently inactive one.

In order to have two memslot sets, but only one copy of actual memslots
it is necessary to split out the memslot data from the memslot sets.

The memslots themselves should be also kept independent of each other
so they can be individually added or deleted.

These two memslot sets should normally point to the same set of
memslots. They can, however, be desynchronized when performing a
memslot management operation by replacing the memslot to be modified
by its copy.  After the operation is complete, both memslot sets once
again point to the same, common set of memslot data.

This commit implements the aforementioned idea.

For tracking of gfns an ordinary rbtree is used since memslots cannot
overlap in the guest address space and so this data structure is
sufficient for ensuring that lookups are done quickly.

The "last used slot" mini-caches (both per-slot set one and per-vCPU one),
that keep track of the last found-by-gfn memslot, are still present in the
new code.

Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <17c0cf3663b760a0d3753d4ac08c0753e941b811.1638817641.git.maciej.szmigiero@oracle.com>
2021-12-08 04:24:34 -05:00