Commit graph

18862 commits

Author SHA1 Message Date
Marc Zyngier
9ee840a960 arm64: Add CNT{P,V}CTSS_EL0 alternatives to cnt{p,v}ct_el0
CNTPCTSS_EL0 and CNTVCTSS_EL0 are alternatives to the usual
CNTPCT_EL0 and CNTVCT_EL0 that do not require a previous ISB
to be synchronised (SS stands for Self-Synchronising).

Use the ARM64_HAS_ECV capability to control alternative sequences
that switch to these low(er)-cost primitives. Note that the
counter access in the VDSO is for now left alone until we decide
whether we want to allow this.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-16-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-19 10:56:20 +01:00
Marc Zyngier
fdf865988b arm64: Add a capability for FEAT_ECV
Add a new capability to detect the Enhanced Counter Virtualization
feature (FEAT_ECV).

Reviewed-by: Oliver Upton <oupton@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-15-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-19 10:56:20 +01:00
Will Deacon
0e277fb807 Merge branch 'timers/drivers/armv8.6_arch_timer' of https://git.linaro.org/people/daniel.lezcano/linux into for-next/8.6-timers
Pull Arm architected timer driver rework from Marc (via Daniel) so that
we can add the Armv8.6 support on top.

Link: https://lore.kernel.org/r/d0c55386-2f7f-a940-45bb-d80ae5e0f378@linaro.org

* 'timers/drivers/armv8.6_arch_timer' of https://git.linaro.org/people/daniel.lezcano/linux:
  clocksource/drivers/arch_arm_timer: Move workaround synchronisation around
  clocksource/drivers/arm_arch_timer: Fix masking for high freq counters
  clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming
  clocksource/drivers/arm_arch_timer: Remove any trace of the TVAL programming interface
  clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations
  clocksource/drivers/arm_arch_timer: Advertise 56bit timer to the core code
  clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL
  clocksource/drivers/arm_arch_timer: Fix MMIO base address vs callback ordering issue
  clocksource/drivers/arm_arch_timer: Move drop _tval from erratum function names
  clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL
  clocksource/drivers/arm_arch_timer: Extend write side of timer register accessors to u64
  clocksource/drivers/arm_arch_timer: Drop CNT*_TVAL read accessors
  clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses
2021-10-19 10:52:11 +01:00
Krzysztof Kozlowski
4b1a78330d arm64: dts: exynos: add 'chassis-type' property
A new 'chassis-type' root node property has recently been approved for
the device-tree specification.

Add this property for end-user devices (such as laptops,
smartphones and tablets) based on Samsung Exynos ARM64 SoCs.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211017101228.19478-1-krzysztof.kozlowski@canonical.com
2021-10-19 10:57:32 +02:00
Daniel Lezcano
32cf6d0ae0 Merge branch 'timers/drivers/armv8.6_arch_timer' into timers/drivers/next
The branch is a stable branch shared with ARM maintainers for the
first 13th patches of the series:

It is based on v5.14-rc3.

As stated by the changelog:

" [... ] enabling ARMv8.6 support for timer subsystem, and was prompted by a
discussion with Oliver around the fact that an ARMv8.6 implementation
must have a 1GHz counter, which leads to a number of things to break
in the timer code:

- the counter rollover can come pretty quickly as we only advertise a
  56bit counter,
- the maximum timer delta can be remarkably small, as we use the
  countdown interface which is limited to 32bit...

Thankfully, there is a way out: we can compute the minimal width of
the counter based on the guarantees that the architecture gives us,
and we can use the 64bit comparator interface instead of the countdown
to program the timer.

Finally, we start making use of the ARMv8.6 ECV features by switching
accesses to the counters to a self-synchronising register, removing
the need for an ISB. Hopefully, implementations will *not* just stick
an invisible ISB there...

A side effect of the switch to CVAL is that XGene-1 breaks. I have
added a workaround to keep it alive.

I have added Oliver's original patch[0] to the series and tweaked a
couple of things. Blame me if I broke anything.

The whole things has been tested on Juno (sysreg + MMIO timers),
XGene-1 (broken sysreg timers), FVP (FEAT_ECV, CNT*CTSS_EL0).
"

Link: https://lore.kernel.org/r/20211017124225.3018098-1-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-19 10:07:28 +02:00
Johan Jonker
5c9e66c6b7 arm64: dts: rockchip: fix resets in tsadc node for rk356x
In the rockchip_thermal.c driver we now get the resets with
a devm_reset_control_array_get() function, so remove
the reset-names property as it is no longer needed.
Although no longer required in rockchip-thermal.yaml
sort tsadc-apb as first item.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20210930110517.14323-4-jbx6244@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-18 20:19:19 +02:00
Paolo Bonzini
a25c78d04c Merge commit 'kvm-pagedata-alloc-fixes' into HEAD 2021-10-18 14:13:37 -04:00
Marc Zyngier
be08c3cf3c Merge branch kvm-arm64/pkvm/fixed-features into kvmarm-master/next
* kvm-arm64/pkvm/fixed-features: (22 commits)
  : .
  : Add the pKVM fixed feature that allows a bunch of exceptions
  : to either be forbidden or be easily handled at EL2.
  : .
  KVM: arm64: pkvm: Give priority to standard traps over pvm handling
  KVM: arm64: pkvm: Pass vpcu instead of kvm to kvm_get_exit_handler_array()
  KVM: arm64: pkvm: Move kvm_handle_pvm_restricted around
  KVM: arm64: pkvm: Consolidate include files
  KVM: arm64: pkvm: Preserve pending SError on exit from AArch32
  KVM: arm64: pkvm: Handle GICv3 traps as required
  KVM: arm64: pkvm: Drop sysregs that should never be routed to the host
  KVM: arm64: pkvm: Drop AArch32-specific registers
  KVM: arm64: pkvm: Make the ERR/ERX*_EL1 registers RAZ/WI
  KVM: arm64: pkvm: Use a single function to expose all id-regs
  KVM: arm64: Fix early exit ptrauth handling
  KVM: arm64: Handle protected guests at 32 bits
  KVM: arm64: Trap access to pVM restricted features
  KVM: arm64: Move sanitized copies of CPU features
  KVM: arm64: Initialize trap registers for protected VMs
  KVM: arm64: Add handlers for protected VM System Registers
  KVM: arm64: Simplify masking out MTE in feature id reg
  KVM: arm64: Add missing field descriptor for MDCR_EL2
  KVM: arm64: Pass struct kvm to per-EC handlers
  KVM: arm64: Move early handlers to per-EC handlers
  ...

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-18 17:20:50 +01:00
Marc Zyngier
0730559011 KVM: arm64: pkvm: Give priority to standard traps over pvm handling
Checking for pvm handling first means that we cannot handle ptrauth
traps or apply any of the workarounds (GICv3 or TX2 #219).

Flip the order around.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-12-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
0c7639cc83 KVM: arm64: pkvm: Pass vpcu instead of kvm to kvm_get_exit_handler_array()
Passing a VM pointer around is odd, and results in extra work on
VHE. Follow the rest of the design that uses the vcpu instead, and
let the nVHE code look into the struct kvm as required.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-11-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
746bdeadc5 KVM: arm64: pkvm: Move kvm_handle_pvm_restricted around
Place kvm_handle_pvm_restricted() next to its little friends such
as kvm_handle_pvm_sysreg().

This allows to make inject_undef64() static.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-10-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
3061725d16 KVM: arm64: pkvm: Consolidate include files
kvm_fixed_config.h is pkvm specific, and would be better placed
near its users. At the same time, include/nvhe/sys_regs.h is now
almost empty.

Merge the two into arch/arm64/kvm/hyp/include/nvhe/fixed_config.h.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-9-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
271b728605 KVM: arm64: pkvm: Preserve pending SError on exit from AArch32
Don't drop a potential SError when a guest gets caught red-handed
running AArch32 code.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-8-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
cbca197384 KVM: arm64: pkvm: Handle GICv3 traps as required
Forward accesses to the ICV_*SGI*_EL1 registers to EL1, and
emulate ICV_SRE_EL1 by returning a fixed value.

This should be enough to support GICv3 in a protected guest.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-7-maz@kernel.org
2021-10-18 16:57:09 +01:00
Marc Zyngier
f3d5ccabab KVM: arm64: pkvm: Drop sysregs that should never be routed to the host
A bunch of system registers (most of them MM related) should never
trap to the host under any circumstance. Keep them close to our chest.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-6-maz@kernel.org
2021-10-18 16:57:08 +01:00
Marc Zyngier
3c90cb15e2 KVM: arm64: pkvm: Drop AArch32-specific registers
All the SYS_*32_EL2 registers are AArch32-specific. Since we forbid
AArch32, there is no need to handle those in any way.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-5-maz@kernel.org
2021-10-18 16:57:08 +01:00
Marc Zyngier
8ffb418883 KVM: arm64: pkvm: Make the ERR/ERX*_EL1 registers RAZ/WI
The ERR*/ERX* registers should be handled as RAZ/WI, and there
should be no need to involve EL1 for that.

Add a helper that handles such registers, and repaint the sysreg
table to declare these registers as RAZ/WI.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-4-maz@kernel.org
2021-10-18 16:57:08 +01:00
Marc Zyngier
ce75916749 KVM: arm64: pkvm: Use a single function to expose all id-regs
Rather than exposing a whole set of helper functions to retrieve
individual ID registers, use the existing decoding tree and expose
a single helper instead.

This allow a number of functions to be made static, and we now
have a single entry point to maintain.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-3-maz@kernel.org
2021-10-18 16:57:08 +01:00
Marc Zyngier
8a049862c3 KVM: arm64: Fix early exit ptrauth handling
The previous rework of the early exit code to provide an EC-based
decoding tree missed the fact that we have two trap paths for
ptrauth: the instructions (EC_PAC) and the sysregs (EC_SYS64).

Rework the handlers to call the ptrauth handling code on both
paths.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211013120346.2926621-2-maz@kernel.org
2021-10-18 16:57:08 +01:00
Marc Zyngier
db26f8f2da clocksource/drivers/arch_arm_timer: Move workaround synchronisation around
We currently handle synchronisation when workarounds are enabled
by having an ISB in the __arch_counter_get_cnt?ct_stable() helpers.

While this works, this prevents us from relaxing this synchronisation.

Instead, move it closer to the point where the synchronisation is
actually needed. Further patches will subsequently relax this.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-14-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-18 09:20:57 +02:00
Linus Torvalds
cf52ad5ff1 Driver core fixes for 5.15-rc6
Here are some small driver core fixes for 5.15-rc6, all of which have
 been in linux-next for a while with no reported issues.
 
 They include:
 	- kernfs negative dentry bugfix
 	- simple pm bus fixes to resolve reported issues
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYWvzFg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymfLQCfSCP698AAvoCgG0fOfLakFkw80h0AoKIVm3lk
 t0GUdnplU18CjnO5M1Zj
 =+dh9
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are some small driver core fixes for 5.15-rc6, all of which have
  been in linux-next for a while with no reported issues.

  They include:

   - kernfs negative dentry bugfix

   - simple pm bus fixes to resolve reported issues"

* tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  drivers: bus: Delete CONFIG_SIMPLE_PM_BUS
  drivers: bus: simple-pm-bus: Add support for probing simple bus only devices
  driver core: Reject pointless SYNC_STATE_ONLY device links
  kernfs: don't create a negative dentry if inactive node exists
2021-10-17 17:17:28 -10:00
Dmitry Baryshkov
8f48ceef5d arm64: dts: qcom: pm8994: add interrupt controller properties
Now that the pmic-mpp is a proper hierarchical IRQ chip, add interrupt
controller properties ('interrupt-controller' and '#interrupt-cells').
The interrupts property is no longer needed so remove it.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-26-dmitry.baryshkov@linaro.org
2021-10-17 19:10:22 -05:00
Dmitry Baryshkov
3386f01427 arm64: dts: qcom: pm8916: add interrupt controller properties
Now that the pmic-mpp is a proper hierarchical IRQ chip, add interrupt
controller properties ('interrupt-controller' and '#interrupt-cells').
The interrupts property is no longer needed so remove it.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-25-dmitry.baryshkov@linaro.org
2021-10-17 19:10:22 -05:00
Dmitry Baryshkov
a4344427ea arm64: dts: qcom: apq8016-sbc: fix mpps state names
The majority of device tree nodes for mpps use xxxx-state as pinctrl
nodes. Change names of mpps pinctrl nodes for the apq8016-sbc board to
follow that pattern.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-13-dmitry.baryshkov@linaro.org
2021-10-17 19:10:22 -05:00
Dmitry Baryshkov
58d92e6e73 arm64: dts: qcom: pm8994: fix mpps device tree node
Add missing "qcom,spmi-mpp" to the compatible list as required by the
node description. Also add gpio-ranges property to mpps device tree
node, adding the mapping between pinctrl and GPIO pins.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-12-dmitry.baryshkov@linaro.org
2021-10-17 19:10:22 -05:00
Dmitry Baryshkov
de0c7e1283 arm64: dts: qcom: pm8916: fix mpps device tree node
Add missing "qcom,spmi-mpp" to the compatible list as required by the
node description. Also add gpio-ranges property to mpps device tree
node, adding the mapping between pinctrl and GPIO pins.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-11-dmitry.baryshkov@linaro.org
2021-10-17 19:10:22 -05:00
Marc Zyngier
ec8f7f3342 clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming
Switching from TVAL to CVAL has a small drawback: we need an ISB
before reading the counter. We cannot get rid of it, but we can
instead remove the one that comes just after writing to CVAL.

This reduces the number of ISBs from 3 to 2 when programming
the timer.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-12-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-17 21:47:44 +02:00
Marc Zyngier
a38b71b083 clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL
In order to cope better with high frequency counters, move the
programming of the timers from the countdown timer (TVAL) over
to the comparator (CVAL).

The programming model is slightly different, as we now need to
read the current counter value to have an absolute deadline
instead of a relative one.

There is a small overhead to this change, which we will address
in the following patches.

Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-5-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-17 21:47:05 +02:00
Marc Zyngier
1e8d929231 clocksource/drivers/arm_arch_timer: Extend write side of timer register accessors to u64
The various accessors for the timer sysreg and MMIO registers are
currently hardwired to 32bit. However, we are about to introduce
the use of the CVAL registers, which require a 64bit access.

Upgrade the write side of the accessors to take a 64bit value
(the read side is left untouched as we don't plan to ever read
back any of these registers).

No functional change expected.

Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-4-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-17 21:46:59 +02:00
Marc Zyngier
d72689988d clocksource/drivers/arm_arch_timer: Drop CNT*_TVAL read accessors
The arch timer driver never reads the various TVAL registers, only
writes to them. It is thus pointless to provide accessors
for them and to implement errata workarounds.

Drop these read-side accessors, and add a couple of BUG() statements
for the time being. These statements will be removed further down
the line.

Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-3-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-17 21:46:50 +02:00
Marc Zyngier
4775bc63f8 clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses
As we are about to change the registers that are used by the driver,
start by adding build-time checks to ensure that we always handle
all registers and access modes.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-2-maz@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2021-10-17 21:45:48 +02:00
Will McVicker
d96890fca9 rtc: s3c: remove HAVE_S3C_RTC in favor of direct dependencies
The config HAVE_S3C_RTC is not really needed since we can simply just
add the dependencies directly to RTC_DRV_S3C. Also, one less config to
keep track of!

Signed-off-by: Will McVicker <willmcvicker@google.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211013212256.3425889-1-willmcvicker@google.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-10-17 19:15:12 +02:00
Nicolas Frattaroli
1938b585ed arm64: dts: rockchip: Add analog audio on Quartz64
On the Quartz64 Model A, the I2S1 TDM controller is connected
to the rk817 codec in I2S mode. Enabling it and adding the
necessary simple-sound-card and codec nodes allows for analog
audio output on the PINE64 Quartz64 Model A SBC.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211016105354.116513-5-frattaroli.nicolas@gmail.com
[some property sorting]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-17 14:35:05 +02:00
Nicolas Frattaroli
ef5c913570 arm64: dts: rockchip: Add i2s1 on rk356x
This adds the necessary device tree node on rk3566 and rk3568
to enable the I2S1 TDM audio controller.

I2S0 has not been added, as it is connected to HDMI and there is
no way to test that it's working without a functioning video
clock (read: VOP2 driver).

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211016105354.116513-4-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-17 14:29:53 +02:00
Marc Zyngier
5f8b2591de Merge branch kvm-arm64/memory-accounting into kvmarm-master/next
* kvm-arm64/memory-accounting:
  : .
  : Sprinkle a bunch of GFP_KERNEL_ACCOUNT all over the code base
  : to better track memory allocation made on behalf of a VM.
  : .
  KVM: arm64: Add memcg accounting to KVM allocations
  KVM: arm64: vgic: Add memcg accounting to vgic allocations

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-17 11:29:36 +01:00
Jia He
115bae923a KVM: arm64: Add memcg accounting to KVM allocations
Inspired by commit 254272ce65 ("kvm: x86: Add memcg accounting to KVM
allocations"), it would be better to make arm64 KVM consistent with
common kvm codes.

The memory allocations of VM scope should be charged into VM process
cgroup, hence change GFP_KERNEL to GFP_KERNEL_ACCOUNT.

There remain a few cases since these allocations are global, not in VM
scope.

Signed-off-by: Jia He <justin.he@arm.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210907123112.10232-3-justin.he@arm.com
2021-10-17 11:25:55 +01:00
Jia He
3ef231670b KVM: arm64: vgic: Add memcg accounting to vgic allocations
Inspired by commit 254272ce65 ("kvm: x86: Add memcg accounting to KVM
allocations"), it would be better to make arm64 vgic consistent with
common kvm codes.

The memory allocations of VM scope should be charged into VM process
cgroup, hence change GFP_KERNEL to GFP_KERNEL_ACCOUNT.

There remain a few cases since these allocations are global, not in VM
scope.

Signed-off-by: Jia He <justin.he@arm.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210907123112.10232-2-justin.he@arm.com
2021-10-17 11:25:55 +01:00
Marc Zyngier
20a3043075 Merge branch kvm-arm64/vgic-fixes-5.16 into kvmarm-master/next
* kvm-arm64/vgic-fixes-5.16:
  : .
  : Multiple updates to the GICv3 emulation in order to better support
  : the dreadful Apple M1 that only implements half of it, and in a
  : broken way...
  : .
  KVM: arm64: vgic-v3: Align emulated cpuif LPI state machine with the pseudocode
  KVM: arm64: vgic-v3: Don't advertise ICC_CTLR_EL1.SEIS
  KVM: arm64: vgic-v3: Reduce common group trapping to ICV_DIR_EL1 when possible
  KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors
  KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-17 11:10:14 +01:00
Marc Zyngier
9d449c71bd KVM: arm64: vgic-v3: Align emulated cpuif LPI state machine with the pseudocode
Having realised that a virtual LPI does transition through an active
state that does not exist on bare metal, align the CPU interface
emulation with the behaviour specified in the architecture pseudocode.

The LPIs now transition to active on IAR read, and to inactive on
EOI write. Special care is taken not to increment the EOIcount for
an LPI that isn't present in the LRs.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010150910.2911495-6-maz@kernel.org
2021-10-17 11:06:36 +01:00
Marc Zyngier
f87ab68272 KVM: arm64: vgic-v3: Don't advertise ICC_CTLR_EL1.SEIS
Since we are trapping all sysreg accesses when ICH_VTR_EL2.SEIS
is set, and that we never deliver an SError when emulating
any of the GICv3 sysregs, don't advertise ICC_CTLR_EL1.SEIS.

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010150910.2911495-5-maz@kernel.org
2021-10-17 11:06:36 +01:00
Marc Zyngier
0924729b21 KVM: arm64: vgic-v3: Reduce common group trapping to ICV_DIR_EL1 when possible
On systems that advertise ICH_VTR_EL2.SEIS, we trap all GICv3 sysreg
accesses from the guest. From a performance perspective, this is OK
as long as the guest doesn't hammer the GICv3 CPU interface.

In most cases, this is fine, unless the guest actively uses
priorities and switches PMR_EL1 very often. Which is exactly what
happens when a Linux guest runs with irqchip.gicv3_pseudo_nmi=1.
In these condition, the performance plumets as we hit PMR each time
we mask/unmask interrupts. Not good.

There is however an opportunity for improvement. Careful reading
of the architecture specification indicates that the only GICv3
sysreg belonging to the common group (which contains the SGI
registers, PMR, DIR, CTLR and RPR) that is allowed to generate
a SError is DIR. Everything else is safe.

It is thus possible to substitute the trapping of all the common
group with just that of DIR if it supported by the implementation.
Yes, that's yet another optional bit of the architecture.
So let's just do that, as it leads to some impressive result on
the M1:

Without this change:
	bash-5.1# /host/home/maz/hackbench 100 process 1000
	Running with 100*40 (== 4000) tasks.
	Time: 56.596

With this change:
	bash-5.1# /host/home/maz/hackbench 100 process 1000
	Running with 100*40 (== 4000) tasks.
	Time: 8.649

which is a pretty convincing result.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20211010150910.2911495-4-maz@kernel.org
2021-10-17 11:06:36 +01:00
Marc Zyngier
df652bcf11 KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors
The infamous M1 has a feature nobody else ever implemented,
in the form of the "GIC locally generated SError interrupts",
also known as SEIS for short.

These SErrors are generated when a guest does something that violates
the GIC state machine. It would have been simpler to just *ignore*
the damned thing, but that's not what this HW does. Oh well.

This part of of the architecture is also amazingly under-specified.
There is a whole 10 lines that describe the feature in a spec that
is 930 pages long, and some of these lines are factually wrong.
Oh, and it is deprecated, so the insentive to clarify it is low.

Now, the spec says that this should be a *virtual* SError when
HCR_EL2.AMO is set. As it turns out, that's not always the case
on this CPU, and the SError sometimes fires on the host as a
physical SError. Goodbye, cruel world. This clearly is a HW bug,
and it means that a guest can easily take the host down, on demand.

Thankfully, we have seen systems that were just as broken in the
past, and we have the perfect vaccine for it.

Apple M1, please meet the Cavium ThunderX workaround. All your
GIC accesses will be trapped, sanitised, and emulated. Only the
signalling aspect of the HW will be used. It won't be super speedy,
but it will at least be safe. You're most welcome.

Given that this has only ever been seen on this single implementation,
that the spec is unclear at best and that we cannot trust it to ever
be implemented correctly, gate the workaround solely on ICH_VTR_EL2.SEIS
being set.

Tested-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010150910.2911495-3-maz@kernel.org
2021-10-17 11:06:36 +01:00
Marc Zyngier
562e530fd7 KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3
Until now, we always let ID_AA64PFR0_EL1.GIC reflect the value
visible on the host, even if we were running a GICv2-enabled VM
on a GICv3+compat host.

That's fine, but we also now have the case of a host that does not
expose ID_AA64PFR0_EL1.GIC==1 despite having a vGIC. Yes, this is
confusing. Thank you M1.

Let's go back to first principles and expose ID_AA64PFR0_EL1.GIC=1
when a GICv3 is exposed to the guest. This also hides a GICv4.1
CPU interface from the guest which has no business knowing about
the v4.1 extension.

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010150910.2911495-2-maz@kernel.org
2021-10-17 11:06:36 +01:00
Johan Jonker
ec3028e7c8 arm64: dts: rockchip: change gpio nodenames
Currently all gpio nodenames are sort of identical to there label.
Nodenames should be of a generic type, so change them all.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20211007144019.7461-3-jbx6244@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-17 09:50:36 +02:00
Maulik Shah
551ed64388 arm64: defconfig: Enable Sleep stats driver
Enable Sleep stats driver. The driver gives statistics for various
low power modes on Qualcomm Technologies, Inc. (QTI) SoCs.

Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1634107104-22197-4-git-send-email-mkshah@codeaurora.org
2021-10-16 18:24:28 -05:00
Maulik Shah
290bc68465 arm64: dts: qcom: Enable RPM Sleep stats
Add device node for Sleep stats driver which provides various
low power mode stats on msm8996, msm8998, qcs404, sdm630 and
sm6125.

Cc: devicetree@vger.kernel.org
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1634107104-22197-6-git-send-email-mkshah@codeaurora.org
2021-10-16 18:23:54 -05:00
Maulik Shah
47cb6a0684 arm64: dts: qcom: Enable RPMh Sleep stats
Add device node for Sleep stats driver which provides various
low power mode stats on sc7180, sc7280, sm8150, sm8250 and sm8350.

Also update the reg size of aoss_qmp device to 0x400.

Cc: devicetree@vger.kernel.org
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1634107104-22197-5-git-send-email-mkshah@codeaurora.org
2021-10-16 18:23:54 -05:00
Philip Chen
0faf297c42 arm64: dts: sc7180: Support Parade ps8640 edp bridge
Add a dts fragment file to support the sc7180 boards with the second
source edp bridge, Parade ps8640.

Signed-off-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008113839.v3.2.I187502fa747bc01a1c624ccf20d985fdffe9c320@changeid
2021-10-16 18:22:02 -05:00
Philip Chen
4537977a50 arm64: dts: sc7180: Factor out ti-sn65dsi86 support
Factor out ti-sn65dsi86 edp bridge as a separate dts fragment.
This helps us introduce the second source edp bridge later.

Signed-off-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008113839.v3.1.Ibada67e75d2982157e64164f1d11715d46cdc42c@changeid
2021-10-16 18:22:02 -05:00
Arnaud Ferraris
eaa744b1c1 arm64: dts: qcom: add 'chassis-type' property
A new 'chassis-type' root node property has recently been approved for
the device-tree specification, in order to provide a simple way for
userspace to detect the device form factor and adjust their behavior
accordingly.

This patch fills in this property for end-user devices (such as laptops,
smartphones and tablets) based on Qualcomm ARM64 processors.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net> # msm8916
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211016102025.23346-4-arnaud.ferraris@collabora.com
2021-10-16 16:55:21 -05:00
Arnaud Ferraris
263b39bce2 arm64: dts: rockchip: add 'chassis-type' property
A new 'chassis-type' root node property has recently been approved for
the device-tree specification, in order to provide a simple way for
userspace to detect the device form factor and adjust their behavior
accordingly.

This patch fills in this property for end-user devices (such as laptops,
smartphones and tablets) based on Rockchip ARM64 processors.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Link: https://lore.kernel.org/r/20211016102025.23346-5-arnaud.ferraris@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-16 21:26:48 +02:00
Heiko Stuebner
b394e70cdc arm64: dts: rockchip: add powerdomains to rk3368
Add the core io-domain node for rk3368.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20210925090405.2601792-3-heiko@sntech.de
2021-10-16 20:44:41 +02:00
Nicolas Frattaroli
7ab91acd36 arm64: dts: rockchip: enable spdif on Quartz64 A
Add the necessary nodes to enable the spdif output on the
RK3566-Quartz-A board.

Co-developed-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211015111303.1365328-2-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-16 20:42:50 +02:00
Peter Geis
a65e6523e6 arm64: dts: rockchip: add spdif node to rk356x
This adds the spdif node to the rk356x device tree.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211015111303.1365328-1-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2021-10-16 20:42:26 +02:00
Frieder Schrempf
0b28c41e3c arm64: dts: imx8mm-kontron: Fix connection type for VSC8531 RGMII PHY
Previously we falsely relied on the PHY driver to unconditionally
enable the internal RX delay. Since the following fix for the PHY
driver this is not the case anymore:

commit 7b005a1742 ("net: phy: mscc: configure both RX and TX internal
delays for RGMII")

In order to enable the delay we need to set the connection type to
"rgmii-rxid". Without the RX delay the ethernet is not functional at
all.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:30:00 +08:00
Frieder Schrempf
ca6f9d85d5 arm64: dts: imx8mm-kontron: Fix CAN SPI clock frequency
The MCP2515 can be used with an SPI clock of up to 10 MHz. Set the
limit accordingly to prevent any performance issues caused by the
really low clock speed of 100 kHz.

This removes the arbitrarily low limit on the SPI frequency, that was
caused by a typo in the original dts.

Without this change, receiving CAN messages on the board beyond a
certain bitrate will cause overrun errors (see 'ip -det -stat link show
can0').

With this fix, receiving messages on the bus works without any overrun
errors for bitrates up to 1 MBit.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:29:57 +08:00
Frieder Schrempf
6562d6e350 arm64: dts: imx8mm-kontron: Fix polarity of reg_rst_eth2
The regulator reg_rst_eth2 should keep the reset signal of the USB ethernet
adapter deasserted anytime. Fix the polarity and mark it as always-on.

Anyway, using the regulator is only a workaround for the missing support of
specifying a reset GPIO for USB devices in a generic way. As we don't
have a solution for this at the moment, at least fix the current
workaround.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:29:54 +08:00
Frieder Schrempf
256a24eba7 arm64: dts: imx8mm-kontron: Set lower limit of VDD_SNVS to 800 mV
According to the datasheet the typical value for VDD_SNVS should be
800 mV, so let's make sure that this is within the range of the
regulator.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:29:51 +08:00
Frieder Schrempf
82a4f329b1 arm64: dts: imx8mm-kontron: Make sure SOC and DRAM supply voltages are correct
It looks like the voltages for the SOC and DRAM supply weren't properly
validated before. The datasheet and uboot-imx code tells us that VDD_SOC
should be 800 mV in suspend and 850 mV in run mode. VDD_DRAM should be
950 mV for DDR clock frequencies of up to 1.5 GHz.

Let's fix these values to make sure the voltages are within the required
range.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:29:34 +08:00
Frieder Schrempf
ec1e91d400 arm64: dts: imx8mm-kontron: Add support for ultra high speed modes on SD card
In order to use ultra high speed modes (UHS) on the SD card slot, we
add matching pinctrls and fix the voltage switching for LDO5 of the
PMIC, by providing the SD_VSEL pin as GPIO to the PMIC driver.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-16 15:28:27 +08:00
Nobuhiro Iwamatsu
9606ebc100 arm64: defconfig: Visconti: Enable PCIe host controller
Enable Visconti's PCIe host controller in the ARM64 defconfig.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Link: https://lore.kernel.org/r/20210907042340.1525711-1-nobuhiro1.iwamatsu@toshiba.co.jp
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
2021-10-16 07:34:01 +09:00
Yuji Ishikawa
518d432fd5 arm64: dts: visconti: Add DTS for the VisROBO board
This board consists of two boards:
the SoM board (VRC SoM) with the SoC on board, and the board for I/O (VRB).

The functions of each board supported by this update are as follows:
  - VRC SoM
    - WDT
    - GPIO
    - SDCard (SPI-MMC mode)
    - I2C x1
  - VRB board
    - VRC SoM
    - UART x2
    - Ethernet phy

Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
Link: https://lore.kernel.org/r/20211014092703.15251-4-yuji2.ishikawa@toshiba.co.jp
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
2021-10-16 07:09:42 +09:00
Yuji Ishikawa
c53fd4102c arm64: dts: visconti: Add 150MHz fixed clock to TMPV7708 SoC
This clock source is referred by baudrate generators of
SPI and I2C devices.

Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
Link: https://lore.kernel.org/r/20211014092703.15251-2-yuji2.ishikawa@toshiba.co.jp
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
2021-10-16 07:09:41 +09:00
Nobuhiro Iwamatsu
6beeaf48db arm64: dts: visconti: Add PCIe host controller support for TMPV7708 SoC
Add PCIe node and fixed clock for PCIe in TMPV7708's dtsi,
and tmpv7708-rm-mbrc boards's dts.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Link: https://lore.kernel.org/r/20210907042500.1525771-1-nobuhiro1.iwamatsu@toshiba.co.jp
2021-10-16 07:09:41 +09:00
Barry Song
778c558f49 sched: Add cluster scheduler level in core and related Kconfig for ARM64
This patch adds scheduler level for clusters and automatically enables
the load balance among clusters. It will directly benefit a lot of
workload which loves more resources such as memory bandwidth, caches.

Testing has widely been done in two different hardware configurations of
Kunpeng920:

 24 cores in one NUMA(6 clusters in each NUMA node);
 32 cores in one NUMA(8 clusters in each NUMA node)

Workload is running on either one NUMA node or four NUMA nodes, thus,
this can estimate the effect of cluster spreading w/ and w/o NUMA load
balance.

* Stream benchmark:

4threads stream (on 1NUMA * 24cores = 24cores)
                stream                 stream
                w/o patch              w/ patch
MB/sec copy     29929.64 (   0.00%)    32932.68 (  10.03%)
MB/sec scale    29861.10 (   0.00%)    32710.58 (   9.54%)
MB/sec add      27034.42 (   0.00%)    32400.68 (  19.85%)
MB/sec triad    27225.26 (   0.00%)    31965.36 (  17.41%)

6threads stream (on 1NUMA * 24cores = 24cores)
                stream                 stream
                w/o patch              w/ patch
MB/sec copy     40330.24 (   0.00%)    42377.68 (   5.08%)
MB/sec scale    40196.42 (   0.00%)    42197.90 (   4.98%)
MB/sec add      37427.00 (   0.00%)    41960.78 (  12.11%)
MB/sec triad    37841.36 (   0.00%)    42513.64 (  12.35%)

12threads stream (on 1NUMA * 24cores = 24cores)
                stream                 stream
                w/o patch              w/ patch
MB/sec copy     52639.82 (   0.00%)    53818.04 (   2.24%)
MB/sec scale    52350.30 (   0.00%)    53253.38 (   1.73%)
MB/sec add      53607.68 (   0.00%)    55198.82 (   2.97%)
MB/sec triad    54776.66 (   0.00%)    56360.40 (   2.89%)

Thus, it could help memory-bound workload especially under medium load.
Similar improvement is also seen in lkp-pbzip2:

* lkp-pbzip2 benchmark

2-96 threads (on 4NUMA * 24cores = 96cores)
                  lkp-pbzip2              lkp-pbzip2
                  w/o patch               w/ patch
Hmean     tput-2   11062841.57 (   0.00%)  11341817.51 *   2.52%*
Hmean     tput-5   26815503.70 (   0.00%)  27412872.65 *   2.23%*
Hmean     tput-8   41873782.21 (   0.00%)  43326212.92 *   3.47%*
Hmean     tput-12  61875980.48 (   0.00%)  64578337.51 *   4.37%*
Hmean     tput-21 105814963.07 (   0.00%) 111381851.01 *   5.26%*
Hmean     tput-30 150349470.98 (   0.00%) 156507070.73 *   4.10%*
Hmean     tput-48 237195937.69 (   0.00%) 242353597.17 *   2.17%*
Hmean     tput-79 360252509.37 (   0.00%) 362635169.23 *   0.66%*
Hmean     tput-96 394571737.90 (   0.00%) 400952978.48 *   1.62%*

2-24 threads (on 1NUMA * 24cores = 24cores)
                 lkp-pbzip2               lkp-pbzip2
                 w/o patch                w/ patch
Hmean     tput-2   11071705.49 (   0.00%)  11296869.10 *   2.03%*
Hmean     tput-4   20782165.19 (   0.00%)  21949232.15 *   5.62%*
Hmean     tput-6   30489565.14 (   0.00%)  33023026.96 *   8.31%*
Hmean     tput-8   40376495.80 (   0.00%)  42779286.27 *   5.95%*
Hmean     tput-12  61264033.85 (   0.00%)  62995632.78 *   2.83%*
Hmean     tput-18  86697139.39 (   0.00%)  86461545.74 (  -0.27%)
Hmean     tput-24 104854637.04 (   0.00%) 104522649.46 *  -0.32%*

In the case of 6 threads and 8 threads, we see the greatest performance
improvement.

Similar improvement can be seen on lkp-pixz though the improvement is
smaller:

* lkp-pixz benchmark

2-24 threads lkp-pixz (on 1NUMA * 24cores = 24cores)
                  lkp-pixz               lkp-pixz
                  w/o patch              w/ patch
Hmean     tput-2   6486981.16 (   0.00%)  6561515.98 *   1.15%*
Hmean     tput-4  11645766.38 (   0.00%) 11614628.43 (  -0.27%)
Hmean     tput-6  15429943.96 (   0.00%) 15957350.76 *   3.42%*
Hmean     tput-8  19974087.63 (   0.00%) 20413746.98 *   2.20%*
Hmean     tput-12 28172068.18 (   0.00%) 28751997.06 *   2.06%*
Hmean     tput-18 39413409.54 (   0.00%) 39896830.55 *   1.23%*
Hmean     tput-24 49101815.85 (   0.00%) 49418141.47 *   0.64%*

* SPECrate benchmark

4,8,16 copies mcf_r(on 1NUMA * 32cores = 32cores)
		Base     	 	Base
		Run Time   	 	Rate
		-------  	 	---------
4 Copies	w/o 580 (w/ 570)       	w/o 11.1 (w/ 11.3)
8 Copies	w/o 647 (w/ 605)       	w/o 20.0 (w/ 21.4, +7%)
16 Copies	w/o 844 (w/ 844)       	w/o 30.6 (w/ 30.6)

32 Copies(on 4NUMA * 32 cores = 128cores)
[w/o patch]
                 Base     Base        Base
Benchmarks       Copies  Run Time     Rate
--------------- -------  ---------  ---------
500.perlbench_r      32        584       87.2  *
502.gcc_r            32        503       90.2  *
505.mcf_r            32        745       69.4  *
520.omnetpp_r        32       1031       40.7  *
523.xalancbmk_r      32        597       56.6  *
525.x264_r            1         --            CE
531.deepsjeng_r      32        336      109    *
541.leela_r          32        556       95.4  *
548.exchange2_r      32        513      163    *
557.xz_r             32        530       65.2  *
 Est. SPECrate2017_int_base              80.3

[w/ patch]
                  Base     Base        Base
Benchmarks       Copies  Run Time     Rate
--------------- -------  ---------  ---------
500.perlbench_r      32        580      87.8 (+0.688%)  *
502.gcc_r            32        477      95.1 (+5.432%)  *
505.mcf_r            32        644      80.3 (+13.574%) *
520.omnetpp_r        32        942      44.6 (+9.58%)   *
523.xalancbmk_r      32        560      60.4 (+6.714%%) *
525.x264_r            1         --           CE
531.deepsjeng_r      32        337      109  (+0.000%) *
541.leela_r          32        554      95.6 (+0.210%) *
548.exchange2_r      32        515      163  (+0.000%) *
557.xz_r             32        524      66.0 (+1.227%) *
 Est. SPECrate2017_int_base              83.7 (+4.062%)

On the other hand, it is slightly helpful to CPU-bound tasks like
kernbench:

* 24-96 threads kernbench (on 4NUMA * 24cores = 96cores)
                     kernbench              kernbench
                     w/o cluster            w/ cluster
Min       user-24    12054.67 (   0.00%)    12024.19 (   0.25%)
Min       syst-24     1751.51 (   0.00%)     1731.68 (   1.13%)
Min       elsp-24      600.46 (   0.00%)      598.64 (   0.30%)
Min       user-48    12361.93 (   0.00%)    12315.32 (   0.38%)
Min       syst-48     1917.66 (   0.00%)     1892.73 (   1.30%)
Min       elsp-48      333.96 (   0.00%)      332.57 (   0.42%)
Min       user-96    12922.40 (   0.00%)    12921.17 (   0.01%)
Min       syst-96     2143.94 (   0.00%)     2110.39 (   1.56%)
Min       elsp-96      211.22 (   0.00%)      210.47 (   0.36%)
Amean     user-24    12063.99 (   0.00%)    12030.78 *   0.28%*
Amean     syst-24     1755.20 (   0.00%)     1735.53 *   1.12%*
Amean     elsp-24      601.60 (   0.00%)      600.19 (   0.23%)
Amean     user-48    12362.62 (   0.00%)    12315.56 *   0.38%*
Amean     syst-48     1921.59 (   0.00%)     1894.95 *   1.39%*
Amean     elsp-48      334.10 (   0.00%)      332.82 *   0.38%*
Amean     user-96    12925.27 (   0.00%)    12922.63 (   0.02%)
Amean     syst-96     2146.66 (   0.00%)     2122.20 *   1.14%*
Amean     elsp-96      211.96 (   0.00%)      211.79 (   0.08%)

Note this patch isn't an universal win, it might hurt those workload
which can benefit from packing. Though tasks which want to take
advantages of lower communication latency of one cluster won't
necessarily been packed in one cluster while kernel is not aware of
clusters, they have some chance to be randomly packed. But this
patch will make them more likely spread.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Tested-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
2021-10-15 11:25:16 +02:00
Jonathan Cameron
c5e22feffd topology: Represent clusters of CPUs within a die
Both ACPI and DT provide the ability to describe additional layers of
topology between that of individual cores and higher level constructs
such as the level at which the last level cache is shared.
In ACPI this can be represented in PPTT as a Processor Hierarchy
Node Structure [1] that is the parent of the CPU cores and in turn
has a parent Processor Hierarchy Nodes Structure representing
a higher level of topology.

For example Kunpeng 920 has 6 or 8 clusters in each NUMA node, and each
cluster has 4 cpus. All clusters share L3 cache data, but each cluster
has local L3 tag. On the other hand, each clusters will share some
internal system bus.

+-----------------------------------+                          +---------+
|  +------+    +------+             +--------------------------+         |
|  | CPU0 |    | cpu1 |             |    +-----------+         |         |
|  +------+    +------+             |    |           |         |         |
|                                   +----+    L3     |         |         |
|  +------+    +------+   cluster   |    |    tag    |         |         |
|  | CPU2 |    | CPU3 |             |    |           |         |         |
|  +------+    +------+             |    +-----------+         |         |
|                                   |                          |         |
+-----------------------------------+                          |         |
+-----------------------------------+                          |         |
|  +------+    +------+             +--------------------------+         |
|  |      |    |      |             |    +-----------+         |         |
|  +------+    +------+             |    |           |         |         |
|                                   |    |    L3     |         |         |
|  +------+    +------+             +----+    tag    |         |         |
|  |      |    |      |             |    |           |         |         |
|  +------+    +------+             |    +-----------+         |         |
|                                   |                          |         |
+-----------------------------------+                          |   L3    |
                                                               |   data  |
+-----------------------------------+                          |         |
|  +------+    +------+             |    +-----------+         |         |
|  |      |    |      |             |    |           |         |         |
|  +------+    +------+             +----+    L3     |         |         |
|                                   |    |    tag    |         |         |
|  +------+    +------+             |    |           |         |         |
|  |      |    |      |             |    +-----------+         |         |
|  +------+    +------+             +--------------------------+         |
+-----------------------------------|                          |         |
+-----------------------------------|                          |         |
|  +------+    +------+             +--------------------------+         |
|  |      |    |      |             |    +-----------+         |         |
|  +------+    +------+             |    |           |         |         |
|                                   +----+    L3     |         |         |
|  +------+    +------+             |    |    tag    |         |         |
|  |      |    |      |             |    |           |         |         |
|  +------+    +------+             |    +-----------+         |         |
|                                   |                          |         |
+-----------------------------------+                          |         |
+-----------------------------------+                          |         |
|  +------+    +------+             +--------------------------+         |
|  |      |    |      |             |   +-----------+          |         |
|  +------+    +------+             |   |           |          |         |
|                                   |   |    L3     |          |         |
|  +------+    +------+             +---+    tag    |          |         |
|  |      |    |      |             |   |           |          |         |
|  +------+    +------+             |   +-----------+          |         |
|                                   |                          |         |
+-----------------------------------+                          |         |
+-----------------------------------+                          |         |
|  +------+    +------+             +--------------------------+         |
|  |      |    |      |             |  +-----------+           |         |
|  +------+    +------+             |  |           |           |         |
|                                   |  |    L3     |           |         |
|  +------+    +------+             +--+    tag    |           |         |
|  |      |    |      |             |  |           |           |         |
|  +------+    +------+             |  +-----------+           |         |
|                                   |                          +---------+
+-----------------------------------+

That means spreading tasks among clusters will bring more bandwidth
while packing tasks within one cluster will lead to smaller cache
synchronization latency. So both kernel and userspace will have
a chance to leverage this topology to deploy tasks accordingly to
achieve either smaller cache latency within one cluster or an even
distribution of load among clusters for higher throughput.

This patch exposes cluster topology to both kernel and userspace.
Libraried like hwloc will know cluster by cluster_cpus and related
sysfs attributes. PoC of HWLOC support at [2].

Note this patch only handle the ACPI case.

Special consideration is needed for SMT processors, where it is
necessary to move 2 levels up the hierarchy from the leaf nodes
(thus skipping the processor core level).

Note that arm64 / ACPI does not provide any means of identifying
a die level in the topology but that may be unrelate to the cluster
level.

[1] ACPI Specification 6.3 - section 5.2.29.1 processor hierarchy node
    structure (Type 0)
[2] https://github.com/hisilicon/hwloc/tree/linux-cluster

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210924085104.44806-2-21cnbao@gmail.com
2021-10-15 11:25:15 +02:00
Kees Cook
42a20f86dc sched: Add wrapper for get_wchan() to keep task blocked
Having a stable wchan means the process must be blocked and for it to
stay that way while performing stack unwinding.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> [arm]
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Link: https://lkml.kernel.org/r/20211008111626.332092234@infradead.org
2021-10-15 11:25:14 +02:00
Paolo Bonzini
e2b6d941ec KVM/arm64 fixes for 5.15, take #2
- Properly refcount pages used as a concatenated stage-2 PGD
 - Fix missing unlock when detecting the use of MTE+VM_SHARED
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAmFpPQwPHG1hekBrZXJu
 ZWwub3JnAAoJECPQ0LrRPXpDasoP/iNiTIEw7zrHs37Vx4dtTjz15RNF9gmFd2iR
 EXCg76V+2VN8/87bIcYdKeHkjXtERJ2tTCOJq9X/dn8MixvyShhCxJnk5chc1eZE
 2W4GY0gkuKO6E5rDAe10kl+zeFKVAd77zAeUezZYGGfRlm1Ly8sXrwzfR7ZXtvDH
 1DL89adycUJlh28lwcX73ScXWpiAsFXdWFjsVpHJngDZ1z3aYUqtPJmESH+mwtuK
 J85tTq4PZCsnubmUpuCYopgBJnogjh4KTulVOyenykvQyXZ+EVBjTA4Xh8iCyi77
 LMxqazvVkFnL3tBw2H7OCWPhQ/xfmWclpKcngDvnfPMIW6b3Tl5dCIY6uNWoLMnV
 8COh4ggahhqgsswHVCiFPBkJ/J3G+L8vLz2PHXtHJw6yOzPTEPD5yXH8oXoJhQ+Y
 U2aT83bWdc5sK9ZvhRHSpVXFZ6bWSUnMztP9szz1DM4QzyT6RHgXJE7TxWXFHhPR
 Hs0VGX13hz1f/AYN/+BDxicCtH9r/SbG6hlTPrt9+IFUAiz9EZ5Xy28fT1+c93Cf
 ArylAulF+HQyZMMe4RV2quAEXx5q5ag8pMsm/KQrh9fn0srrO4AnaoBGtuIjKJu3
 ccBd/1vbIAU9AxLw82LHW558gAzdq3LskPApgjkTA19oj7ffdMEqqs/cIDkN7nDx
 QEDaVxFv
 =eQRY
 -----END PGP SIGNATURE-----

Merge tag 'kvmarm-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 5.15, take #2

- Properly refcount pages used as a concatenated stage-2 PGD
- Fix missing unlock when detecting the use of MTE+VM_SHARED
2021-10-15 04:47:55 -04:00
Tim Harvey
7973009235 arm64: dts: imx8mm-venice-gw7901.dts: disable pgc_gpumix
Since commit b21269b12e48 ("arm64: dts: imx8mm: add GPC node") the
GW7901 will hang during kernel init because it does not power the unused
GPU voltage rails on the IMX8MM. Disable pgc_gpumix to work around this.

We also disable the GPU devices that depend on the gpumix power domain
and pgc_gpu to avoid them staying in a probe deferred state forever.

Additionally as the MIPI voltage rail is also not connected on this
board we disable pgc_mipi and disp_blk_ctrl.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 10:42:53 +08:00
Sebastian Krzyszkowiak
fea0fd097c arm64: dts: imx8mq-librem5: set debounce interval of volume buttons to 50ms
The default of 5ms is too low.

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:45:48 +08:00
Angus Ainslie
09d255f0be arm64: dts: imx8mq-librem5: Limit the max sdio frequency
This is needed for the 1LV Cyress WiFi module to probe correctly.
It also helps improve GNSS sensitivity.

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:53 +08:00
Angus Ainslie
2344af0d5b arm64: dts: imx8mq-librem5: add power sequencing for M.2 cards
Some wifi cards need reset asserted until after the power supplies
have been enabled.

So wire up the W_DISABLE signal for the SDIO port (WIFI_REG_ON net) and
the BT_REG_ON net to use it for power sequencing.

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:50 +08:00
Angus Ainslie
c3817595d6 arm64: dts: imx8mq-librem5: delay the startup of the SDIO
The redpine wifi card takes some time to wake up. Wait for it.

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:47 +08:00
Guido Günther
924025e5ee arm64: dts: imx8mq-librem5: wire up the wifi regulator
Connect the wifi power regulator to the corresponding GPIO.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:45 +08:00
Sebastian Krzyszkowiak
1f8359d4a2 arm64: dts: imx8mq-librem5: Fix led_r and led_g pinctrl assignments
Fix wrong pinctrl assignments.

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Suggested-by: Eric Kuzmenko <eric.kuzmenko@puri.sm>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:42 +08:00
Martin Kepplinger
ca4fd34e86 arm64: dts: imx8mq-librem5: add reset gpio to mantix panel description
Add the missing description for the reset gpio to the panels DT
description.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-15 09:44:30 +08:00
Dmitry Baryshkov
266e5cf39a arm64: dts: qcom: sm8250: remove mmcx regulator
Switch dispcc and videocc into using MMCX domain directly. Drop the now
unused mmcx regulator.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210829154757.784699-7-dmitry.baryshkov@linaro.org
2021-10-14 20:07:48 -05:00
Rajesh Patil
dfe28877db arm64: dts: qcom: sc7180: Add qspi compatible
Add "qcom,sc7180-qspi" compatible in qspi node

Signed-off-by: Rajesh Patil <rajpat@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1632997450-32293-3-git-send-email-rajpat@codeaurora.org
2021-10-14 20:00:13 -05:00
Bjorn Andersson
622adb84b3 arm64: dts: qcom: sdm845: Drop standalone smem node
Now that the SMEM binding and driver allows the SMEM node to be
described in the reserved-memory region directly, move the compatible
and hwlock properties to the reserved-memory node and drop the
standadlone node.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Link: https://lore.kernel.org/r/20210930182111.57353-5-bjorn.andersson@linaro.org
2021-10-14 19:58:13 -05:00
Stephan Gerhold
9095d05485 arm64: dts: qcom: msm8916: Drop underscore in node name
Using underscores in device tree nodes is not very common.
Additionally, the _region suffix in "smem_region@..." is not really
useful since it's obvious that it describes a reserved memory region.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210921152120.6710-2-stephan@gerhold.net
2021-10-14 19:55:51 -05:00
Stephan Gerhold
2533786f46 arm64: dts: qcom: apq8016-sbc: Clarify firmware-names
Commit 0f6b380d58 ("arm64: dts: qcom: apq8016-sbc: Update modem and WiFi
firmware path") added "firmware-name"s to the APQ8016 SBC (DB410c) device
tree to separate the (test key)-signed firmware from other devices.

However, the added names are a bit confusing. The "modem" firmware used by
DB410c is actually a simplified version for APQ8016 that lacks most of the
modem functionality (phone calls, SMS etc) that is available on MSM8916.
Placing it in "qcom/msm8916/modem.mbn" suggests that it supports all
functionality for MSM and not just the reduced functionality for APQ.

Request the firmware from "qcom/apq8016/modem.mbn" instead to clarify this.
Do the same for "wcnss.mbn" for consistency (although the WCNSS firmware
works just fine on MSM8916).

Finally, add a "_sbc" suffix to the WCNSS_qcom_wlan_nv.bin firmware file.
It seems like the nv.bin firmware is somewhat board specific and can
therefore vary a bit from device to device. This makes it more clear
which board it is intended to be used for.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210922195853.95574-1-stephan@gerhold.net
2021-10-14 19:54:58 -05:00
Sai Prakash Ranjan
88800cb254 arm64: defconfig: Enable QTI SC7280 pinctrl, gcc and interconnect
Enable the QTI SC7280 pinctrl, gcc and interconnect drivers required
for kernel to boot to console.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211007052812.3717-1-quic_saipraka@quicinc.com
2021-10-14 19:50:13 -05:00
Bjorn Andersson
5c1c3e2a76 arm64: defconfig: Disable firmware sysfs fallback
Part of the enablement of SDMA on the IMX platforms, '7f4e4afa140c
("arm64: defconfig: Enable SDMA on i.mx8mq/8mm")' also enabled
CONFIG_FW_LOADER_USER_HELPER_FALLBACK, to allow "firmware loaded by
udev".

Unfortunately having the fallback enabled does, due to the 60 second
timeout, essentially requiring userspace to provide a firmware loader.
But systemd dropped the support for this interface back in 2014 and
because arm64 is the only architecture that has this enabled, there
doesn't seem to be any standard solution available.

Examples of this problem can be found in e.g. the ath10k driver, which
with a standard distro can take about 10 minutes before wlan0 appears.

The alternative to this patch would be to change these drivers to use
firmware_request_direct(), to avoid the sysfs fallback. But that would
prevent other systems, such as Android, to rely on a userspace firmware
loader to pick the firmware from a non-standard place, with just a
custom defconfig.

This patch therefor attempts to align the arm64 defconfig will all other
architectures in the upstream kernel.

Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210930215300.60290-1-bjorn.andersson@linaro.org
2021-10-14 19:49:09 -05:00
Geert Uytterhoeven
12ee311887 arm64: dts: renesas: rcar-gen3e: Add Cortex-A57 2 GHz opps
Add operating points for running the Cortex-A57 CPU cores on R-Car
H3e-2G, M3e-2G, and M3Ne-2G at 2 GHz.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/08a0f27f50b8ad4a78c05186190bebcfb364fe8f.1634200489.git.geert+renesas@glider.be
2021-10-14 10:46:46 +02:00
Biju Das
361b0dcbd7 arm64: dts: renesas: rzg2l-smarc-som: Enable Ethernet
Enable Ethernet{0,1} interfaces on RZ/G2L SMARC EVK.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20211013075647.32231-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-14 10:46:46 +02:00
Biju Das
38ad23e15a arm64: dts: renesas: r9a07g044: Add GbEthernet nodes
Add Gigabit Ethernet{0,1} nodes to SoC DTSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20211013075647.32231-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-14 10:46:46 +02:00
Niklas Söderlund
c534e655d5 arm64: dts: renesas: Add ports node to all adv7482 nodes
The different port@ entries of the adv7482 nodes shall be encapsulated
in a ports node, add one.  This change does not change how the driver
parses the DT and no driver change is needed.

The change however makes it possible to validate the source files with a
correct json-schema.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20211012183431.718691-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-14 10:46:46 +02:00
Niklas Söderlund
5fea5b5571 arm64: dts: renesas: r8a779a0: Add and connect all CSI-2, ISP and VIN nodes
The V3U have 32 VIN, 4 CSI-2 and 4 ISP nodes that interact with each
other for video capture. Add all nodes and record how they are
interconnected.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20211012100038.375289-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-14 10:46:46 +02:00
Chukun Pan
d4949bf9cc
arm64: dts: allwinner: NanoPi R1S H5: Add generic compatible string for I2C EEPROM
The 'microchip,24c02' compatible does not match the at24 driver, so
add this generic fallback to the device node compatible string to
make the device to match the driver using the OF device ID table.

Also set this eeprom to read-only mode because it stores the mac
address of the onboard usb network card.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20211010135017.6855-2-amadeus@jmu.edu.cn
2021-10-14 09:17:42 +02:00
Robert Marko
7379291912 arm64: dts: marvell: add Globalscale MOCHAbin
Globalscale MOCHAbin is a Armada 7040 based development board.

Specifications:
* Armada 7040 Quad core ARMv8 Cortex A-72 @ 1.4GHz
* 2 / 4 / 8 GB of DDR4 DRAM
* 16 GB eMMC
* 4MB SPI-NOR (Bootloader)
* 1x M.2-2280 B-key socket (for SSD expansion, SATA3 only)
* 1x M.2-2250 B-key socket (for modems, USB2.0 and I2C only)
* 1x Mini-PCIe 3.0 (x1, USB2.0 and I2C)
* 1x SATA 7+15 socket (SATA3)
* 1x 16-pin (2×8) MikroBus Connector
* 1x SIM card slot (Connected to the mini-PCIe and both M.2 slots)
* 2x USB3.0 Type-A ports via SMSC USB5434B hub
* Cortex 2x5 JTAG
* microUSB port for UART (PL2303GL/PL2303SA onboard)
* 1x 10G SFP+
* 1x 1G SFP (Connected to 88E1512 PHY)
* 1x 1G RJ45 with PoE PD (Connected to 88E1512 PHY)
* 4x 1G RJ45 ports via Topaz 88E6141 switch
* RTC with battery holder (SoC provided, requires CR2032 battery)
* 1x 12V DC IN
* 1x Power switch
* 1x 12V fan header (3-pin, power only)
* 1x mini-PCIe LED header (2x0.1" pins)
* 1x M.2-2280 LED header (2x0.1" pins)
* 6x Bootstrap jumpers
* 1x Power LED (Green)
* 3x Tri-color RGB LEDs (Controllable)
* 1x Microchip ATECC608B secure element

Note that 1G SFP and 1G WAN cannot be used at the same time as they are in
parallel connected to the same PHY.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
2021-10-13 16:45:59 +02:00
Linus Torvalds
f4d0cc426f arm64 fixes:
- Fix CMA gigantic page order for 16K/64K page sizes.
 
 - Fix section mismatch error in drivers/acpi/arm64/gtdt.c.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmFlvOMACgkQa9axLQDI
 XvGPgA//Ur1ncAUo8xUlwCY+/BWr9YSOGh5JBf1Ac2nG/Qec2FwxEwv7uyM80nw1
 tQ2XmzTL6j4u9r4ZoaHyDI+YQ+fY++OqE+OMj4Ym86GRsG8cZD9rfFRlVipC2Fuy
 09er43QfPt5sLwrzvb9nlyYeyNCIGEyeYvJLW1uftyBXqx5ODOoTRo4ZLEVRYiSe
 B5hGFysG5oI6euG/z3xP6NLoOA51gIVtw8DvCrVHyrwxrpKJbH8LLVESihR/e/Vv
 SWEJtJ0Z/IZRyZbPX/BFLj+CQKbJPsc5T73tOsSZHm78XYlfwyCX/iGDvNBrTRqm
 eRKEzpZ8Nvi0tCt06IS6TV85GNszgKQW3SJgh1d+UkWdJ16EirkVI5Xf6NWMbRYn
 xxWAsXaWdfynZ1oB6o+QBqkNLr6rwfNfZrgF/1c8mtp0qN+aKwyUAfQB8ornBJkH
 ErTqC4u9AOmo2S+wgLqAJb3/XMXGGGYSVhyaZzqFr5hhksFL969X8WAzkvYSPisv
 CE+GYqRTuWtvLknUklSi1oDKcMf6WDIxvfq09CU+ydk3MskaZR3Eh3SNuX9joGDD
 vY/FVVofaFGkIKayeB7dCQjPnfhxwkWSK1sv0LpOk3OByBcHdpZTYeuwdvC0n9QJ
 o2+mfvShfl2maTCf+2dr1ZqbpI5sG49cywffBQrgQfpzSAkPT5A=
 =L70N
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

 - Fix CMA gigantic page order for 16K/64K page sizes

 - Fix section mismatch error in drivers/acpi/arm64/gtdt.c

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  acpi/arm64: fix next_platform_timer() section mismatch error
  arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE
2021-10-12 11:16:38 -07:00
Marc Zyngier
2a6bf5139e Merge branch kvm-arm64/misc-5.16 into kvmarm-master/next
* kvm-arm64/misc-5.16:
  : .
  : - Allow KVM to be disabled from the command-line
  : - Clean up CONFIG_KVM vs CONFIG_HAVE_KVM
  : - Fix endianess evaluation on MMIO access from EL0
  : .
  KVM: arm64: Fix reporting of endianess when the access originates at EL0

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-12 15:49:14 +01:00
Marc Zyngier
69adec18e9 KVM: arm64: Fix reporting of endianess when the access originates at EL0
We currently check SCTLR_EL1.EE when computing the address of
a faulting guest access. However, the fault could have occured at
EL0, in which case the right bit to check would be SCTLR_EL1.E0E.

This is pretty unlikely to cause any issue in practice: You'd have
to have a guest with a LE EL1 and a BE EL0 (or the other way around),
and have mapped a device into the EL0 page tables.

Good luck with that!

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Link: https://lore.kernel.org/r/20211012112312.1247467-1-maz@kernel.org
2021-10-12 15:47:25 +01:00
Arnd Bergmann
96c7f32d17 Devicetree changes for TI K3 platforms for v5.16 merge window:
* New Platforms:
   - AM654: Siemens IOT2050 PG2 boards
   - J721E: Low cost SK board
 * New features:
   - mmc aliases introduced
   - AM64 ICSSG nodes, mcu pinctrl added
 * Fixes:
   - Schema fixups for pcie, thermal zones
   - Fixup to include board specific property for J721e-evm and j7200-evm
   - Misc fixups including cleaning up order in Makefile
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE+KKGk1TrgjIXoxo03bWEnRc2JJ0FAmFldHYACgkQ3bWEnRc2
 JJ1Ecw//Qwdmws9fgghodAov7lHNl+vKk8rM8jIavZbVvHMdk/s7kD8vjRse8LtT
 9bhmf59XF/JfQwah01GKz2J4bCSgMw0WEzk5fcWJU/wzocoEdw3t0DeLS1UJFvaX
 0z3bKnO9PBfTMqjjLpWymFMRG4w1upuIp3EpvN8jRq+r8f6reEOuFGceZJt5dgT8
 KjoK8lk+dvVqn/UkB17gSPT8sZ6FPR+un7VVN9aqL0Fh/8F2xpNaYza8JLKtqdAg
 GPC0PL+fEfY7jtoPWvo0Pv0SdmSuBHeHLo+Tt9e8KD2ngb6We9MhU2W5BX0vSUvO
 SNhf5hxF0erXGv8/3h/hEFAApM/RjVPHltLZ5GarIbyQXJNNNzj5Ahy8TzxjTfVE
 /8rzCpWEf9FP1g/8B7l6U8bGrLEGpBOrXG2cZlKQDnhfJXPojVkLFh+dwXbkhyt7
 BuKUZ/xTimOKP+1AyJrSm4svwk41mI+gZZ2jl/dbOcpD9uWIAE1s8pCsMlfrTlwV
 DM0Cs4uH3dyR0iytUX0T8X3R0x6wUsouSY3IWVGYrvxqmptwPnCelyq1711sIKE0
 btqyVZHjxJYMiiRSb0RX1fVNQFW56LeIIXJU20boZe9HV4gu4DlczEjQvD6gRiyk
 QRBPv1EaJF/rHHTaKA+Ys1Fs0vuUrlMS3p27xXjp1hzpwBK3eDo=
 =6QM1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFlhM0ACgkQmmx57+YA
 GNlPIw//azQ029ryXE/J9xsAGAUdMvvaZOjiLzKP7hB8CWx9txIgqbuUc3ywTm8k
 1D9QVEsXJUUHyOyENacffAjudIl5GLSA3hlzP1owirvJm7zcuTcOSQ/1GFnyBCXV
 T0iLG4CBV9G1sd9EerUO96XoXgO7S5ijx9v8fGrlagIMXebR6CXbdil1+yjJk8wM
 EgELxIGNCIDCiedbBurv/TMgFhIh7mr01ykaVlkQ1PLY9oLLI65p+iuAhVDPMoL0
 h8kg0MNf1QNc0iPaZG6UezWnZjfxeQ4+jtOya4j3pB4eRLeZjoFnsJT47KcqCCTL
 vMCTwMMiJwyWoFUN9ufjvY/7vu2atpFgC8AoNBrJAlK6CqxM/LTM7vGIED50Oahb
 +Pb8Le+t25ZQoFOq9EK8FnNQszcuyhI+pwp5khSShmarRy+97swfKuIoXOPm4gO0
 +C0UxWfULVFQN1FUJrX/SfE2/hYNuHXK1nsilzII7h9NLZio580mwA05Ge2UbjP7
 UJTxlff0fBLXjTddBPPf8OjN7L9QFgweblkWfahRV+qFItL9iwYtnsD1lxZnJgHE
 vRYDtaeWH12vp7QRIjUvtD1O2ZSqwD2tC/MHC1rlWq/tGf5+ghdzGnGOaELocvAu
 iO4bJ0KOgJkDKkhroFtcXXYO0XAVki5fQWlQF2G4371I4t/xDh8=
 =M+lK
 -----END PGP SIGNATURE-----

Merge tag 'ti-k3-dt-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nmenon/linux into arm/dt

Devicetree changes for TI K3 platforms for v5.16 merge window:

* New Platforms:
  - AM654: Siemens IOT2050 PG2 boards
  - J721E: Low cost SK board
* New features:
  - mmc aliases introduced
  - AM64 ICSSG nodes, mcu pinctrl added
* Fixes:
  - Schema fixups for pcie, thermal zones
  - Fixup to include board specific property for J721e-evm and j7200-evm
  - Misc fixups including cleaning up order in Makefile

* tag 'ti-k3-dt-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nmenon/linux: (24 commits)
  arm64: dts: ti: k3-j721e-sk: Add DDR carveout memory nodes
  arm64: dts: ti: k3-j721e-sk: Add IPC sub-mailbox nodes
  arm64: dts: ti: Add support for J721E SK
  dt-bindings: arm: ti: Add compatible for J721E SK
  arm64: dts: ti: iot2050: Add support for product generation 2 boards
  arm64: dts: ti: iot2050: Prepare for adding 2nd-generation boards
  dt-bindings: arm: ti: Add bindings for Siemens IOT2050 PG2 boards
  arm64: dts: ti: iot2050: Add/enabled mailboxes and carve-outs for R5F cores
  arm64: dts: ti: iot2050: Disable SR2.0-only PRUs
  arm64: dts: ti: iot2050: Flip mmc device ordering on Advanced devices
  arm64: dts: ti: k3-j7200-common-proc-board: Add j7200-evm compatible
  arm64: dts: ti: k3-j721e-common-proc-board: Add j721e-evm compatible
  dt-bindings: arm: ti: Add missing compatibles for j721e/j7200 evms
  arm64: dts: ti: Makefile: Collate AM64 platforms together
  arm64: dts: ti: k3-am64-main: Add ICSSG nodes
  arm64: dts: ti: k3-am65: Relocate thermal-zones to SoC specific location
  arm64: dts: ti: ti-k3*: Introduce aliases for mmc nodes
  arm64: dts: ti: k3-am65-main: Cleanup "ranges" property in "pcie" DT node
  arm64: dts: ti: j7200-main: Add *max-virtual-functions* for pcie-ep DT node
  arm64: dts: ti: j7200-main: Fix "bus-range" upto 256 bus number for PCIe
  ...

Link: https://lore.kernel.org/r/20211012120817.beqhp4tygnf3xyi5@wireless
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-12 14:51:25 +02:00
Chanho Park
2b663ae715 arm64: dts: exynos: add minimal support for exynosautov9 sadk board
SADK(Samsung Automotive Development Kit) is the development kit to
evaluate Exynos Auto v9 SoC. It has 16GB LPDDR4 DRAM and two
256GB Samsung UFS. This patch enables only serial console and ufs0
device.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Link: https://lore.kernel.org/r/20211012002314.38965-4-chanho61.park@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-10-12 14:20:57 +02:00
Chanho Park
31bbac5263 arm64: dts: exynos: add initial support for exynosautov9 SoC
Add minimal support for ExynosAuto v9 SoC[1].

- Enumarate all pinctrl nodes
- UART with exynos850 compatible
- UFS0 HCI + Phy

Like exynos850, this also uses fixed-rate clock nodes until clock driver
has been supported. The clock nodes are initialized on bootloader stage
thus we don't need to control them so far.

[1]: https://www.samsung.com/semiconductor/minisite/exynos/products/automotiveprocessor/exynos-auto-v9/

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Link: https://lore.kernel.org/r/20211012002314.38965-3-chanho61.park@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-10-12 14:20:44 +02:00
Sumit Garg
de56379f21 arm64: ftrace: use function_nocfi for _mcount as well
Commit 800618f955 ("arm64: ftrace: use function_nocfi for ftrace_call")
only fixed address of ftrace_call but address of _mcount needs to be
fixed as well. Use function_nocfi() to get the actual address of _mcount
function as with CONFIG_CFI_CLANG, the compiler replaces function pointers
with jump table addresses which breaks dynamic ftrace as the address of
_mcount is replaced with the address of _mcount.cfi_jt.

With mainline, this won't be a problem since by default
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y with Clang >= 10 as it supports
-fpatchable-function-entry and CFI requires Clang 12 but for consistency
we should add function_nocfi() for _mcount as well.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20211011125059.3378646-1-sumit.garg@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-12 09:24:49 +01:00
Anders Roxell
1dfde0892b arm64: asm: setup.h: export common variables
When building the kernel with sparse enabled 'C=1' the following
warnings can be seen:

arch/arm64/kernel/setup.c:58:13: warning: symbol '__fdt_pointer' was not declared. Should it be static?
arch/arm64/kernel/setup.c:84:25: warning: symbol 'boot_args' was not declared. Should it be static?

Rework so the variables are exported, since these two variable are
created and used in setup.c, also used in head.S.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/r/20211007195601.677474-1-anders.roxell@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-12 09:22:33 +01:00
Arnd Bergmann
543659b312 arm64: tegra: Default configuration changes for v5.16-rc1
This enables drivers for the various audio processors found on Tegra210
 and later.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmFgoxMTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoXviD/wLoYBKWPFa0GWo037+xMN3xqyOCgN5
 CbHGvTC24Gln/RoN3A72TVezV6E27+sy9kz0J0jE9yQ0AKxjNKYQM5VXSWwgGSCW
 JhVZ2x65OlQjEGsRuNa+C10QFWC8sUigKOUT+fP6LiKZ4oHefouHecttJmLViSoj
 h/9OhrOhI6kqmj3DFUUz5zqNGwyooFvSyvC87gCJO9YEnFgV1i51SWxfuczdTokI
 v49EqjU2vvyADtqZb1JVIrAIG0qlqjMDhb20JHklvIP3dQja+OjRSfsoQyeZ3dTU
 CqKQCfA0/eaDtIsi6PwEFLRxqmZ8AnMFd3CMTixJa5ba2iERRWqUqTJSrgBBZMtr
 Ly18iBZXiSQCBfHC8xbH7Y3MV95pOwO+NVzqGLK6REtWtz0RjfgnDRxml4J9Uh+M
 Fzt0glGTrDkdQKoR5ijPv7P0w5nkiuXwlAS+bpwQtqVTo5UpQjABjoOZ+PTimtWb
 QF7nxoYkFuEqB6PGLFamkNsd+Etfv812UqENjMCf9I+BaRrstlEfDBj9vdNuWBT4
 zoEVu4DtQXSqoUXDPf03XAFROf5imm/0xzrFzkOc0q+twIY7aW6lxa6DFqTXkgTA
 f9lEbQlbyrXGByGfGLNFphi4F/dqFAZKFSQj8RH6sECAhZ8QP7h5th18IahhXtiY
 13sQVGfDRkXq9Q==
 =v2qB
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFktucACgkQmmx57+YA
 GNkX1g/+PU7nLo9DRbhJUh38Pm7PGmlAZJKzIL9+igaedvLaxkBsZQ1MQTdSTlti
 pcE1lkFZZbGphZ8gyWiWQsQjzG2gmuX7TTBNPncG4nuv93J3+bGY0H85d6JeTZ29
 XK/ncvdNLtegbYDkYtpuitZCT6wH8uWc2CMjuqScSMjXCGY+oN2ObIWl2t/0kcby
 WDhL9q18nebB38XSQxrOgL7nKIJj8zgypujZuapdgI658ZJQIv59nhpBon8X6yZK
 fbEycltVzgD8ZRIDB4pDuzRVb7A9nPwosAIzIFcDp6F0HYyMNFA/ikXlSLwnXVND
 cwq7p5XPjvjfWvphYhG8aVTcFL5Tz6v+4pNm6CCE3kOGGB6PXvWz88GJjAvSWdCu
 OA0d0xxnXBaEqIljLF/7lw8VRNd/kJpXki01YFa3aFoDWLrvmXODNm6XjdHtokXq
 O6Z74CYSbHH2Ny1zaJNJkl1qIVRck9/2hu1Pp3rQSXl3IVfwjskGZm3NdRw1vCtz
 BdJvj/4gpkT8oCqCaFWbGMabIRhU0Rudvlr2P7/YfmRlO6vf4xspnNhpi9FW0csV
 5ZIpGn3Yiil/1ahtX/F2PU97kTja6eR3bo+ATUF+mw3BgOr0cWdfjIpDpl4EWm/e
 OYYDrRcLcxUK08r8kBkhCebo7jV7a7uJY2Sis76Cq1K3gSE/WE4=
 =7sxf
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-5.16-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfigs

arm64: tegra: Default configuration changes for v5.16-rc1

This enables drivers for the various audio processors found on Tegra210
and later.

* tag 'tegra-for-5.16-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: defconfig: Enable few Tegra210 based AHUB drivers

Link: https://lore.kernel.org/r/20211008201132.1678814-8-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-12 00:12:55 +02:00
Arnd Bergmann
2a9c7b9062
Revert "arm64: dts: Add support for Unisoc's UMS512"
The patch uses the "dt-bindings/clock/sprd,ums512-clk.h header, which
is not merged yet. This caused a build regression, and it means the
patch was not ready to get merged anyway.

This reverts commit 23410de579.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-11 23:02:34 +02:00
Arnd Bergmann
d1edc9865c arm64: tegra: Device tree changes for v5.16-rc1
This enables additional interrupts on the Tegra194 GPIO controller for
 better load balancing and/or virtualization, adds audio support on
 Jetson TX2 NX, enables the NVDEC video decoder on Tegra186 and later and
 enables more audio processors that are found on Tegra210 and later.
 
 Various cleanups across the board top things off.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmFgotUTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoaYVD/9XwbRdNCseQB/fj36HQPtyCPC8ZISd
 2RHu+Jx+XN0L4aChGaM4iBi1/RxrAcFHbQb4HI8IsI0IoMgHcfNSUd+rlfUNDzEX
 Wy1O3CoJa4Z8FO6i3PsRAEOCPZgudglhU5PNmnV32OoXSNSv9EzvWXI+EaZwb8fd
 VHF9yuXa1CXJqz5OuVoCIK/8IopbVf4w5qlgr+SJRok+j3xVTx68eMracvoTx71R
 I6kWGLk0vRfySUO8FQwi69RMqvzVH/doDiu9FZcB89OWPBCokgxQY0THLm1/A7c7
 VstmsQUodwflz47drrAQoel6RsqHmpAqbn+SfxpdKwCEQBcbXTSjCqJ5zfqIBaRC
 qJUb0oNB9mS2TbTZ4CQz579BcXy4FE+JW0nANO1tqkUqRa1JcJDN8P6CMJE04Dka
 fCG+IWs1IRBPeLEvbgg6fpJ581pVGr+sqKiGr9FnYHwKPLXNfyX6jCvtvWsXfmAo
 9u36b8kcdrAvGuEZTiumboIP81sGYYEzP4GjnOB7JjLbtUpGTllDDTuTJdSozScJ
 dlEzoLNuNJDqk3Lq0GqIdy0BTyJVy+9xudD8RpP+T3vvS3PvWp4GAQoH0k3pdbtV
 fLpgl8UM7uoPHKoFy80aqS0RTDoq8/818qnKLpAeurPsivu2pbLRTB29/10x8TYr
 1domUAtN/S44Bg==
 =rNmg
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFkmi4ACgkQmmx57+YA
 GNmp6Q/9Hq2UTbGAcwfdtCyS8zazz3uyPoI6EToqyAA+FFllW6uIZrP1fo7UCjL3
 U95L9n4iyGGTf8Xm4isVxZoJlIPqf61eXb6kqVhMz9BpuEEcpvQ/SZgGVnIU7hmU
 rZeiQC5l2tK3o4EUrgRkLBJzY6jlcjEowRMxrjn6n7WUmdw1y1KwGe/BLC+6xrR3
 /q2VZzcVtMWUR7jucwOSdUtdyTKOADRuqHe7R7zjIkmkffOa/dimyJwBjT0YXFZo
 nl9W6TdLcDmu9gTTU7YAL1kvSG5kTri53jsRymBd6Tu9ZAqtaUGqqJ+b6VEf58KV
 S2Q8vu6OoGZonGCEtWO5OuR08fWdK09xJKrII/7gV4GVSPKZN0zrcb/ZOmOxhgvu
 UuO9UqGF45rhvgSIjyxXEAT/AKg1nIWL0x32Qex7n1sCl1M/uWLhhmWjp0aop0dK
 z+Gkso2Vqsj0/MGTNQHiDmCwsR9oNgxpB1DuD7ulsofQDqKcI3VcMth+WOiUPrs0
 cpr2gUpu/ZXT+yVDg2hgxiWuh+OoUa0IOC2l9iEPAehQDO/CmWuxOK+JoRH9NZFa
 Cyq86xsi+x1ocGqehu3Gn5k61iSzG+S9fjjBb1DEIlM+M8Xvejex59gX7hr48gDL
 WpT84s2iElQ6chDWDMgnZ3s3G1BKV6JsdcW2e6xYGuZG2Jwa1W4=
 =dOYU
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-5.16-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt

arm64: tegra: Device tree changes for v5.16-rc1

This enables additional interrupts on the Tegra194 GPIO controller for
better load balancing and/or virtualization, adds audio support on
Jetson TX2 NX, enables the NVDEC video decoder on Tegra186 and later and
enables more audio processors that are found on Tegra210 and later.

Various cleanups across the board top things off.

* tag 'tegra-for-5.16-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: tegra: Fix pcie-ep DT nodes
  arm64: tegra: Remove useless usb-ehci compatible string
  arm64: tegra: Extend APE audio support on Jetson platforms
  arm64: tegra: Add few AHUB devices for Tegra210 and later
  arm64: tegra: Remove unused backlight-boot-off property
  arm64: tegra: Add NVDEC to Tegra186/194 device trees
  arm64: tegra: Add new USB PHY properties on Tegra132
  arm64: tegra: Update HDA card name on Jetson TX2 NX
  arm64: tegra: Audio graph sound card for Jetson TX2 NX
  arm64: tegra: Add additional GPIO interrupt entries on Tegra194

Link: https://lore.kernel.org/r/20211008201132.1678814-7-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-11 22:10:22 +02:00
Chunyan Zhang
23410de579
arm64: dts: Add support for Unisoc's UMS512
Add basic DT to support Unisoc's UMS512, with this patch,
the board ums512-1h10 can run into console.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20211008034533.343167-3-zhang.lyra@gmail.com'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-11 21:53:55 +02:00
Mike Kravetz
2e5809a4dd arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE
For non-4K PAGE_SIZE configs, the largest gigantic huge page size is
CONT_PMD_SHIFT order. On arm64 with 64K PAGE_SIZE, the gigantic page is
16G. Therefore, one should be able to specify 'hugetlb_cma=16G' on the
kernel command line so that one gigantic page can be allocated from CMA.
However, when adding such an option the following message is produced:

hugetlb_cma: cma area should be at least 8796093022208 MiB

This is because the calculation for non-4K gigantic page order is
incorrect in the arm64 specific routine arm64_hugetlb_cma_reserve().

Fixes: abb7962adc ("arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs")
Cc: <stable@vger.kernel.org> # 5.9.x
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20211005202529.213812-1-mike.kravetz@oracle.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2021-10-11 18:45:19 +01:00
Arnd Bergmann
1649069312 Amlogic ARM64 DT changes for v5.16:
- New Boards (with bindings):
   - Radxa Zero
   - Jethub D1 & H1 home automation controllers
 - Misc Changes:
   - add Ethernet PHY reset line for ODROID-C4/HC4
   - add audio playback nodes to rbox-pro
   - Fix the pwm regulator supply properties
   - meson-g12b-odroid-n2: add missing 5v regulator gpio
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmFewM0ACgkQd9zb2sjI
 SdEqAQ//Rekq0ugm358sg434utmQ+2Ney7Qjuu9q/qmm3mZCtX7im7ejyp/5niTg
 aGcvtDn1U1iR+7uPsp/5u1SV7zE+DT7XwcALMxHLrDqa9PNkLEqgn4PMKdrw7JYb
 O0hWcGG0P9nI9o7XZDS+zR6DU6CTrutmlK7ZpuoY0cZDdJg9ZvF2zjx1aTbw52+N
 iB0wutDJpqhKU4nSMnndnmlSVXsHRvrZcWRROrBcbD8IiNDlPW7e2LU0tbPizHhq
 +lfZqNNIxv/0v+Cgfg1YSJeV2fvIju/BNGWsU2zUELf+mndrZyF89+HUu/Kbf9AO
 u+FitXp2OVF/W2I7kgdRtxXvwDWRhWdVHQT8nWDNrNmO4d0paT7TzaXU046HRDkk
 ypTZZXDsmOe3cQ0xXz3ggW+VaCjulRChLI/oW5+56HMPuqtR1Nl0o3xkTwddWejs
 Ol8Gor6upv6F3dP89uzERLo0OeJ4n0v8Dh8du8dPqu8kUrJC5OCXLR8TiIylKmtS
 RUlP7oCOR7/u7e18vdSoTDyuCX+laCzuCkgBUuRUndW0uJCLDgEaYw8fRru8VwGS
 brU/DMIbXRStOviIhxQjYR4uwXQAAZompZCQnSKCwMH/hMm9YyAUcTtMMRs0hv+3
 MPrx4NT69M9Q8TQthkEduR7hRINCD1iUaL/M4gjWxO1XYJOKyoU=
 =2tyw
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFkVEsACgkQmmx57+YA
 GNkZjhAAuQGq6bnQjP3l7lsalzvk3MMDKYb+2ot810sBtStbxPabhu9m0GawOYsd
 NSzdCSFpBYFNyy1PqzDWDvl1Vf84Yhs2BZRqIFHxP8vM3udE26MpS9nXuByWvCfA
 8Ljl6+3qaMpBwfD0wlsIQj0z1Bdzcc4ASn7yE4gbNpU9BvcVnDEcuqxN1rvdibuQ
 OCKCSXqAZ8jCiikMrV2cfaFjK3fFq8rdDJg7tkYGN1+wGcokR5CKV08EsoNBOOhf
 6Jv2C+7LD/B7NFMXBWCEe/HSr2Qllu3+Yn5F+MUShxuqq5USCaV9DlwYmnkPpmk/
 RmuyIxVowYeBZ9wEgr0TJURu3/Vr7E+WkbKhFr11KKfXxhbVxtpZ5H/PvHtIAZ8b
 yEbOWzHtR6HEOoM9Ydd5ffSQB/uf5Ce/zV5tlB1USJDXsRe2ScEAE9fnOXVUntDy
 Mcq4io8ZlKpAF3dXQGVpZV4g23HzoRI+GBvrhu7n6RphQGxblssQLjg+0mSm0F5x
 Quc7iwDZJnBbDcdayHUSU8vYJsvxrl8PV6h1nmCfN4GyXh4U6g4hOV/tmFYa1BWE
 m+ugP+RA9jqyj8yFFtcrYFRimqyhBy8thKWWmYe7+xUd+H9ACRLnIvdsd9I4xl5T
 SqzIsfku5qGJwNuHoc3t2QW2bAwiH4VUqVf0FQ4UOG56pBse6P8=
 =wQxa
 -----END PGP SIGNATURE-----

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

Amlogic ARM64 DT changes for v5.16:
- New Boards (with bindings):
  - Radxa Zero
  - Jethub D1 & H1 home automation controllers
- Misc Changes:
  - add Ethernet PHY reset line for ODROID-C4/HC4
  - add audio playback nodes to rbox-pro
  - Fix the pwm regulator supply properties
  - meson-g12b-odroid-n2: add missing 5v regulator gpio

* tag 'amlogic-arm64-dt-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  arm64: dts: meson-g12b-odroid-n2: add 5v regulator gpio
  arm64: dts: meson-sm1: Fix the pwm regulator supply properties
  arm64: dts: meson-g12b: Fix the pwm regulator supply properties
  arm64: dts: meson-g12a: Fix the pwm regulator supply properties
  arm64: dts: meson: add audio playback to rbox-pro
  arm64: dts: meson-axg: add support for JetHub D1
  arm64: dts: meson-gxl: add support for JetHub H1
  dt-bindings: vendor-prefixes: add jethome prefix
  dt-bindings: arm: amlogic: add bindings for Jethub D1/H1
  arm64: dts: amlogic: add support for Radxa Zero
  dt-bindings: arm: amlogic: add support for Radxa Zero
  arm64: dts: meson: sm1: add Ethernet PHY reset line for ODROID-C4/HC4

Link: https://lore.kernel.org/r/cc0a3af0-b1b1-dbe1-f553-cf58a1c63d0b@baylibre.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-11 17:12:11 +02:00
Arnd Bergmann
687d67639b arm64: dts: ZynqMP DT changes for v5.16-v2
- Add support for Kria SOM board
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCYV6e2AAKCRDKSWXLKUoM
 IS/BAKCZ7K9fo7UhgytlPzxnY99nm3wu9QCeK/0bs3dHFgOv3ICARrQMwrzZzuA=
 =jrSM
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFkU9cACgkQmmx57+YA
 GNnVTRAAvViib69MVXtwdWr6e984+UaQtkIw4aiEJoVchU8P7FalAvOqfjNP9Buo
 Mp1SMleTBQAigF4oWE/IuukOVlI5x6sbN6qrpzb/sKQ3NBn4l/MT71UaP8mrs9of
 CnUzRWGJxlu7oaQX65ZCAc01jdFhyai9/o6gipP17LWHZUaGZVI6P43/17JW/EP0
 QWuOyb0swgPLhUTbtSpZQdR5G5Y+b98nfOAhwYSxngSI4/xYzR2md8blt1hwVol8
 3d2laoz2PtfR/LYuWFmgr95KdUza/H9EL00WRo0hrhdGItG3C7/jZ/FlqAOzME7o
 P+AS1YSCqIR37IJTqEckjHO8iAkeEIJGVyRDhRXlu/HJ93f2DWpMAFszv3Bphdh/
 JD5qvs7tfC8oZTCI/RU7ovbcg0U9iMlAu16UfnV8Tcp37kuGOa8564nLh9YbaJxG
 YXPLhSkkxg9axTJX7AHcVK9W5oRszneHA0o/kDHdvqGcZQR6Sl8a6yCaS8beeTcS
 UbCJYry1eIthkpB3GzwFiriUVsfRHfX1qmvTcuvaNQ2viZNqVB52Ela+v2JLCpbE
 lbFE0eTim3kPdcQta8qFT0iJklezLFDL/cXYMl+ApongbUB2khXPn7a6/ugn3tCE
 tU5FtuXUHdZnYKiYaW0ucxZEkVVQRsSbiyn2QpJdPRzd8sGzj5U=
 =JffT
 -----END PGP SIGNATURE-----

Merge tag 'zynqmp-dt-for-v5.16-v2' of https://github.com/Xilinx/linux-xlnx into arm/dt

arm64: dts: ZynqMP DT changes for v5.16-v2

- Add support for Kria SOM board

* tag 'zynqmp-dt-for-v5.16-v2' of https://github.com/Xilinx/linux-xlnx:
  arm64: zynqmp: Add support for Xilinx Kria SOM board

Link: https://lore.kernel.org/r/9815867c-ffbb-fc9d-64b9-badee5e2862b@xilinx.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-11 17:10:15 +02:00
Fuad Tabba
5f39efc420 KVM: arm64: Handle protected guests at 32 bits
Protected KVM does not support protected AArch32 guests. However,
it is possible for the guest to force run AArch32, potentially
causing problems. Add an extra check so that if the hypervisor
catches the guest doing that, it can prevent the guest from
running again by resetting vcpu->arch.target and returning
ARM_EXCEPTION_IL.

If this were to happen, The VMM can try and fix it by re-
initializing the vcpu with KVM_ARM_VCPU_INIT, however, this is
likely not possible for protected VMs.

Adapted from commit 22f553842b ("KVM: arm64: Handle Asymmetric
AArch32 systems")

Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-12-tabba@google.com
2021-10-11 14:57:30 +01:00
Fuad Tabba
1423afcb41 KVM: arm64: Trap access to pVM restricted features
Trap accesses to restricted features for VMs running in protected
mode.

Access to feature registers are emulated, and only supported
features are exposed to protected VMs.

Accesses to restricted registers as well as restricted
instructions are trapped, and an undefined exception is injected
into the protected guests, i.e., with EC = 0x0 (unknown reason).
This EC is the one used, according to the Arm Architecture
Reference Manual, for unallocated or undefined system registers
or instructions.

Only affects the functionality of protected VMs. Otherwise,
should not affect non-protected VMs when KVM is running in
protected mode.

Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-11-tabba@google.com
2021-10-11 14:57:30 +01:00
Fuad Tabba
72e1be120e KVM: arm64: Move sanitized copies of CPU features
Move the sanitized copies of the CPU feature registers to the
recently created sys_regs.c. This consolidates all copies in a
more relevant file.

No functional change intended.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-10-tabba@google.com
2021-10-11 14:57:30 +01:00
Fuad Tabba
2a0c343386 KVM: arm64: Initialize trap registers for protected VMs
Protected VMs have more restricted features that need to be
trapped. Moreover, the host should not be trusted to set the
appropriate trapping registers and their values.

Initialize the trapping registers, i.e., hcr_el2, mdcr_el2, and
cptr_el2 at EL2 for protected guests, based on the values of the
guest's feature id registers.

No functional change intended as trap handlers introduced in the
previous patch are still not hooked in to the guest exit
handlers.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-9-tabba@google.com
2021-10-11 14:57:29 +01:00
Fuad Tabba
6c30bfb18d KVM: arm64: Add handlers for protected VM System Registers
Add system register handlers for protected VMs. These cover Sys64
registers (including feature id registers), and debug.

No functional change intended as these are not hooked in yet to
the guest exit handlers introduced earlier. So when trapping is
triggered, the exit handlers let the host handle it, as before.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-8-tabba@google.com
2021-10-11 14:57:29 +01:00
Fuad Tabba
16dd1fbb12 KVM: arm64: Simplify masking out MTE in feature id reg
Simplify code for hiding MTE support in feature id register when
MTE is not enabled/supported by KVM.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-7-tabba@google.com
2021-10-11 14:57:29 +01:00
Fuad Tabba
5386839077 KVM: arm64: Add missing field descriptor for MDCR_EL2
It's not currently used. Added for completeness.

No functional change intended.

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-6-tabba@google.com
2021-10-11 14:57:28 +01:00
Fuad Tabba
3b1a690eda KVM: arm64: Pass struct kvm to per-EC handlers
We need struct kvm to check for protected VMs to be able to pick
the right handlers for them in subsequent patches.

Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-5-tabba@google.com
2021-10-11 14:57:28 +01:00
Marc Zyngier
8fb2046180 KVM: arm64: Move early handlers to per-EC handlers
Simplify the early exception handling by slicing the gigantic decoding
tree into a more manageable set of functions, similar to what we have
in handle_exit.c.

This will also make the structure reusable for pKVM's own early exit
handling.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211010145636.1950948-4-tabba@google.com
2021-10-11 14:57:28 +01:00
Marc Zyngier
cc1e6fdfa9 KVM: arm64: Don't include switch.h into nvhe/kvm-main.c
hyp-main.c includes switch.h while it only requires adjust-pc.h.
Fix it to remove an unnecessary dependency.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211010145636.1950948-3-tabba@google.com
2021-10-11 14:57:27 +01:00
Marc Zyngier
7dd9b5a157 KVM: arm64: Move __get_fault_info() and co into their own include file
In order to avoid including the whole of the switching helpers
in unrelated files, move the __get_fault_info() and related helpers
into their own include file.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20211010145636.1950948-2-tabba@google.com
2021-10-11 14:57:27 +01:00
Marc Zyngier
1eb07f4b68 Merge branch kvm-arm64/raz-sysregs into kvmarm-master/next
* kvm-arm64/raz-sysregs:
  : .
  : Simplify the handling of RAZ register, removing pointless indirections.
  : .
  KVM: arm64: Replace get_raz_id_reg() with get_raz_reg()
  KVM: arm64: Use get_raz_reg() for userspace reads of PMSWINC_EL0
  KVM: arm64: Return early from read_id_reg() if register is RAZ

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-11 14:15:53 +01:00
Alexandru Elisei
ebf6aa8c04 KVM: arm64: Replace get_raz_id_reg() with get_raz_reg()
Reading a RAZ ID register isn't different from reading any other RAZ
register, so get rid of get_raz_id_reg() and replace it with get_raz_reg(),
which does the same thing, but does it without going through two layers of
indirection.

No functional change.

Suggested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211011105840.155815-4-alexandru.elisei@arm.com
2021-10-11 14:13:59 +01:00
Alexandru Elisei
5a43097623 KVM: arm64: Use get_raz_reg() for userspace reads of PMSWINC_EL0
PMSWINC_EL0 is a write-only register and was initially part of the VCPU
register state, but was later removed in commit 7a3ba3095a ("KVM:
arm64: Remove PMSWINC_EL0 shadow register"). To prevent regressions, the
register was kept accessible from userspace as Read-As-Zero (RAZ).

The read function that is used to handle userspace reads of this
register is get_raz_id_reg(), which, while technically correct, as it
returns 0, it is not semantically correct, as PMSWINC_EL0 is not an ID
register as the function name suggests.

Add a new function, get_raz_reg(), to use it as the accessor for
PMSWINC_EL0, as to not conflate get_raz_id_reg() to handle other types
of registers.

No functional change intended.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211011105840.155815-3-alexandru.elisei@arm.com
2021-10-11 14:13:59 +01:00
Alexandru Elisei
00d5101b25 KVM: arm64: Return early from read_id_reg() if register is RAZ
If read_id_reg() is called for an ID register which is Read-As-Zero (RAZ),
it initializes the return value to zero, then goes through a list of
registers which require special handling before returning the final value.

By not returning as soon as it checks that the register should be RAZ, the
function creates the opportunity for bugs, if, for example, a patch changes
a register to RAZ (like has happened with PMSWINC_EL0 in commit
11663111cd), but doesn't remove the special handling from read_id_reg();
or if a register is RAZ in certain situations, but readable in others.

Return early to make it impossible for a RAZ register to be anything other
than zero.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211011105840.155815-2-alexandru.elisei@arm.com
2021-10-11 14:13:58 +01:00
Marc Zyngier
a049cf7e63 Merge branch kvm-arm64/misc-5.16 into kvmarm-master/next
* kvm-arm64/misc-5.16:
  : .
  : - Allow KVM to be disabled from the command-line
  : - Clean up CONFIG_KVM vs CONFIG_HAVE_KVM
  : .
  KVM: arm64: Depend on HAVE_KVM instead of OF
  KVM: arm64: Unconditionally include generic KVM's Kconfig
  KVM: arm64: Allow KVM to be disabled from the command line

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-11 10:14:38 +01:00
Sean Christopherson
e26bb75aa2 KVM: arm64: Depend on HAVE_KVM instead of OF
Select HAVE_KVM at all times on arm64, as the OF requirement is
always there (even in the case of an ACPI system, we still depend
on some of the OF infrastructure), and won't fo away.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Acked-by: Will Deacon <will@kernel.org>
[maz: Drop the "HAVE_KVM if OF" dependency, as OF is always there on arm64,
 new commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210921222231.518092-3-seanjc@google.com
2021-10-11 10:08:50 +01:00
Sean Christopherson
c8f1e96734 KVM: arm64: Unconditionally include generic KVM's Kconfig
Unconditionally "source" the generic KVM Kconfig instead of wrapping it
with KVM=y.  A future patch will select HAVE_KVM so that referencing
HAVE_KVM in common kernel code doesn't break, and because KVM=y and
HAVE_KVM=n is weird.  Source the generic KVM Kconfig unconditionally so
that HAVE_KVM and KVM don't end up with a circular dependency.

Note, all but one of generic KVM's "configs" are of the HAVE_XYZ nature,
and the one outlier correctly takes a dependency on CONFIG_KVM, i.e. the
generic Kconfig is intended to be included unconditionally.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
[maz: made NVHE_EL2_DEBUG depend on KVM]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210921222231.518092-2-seanjc@google.com
2021-10-11 10:04:59 +01:00
Biju Das
34cdc0edfe arm64: dts: renesas: rzg2l-smarc: Enable microSD on SMARC platform
This patch enables microSD card slot connected to SDHI1 on RZ/G2L SMARC
platform.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20211010142520.21976-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-11 10:55:48 +02:00
Biju Das
a60a311cb8 arm64: dts: renesas: rzg2l-smarc-som: Enable eMMC on SMARC platform
RZ/G2L SoM has both 64 GB eMMC and microSD connected to SDHI0.

Both these interfaces are mutually exclusive and the SD0 device
selection is based on the XOR between GPIO_SD0_DEV_SEL and SW1[2]
switch position.

This patch sets GPIO_SD0_DEV_SEL to high in DT. Use the below switch
setting logic for device selection between eMMC and microSD slot
connected to SDHI0.

Set SW1[2] to position 2/OFF for selecting eMMC
Set SW1[2] to position 3/ON for selecting microSD

This patch enables eMMC on RZ/G2L SMARC platform by default.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20211010142520.21976-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-11 10:55:48 +02:00
Marc Zyngier
b6a68b97af KVM: arm64: Allow KVM to be disabled from the command line
Although KVM can be compiled out of the kernel, it cannot be disabled
at runtime. Allow this possibility by introducing a new mode that
will prevent KVM from initialising.

This is useful in the (limited) circumstances where you don't want
KVM to be available (what is wrong with you?), or when you want
to install another hypervisor instead (good luck with that).

Reviewed-by: David Brazdil <dbrazdil@google.com>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Scull <ascull@google.com>
Link: https://lore.kernel.org/r/20211001170553.3062988-1-maz@kernel.org
2021-10-11 09:48:47 +01:00
Marc Zyngier
15f9017c28 Merge branch kvm-arm64/vgic-ipa-checks into kvmarm-master/next
* kvm-arm64/vgic-ipa-checks:
  : .
  : Add extra checks to prevent ther various GIC regions to land
  : outside of the IPA space (and tests to verify that it works).
  : .
  KVM: arm64: selftests: Add init ITS device test
  KVM: arm64: selftests: Add test for legacy GICv3 REDIST base partially above IPA range
  KVM: arm64: selftests: Add tests for GIC redist/cpuif partially above IPA range
  KVM: arm64: selftests: Add some tests for GICv2 in vgic_init
  KVM: arm64: selftests: Make vgic_init/vm_gic_create version agnostic
  KVM: arm64: selftests: Make vgic_init gic version agnostic
  KVM: arm64: vgic: Drop vgic_check_ioaddr()
  KVM: arm64: vgic-v3: Check ITS region is not above the VM IPA size
  KVM: arm64: vgic-v2: Check cpu interface region is not above the VM IPA size
  KVM: arm64: vgic-v3: Check redist region is not above the VM IPA size
  kvm: arm64: vgic: Introduce vgic_check_iorange

Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-10-11 09:43:06 +01:00
Ricardo Koller
96e9038969 KVM: arm64: vgic: Drop vgic_check_ioaddr()
There are no more users of vgic_check_ioaddr(). Move its checks to
vgic_check_iorange() and then remove it.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-6-ricarkol@google.com
2021-10-11 09:31:42 +01:00
Ricardo Koller
2ec02f6c64 KVM: arm64: vgic-v3: Check ITS region is not above the VM IPA size
Verify that the ITS region does not extend beyond the VM-specified IPA
range (phys_size).

  base + size > phys_size AND base < phys_size

Add the missing check into vgic_its_set_attr() which is called when
setting the region.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-5-ricarkol@google.com
2021-10-11 09:31:42 +01:00
Ricardo Koller
c56a87da0a KVM: arm64: vgic-v2: Check cpu interface region is not above the VM IPA size
Verify that the GICv2 CPU interface does not extend beyond the
VM-specified IPA range (phys_size).

  base + size > phys_size AND base < phys_size

Add the missing check into kvm_vgic_addr() which is called when setting
the region. This patch also enables some superfluous checks for the
distributor (vgic_check_ioaddr was enough as alignment == size for the
distributors).

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-4-ricarkol@google.com
2021-10-11 09:31:41 +01:00
Ricardo Koller
4612d98f58 KVM: arm64: vgic-v3: Check redist region is not above the VM IPA size
Verify that the redistributor regions do not extend beyond the
VM-specified IPA range (phys_size). This can happen when using
KVM_VGIC_V3_ADDR_TYPE_REDIST or KVM_VGIC_V3_ADDR_TYPE_REDIST_REGIONS
with:

  base + size > phys_size AND base < phys_size

Add the missing check into vgic_v3_alloc_redist_region() which is called
when setting the regions, and into vgic_v3_check_base() which is called
when attempting the first vcpu-run. The vcpu-run check does not apply to
KVM_VGIC_V3_ADDR_TYPE_REDIST_REGIONS because the regions size is known
before the first vcpu-run. Note that using the REDIST_REGIONS API
results in a different check, which already exists, at first vcpu run:
that the number of redist regions is enough for all vcpus.

Finally, this patch also enables some extra tests in
vgic_v3_alloc_redist_region() by calculating "size" early for the legacy
redist api: like checking that the REDIST region can fit all the already
created vcpus.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-3-ricarkol@google.com
2021-10-11 09:31:41 +01:00
Ricardo Koller
f25c5e4daf kvm: arm64: vgic: Introduce vgic_check_iorange
Add the new vgic_check_iorange helper that checks that an iorange is
sane: the start address and size have valid alignments, the range is
within the addressable PA range, start+size doesn't overflow, and the
start wasn't already defined.

No functional change.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-2-ricarkol@google.com
2021-10-11 09:31:41 +01:00
Will Deacon
057bed206f KVM: arm64: Disable privileged hypercalls after pKVM finalisation
After pKVM has been 'finalised' using the __pkvm_prot_finalize hypercall,
the calling CPU will have a Stage-2 translation enabled to prevent access
to memory pages owned by EL2.

Although this forms a significant part of the process to deprivilege the
host kernel, we also need to ensure that the hypercall interface is
reduced so that the EL2 code cannot, for example, be re-initialised using
a new set of vectors.

Re-order the hypercalls so that only a suffix remains available after
finalisation of pKVM.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-7-will@kernel.org
2021-10-11 09:07:29 +01:00
Will Deacon
07036cffe1 KVM: arm64: Prevent re-finalisation of pKVM for a given CPU
__pkvm_prot_finalize() completes the deprivilege of the host when pKVM
is in use by installing a stage-2 translation table for the calling CPU.

Issuing the hypercall multiple times for a given CPU makes little sense,
but in such a case just return early with -EPERM rather than go through
the whole page-table dance again.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-6-will@kernel.org
2021-10-11 09:07:29 +01:00
Will Deacon
2f2e1a5069 KVM: arm64: Propagate errors from __pkvm_prot_finalize hypercall
If the __pkvm_prot_finalize hypercall returns an error, we WARN but fail
to propagate the failure code back to kvm_arch_init().

Pass a pointer to a zero-initialised return variable so that failure
to finalise the pKVM protections on a host CPU can be reported back to
KVM.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-5-will@kernel.org
2021-10-11 09:07:29 +01:00
Will Deacon
8579a185ba KVM: arm64: Reject stub hypercalls after pKVM has been initialised
The stub hypercalls provide mechanisms to reset and replace the EL2 code,
so uninstall them once pKVM has been initialised in order to ensure the
integrity of the hypervisor code.

To ensure pKVM initialisation remains functional, split cpu_hyp_reinit()
into two helper functions to separate usage of the stub from usage of
pkvm hypercalls either side of __pkvm_init on the boot CPU.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-4-will@kernel.org
2021-10-11 09:07:28 +01:00
Will Deacon
8f4566f18d arm64: Prevent kexec and hibernation if is_protected_kvm_enabled()
When pKVM is enabled, the hypervisor code at EL2 and its data structures
are inaccessible to the host kernel and cannot be torn down or replaced
as this would defeat the integrity properies which pKVM aims to provide.
Furthermore, the ABI between the host and EL2 is flexible and private to
whatever the current implementation of KVM requires and so booting a new
kernel with an old EL2 component is very likely to end in disaster.

In preparation for uninstalling the hyp stub calls which are relied upon
to reset EL2, disable kexec and hibernation in the host when protected
KVM is enabled.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-3-will@kernel.org
2021-10-11 09:07:28 +01:00
Marc Zyngier
a78738ed1d KVM: arm64: Turn __KVM_HOST_SMCCC_FUNC_* into an enum (mostly)
__KVM_HOST_SMCCC_FUNC_* is a royal pain, as there is a fair amount
of churn around these #defines, and we avoid making it an enum
only for the sake of the early init, low level code that requires
__KVM_HOST_SMCCC_FUNC___kvm_hyp_init to be usable from assembly.

Let's be brave and turn everything but this symbol into an enum,
using a bit of arithmetic to avoid any overlap.

Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/877depq9gw.wl-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-2-will@kernel.org
2021-10-11 09:07:28 +01:00
Weizhao Ouyang
6644c654ea ftrace: Cleanup ftrace_dyn_arch_init()
Most of ARCHs use empty ftrace_dyn_arch_init(), introduce a weak common
ftrace_dyn_arch_init() to cleanup them.

Link: https://lkml.kernel.org/r/20210909090216.1955240-1-o451686892@gmail.com

Acked-by: Heiko Carstens <hca@linux.ibm.com> (s390)
Acked-by: Helge Deller <deller@gmx.de> (parisc)
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-10-08 19:41:39 -04:00
Linus Torvalds
0dcf60d001 asm-generic: build fixes for v5.15
There is one build fix for Arm platforms that ended up impacting most
 architectures because of the way the drivers/firmware Kconfig file is
 wired up:
 
 The CONFIG_QCOM_SCM dependency have caused a number of randconfig
 regressions over time, and some still remain in v5.15-rc4. The
 fix we agreed on in the end is to make this symbol selected by any
 driver using it, and then building it even for non-Arm platforms with
 CONFIG_COMPILE_TEST.
 
 To make this work on all architectures, the drivers/firmware/Kconfig
 file needs to be included for all architectures to make the symbol
 itself visible.
 
 In a separate discussion, we found that a sound driver patch that is
 pending for v5.16 needs the same change to include this Kconfig file,
 so the easiest solution seems to have my Kconfig rework included in v5.15.
 
 There is a small merge conflict against an earlier partial fix for the
 QCOM_SCM dependency problems.
 
 Finally, the branch also includes a small unrelated build fix for NOMMU
 architectures.
 
 Link: https://lore.kernel.org/all/20210928153508.101208f8@canb.auug.org.au/
 Link: https://lore.kernel.org/all/20210928075216.4193128-1-arnd@kernel.org/
 Link: https://lore.kernel.org/all/20211007151010.333516-1-arnd@kernel.org/
 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFgVp8ACgkQmmx57+YA
 GNlQoA/+O0ljtTy5D0MjRGmFDs11M5AtKNrfys82lm2GeEnc4lnxn722jLk8kR6s
 y6DSOWFs7w1bqhKExQNehZYtJO3sgW/9qiLMV9qfOx1Nc6WwhDPcYM9bMyGlpTmL
 M456nh8NopixV7slanNtfz1e0kbMKoK+4Ub7M5OHepK6x9FKQXQYQpeoBxaXHmWZ
 9eaRiL/CsRHO/cSkvpq1GtL7IVrudvij3FDHzxoDGFFjkCUm9LiN/8yrnVxHA9G7
 3EPyJazI559SsnxXJR32udGPJWZV1HZ7D5gbxDvzr5rZ9EX0JpyPGJsuXUR1wqlS
 UB2Y7AUTSxkwDiZ8UhPoXn6i67WAirzEsP2WmdS4v6NEbxlNloLGTIeGwcwkCRMU
 DBvMtDW8kKusgVu/OkEUgoC6MTRt+Mg+gZcQI/C4sp0MqZGaMY6c7abnYjqwEzBV
 ARS7bUYyME2GL6wNDPFB8esuD9jjdFXy96bGHATmzMxT3012K3X7ufFOzJZ+GOF9
 pan00fgoC17oiI+Xu/sZEHns6KvMTSE11Aw3uk+yhHxYtZbzWi2B5Nk+4tBdsOxF
 PAZdZ5qsyuEcBw+PyfbyZIHWOrlbvZkrmjiIsMJo63cIXuOtgraCjvRRAwe/ZwoU
 PXgPcUmrlAs06WjKhuQAZWt6bww7cEP2XyOYlDqwZ4Vj0dqav6g=
 =187C
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic fixes from Arnd Bergmann:
 "There is one build fix for Arm platforms that ended up impacting most
  architectures because of the way the drivers/firmware Kconfig file is
  wired up:

  The CONFIG_QCOM_SCM dependency have caused a number of randconfig
  regressions over time, and some still remain in v5.15-rc4. The fix we
  agreed on in the end is to make this symbol selected by any driver
  using it, and then building it even for non-Arm platforms with
  CONFIG_COMPILE_TEST.

  To make this work on all architectures, the drivers/firmware/Kconfig
  file needs to be included for all architectures to make the symbol
  itself visible.

  In a separate discussion, we found that a sound driver patch that is
  pending for v5.16 needs the same change to include this Kconfig file,
  so the easiest solution seems to have my Kconfig rework included in
  v5.15.

  Finally, the branch also includes a small unrelated build fix for
  NOMMU architectures"

Link: https://lore.kernel.org/all/20210928153508.101208f8@canb.auug.org.au/
Link: https://lore.kernel.org/all/20210928075216.4193128-1-arnd@kernel.org/
Link: https://lore.kernel.org/all/20211007151010.333516-1-arnd@kernel.org/

* tag 'asm-generic-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic/io.h: give stub iounmap() on !MMU same prototype as elsewhere
  qcom_scm: hide Kconfig symbol
  firmware: include drivers/firmware/Kconfig unconditionally
2021-10-08 11:57:54 -07:00
Biju Das
a83ad872f4 arm64: dts: renesas: r9a07g044: Add SDHI nodes
Add SDHI{0, 1} nodes to RZ/G2L SoC DTSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20211007155451.10654-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-08 15:17:56 +02:00
Wolfram Sang
f28daeedd7 arm64: dts: renesas: falcon-cpu: Add SPI flash via RPC
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20211006085836.42155-5-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-08 15:16:02 +02:00
Duc Nguyen
5de968a25a arm64: dts: renesas: r8a779a0: Add RPC node
Add device node for RPC on R8A779A0 SoC.

Signed-off-by: Duc Nguyen <duc.nguyen.ub@renesas.com>
[wsa: rebased]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20211006085836.42155-4-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-08 15:16:02 +02:00
Lad Prabhakar
9223cb663e arm64: dts: renesas: r9a07g044: Add SPI Multi I/O Bus controller node
Add SPI Multi I/O Bus controller node to R9A07G044 (RZ/G2L) SoC DTSI.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20210928155852.32569-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-10-08 15:15:13 +02:00
Enric Balletbo i Serra
4bdb00edbd arm64: dts: mt8183: Add the mmsys reset bit to reset the dsi0
Reset the DSI hardware is needed to prevent different settings between
the bootloader and the kernel.

While here, also remove the undocumented and also not used
'mediatek,syscon-dsi' property.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210930103105.v4.5.I933f1532d7a1b2910843a9644c86a7d94a4b44e1@changeid
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-10-08 15:11:14 +02:00
Enric Balletbo i Serra
7fdb1bc3d9 arm64: dts: mt8173: Add the mmsys reset bit to reset the dsi0
Reset the DSI hardware is needed to prevent different settings between
the bootloader and the kernel.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210930103105.v4.4.I7bd7d9a8da5e2894711b700a1127e6902a2b2f1d@changeid
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-10-08 15:11:13 +02:00
Enric Balletbo i Serra
f07c776f6d arm64: dts: mediatek: Move reset controller constants into common location
The DT binding includes for reset controllers are located in
include/dt-bindings/reset/. Move the Mediatek reset constants in there.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20210930103105.v4.1.I514d9aafff3a062f751b37d3fea7402f67595b86@changeid
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2021-10-08 15:11:13 +02:00
Linus Torvalds
3e899c7209 ARM: SoC fixes for v5.15
This is a larger than normal update for Arm SoC specific code, most
 of it in device trees, but also drivers and the omap and at91/sama7
 platforms:
 
  - There are four new entries to the MAINTAINERS file: Sven Peter and
    Alyssa Rosenzweig for Apple M1, Romain Perier for Mstar/sigmastar,
    and Vignesh Raghavendra for TI K3
 
  - Build fixes to address randconfig warnings in sharpsl, dove, omap1,
    and qcom platforms as well as the  scmi and op-tee subsystems
 
  - Regression fixes for missing CONFIG_FB and other options for several
    defconfigs
 
  - Several bug fixes for the newly added Microchip SAMA7 platform,
    mostly regarding power management
 
  - Missing SMP barriers to protect accesses to SCMI virtio device
 
  - Regression fixes for TI OMAP, including a boot-time hang on am335x.
 
  - Lots of bug fixes for NXP i.MX, mostly addressing incorrect settings
    in devicetree files, and one revert for broken suspend.
 
  - Fixes for ARM Juno/Vexpress devicetree files, addressing a couple
    of schema warnings.
 
  - Regression fixes for qualcomm SoC specific drivers and devicetree
    files, reverting an mdt_loader change and at least pastially
    reverting some of the 5.15 DTS changes, plus some minor bugfixes
 
 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFfXRgACgkQmmx57+YA
 GNk2ig//eDxbnQPFbltxAHboSaS7S6S/s3MTLC7vqwlv7n4ypINgKEGTD+kOpQ37
 zPhR+30+qHTPFI2LRFyN+iTaz/D+MP1/pRGKieXlSfQew4FvLW+aQvkhs/LLA6Qr
 jB5GJEqVKbzsfM3+GkxJ3uI44BUOUji7lCJWHDrToa40chz+I1nuORybeLgBtV/7
 D7f047FtB4cgScoZ6ZhLWysjcvIEi2+9PfMbmGPF3bZrjRLESniXqJ4pT6kiv7OF
 +rq+Bg4pkDqL6qUjMwAhIorH1dNXHi5qwr8ET23/mpefxJJQzbEO725j6ANOKHR1
 2neA+Eaghu7jfUdNQe4c8oY4lHnfsWIJInji4Sv0Yc8xivvQF+Mrzc1lzgA8o9VQ
 Tb9+bcE+xjkalwXVdVTp2FfyGh8E/cA87uv1qdprghEHjR07evs/AJZag3CjRqik
 c3FIODyQtG/RlVQxZR6PFOKxO1dQ0Qwqg5FSBTlfdT/rEG5no8KhWJYwLhXCsKGL
 O70LTspSLiaT1Gc93EeC6dWYVrLAkfnStwTF233Sq/apE5ouCEHqF4OSJvh2yaEO
 gVw50MC4BC5mJpzUQZEgZj3cntp4WGqbERYhL0bXyqPp9dGfCrPNaThN8x/CMqrG
 2z/KDKmuY3lhilEnO+s+fZI81Yl+VQsl+v1jh1En6yBqeRFU0Iw=
 =Mrh2
 -----END PGP SIGNATURE-----

Merge tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "This is a larger than normal update for Arm SoC specific code, most of
  it in device trees, but also drivers and the omap and at91/sama7
  platforms:

   - There are four new entries to the MAINTAINERS file: Sven Peter and
     Alyssa Rosenzweig for Apple M1, Romain Perier for Mstar/sigmastar,
     and Vignesh Raghavendra for TI K3

   - Build fixes to address randconfig warnings in sharpsl, dove, omap1,
     and qcom platforms as well as the scmi and op-tee subsystems

   - Regression fixes for missing CONFIG_FB and other options for
     several defconfigs

   - Several bug fixes for the newly added Microchip SAMA7 platform,
     mostly regarding power management

   - Missing SMP barriers to protect accesses to SCMI virtio device

   - Regression fixes for TI OMAP, including a boot-time hang on am335x.

   - Lots of bug fixes for NXP i.MX, mostly addressing incorrect
     settings in devicetree files, and one revert for broken suspend.

   - Fixes for ARM Juno/Vexpress devicetree files, addressing a couple
     of schema warnings.

   - Regression fixes for qualcomm SoC specific drivers and devicetree
     files, reverting an mdt_loader change and at least pastially
     reverting some of the 5.15 DTS changes, plus some minor bugfixes"

* tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (64 commits)
  MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer
  MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer
  firmware: arm_scmi: Add proper barriers to scmi virtio device
  firmware: arm_scmi: Simplify spinlocks in virtio transport
  ARM: dts: omap3430-sdp: Fix NAND device node
  bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893
  ARM: sharpsl_param: work around -Wstringop-overread warning
  ARM: defconfig: gemini: Restore framebuffer
  ARM: dove: mark 'putc' as inline
  ARM: omap1: move omap15xx local bus handling to usb.c
  MAINTAINERS: Add Vignesh to TI K3 platform maintainership
  arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio
  ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence
  arm64: dts: ls1028a: fix eSDHC2 node
  arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins
  ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs
  ARM: at91: pm: preload base address of controllers in tlb
  ARM: at91: pm: group constants and addresses loading
  ARM: dts: at91: sama7g5ek: add suspend voltage for ddr3l rail
  ...
2021-10-07 14:01:29 -07:00
Mauro Carvalho Chehab
b9e2404c8b arm64: tegra: Fix pcie-ep DT nodes
As defined by Documentation/devicetree/bindings/pci/pci-ep.yaml,
PCIe endpoints match this pattern:

	properties:
	  $nodename:
	    pattern: "^pcie-ep@"

Change the existing ones in order to avoid those warnings:

	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dt.yaml: pcie_ep@14160000: $nodename:0: 'pcie_ep@14160000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dt.yaml: pcie_ep@14180000: $nodename:0: 'pcie_ep@14180000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dt.yaml: pcie_ep@141a0000: $nodename:0: 'pcie_ep@141a0000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0000.dt.yaml: pcie_ep@14160000: $nodename:0: 'pcie_ep@14160000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0000.dt.yaml: pcie_ep@14180000: $nodename:0: 'pcie_ep@14180000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0000.dt.yaml: pcie_ep@141a0000: $nodename:0: 'pcie_ep@141a0000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dt.yaml: pcie_ep@14160000: $nodename:0: 'pcie_ep@14160000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dt.yaml: pcie_ep@14180000: $nodename:0: 'pcie_ep@14180000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
	arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dt.yaml: pcie_ep@141a0000: $nodename:0: 'pcie_ep@141a0000' does not match '^pcie-ep@'
		From schema: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 21:23:37 +02:00
Thierry Reding
056474013c arm64: tegra: Remove useless usb-ehci compatible string
There's no such thing as a generic USB EHCI controller. The EHCI
controllers found on Tegra SoCs are instantiations that need Tegra-
specific glue to work properly, so drop the generic compatible string
and keep only the Tegra-specific ones.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 21:00:09 +02:00
Sameer Pujar
1e9b816166 arm64: defconfig: Enable few Tegra210 based AHUB drivers
Enable configs for following modules:
 * SFC (Sampling Frequency Converter)
 * MVC (Master Volume Control)
 * AMX (Audio Multiplexer)
 * ADX (Audio Demultiplexer)
 * Mixer

These configs are used on Tegra186 and later SoCs as well.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 20:37:23 +02:00
Sameer Pujar
4f45fb0bd3 arm64: tegra: Extend APE audio support on Jetson platforms
Extend APE audio support by adding more audio components such as SFC,
MVC, AMX, ADX and Mixer. These components can be plugged into an audio
path and required processing can be done. ASoC audio-graph based sound
driver is used to facilitate this and thus extend sound bindings as
well.

The components in the path may require different PCM parameters (such
as sample rate, channels or sample size). Depending on the pre-defined
audio paths, these can be statically configured with "convert-xxx" DT
properties in endpoint subnode. The support for the rate and channel
conversion is already available in generic audio-graph driver. Sample
size conversion support can be added based on the need in future.

The support is extended for following platforms:
 * Jertson TX1
 * Jetson Nano
 * Jetson TX2
 * Jetson AGX Xavier
 * Jetson Xavier NX

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 20:36:22 +02:00
Sameer Pujar
848f3290ab arm64: tegra: Add few AHUB devices for Tegra210 and later
Add DT nodes for following AHUB devices:
 * SFC (Sampling Frequency Converter)
 * MVC (Master Volume Control)
 * AMX (Audio Multiplexer)
 * ADX (Audio Demultiplexer)
 * Mixer

Above devices are added for Tegra210, Tegra186 and Tegra194 generations
of Tegra SoC.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 20:35:54 +02:00
David Heidelberg
e1b863e615 arm64: tegra: Remove unused backlight-boot-off property
The backlight-boot-off property was proposed as a patch, but ended not
being accepted since different solution was already in the place:

    https://patchwork.kernel.org/project/linux-arm-kernel/patch/1406806970-12561-1-git-send-email-thierry.reding@gmail.com/#21327479

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-07 20:35:23 +02:00
Arnd Bergmann
951cd3a086
firmware: include drivers/firmware/Kconfig unconditionally
Compile-testing drivers that require access to a firmware layer
fails when that firmware symbol is unavailable. This happened
twice this week:

 - My proposed to change to rework the QCOM_SCM firmware symbol
   broke on ppc64 and others.

 - The cs_dsp firmware patch added device specific firmware loader
   into drivers/firmware, which broke on the same set of
   architectures.

We should probably do the same thing for other subsystems as well,
but fix this one first as this is a dependency for other patches
getting merged.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Simon Trimmer <simont@opensource.cirrus.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-07 16:51:26 +02:00
Zenghui Yu
2da25852c3
arm64: defconfig: drop obsolete ARCH_* configs
Per commit 4a9a1a5602 ("arm64: socfpga: merge Agilex and N5X into
ARCH_INTEL_SOCFPGA") and commit 89d4f98ae9 ("ARM: remove zte zx
platform"), they can be dropped from defconfig now.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-07 15:13:48 +02:00
André Almeida
ea7c45fde5 futex,arm: Wire up sys_futex_waitv()
Wire up syscall entry point for ARM architectures, for both 32 and 64-bit.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210923171111.300673-19-andrealmeid@collabora.com
2021-10-07 13:51:12 +02:00
Vincenzo Frascino
ec0288369f arm64: mte: Add asymmetric mode support
MTE provides an asymmetric mode for detecting tag exceptions. In
particular, when such a mode is present, the CPU triggers a fault
on a tag mismatch during a load operation and asynchronously updates
a register when a tag mismatch is detected during a store operation.

Add support for MTE asymmetric mode.

Note: If the CPU does not support MTE asymmetric mode the kernel falls
back on synchronous mode which is the default for kasan=on.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20211006154751.4463-5-vincenzo.frascino@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-07 09:30:24 +01:00
Vincenzo Frascino
d73c162e07 arm64: mte: CPU feature detection for Asymm MTE
Add the cpufeature entries to detect the presence of Asymmetric MTE.

Note: The tag checking mode is initialized via cpu_enable_mte() ->
kasan_init_hw_tags() hence to enable it we require asymmetric mode
to be at least on the boot CPU. If the boot CPU does not have it, it is
fine for late CPUs to have it as long as the feature is not enabled
(ARM64_CPUCAP_BOOT_CPU_FEATURE).

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <Suzuki.Poulose@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20211006154751.4463-4-vincenzo.frascino@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-07 09:21:57 +01:00
Vincenzo Frascino
ba1a98e8b1 arm64: mte: Bitfield definitions for Asymm MTE
Add Asymmetric Memory Tagging Extension bitfield definitions.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20211006154751.4463-3-vincenzo.frascino@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-07 09:21:57 +01:00
Mikko Perttunen
78a058737b arm64: tegra: Add NVDEC to Tegra186/194 device trees
Add a device tree node for NVDEC on Tegra186, and
device tree nodes for NVDEC and NVDEC1 on Tegra194.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-06 20:17:00 +02:00
Arnd Bergmann
2250596374 i.MX fixes for 5.15, round 2:
- A couple of fixes from Haibo Chen to update SPI NOR TX bus width for
   i.MX6 and i.MX8 boards.  This becomes necessary because spi-nor driver
   starts using the setting in DT.
 - Mark buck2 always-on for i.MX8MM Kontron-n801x-som board to avoid the
   core supply being turned off unexpectedly.
 - Fix eSDHC2 device tree settings for LS1028A SoC.
 - Disable GIC CPU interface before calling stby-poweroff sequence to fix
   power-off failure on i.MX6.
 - Fix M2_RST# GPIO pinmux on i.MX8M venice-gw7902 boards.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmFdm+0UHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7LyAf/QS/9SEi7xwgmsE6ywozsk/VZB8Ze
 77MSlR1U/HoqtreF9RNGB31Wv2TI0Cxi05TEbSonFDrk4rHFdh158YQZk8sINWOT
 AXIWso6qMqCA8onmHkTLgYKj2rFBdfzKffhdv/IhmIPW08DouFxRq1sHFOae0Dv4
 Lo+4fhHqd3OYGPAi3Po9DgYOjJt7VujY7XRJJIrq3RMarxbXDAbpz7W12ioB/j1T
 x24jxEnaDfgpfNiCRoks2CEttnA28iIY3BXMH6J37ilFrKWTdyT45oIFe4bs8u7n
 ZRuwJs8W5FclRYVquXkDlh/i/h1YmxdDs80lseQl9G/dsZZ3oKxE+VpNrA==
 =Xtlw
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFdwoIACgkQmmx57+YA
 GNkVjA//TPxAY3Egild9GdtZgUUMYsK8WDG54aia8UyL6G3v9z3x6kWs/kkWJSBv
 sF+3Tr9935BvhlQiAuzM/8DZ8whlTDdXCB1MVCLqQRBkccwEij9qdGhDhllQiVt3
 bzMyFZgyr3e0GqsulD8bMkh6FE6i7Mm3f0FTe4XgW6TFreWz3mq1rz6I2UYtIn86
 47gbxAHUPgcM6LXBEYmbRk16p6Y5vCF/IVXMZuz5cYEgGn2oxttLW2f3jSlSs6k0
 xP9u7UCFSSnL1WCcq8NHBrKvAyv9GCxrXXoi/C1WxvtGp/FqftCucLgS5NsAdaf6
 23KOzyzrpHDHeCsr8iN2jXoy/HTk5highh7qrKac4y/AcKQAtK9ljHVFBWiqAY2f
 D5wM3PZaLxTiiSamHumOniYqyp+BoMRqqCsVNh+elzvHOM8ODjwX/AQ6JAnnDsX1
 T+LpKbUwRF5tpPaoA1AlS/kpe8bLAgqmcxXWOqoqF5TIc97so+Lce3MHA/c4druC
 K5/1vW9KH+1SaLif8NJr86hEZJ78sVyfUMNktT4qAMeDsAVBVt8z3zPH7HbOhFy5
 VTLQj9otXnC2+35veqgBdg7rOA2fORv+LlS3gKBGC4am5ZO0GiqMn2xLpXB8S/yM
 JHoysZBwMjiV9wVc+LZ8vZG4XXMHBQYk9U1D7PIOwTjfC52O/+s=
 =lVwf
 -----END PGP SIGNATURE-----

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

i.MX fixes for 5.15, round 2:

- A couple of fixes from Haibo Chen to update SPI NOR TX bus width for
  i.MX6 and i.MX8 boards.  This becomes necessary because spi-nor driver
  starts using the setting in DT.
- Mark buck2 always-on for i.MX8MM Kontron-n801x-som board to avoid the
  core supply being turned off unexpectedly.
- Fix eSDHC2 device tree settings for LS1028A SoC.
- Disable GIC CPU interface before calling stby-poweroff sequence to fix
  power-off failure on i.MX6.
- Fix M2_RST# GPIO pinmux on i.MX8M venice-gw7902 boards.

* tag 'imx-fixes-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio
  ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence
  arm64: dts: ls1028a: fix eSDHC2 node
  arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  arm64: dts: imx8: change the spi-nor tx
  ARM: dts: imx: change the spi-nor tx

Link: https://lore.kernel.org/r/20211006125734.GA10197@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-06 17:36:34 +02:00
Stefan Wahren
1d71d54346 arm64: dts: broadcom: Add reference to RPi CM4 IO Board
This adds a reference to the dts of the Raspberry Pi Compute Module 4
IO Board, so we don't need to maintain the content in arm64.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1628334401-6577-11-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
2021-10-06 09:53:36 +02:00
Sinthu Raja
f46d16cf5b arm64: dts: ti: k3-j721e-sk: Add DDR carveout memory nodes
Two carveout reserved memory nodes each have been added for each of the
other remote processors devices within the MAIN domain on the TI J721E
SK boards. These nodes are assigned to the respective rproc device nodes
as well. The first region will be used as the DMA pool for the rproc
devices, and the second region will furnish the static carveout regions
for the firmware memory.

An additional reserved memory node is also added to reserve a portion of
the DDR memory to be used for performing inter-processor communication
between all the remote processors running RTOS or baremetal firmwares.
8 MB of memory is reserved for this purpose, and this accounts for all
the vrings and vring buffers between all the possible pairs of remote
processors.

The current carveout addresses and sizes are defined statically for each
rproc device. The R5F processors do not have an MMU, and as such require
the exact memory used by the firmwares to be set-aside. The C71x DSP
processor does support a MMU called CMMU, but is not currently supported
and as such requires the exact memory used by the firmware to be
set-aside. The firmware images do not require any RSC_CARVEOUT entries
in their resource tables to allocate the memory for firmware memory
segments

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20210929081333.26454-5-sinthu.raja@ti.com
2021-10-05 17:46:40 -05:00
Sinthu Raja
e910e5b676 arm64: dts: ti: k3-j721e-sk: Add IPC sub-mailbox nodes
Add the sub-mailbox nodes that are used to communicate between MPU and
various remote processors present in the J721E SoCs to the J721E EAIK
board. These include the R5F remote processors in the dual-R5F cluster
(MCU_R5FSS0) in the MCU domain and the two dual-R5F clusters
(MAIN_R5FSS0 & MAIN_R5FSS1) in the MAIN domain; the two C66x DSP remote
processors and the single C71x DSP remote processor in the MAIN domain.
These sub-mailbox nodes utilize the System Mailbox clusters 0 through 4.
All the remaining mailbox clusters are currently not used on A72 core,
and are hence disabled.

The sub-mailbox nodes added match the hard-coded mailbox configuration
used within the TI RTOS IPC software packages. The R5F processor
sub-systems are assumed to be running in Split mode, so a sub-mailbox
node is used by each of the R5F cores. Only the sub-mailbox node for
the first R5F core in each cluster is used in case of a Lockstep mode
for that R5F cluster.

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20210929081333.26454-4-sinthu.raja@ti.com
2021-10-05 17:46:40 -05:00
Sinthu Raja
1bfda92a3a arm64: dts: ti: Add support for J721E SK
J721E Starter Kit (SK)[1] is a low cost, small form factor board designed
for TI’s J721E SoC. TI’s J721E SoC comprises of dual core A72, high
performance vision accelerators, video codec accelerators, latest C71x
and C66x DSP, high bandwidth real-time IPs for capture and display, GPU,
dedicated safety island and security accelerators. The SoC is power
optimized to provide best in class performance for industrial and
automotive applications.

    J721E SK supports the following interfaces:
    * 4 GB LPDDR4 RAM
    * x1 Gigabit Ethernet interface
    * x1 USB 3.0 Type-C port
    * x3 USB 3.0 Type-A ports
    * x1 PCIe M.2 E Key
    * x1 PCIe M.2 M Key
    * 512 Mbit OSPI flash
    * x2 CSI2 Camera interface (RPi and TI Camera connector)
    * 40-pin Raspberry Pi GPIO header

Add basic support for J721E-SK.

[1] https://www.ti.com/tool/SK-TDA4VM

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20210929081333.26454-3-sinthu.raja@ti.com
2021-10-05 17:46:40 -05:00
Jan Kiszka
614d47cc93 arm64: dts: ti: iot2050: Add support for product generation 2 boards
This adds the devices trees for IOT2050 Product Generation 2 (PG2)
boards. We have Basic and an Advanced variants again, differing in
number of cores, RAM size, availability of eMMC and further details.
The major difference to PG1 is the used silicon revision (SR2.x on
PG2).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/cc868da8264324bde2c87d0c01d4763e3678c706.1632657917.git.jan.kiszka@web.de
2021-10-05 17:46:40 -05:00
Jan Kiszka
a9dbf044c6 arm64: dts: ti: iot2050: Prepare for adding 2nd-generation boards
The current IOT2050 devices are Product Generation 1 (PG1), using SR1.0
AM65x silicon. Upcoming PG2 devices will use SR2.x SoCs and will
therefore need separate device trees. Prepare for that by factoring out
common bits that will be shared across both generations.

At this chance, drop a link to the product homepage to in the top-level
dts files. Also fix a typo in my email address in some headers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/31fece05f9728a852c0632985c4fa537cced4ece.1632657917.git.jan.kiszka@web.de
2021-10-05 17:46:40 -05:00
Jan Kiszka
af755fe2b3 arm64: dts: ti: iot2050: Add/enabled mailboxes and carve-outs for R5F cores
Analogously to the am654-base-board, configure the mailboxes for the two
R5F cores, add them and the already existing memory carve-outs to the
related MCU nodes. Allows to load applications under Linux onto the
cores, e.g. the RTI watchdog firmware.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/1776f8be19b39a938d9248fcfc5332b753783c3e.1632657917.git.jan.kiszka@web.de
2021-10-05 17:46:40 -05:00
Jan Kiszka
262a98b43c arm64: dts: ti: iot2050: Disable SR2.0-only PRUs
The IOT2050 devices described so far are using SR1.0 silicon, thus do
not have the additional PRUs of the ICSSG of the SR2.0. Disable them.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Aswath Govindraju <a-govindraju@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/189a91866fb1af02e4fd2345dc56774aa069d5ba.1632657917.git.jan.kiszka@web.de
2021-10-05 17:46:40 -05:00
Jan Kiszka
06784f7679 arm64: dts: ti: iot2050: Flip mmc device ordering on Advanced devices
This ensures that the SD card will remain mmc0 across Basic and Advanced
devices, also avoiding surprises for users coming from the downstream
kernels.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/fe20d6346f119a28e47d129b616682001299cf0e.1632657917.git.jan.kiszka@web.de
2021-10-05 17:46:39 -05:00
Nishanth Menon
2cf3213d23 arm64: dts: ti: k3-j7200-common-proc-board: Add j7200-evm compatible
Add j7200-evm compatible to the board to allow the board to distinguish
itself from other platforms that may be added in the future.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210925201430.11678-5-nm@ti.com
2021-10-05 17:46:39 -05:00
Nishanth Menon
c47eebaf4d arm64: dts: ti: k3-j721e-common-proc-board: Add j721e-evm compatible
Add j721e-evm compatible to the board to allow the board to distinguish
itself from other platforms that are pending to be added.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210925201430.11678-4-nm@ti.com
2021-10-05 17:46:39 -05:00
Nishanth Menon
e94575e1b0 arm64: dts: ti: Makefile: Collate AM64 platforms together
Make sure that the platforms are grouped together per SoC. This helps
keep the Makefile readable as newer platforms get added to the list.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210915121442.27112-1-nm@ti.com
2021-10-05 17:46:39 -05:00
Suman Anna
c9087e3898 arm64: dts: ti: k3-am64-main: Add ICSSG nodes
Add the DT nodes for the ICSSG0 and ICSSG1 processor subsystems that are
present on the K3 AM64x SoCs. The two ICSSGs are identical to each other
for the most part, with some of the peripheral pins from ICSSG1 not pinned
out. Each ICSSG instance is represented by a PRUSS subsystem node and other
child nodes.

The nodes are all added and enabled in the common k3-am64-main.dtsi
file by default. The MDIO nodes need pinctrl lines, and so should be
enabled only on boards where they are actually wired and pinned out
for ICSSG Ethernet. Any new board dts file should disable these if
they are not sure. These are disabled in the existing AM64x board dts
files to begin with.

The ICSSGs on K3 AM64x SoCs are very similar to the versions of the ICSSG
on K3 J721E and AM65x SR2.0 SoCs. The IRAM and BroadSize RAM sizes are all
identical to those on J721E SoCs. All The ICSSG host interrupts intended
towards the main Arm core are also shared with other processors on the SoC,
and can be partitioned as per system integration needs.

The ICSSG subsystem node contains the entire address space. The various
sub-modules of the ICSSG are represented as individual child nodes (so
platform devices themselves) of the PRUSS subsystem node. These include:
 - two Programmable Real-Time Units (PRUs)
 - two auxiliary PRU cores called RTUs
 - two Transmit Programmable Real-Time Units (Tx_PRUs)
 - Interrupt controller (INTC)
 - a 'memories' node containing all the ICSSG level Data RAMs
 - Real Time Media Independent Interface controller (MII_RT)
 - Gigabit capable MII_G_RT
 - ICSSG CFG sub-module providing two internal clock muxes, with the
   default clock parents also assigned using the assigned-clock-parents
   property.

The default names for the firmware images for each PRU, RTU and Tx_PRU
cores are defined as follows using the 'firmware-name' property (these
can be adjusted either in derivative board dts files or through sysfs at
runtime if required):
 ICSSG0 PRU0 Core    : am64x-pru0_0-fw   ; PRU1 Core    : am64x-pru0_1-fw
 ICSSG0 RTU0 Core    : am64x-rtu0_0-fw   ; RTU1 Core    : am64x-rtu0_1-fw
 ICSSG0 Tx_PRU0 Core : am64x-txpru0_0-fw ; Tx_PRU1 Core : am64x-txpru0_1-fw
 ICSSG1 PRU0 Core    : am64x-pru1_0-fw   ; PRU1 Core    : am64x-pru1_1-fw
 ICSSG1 RTU0 Core    : am64x-rtu1_0-fw   ; RTU1 Core    : am64x-rtu1_1-fw
 ICSSG1 Tx_PRU0 Core : am64x-txpru1_0-fw ; Tx_PRU1 Core : am64x-txpru1_1-fw

Note:
1. The ICSSG INTC on AM64x SoCs share all the host interrupts with other
   processors, so use the 'ti,irqs-reserved' property in derivative board
   dts files _if_ any of them should not be handled by the host OS.
2. There are few more sub-modules like the Industrial Ethernet Peripherals
   (IEPs), eCAP, PWM, UART that do not have bindings and so will be added
   in the future.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20210919202935.15604-1-s-anna@ti.com
2021-10-05 17:46:39 -05:00
Saravana Kannan
81967efb5f drivers: bus: Delete CONFIG_SIMPLE_PM_BUS
The simple-pm-bus driver is mandatory for CONFIG_OF based platforms to work
with fw_devlink. So, always compile it in for CONFIG_OF and delete the
config since it's no longer necessary.

Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20210929000735.585237-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-05 17:47:22 +02:00
Arnd Bergmann
8839e60e15 Renesas ARM DT updates for v5.16
- I2C EEPROM support on the RZA2MEVB development board,
   - DMA, USB2.0, and audio support for the RZ/G2L SoC,
   - USB2.0, I2C, audio, ADC, and CANFD support for the RZ/G2L SMARC EVK
     development board,
   - Support for more R-Car Gen3e SoCs (H3e, M3e, M3Ne(-2G), D3e, E3e,
     H3Ne),
   - PWM support for the R-Car M3-W+ and V3U SoCs,
   - IPMMU support for SDHI on the R-Car V3U SoC,
   - Switches support for the Falcon development board,
   - Improve Ethernet PHY descriptions to fix reset handling after kexec,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCYVbUMwAKCRCKwlD9ZEnx
 cC3lAQCXJwi2QXqvWKKLPmnkT7GwD5OaF4F1ykBmfExD3fHpcwD5ATmkHwvIGkRG
 JOH1BDNSmcq36xwaAsRXmCAWm0dG6wE=
 =HxRU
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFcXegACgkQmmx57+YA
 GNlydA/9Ff5XmmzVi3syHkc/whtmy8nWD2RpweGRbLXQK7N95nbYxsYkIp42xNMI
 SaErs6QvpTsM9Les2khRjnStT/UZIXJyzejiGzFCTfNyqO6w7SObzS1h2fcxwemh
 EYpbIDCqsvI+Hh1+AT4vOare3uYnsRijTqCyVEQ/0zKdANmRAx5f4P6J9q69nfX7
 nSwg/qIKOeB1X1EOUd6P2l/UySHhCOCmGxibxJbjc9IAlo+kitByw8pjpdwJOxvJ
 R3sxRgNwSGRx2JwtiB613C6sQRu6k9960GcEJvXVlU72IKZSiwOdv/aYHWkeL6Ul
 zarqSqtZNjxmqefcyfKpqw1ENn6KGcqYz7X5DVNJbV1yzs/eAeWb3nBr3bDyfwro
 1JRAr07tC8dS9bZCjO7uXNs4xbC4cztJtgzHYBKfS30G/Hbc4eQ9+WyPW8pYf4/8
 qxigbATpKhQojpZuvH84EhWzVl6gSaU6m6vaz0UJqsIlu9lOf2vE9gFkKahAobX+
 0fcylpTZ5eZY8SDe1l033vH+/YepYqOAifGPChNe5katwmEMlT9wubbbXKoO5dYd
 mdglOlyT3s8PyxePDMIBnax1TsZYHC43FqVTByMJq6tDNfkblcLbHILqpudGy5Hx
 Mj87uzNifsSPpRFghXy7FSac6D9/9XXFroIIB/n+/j/JCEv0V10=
 =9/VI
 -----END PGP SIGNATURE-----

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

Renesas ARM DT updates for v5.16

  - I2C EEPROM support on the RZA2MEVB development board,
  - DMA, USB2.0, and audio support for the RZ/G2L SoC,
  - USB2.0, I2C, audio, ADC, and CANFD support for the RZ/G2L SMARC EVK
    development board,
  - Support for more R-Car Gen3e SoCs (H3e, M3e, M3Ne(-2G), D3e, E3e,
    H3Ne),
  - PWM support for the R-Car M3-W+ and V3U SoCs,
  - IPMMU support for SDHI on the R-Car V3U SoC,
  - Switches support for the Falcon development board,
  - Improve Ethernet PHY descriptions to fix reset handling after kexec,
  - Miscellaneous fixes and improvements.

* tag 'renesas-arm-dt-for-v5.16-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (45 commits)
  arm64: dts: renesas: rcar-gen3: Add missing Ethernet PHY resets
  ARM: dts: rzg1: Add missing Ethernet PHY resets
  ARM: dts: r-mobile: Add missing Ethernet PHY resets
  arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet PHYs
  arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
  arm64: dts: renesas: Add compatible properties to AR8031 Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to uPD6061x Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to RTL8201FL Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to LAN8710A Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to KSZ8081 Ethernet PHYs
  ARM: dts: renesas: Add compatible properties to KSZ8041 Ethernet PHYs
  arm64: dts: renesas: beacon: Fix Ethernet PHY mode
  ARM: dts: renesas: Fix SMSC Ethernet compatible values
  arm64: dts: renesas: rzg2l-smarc: Enable CANFD
  arm64: dts: renesas: rzg2l-smarc-som: Enable ADC on SMARC platform
  arm64: dts: renesas: rzg2l-smarc-som: Move extal and memory nodes to SOM DTSI
  arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW47-SW49 support
  arm64: dts: renesas: rzg2l-smarc: Add Mic routing
  arm64: dts: renesas: rzg2l-smarc: Enable audio
  ...

Link: https://lore.kernel.org/r/cover.1633081147.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-05 16:15:04 +02:00
Arnd Bergmann
0ddc52da03 This contains the parts that were originally meant for 5.15 + some
new thing:
 
 New boards: Firefly roc-rk3399-pc-pls and rk3328-pc; Scarlet-Dumo
 tablet variant; Rock Pi 4 A+, B+; Pine64 Quartz64-A (rk3566-based)
 
 Big additions for the rk3568: tsadc; saradc; gpio-support; gmac 1+2;
 watchdog; pmu; io-domains and enabling these new things on the
 rk3568-evb.
 
 Addition of the rk3566 - a variant of the rk3568 with slightly less
 peripherals.
 
 SFC (serial flash controller) for rk3308 and px30 (including the
 Odroid Go2)
 
 Support for the rk3399's second image signal processor and its coresight
 component. And camera + vpu support on px30.
 
 A number of smaller additions to multiple boards (Rock Pi 4, Pinebook Pro
 and helios64, lion-haikou, Odroid-Go2) and cleanups in some parts.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmFReesQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgaOAB/9GKqxpGASvceWq1ZBflL1VLHBWUj8LsK5l
 gcHqDtafPuUyXx8fAbD7ND+Rwg9syBHY1p5VnXLqem4iHAluLGFAVAdjjNEVhytV
 S6CAcrAcwk8sWjRxN/8ivNKTx7mhXKZAyytvZfRcox2f8oUwuuigchuJxiGK24LW
 4XsuMrHkwijPyr1JjFwTbqgdMkIICCPBWpRI0RQHSTulDFCBCEfussYPIw8H+iQ5
 KTy1rr7GdpLPIVCOXiHM4KJ2/Uy+a6C8049dExe+Gwg92kj7EhRb3kub+eLZqbJT
 6vapPbI0AFiirZ1RI2Gf2yUUAI1yZEB4ABxWVD1yZot0+hGuUIBT
 =jjAv
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFcXJYACgkQmmx57+YA
 GNlbpw/8D6WpBRD2Ooq4psIph4cEIbQ5k8qKz8Ku64j4c3gSUyoOe4ftgA3ptha4
 DjkJYFHBactVUj7pEYO/F/cEaVl4G+xafSOiDDdVL2CLSDHOWxV+ln3abGGHpjsS
 Y/Xvffmi7/ORH9wGEBruIBIVOM0iqfDtDlfFaphaj4hzxrGxQ7jjOZ9zJxwfh0OB
 TQklFaUv0kXl2eV0Gb+M+UfksT+zBSVxEjvXwQ65nzyG3kqQX6gdN67808jzD2sb
 jD6GS2zOp8dHmMQ5KthkaSBSzG0RJR3i72SSb5eeW+cMzO+Lrcv0Ies6ME7A5D4+
 NPUGZZkkL/4sI4DROcPjMHubS5KU6tpFUVBxunyNi6KqVsNQi/uzrGAW+pWmUS1O
 m2v7WICTcacErsr/4j0y8HIAHmgqU7Xbwdvx0AENvshKYMWyX7CPQDGvJBA6+aGf
 PY0xZoiaK0y6omD1TZGon+PmSTDO3fFz8EekjEdVtbt5ohTQDwzFemRF6KOqybT1
 Tk4UwbtVZt+bATREnPef5e+upqZwztVCI0zzU8hnmdH/KXAkShzmEFqxYOBX93tW
 +n/i+XxHFv8bGnK8k4QLUopDAJ/dcfevXUaa0v2YPzOAKqRecGrJqBqrrw9crBvW
 YAOpir63TAvUIBjBT9I03XMLJinWKzlws0FSrvO22gK3ejYk30o=
 =5zhA
 -----END PGP SIGNATURE-----

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

This contains the parts that were originally meant for 5.15 + some
new thing:

New boards: Firefly roc-rk3399-pc-pls and rk3328-pc; Scarlet-Dumo
tablet variant; Rock Pi 4 A+, B+; Pine64 Quartz64-A (rk3566-based)

Big additions for the rk3568: tsadc; saradc; gpio-support; gmac 1+2;
watchdog; pmu; io-domains and enabling these new things on the
rk3568-evb.

Addition of the rk3566 - a variant of the rk3568 with slightly less
peripherals.

SFC (serial flash controller) for rk3308 and px30 (including the
Odroid Go2)

Support for the rk3399's second image signal processor and its coresight
component. And camera + vpu support on px30.

A number of smaller additions to multiple boards (Rock Pi 4, Pinebook Pro
and helios64, lion-haikou, Odroid-Go2) and cleanups in some parts.

* tag 'v5.16-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (65 commits)
  arm64: dts: rockchip: add phandles to muxed i2c buses on rk3368-lion
  arm64: dts: rockchip: define iodomains for rk3368-lion
  arm64: dts: rockchip: fix LDO_REG4 / LDO_REG7 confusion on rk3368-lion
  arm64: dts: rockchip: align operating-points table name with dtschema
  arm64: dts: rockchip: hook up camera on px30-evb
  arm64: dts: rockchip: add isp node for px30
  arm64: dts: rockchip: add Coresight debug range for RK3399
  arm64: dts: rockchip: Correct regulator for USB host on Odroid-Go2
  arm64: dts: rockchip: fix PCI reg address warning on rk3399-gru
  arm64: dts: rockchip: add saradc to rk3568-evb1-v10
  arm64: dts: rockchip: Fix GPU register width for RK3328
  arm64: dts: rockchip: Re-add interrupt-names for RK3399's vpu
  arm64: dts: rockchip: add missing rockchip,grf property to rk356x
  arm64: dts: rockchip: add RK3399 Gru gpio-line-names
  arm64: dts: rockchip: Enable SFC for Odroid Go Advance
  arm64: dts: rockchip: Add SFC to RK3308
  arm64: dts: rockchip: Add SFC to PX30
  arm64: dts: rockchip: add thermal support to Quartz64 Model A
  arm64: dts: rockchip: add rk3568 tsadc nodes
  arm64: dts: rockchip: add rk356x gpio debounce clocks
  ...

Link: https://lore.kernel.org/r/4439872.CQOukoFCf9@phil
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-05 16:09:26 +02:00
Arnd Bergmann
db55451509 arm64: dts: ZynqMP DT changes for v5.16
- Fix issues reported by dtbs_check
 - Enable DMAs, DP, USB, NAND on various boards
 - Add description for irps5401
 - Add pinctrl description
 - Add psgtr description for usb3, sata and DP
 - Start to use nvmem alias for eeprom reference
 - Clean up aliases list
 - Wire qspi and usb3.0
 - Add support for zcu102-rev1.1
 - Couple of minor fixes and sync patches
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCYUGo/gAKCRDKSWXLKUoM
 IdIJAJ9kAd96FWmyr9o/CM0iXUU+aefNlACfUtuOkYt4zGmfdLpMUK0jlY0auSQ=
 =nzU4
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFcWtIACgkQmmx57+YA
 GNkBVg//aggPFH6kDCznxNNTmVuqIXwJUXUNEEjD5k7eOIaQKc2K+oZSGz4NbFn6
 /CSifK6FoAJNmNwtzB4B9Vk02lj1WsTM1PqPY90wK03UAgFu0/9gKcgn+wbapjBN
 x010rQ1mgb/813drxPgBoovyx9fyO9nlMW640vx7/x9QvtJEwJtKI+OfUpm/mAVF
 K8QyRswAdYIBmIRZc0qDywcy0EhfdTiJUEEbrQlOXVq/D+hcP3LEo3alMLCSdtku
 Wv0aHMhuS2SPCI9oqRh6TWxt7NVszCxfSJ/Ij6oJQNf6LUARHyQny6niiSOP1Bqt
 vg+JD6OSe3oEFmKn+54haylSDCbkbvgDqkSacssBd+8y0+vxyos8Pgms5c0Y9t9p
 xGSwyKbrrnAOpjRN91GF3CdUSNH/aZUD54EzHk46wE5RvIY6SZKS74DUylsc0TSz
 EgefzWPtuPYA2KvkQ1usDhF7myfXy/yJ5/gLbAeZg0P2U8TRGsznFiCJ1RKhg++y
 KMNFmp+8if/gQ3qKKb973cWA28R9YKByIsiGU9h9A1GUKUj+1DDjDP9HVKXsOKvR
 VXKCbYEcJAvw3idMNq42R22dIwsLBOhPPQu6LM6VKSPemhtZ6EtGPJbH48eLb0VZ
 Z0IwX2YE9H7MbCU5MYCuhpE44mr3hWHbtkuqMsd0bVkiACEYbqI=
 =hI0/
 -----END PGP SIGNATURE-----

Merge tag 'zynqmp-dt-for-v5.16' of https://github.com/Xilinx/linux-xlnx into arm/dt

arm64: dts: ZynqMP DT changes for v5.16

- Fix issues reported by dtbs_check
- Enable DMAs, DP, USB, NAND on various boards
- Add description for irps5401
- Add pinctrl description
- Add psgtr description for usb3, sata and DP
- Start to use nvmem alias for eeprom reference
- Clean up aliases list
- Wire qspi and usb3.0
- Add support for zcu102-rev1.1
- Couple of minor fixes and sync patches

* tag 'zynqmp-dt-for-v5.16' of https://github.com/Xilinx/linux-xlnx: (36 commits)
  arm64: zynqmp: Wire psgtr for zc1751-xm013
  arm64: zynqmp: Enable xlnx,zynqmp-dwc3 driver for xilinx boards
  arm64: zynqmp: Enable gpio and qspi for zc1275-revA
  arm64: zynqmp: Fix serial compatible string
  arm64: zynqmp: Remove not documented is-dual property
  arm64: zynqmp: Add psgtr description to zc1751 dc1 board
  arm64: zynqmp: Add support for zcu102-rev1.1 board
  arm64: zynqmp: Remove description for 8T49N287 and si5382 chips
  arm64: zynqmp: Sync psgtr node location with zcu104-revA
  arm64: zynqmp: Add reset description for sata
  arm64: zynqmp: Move rtc to different location on zcu104-revA
  arm64: zynqmp: Wire qspi on multiple boards
  arm64: zynqmp: Remove information about dma clock on zcu106
  arm64: zynqmp: Update rtc calibration value
  arm64: zynqmp: Add note about UHS mode on some boards
  arm64: zynqmp: Move DP nodes to the end of file on zcu106
  arm64: zynqmp: Remove can aliases from zc1751
  arm64: zynqmp: Add reset-on-timeout to all boards and modify default timeout value
  arm64: zynqmp: List reset property for ethernet phy
  arm64: zynqmp: Add nvmem alises for eeproms
  ...

Link: https://lore.kernel.org/r/b1cbd05d-ab40-e1fc-4001-6cf88e1e81f9@monstr.eu
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-05 16:01:54 +02:00
Arnd Bergmann
581b334b45 Renesas ARM defconfig updates for v5.16
- Enable built-in (I2C, DMAC, USB PHY control) and modular (audio,
     ADC) build of drivers for the RZ/G2L SoC and SMARC EVK board,
   - Enable modular build of the Renesas TPU PWM driver for the R-Car
     V3U SoC.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCYVbQSQAKCRCKwlD9ZEnx
 cJgdAP4qynb96S1sQtdFV4vyjvwvFOm3WQEl6lPejPlfmi3v+wD/Vzwiz3qefPXI
 69g9xDfPdiEwJTjOyMl7/Ly0bgYr4A8=
 =lyUr
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFcWjcACgkQmmx57+YA
 GNlkWxAAudaLnZnPyYMo6pK3hEv7RJ2JhpygGqMsFBL3//zeBXwechXAVfMgjnyu
 xgXeDwqjIVreIPYShObbSO28zMKQtHd9thLYd44T/cGZpFAtOgHCwSO77Q39VQ03
 8tsezV1oNW8HTfxLuiDFD7AVDsPn8IxMWi0sgqFEcMo5mddni2NaHZqi+hZG1Wiw
 oEPIajUvLZNEG2+Xgw2Rv2+YHe4mAa2TaCqj53Y3zkBYCctQ01aIAbLEYjvOXA0Y
 5ml/bOJzNo0Jqs6GGdkyPA/ZhKtP8J+Wrb3h2ERBcc8J1p6hwPt7FgRW5BXo/CwJ
 ACUVUxSSo0STGrna7IRNOrttbWPbga5xCiQrn678OUAK0Z4OBKstMkivnp6vkUx/
 MEP6YRhw/xT8VEIyWup7G2ww5+Z6gcFArr2TR06EaUWZSDN1sTR6WkZ6vST0VycX
 Zlg6h+lyZvoxs48gQmx8GnxiCaxcn1v48XMu+9D7QB9lhO+LGucie8Okkzu0Dar6
 yHjaSge9fiEuzCdd6nB+RsAQkEDg+ibMsse6ihQfHJXgadMfT/bTvDI041qryyeL
 nr00kobIp/IVyEP+QNzb7nCzS9t8NISEIS6oUouWamKVcLkoO167dpwO3QGEDLcJ
 +Wq0XJYSlSUjlqQjul/KEtppYl2U9A+ypp358rzaK9o+3NlECo8=
 =wD41
 -----END PGP SIGNATURE-----

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

Renesas ARM defconfig updates for v5.16

  - Enable built-in (I2C, DMAC, USB PHY control) and modular (audio,
    ADC) build of drivers for the RZ/G2L SoC and SMARC EVK board,
  - Enable modular build of the Renesas TPU PWM driver for the R-Car
    V3U SoC.

* tag 'renesas-arm-defconfig-for-v5.16-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  arm64: defconfig: Enable RZG2L_ADC
  arm64: defconfig: Enable SND_SOC_WM8978
  arm64: defconfig: Enable SOUND_SOC_RZ
  arm64: defconfig: Enable RZ_DMAC
  arm64: defconfig: Add Renesas TPU as module
  arm64: defconfig: Enable RZ/G2L USBPHY control driver
  arm64: defconfig: Enable RIIC

Link: https://lore.kernel.org/r/cover.1633081145.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-05 15:59:19 +02:00
Arnd Bergmann
04e0ae8d2b Qualcomm ARM64 DTS fixes for 5.15
This starts by reverting the SC7280 CPUfreq update, which was merged
 before concensus about the associated drivers changes was reached.
 
 It then moves the reserved-memory changes done to get IPA working on the
 Lenovo Yoga C630 into the Yoga specific DTS, as changing the memory map
 on the platform level did break a couple of the other boards.
 
 It fixes the HDMI audio on Trogdor and add missing Aggre2 NOC qos clocks
 on SDM6{30,36,60} which prevented some boards from booting.
 
 Lastly it enables the PON module on SM8250/QRB5165, as the lack thereof
 is blocking automated testing in LKFT.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmFVJG0bHGJqb3JuLmFu
 ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3FERkQAM3FaUFBCPGOTfUUrn0U
 3SVgzk2i6z+lw3YKWXxsx0248aGwHQX2+DgvnPdP7Fr2B+TVYZFP/bIXLQoL2OFP
 F05g1dXsLxEBsCAt03DrJc6mLDBFVl3qdgBySqtWTjpIaV3lqlR3YBazxxltKWcW
 pFh2fqAZVhaUgP4Di+4CCyW5I87rojnEIRzZ4e/AHF64+96dpjumzjBCgE/azki7
 m981qvT+q4EyErVY83kkwc7B4hDmCoMxqKbFhQCfbw3TbogT8Md6ZZwJUskP5Ku9
 1ILcO7U2fW2PVeqL6cvzxbIkxEYGVeHxoLK1Cw90z5ChOYK5EEH1IPkZ+P6x0mhN
 3SDI0Yl5HnZ1PpLRXMcNWcID7qARN/ZDajP+u48d3cOHB8KeJM7eAQ1mDeAT7/HB
 vFMTQiqiosqSknEoHCI6mtMtZ+mq6CelDEH3Lr0IjK0siH80yfirCcNpWqDTlmmq
 Z9+bFl32unChO1VVAoH+/hTydyFkue0rNG8dvub/QrGZPbVBzKDaDsLIWy1EavgU
 C65uzihAHzywUfGq+iCgqANIsSTld9qS6Q2fNLg9JKkXNTzcpAd6W8kK/SYSId1p
 ozXU8z85PFHEcd+9MbJLL4K1vJy7zaoUU2l0vyrv2zxR2f7oHZODuN/8Sjh5HawF
 bvyXXiQVQjqnBO4yBuuXGZ3/
 =QK4n
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmFcVP8ACgkQmmx57+YA
 GNnaShAAjz6TDZZTGWga9CVadv6uMOstX/4XQ2sTfvUT3avEP8gJCA6VwffmanBl
 PQSCslzL9YZn55nH9DXd9CAGTtp/WG75ENNoIUr8x/fsSi/Xd2XYnGcWG3MHWSxm
 kn03S1mK+QLKmV+K7IUYL/sGrjDQfMDTxHhUPULvtI9DAvdL94hRpPEl6YSJgUSZ
 bxiK805q3/biQxCmQ6mzTvRxijbb7fEJ5cOTr4gZKGadtiW4NpNFQgRTnBTN9As/
 caGKNcpbEEpddrwdJIwk81ppx6nlNP6VmfYmOc1FJfQKSZNCYRxA4atngKE/WBsr
 O8BEj4JlUFGFx+oL6DgYyq873l5yhGTJb09pq4WU2m/mAFJBV8uEEYrumWgoK3mE
 XT7Pluh9uFOojjDPMzLLd2JHKjQm+aBzXwBqtyemp6we9iR8oL1QvPq6ajHEHelj
 Y4IByE64DsfjAmX4CrpMmLSC1NiOP0Zy18ehTijlcpArfmCdDi9919sm1OQtiWwB
 fNCU1nx/Wu/W1EDzY5rAWedlDa6NqA/gL1kx/OzasQMbC8VTPAtRM/bhZPj6vrle
 nfkhsjKsbof+lxQEyS7VUwYN2Egy/K3YjVHmqckAF4aej6i7ZFeYGdQ4NLp5aPzl
 Mm2yhfh7eT47UdhKeRyGhhdAsPItevrQyvgTxWfgkyYpA15L/eg=
 =lLJz
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm ARM64 DTS fixes for 5.15

This starts by reverting the SC7280 CPUfreq update, which was merged
before concensus about the associated drivers changes was reached.

It then moves the reserved-memory changes done to get IPA working on the
Lenovo Yoga C630 into the Yoga specific DTS, as changing the memory map
on the platform level did break a couple of the other boards.

It fixes the HDMI audio on Trogdor and add missing Aggre2 NOC qos clocks
on SDM6{30,36,60} which prevented some boards from booting.

Lastly it enables the PON module on SM8250/QRB5165, as the lack thereof
is blocking automated testing in LKFT.

* tag 'qcom-arm64-fixes-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  arm64: dts: qcom: sdm630: Add missing a2noc qos clocks
  arm64: dts: qcom: qrb5165-rb5: enabled pwrkey and resin nodes
  arm64: dts: qcom: pm8150: specify reboot mode magics
  arm64: dts: qcom: pm8150: use qcom,pm8998-pon binding
  arm64: dts: qcom: sc7180-trogdor: Fix lpass dai link for HDMI
  arm64: dts: qcom: sdm850-yoga: Reshuffle IPA memory mappings
  Revert "arm64: dts: qcom: sc7280: Fixup the cpufreq node"

Link: https://lore.kernel.org/r/20210930025509.1091-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-10-05 15:37:03 +02:00
Quentin Perret
6e6a8ef088 KVM: arm64: Release mmap_lock when using VM_SHARED with MTE
VM_SHARED mappings are currently forbidden in a memslot with MTE to
prevent two VMs racing to sanitise the same page. However, this check
is performed while holding current->mm's mmap_lock, but fails to release
it. Fix this by releasing the lock when needed.

Fixes: ea7fc1bb1c ("KVM: arm64: Introduce MTE VM feature")
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005122031.809857-1-qperret@google.com
2021-10-05 13:22:45 +01:00
Quentin Perret
7615c2a514 KVM: arm64: Report corrupted refcount at EL2
Some of the refcount manipulation helpers used at EL2 are instrumented
to catch a corrupted state, but not all of them are treated equally. Let's
make things more consistent by instrumenting hyp_page_ref_dec_and_test()
as well.

Acked-by: Will Deacon <will@kernel.org>
Suggested-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/20211005090155.734578-6-qperret@google.com
2021-10-05 13:02:54 +01:00
Quentin Perret
1d58a17ef5 KVM: arm64: Fix host stage-2 PGD refcount
The KVM page-table library refcounts the pages of concatenated stage-2
PGDs individually. However, when running KVM in protected mode, the
host's stage-2 PGD is currently managed by EL2 as a single high-order
compound page, which can cause the refcount of the tail pages to reach 0
when they shouldn't, hence corrupting the page-table.

Fix this by introducing a new hyp_split_page() helper in the EL2 page
allocator (matching the kernel's split_page() function), and make use of
it from host_s2_zalloc_pages_exact().

Fixes: 1025c8c0c6 ("KVM: arm64: Wrap the host with a stage 2")
Acked-by: Will Deacon <will@kernel.org>
Suggested-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/20211005090155.734578-5-qperret@google.com
2021-10-05 13:02:54 +01:00
Frieder Schrempf
315e7b8841 arm64: dts: imx8mm-kontron: Fix reset delays for ethernet PHY
According to the datasheet the VSC8531 PHY expects a reset pulse of 100 ns
and a delay of 15 ms after the reset has been deasserted. Set the matching
values in the devicetree.

Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 15:24:06 +08:00
Lucas Stach
d2fefef92e arm64: dts: imx8mm: add DISP blk-ctrl
Add the DT node for the DISP blk-ctrl. With this in place the
display/mipi power domains are fully functional.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:38:54 +08:00
Lucas Stach
2604c5cafb arm64: dts: imx8mm: add VPU blk-ctrl
Add the DT node for the VPU blk-ctrl. With this in place the
VPU power domains are fully functional.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:38:51 +08:00
Frieder Schrempf
4523be8e46 arm64: dts: imx8mm: Add GPU nodes for 2D and 3D core
According to the documents, the i.MX8M-Mini features a GC320 and a
GCNanoUltra GPU core. Etnaviv detects them as:

	etnaviv-gpu 38000000.gpu: model: GC600, revision: 4653
	etnaviv-gpu 38008000.gpu: model: GC520, revision: 5341

This seems to work fine more or less without any changes to the HWDB,
which still might be needed in the future to correct some features,
etc.

[lst]: Added power domains and switched clock assignments to the
       new clock defines used for the composite clocks, instead of
       relying on the backwards compat defines.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:38:48 +08:00
Lucas Stach
01df28d808 arm64: dts: imx8mm: put USB controllers into power-domains
Now that we have support for the power domain controller on the i.MX8MM
we can put the USB controllers in their respective power domains to allow
them to power down the PHY when possible.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:38:46 +08:00
Lucas Stach
d39d4bb153 arm64: dts: imx8mm: add GPC node
Add the DT node for the GPC, including all the PGC power domains,
some of them are not fully functional yet, as they require interaction
with the blk-ctrls to properly power up/down the peripherals.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:38:34 +08:00
Tim Harvey
3518441dda arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio
Fix invalid M2_RST# gpio pinmux.

Fixes: ef484dfcf6 ("arm64: dts: imx: Add i.mx8mm/imx8mn Gateworks gw7902 dts support")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:26:21 +08:00
Vladimir Oltean
8fcea7be57 arm64: dts: ls1028a: mark internal links between Felix and ENETC as capable of flow control
The internal Ethernet switch suffers from erratum A-050484 ("Ethernet
flow control not functional on L2 switch NPI port when XFH is used").
XFH stands for "Extraction Frame Header" - which basically means the
default "ocelot" DSA tagging protocol.

However, the switch supports one other tagging protocol - "ocelot-8021q",
and this is not subject to the erratum above. So describe the hardware
ability to pass PAUSE frames in the device tree, and let the driver
figure out whether it should use flow control on the CPU port or not,
depending on whether the "ocelot" or "ocelot-8021q" tagging protocol is
being used.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:01:14 +08:00
Rob Herring
869f0ec048 arm64: dts: freescale: Fix 'interrupt-map' parent address cells
The 'interrupt-map' in several Layerscape SoCs is malformed. The
'#address-cells' size of the parent interrupt controller (the GIC) is not
accounted for.

Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Li Yang <leoyang.li@nxp.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-05 14:00:03 +08:00
Dmitry Osipenko
212a6aeef4 arm64: tegra: Add new USB PHY properties on Tegra132
Add new properties to USB PHYs needed for enabling USB OTG mode.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-10-04 23:12:28 +02:00
Michael Walle
caa355c53b arm64: dts: ls1028a: use phy-mode instead of phy-connection-type
In linux both are identical, phy-mode is used more often, though. Also
for the ls1028a both phy-connection-type and phy-mode was used, one for
the enetc nodes and the other for the switch nodes. Unify them. But the
main reason for this is that the device tree files can be shared with
the u-boot ones; there the enetc driver only supports the "phy-mode"
property.

Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 21:00:40 +08:00
Michael Walle
6783380506 arm64: dts: ls1028a: move PHY nodes to MDIO controller
Move the PHY nodes from the network controller to the dedicated MDIO
controller. According to Vladimir Oltean direct MDIO access via the PF,
that is when the PHY is put under the "mdio" subnode, is defeatured and
in fact the latest reference manual isn't mentioning it anymore.

Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 21:00:36 +08:00
Michael Walle
70293bea92 arm64: dts: ls1028a: disable usb controller by default
One of the last devices which are enabled by default are the USB
controllers. Although the pins are not multi-function pins, some boards
might not use USB at all. Apply the "disabled-by-default" style also for
the USB controllers and enable the controllers in the actual device tree
of the boards.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 21:00:19 +08:00
Michael Walle
55ca18c0d9 arm64: dts: ls1028a: add Vivante GPU node
Recently, support for this particular Vivante GC7000 GPU was added to the
linux kernel. Add the corresponding device tree node.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 21:00:16 +08:00
Michael Walle
7de87eae2d arm64: dts: ls1028a: move Mali DP500 node into /soc
Move it inside the /soc subnode because it is part of the CCSR space.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 21:00:14 +08:00
Michael Walle
b4751afb72 arm64: dts: ls1028a: move pixel clock pll into /soc
Move it inside the /soc subnode because it is part of the CCSR space.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 20:59:59 +08:00
Michael Walle
8b94aa318a arm64: dts: ls1028a: fix eSDHC2 node
On the LS1028A this instance of the eSDHC controller is intended for
either an eMMC or eSDIO card. It doesn't provide a card detect pin and
its IO voltage is fixed at 1.8V.

Remove the bogus broken-cd property, instead add the non-removable
property. Fix the voltage-ranges property and set it to 1.8V only.

Fixes: 491d3a3fc1 ("arm64: dts: ls1028a: Add esdhc node in dts")
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 20:42:32 +08:00
Heiko Thiery
9786cca4b4 arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
The buck2 output of the PMIC is the VDD core voltage of the cpu.
Switching off this will poweroff the CPU. Add the 'regulator-always-on'
property to avoid this.

Fixes: 8668d8b2e6 ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 20:36:54 +08:00
Chester Lin
0c8bedf26f arm64: dts: s32g2: add memory nodes for evb and rdb2
Add memory nodes for S32G-VNP-EVB and S32G-VNP-RDB2.

Signed-off-by: Chester Lin <clin@suse.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 16:09:24 +08:00
Chester Lin
3686673dc3 arm64: dts: s32g2: add VNP-EVB and VNP-RDB2 support
Add initial device-trees of NXP S32G2's Evaluation Board (S32G-VNP-EVB)
and Reference Design 2 Board (S32G-VNP-RDB2).

Signed-off-by: Chester Lin <clin@suse.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 16:09:12 +08:00
Chester Lin
994f4e42ec arm64: dts: s32g2: add serial/uart support
Add serial/uart support for NXP S32G2 based on the information provided by
NXP's CodeAurora BSP.

Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
Signed-off-by: Chester Lin <clin@suse.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 16:09:00 +08:00
Chester Lin
aeb78b1c05 arm64: dts: add NXP S32G2 support
Add an initial dtsi file for generic SoC features of NXP S32G2.

Signed-off-by: Chester Lin <clin@suse.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 16:08:49 +08:00
Wasim Khan
aa3457d4c1 arm64: dts: add device tree for the LX2160A on the NXP BlueBox3 board
The NXP BlueBox3 is a prototyping board for high-performance autonomous
driving systems. It contains two Linux systems, running on the
LX2160A and the other on the S32G2 SoC. This patch adds the device tree
support for the LX2160A SoC.

In terms of networking from the LX2160A's perspective, there are:

- 4 RJ45 10G ports using Aquantia copper PHYs which are attached
  directly to DPAA2 ports on the LX2160A

- 3 NXP SJA1110 automotive Ethernet switches. First two are managed by
  the LX2160A (each switch has a host port towards a dpmac), the third
  switch is managed by the S32G2. All 3 switches are interconnected
  through on-board SERDES lanes. The cascade ports between the 2
  switches managed by LX2160A form a DSA link, the cascade ports between
  the LX2160A and the S32G2 domain form user ports (the "to_sw3" net
  device).

- 2 RJ45 1G ports using Atheros copper PHYs which are attached directly
  to NXP SJA1110 switches

- 12 automotive 100base-T1 single-pair Ethernet ports routed from the
  SJA1110 internal PHY ports (TJA1103)

- One SGMII SERDES lane towards an internal connector, attached to one
  of the SJA1110 switch ports

On board rev A, the AR8035 RGMII PHY addresses were different than on
rev B and later. This patch introduces a separate device tree for rev A.
The main device tree is supposed to cover rev B and later.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Co-developed-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Co-developed-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Co-developed-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Co-developed-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Co-developed-by: Heinz Wrobel <Heinz.Wrobel@nxp.com>
Signed-off-by: Heinz Wrobel <Heinz.Wrobel@nxp.com>
Co-developed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Co-developed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 11:46:00 +08:00
Haibo Chen
04aa946d57 arm64: dts: imx8: change the spi-nor tx
Before commit 0e30f47232 ("mtd: spi-nor: add support for DTR protocol"),
for all PP command, it only support 1-1-1 mode, no matter the tx setting
in dts. But after the upper commit, the logic change. It will choose
the best mode(fastest mode) which flash device and spi-nor host controller
both support.

qspi and fspi host controller do not support read 1-4-4 mode. so need to
set the tx to 1, let the common code finally select read 1-1-4 mode.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Fixes: 0e30f47232 ("mtd: spi-nor: add support for DTR protocol")
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-10-04 11:25:31 +08:00
Anshuman Khandual
3de360c3fd arm64/mm: drop HAVE_ARCH_PFN_VALID
CONFIG_SPARSEMEM_VMEMMAP is now the only available memory model on arm64
platforms and free_unused_memmap() would just return without creating any
holes in the memmap mapping.  There is no need for any special handling in
pfn_valid() and HAVE_ARCH_PFN_VALID can just be dropped.  This also moves
the pfn upper bits sanity check into generic pfn_valid().

[rppt: rebased on v5.15-rc3]

Link: https://lkml.kernel.org/r/1621947349-25421-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/20210930013039.11260-3-rppt@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 14:54:45 +01:00
Pasha Tatashin
6091dd9eaf arm64: trans_pgd: remove trans_pgd_map_page()
The intend of trans_pgd_map_page() was to map contiguous range of VA
memory to the memory that is getting relocated during kexec. However,
since we are now using linear map instead of contiguous range this
function is not needed

Suggested-by: Pingfan Liu <kernelfans@gmail.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-16-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:01 +01:00
Pasha Tatashin
7a2512fa64 arm64: kexec: remove cpu-reset.h
This header contains only cpu_soft_restart() which is never used directly
anymore. So, remove this header, and rename the helper to be
cpu_soft_restart().

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-15-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
939f1b9564 arm64: kexec: remove the pre-kexec PoC maintenance
Now that kexec does its relocations with the MMU enabled, we no longer
need to clean the relocation data to the PoC.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-14-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
efc2d0f20a arm64: kexec: keep MMU enabled during kexec relocation
Now, that we have linear map page tables configured, keep MMU enabled
to allow faster relocation of segments to final destination.

Cavium ThunderX2:
Kernel Image size: 38M Iniramfs size: 46M Total relocation size: 84M
MMU-disabled:
relocation	7.489539915s
MMU-enabled:
relocation	0.03946095s

Broadcom Stingray:
The performance data: for a moderate size kernel + initramfs: 25M the
relocation was taking 0.382s, with enabled MMU it now takes
0.019s only or x20 improvement.

The time is proportional to the size of relocation, therefore if initramfs
is larger, 100M it could take over a second.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Tested-by: Pingfan Liu <piliu@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-13-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
3744b5280e arm64: kexec: install a copy of the linear-map
To perform the kexec relocation with the MMU enabled, we need a copy
of the linear map.

Create one, and install it from the relocation code. This has to be done
from the assembly code as it will be idmapped with TTBR0. The kernel
runs in TTRB1, so can't use the break-before-make sequence on the mapping
it is executing from.

The makes no difference yet as the relocation code runs with the MMU
disabled.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-12-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
19a046f07c arm64: kexec: use ld script for relocation function
Currently, relocation code declares start and end variables
which are used to compute its size.

The better way to do this is to use ld script, and put relocation
function in its own section.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-11-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
ba959fe96a arm64: kexec: relocate in EL1 mode
Since we are going to keep MMU enabled during relocation, we need to
keep EL1 mode throughout the relocation.

Keep EL1 enabled, and switch EL2 only before entering the new world.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-10-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
08eae0ef61 arm64: kexec: configure EL2 vectors for kexec
If we have a EL2 mode without VHE, the EL2 vectors are needed in order
to switch to EL2 and jump to new world with hypervisor privileges.

In preparation to MMU enabled relocation, configure our EL2 table now.

Kexec uses #HVC_SOFT_RESTART to branch to the new world, so extend
el1_sync vector that is provided by trans_pgd_copy_el2_vectors() to
support this case.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-9-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
878fdbd704 arm64: kexec: pass kimage as the only argument to relocation function
Currently, kexec relocation function (arm64_relocate_new_kernel) accepts
the following arguments:

head:		start of array that contains relocation information.
entry:		entry point for new kernel or purgatory.
dtb_mem:	first and only argument to entry.

The number of arguments cannot be easily expended, because this
function is also called from HVC_SOFT_RESTART, which preserves only
three arguments. And, also arm64_relocate_new_kernel is written in
assembly but called without stack, thus no place to move extra arguments
to free registers.

Soon, we will need to pass more arguments: once we enable MMU we
will need to pass information about page tables.

Pass kimage to arm64_relocate_new_kernel, and teach it to get the
required fields from kimage.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-8-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
3036ec5993 arm64: kexec: Use dcache ops macros instead of open-coding
kexec does dcache maintenance when it re-writes all memory. Our
dcache_by_line_op macro depends on reading the sanitized DminLine
from memory. Kexec may have overwritten this, so open-codes the
sequence.

dcache_by_line_op is a whole set of macros, it uses dcache_line_size
which uses read_ctr for the sanitsed DminLine. Reading the DminLine
is the first thing the dcache_by_line_op does.

Rename dcache_by_line_op dcache_by_myline_op and take DminLine as
an argument. Kexec can now use the slightly smaller macro.

This makes up-coming changes to the dcache maintenance easier on
the eye.

Code generated by the existing callers is unchanged.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-7-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
5bb6834fc2 arm64: kexec: skip relocation code for inplace kexec
In case of kdump or when segments are already in place the relocation
is not needed, therefore the setup of relocation function and call to
it can be skipped.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Suggested-by: James Morse <james.morse@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-6-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
0d8732e461 arm64: kexec: flush image and lists during kexec load time
Currently, during kexec load we are copying relocation function and
flushing it. However, we can also flush kexec relocation buffers and
if new kernel image is already in place (i.e. crash kernel), we can
also flush the new kernel image itself.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-5-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:31:00 +01:00
Pasha Tatashin
a347f60145 arm64: hibernate: abstract ttrb0 setup function
Currently, only hibernate sets custom ttbr0 with safe idmaped function.
Kexec, is also going to be using this functionality when relocation code
is going to be idmapped.

Move the setup sequence to a dedicated cpu_install_ttbr0() for custom
ttbr0.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-4-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:30:59 +01:00
Pasha Tatashin
788bfdd974 arm64: trans_pgd: hibernate: Add trans_pgd_copy_el2_vectors
Users of trans_pgd may also need a copy of vector table because it is
also may be overwritten if a linear map can be overwritten.

Move setup of EL2 vectors from hibernate to trans_pgd, so it can be
later shared with kexec as well.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-3-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:30:59 +01:00
Pasha Tatashin
094a3684b9 arm64: kernel: add helper for booted at EL2 and not VHE
Replace places that contain logic like this:
	is_hyp_mode_available() && !is_kernel_in_hyp_mode()

With a dedicated boolean function  is_hyp_nvhe(). This will be needed
later in kexec in order to sooner switch back to EL2.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-2-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-10-01 13:30:59 +01:00
Juergen Gross
78b497f2e6 kvm: use kvfree() in kvm_arch_free_vm()
By switching from kfree() to kvfree() in kvm_arch_free_vm() Arm64 can
use the common variant. This can be accomplished by adding another
macro __KVM_HAVE_ARCH_VM_FREE, which will be used only by x86 for now.

Further simplification can be achieved by adding __kvm_arch_free_vm()
doing the common part.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-Id: <20210903130808.30142-5-jgross@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-01 03:44:57 -04:00
Masami Hiramatsu
adf8a61a94 kprobes: treewide: Make it harder to refer kretprobe_trampoline directly
Since now there is kretprobe_trampoline_addr() for referring the
address of kretprobe trampoline code, we don't need to access
kretprobe_trampoline directly.

Make it harder to refer by renaming it to __kretprobe_trampoline().

Link: https://lkml.kernel.org/r/163163045446.489837.14510577516938803097.stgit@devnote2

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-09-30 21:24:06 -04:00
Masami Hiramatsu
96fed8ac2b kprobes: treewide: Remove trampoline_address from kretprobe_trampoline_handler()
The __kretprobe_trampoline_handler() callback, called from low level
arch kprobes methods, has the 'trampoline_address' parameter, which is
entirely superfluous as it basically just replicates:

  dereference_kernel_function_descriptor(kretprobe_trampoline)

In fact we had bugs in arch code where it wasn't replicated correctly.

So remove this superfluous parameter and use kretprobe_trampoline_addr()
instead.

Link: https://lkml.kernel.org/r/163163044546.489837.13505751885476015002.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-09-30 21:24:06 -04:00
Masami Hiramatsu
9c89bb8e32 kprobes: treewide: Cleanup the error messages for kprobes
This clean up the error/notification messages in kprobes related code.
Basically this defines 'pr_fmt()' macros for each files and update
the messages which describes

 - what happened,
 - what is the kernel going to do or not do,
 - is the kernel fine,
 - what can the user do about it.

Also, if the message is not needed (e.g. the function returns unique
error code, or other error message is already shown.) remove it,
and replace the message with WARN_*() macros if suitable.

Link: https://lkml.kernel.org/r/163163036568.489837.14085396178727185469.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-09-30 21:24:05 -04:00
Ard Biesheuvel
bcf9033e54 sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y
THREAD_INFO_IN_TASK moved the CPU field out of thread_info, but this
causes some issues on architectures that define raw_smp_processor_id()
in terms of this field, due to the fact that #include'ing linux/sched.h
to get at struct task_struct is problematic in terms of circular
dependencies.

Given that thread_info and task_struct are the same data structure
anyway when THREAD_INFO_IN_TASK=y, let's move it back so that having
access to the type definition of struct thread_info is sufficient to
reference the CPU number of the current task.

Note that this requires THREAD_INFO_IN_TASK's definition of the
task_thread_info() helper to be updated, as task_cpu() takes a
pointer-to-const, whereas task_thread_info() (which is used to generate
lvalues as well), needs a non-const pointer. So make it a macro instead.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
2021-09-30 16:13:10 +02:00
Ard Biesheuvel
001430c191 arm64: add CPU field to struct thread_info
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.

Note that arm64 always has CONFIG_SMP=y so there is no point in guarding
the CPU field with an #ifdef.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
2021-09-30 14:39:43 +02:00
Peter Collingbourne
e5af50a5df arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled
It is not necessary to write to GCR_EL1 on every kernel entry and
exit when HW tag-based KASAN is disabled because the kernel will not
execute any IRG instructions in that mode. Since accessing GCR_EL1
can be expensive on some microarchitectures, avoid doing so by moving
the access to task switch when HW tag-based KASAN is disabled.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://linux-review.googlesource.com/id/I78e90d60612a94c24344526f476ac4ff216e10d2
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210924010655.2886918-1-pcc@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-09-29 17:18:57 +01:00
Sudarshan Rajagopalan
8fac67ca23 arm64: mm: update max_pfn after memory hotplug
After new memory blocks have been hotplugged, max_pfn and max_low_pfn
needs updating to reflect on new PFNs being hot added to system.
Without this patch, debug-related functions that use max_pfn such as
get_max_dump_pfn() or read_page_owner() will not work with any page in
memory that is hot-added after boot.

Fixes: 4ab2150615 ("arm64: Add memory hotplug support")
Signed-off-by: Sudarshan Rajagopalan <quic_sudaraja@quicinc.com>
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Georgi Djakov <quic_c_gdjako@quicinc.com>
Tested-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
Link: https://lore.kernel.org/r/a51a27ee7be66024b5ce626310d673f24107bcb8.1632853776.git.quic_cgoldswo@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-09-29 17:11:06 +01:00
Anshuman Khandual
f8b46c4b51 arm64/mm: Add pud_sect_supported()
Section mapping at PUD level is supported only on 4K pages and currently it
gets verified with explicit #ifdef or IS_ENABLED() constructs. This adds a
new helper pud_sect_supported() for this purpose, which particularly cleans
up the HugeTLB code path. It updates relevant switch statements with checks
for __PAGETABLE_PMD_FOLDED in order to avoid build failures caused with two
identical switch case values in those code blocks.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/1632130171-472-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-09-29 16:54:33 +01:00
Amit Daniel Kachhap
f5b650f887 arm64/traps: Avoid unnecessary kernel/user pointer conversion
Annotating a pointer from kernel to __user and then back again requires
an extra __force annotation to silent sparse warning. In call_undef_hook()
this unnecessary complexity can be avoided by modifying the intermediate
user pointer to unsigned long.

This way there is no inter-changeable use of user and kernel pointers
and the code is consistent.

Note: This patch adds no functional changes to code.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20210917055811.22341-1-amit.kachhap@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-09-29 16:44:20 +01:00
Will McVicker
6ad4185220 arm64: exynos: don't have ARCH_EXYNOS select EXYNOS_CHIPID
Now that EXYNOS_CHIPID can be a module and is enabled by default via
ARCH_EXYNOS, we don't need to have ARCH_EXYNOS directly select it. So
remove that.

Signed-off-by: Will McVicker <willmcvicker@google.com>
Link: https://lore.kernel.org/r/20210928235635.1348330-2-willmcvicker@google.com
[krzysztof: the driver is not essential to boot and on ARMv7 it is also
 allowed to disable it]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-09-29 15:56:30 +02:00
Will Deacon
e63cf610ea arm64: mm: Drop pointless call to set_max_mapnr()
set_max_mapnr() is an empty stub function if CONFIG_NUMA=y, otherwise it
assigns to the 'max_mapnr' variable which is used to provide a generic
pfn_valid() implementation if CONFIG_MMU=n.

Since we don't support nommu on arm64, drop the pointless call to
set_max_mapnr() from mem_init().

Link: https://lore.kernel.org/r/130a50d7-92fd-31fa-261e-f73dadcb4fcf@redhat.com
Signed-off-by: Will Deacon <will@kernel.org>
2021-09-29 13:54:04 +01:00
Michal Simek
7a4c31ee87 arm64: zynqmp: Add support for Xilinx Kria SOM board
There are couple of revisions of SOMs (k26) and associated carrier cards
(kv260).
SOM itself has two major versions:
sm-k26 - SOM with EMMC
smk-k26 - SOM without EMMC used on starter kit with preprogrammed firmware
in QSPI.

SOMs are describing only devices available on the SOM or connections which
are described in specification (for example UART, fwuen).

When SOM boots out of QSPI it uses limited number of peripherals defined by
the specification and present in sm(k)-k26 dtses.
Then a carrier card (CC) detection is happening and DT overlay is applied
to brings new functionality. That's why DT overlays are used. The name is
composed together with SOM name and CC name that's why DT overlays with
these names are generated to make sure they can be used together.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1ba32590670434b650bacf6410a65579dd30b38b.1632294439.git.michal.simek@xilinx.com
2021-09-29 13:48:21 +02:00
Shawn Guo
c22441a7cb arm64: dts: qcom: sdm630-nile: Correct regulator label name
29.5V (29p5) is obviously wrong for regulator l4 and l5.  Correct them
to be 2.95V (2p95).  No functional change.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210926072215.27517-1-shawn.guo@linaro.org
2021-09-28 10:36:30 -05:00
Marijn Suijten
4e31e85759 arm64: dts: qcom: sm6125: Improve indentation of multiline properties
Some multiline properties (spread out over multiple lines to keep length
in check) were not indented properly, leading to misalignment with the
items above.  The DT file is still small enough to address this early in
the process.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Martin Botka <martin.botka@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210925141841.407257-1-marijn.suijten@somainline.org
2021-09-28 10:34:31 -05:00
Stephan Gerhold
b30cad26d8 arm64: dts: qcom: msm8916-longcheer-l8150: Use &pm8916_usbin extcon
At the moment, longcheer-l8150 is using a dummy extcon-usb-gpio device
that permanently enables USB gadget mode. This workaround allows USB
to work but is actually wrong and confusing. The "vbus-gpio" used there
refers to an unused (floating) GPIO that is pulled up to make
extcon-usb-gpio report USB gadget mode permanently.

Replace this with the new &pm8916_usbin extcon device that actually
reports if an USB cable is attached or not. This allows the USB PHY
to be turned off when there is no USB cable attached and is much
cleaner overall.

Fixes: 16e8e80721 ("arm64: dts: qcom: Add device tree for Longcheer L8150")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210928112945.25310-3-stephan@gerhold.net
2021-09-28 10:28:05 -05:00
Stephan Gerhold
f5d7bca554 arm64: dts: qcom: pm8916: Add pm8941-misc extcon for USB detection
At the moment, USB gadget mode on MSM8916 works only with an extcon
device that reports the correct USB mode. This might be because the
USB PHY needs to be configured appropriately.

Unfortunately there is currently no simple approach to get such an
extcon device during early bring-up. The extcon device for USB VBUS
(i.e. gadget/peripheral mode) is typically provided by the charging
driver which is almost always very complex to port.

On pretty much all devices with PM8916, the USB VBUS is also connected
to the PM8916 "USB_IN" pad, no matter if they use the linear charger
integrated into PM8916 or not. The state of this pad can be checked
with the "USBIN_VALID" interrupt of PM8916.

The "qcom,pm8941-misc" binding exists to expose an "usb_vbus" and/or
"usb_id" interrupt from the PMIC as an extcon device.

Add a &pm8916_usbin node to pm8916.dtsi which can be used as simple
extcon device for devices that are currently lacking a proper charger
driver.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210928112945.25310-2-stephan@gerhold.net
2021-09-28 10:28:05 -05:00
Stephan Gerhold
483de2b44c arm64: dts: qcom: pm8916: Remove wrong reg-names for rtc@6000
While removing the size from the "reg" properties in pm8916.dtsi,
commit bd6429e810 ("ARM64: dts: qcom: Remove size elements from
pmic reg properties") mistakenly also removed the second register
address for the rtc@6000 device. That one did not represent the size
of the register region but actually the address of the second "alarm"
register region of the rtc@6000 device.

Now there are "reg-names" for two "reg" elements, but there is actually
only one "reg" listed.

Since the DT schema for "qcom,pm8941-rtc" only expects one "reg"
element anyway, just drop the "reg-names" entirely to fix this.

Fixes: bd6429e810 ("ARM64: dts: qcom: Remove size elements from pmic reg properties")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210928112945.25310-1-stephan@gerhold.net
2021-09-28 10:28:05 -05:00
Geert Uytterhoeven
732e8ee035 arm64: dts: renesas: rcar-gen3: Add missing Ethernet PHY resets
Describe all Ethernet PHY reset GPIOs on R-Car Gen3 boards, to avoid
relying solely on boot loaders to bring PHYs out of reset.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/3e6fd765850e8ef0980d8e98bc5f2126538d626f.1631177442.git.geert+renesas@glider.be
2021-09-28 09:59:26 +02:00
Geert Uytterhoeven
d45ba2a5f7 arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet PHYs
Add compatible values to Ethernet PHY subnodes representing Realtek
RTL8211E PHYs on RZ/G2 boards.  This allows software to identify the PHY
model at any time, regardless of the state of the PHY reset line.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/3b366e3dddd4d3cd7e89b92d3a8f78f6dc18e244.1631174218.git.geert+renesas@glider.be
2021-09-28 09:45:22 +02:00
Geert Uytterhoeven
722d55f3a9 arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
Add compatible values to Ethernet PHY subnodes representing Micrel
KSZ9031 PHYs on R-Car Gen3 boards.  This allows software to identify the
PHY model at any time, regardless of the state of the PHY reset line.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/07bd7e04dda9e84cde0664980f0b1a6d69e03109.1631174218.git.geert+renesas@glider.be
2021-09-28 09:45:22 +02:00
Geert Uytterhoeven
18a2427146 arm64: dts: renesas: Add compatible properties to AR8031 Ethernet PHYs
Add compatible values to Ethernet PHY subnodes representing Atheros
AR8031 PHYs on RZ/G2 boards.  This allows software to identify the PHY
model at any time, regardless of the state of the PHY reset line.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Adam Ford <aford173@gmail.com>
Link: https://lore.kernel.org/r/3f1b58756f149f0c634c66abaecc88e699f4c3cc.1631174218.git.geert+renesas@glider.be
2021-09-28 09:44:16 +02:00
Geert Uytterhoeven
59a8bda062 arm64: dts: renesas: beacon: Fix Ethernet PHY mode
While networking works fine in RGMII mode when using the Linux generic
PHY driver, it fails when using the Atheros PHY driver.
Fix this by correcting the Ethernet PHY mode to RGMII-RXID, which works
fine with both drivers.

Fixes: a5200e63af ("arm64: dts: renesas: rzg2: Convert EtherAVB to explicit delay handling")
Reported-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/2a4c15b2df23bb63f15abf9dfb88860477f4f523.1632465965.git.geert+renesas@glider.be
2021-09-28 09:44:15 +02:00
Lad Prabhakar
93207e415d arm64: defconfig: Enable RZG2L_ADC
Enable ADC driver support for Renesas RZ/G2L based platforms.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210927193551.22422-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-09-28 09:31:38 +02:00
Biju Das
3c158ec884 arm64: defconfig: Enable SND_SOC_WM8978
WM8978 audio CODEC is supported on RZ/G2L SMARC EVK.
Enable it on arm64 defconfig as module.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20210920093905.10878-1-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-09-28 09:31:33 +02:00
Sibi Sankar
0025fac17b arm64: dts: qcom: sc7280: Update Q6V5 MSS node
Update MSS node to support MSA based modem boot on SC7280 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1631886935-14691-11-git-send-email-sibis@codeaurora.org
2021-09-27 17:48:59 -05:00