Oded Gabbay
28bcf1fdc4
habanalabs: enable F/W events after init done
...
Only after the initialization of the device is done, the driver is
ready to receive events from the F/W. The driver can't handle events
before that because of races so it will ignore events. In case of
a fatal event, the driver won't know about it and the device will be
operational although it shouldn't be.
Same logic should be applied after hard-reset.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org >
2021-02-08 18:20:08 +02:00
Ohad Sharabi
b520ca5d82
habanalabs/gaudi: use HBM_ECC_EN bit for ECC ERR
...
driver should use ECC info from FW only if HBM ECC CAP is set.
otherwise, try to fetch the data from MC regs only if security is
disabled.
Signed-off-by: Ohad Sharabi <osharabi@habana.ai >
Reviewed-by: Oded Gabbay <ogabbay@kernel.org >
Signed-off-by: Oded Gabbay <ogabbay@kernel.org >
2021-02-08 18:20:08 +02:00
Ofir Bitton
e52606d2f5
habanalabs: support fetching first available user CQ
...
User must be aware of the available CQs when it needs to use them.
Signed-off-by: Ofir Bitton <obitton@habana.ai >
Reviewed-by: Oded Gabbay <ogabbay@kernel.org >
Signed-off-by: Oded Gabbay <ogabbay@kernel.org >
2021-02-08 18:20:08 +02:00
Ofir Bitton
5dbd7b4de6
habanalabs: improve communication protocol with cpucp
...
Current messaging communictaion protocol with cpucp can get out
of sync due to coherency issues. In order to improve the protocol
reliability, we modify the protocol to expect a different
acknowledgment for every packet sent to cpucp.
Signed-off-by: Ofir Bitton <obitton@habana.ai >
Reviewed-by: Oded Gabbay <ogabbay@kernel.org >
Signed-off-by: Oded Gabbay <ogabbay@kernel.org >
2021-02-08 18:20:08 +02:00
Oded Gabbay
6c1e3f92f9
habanalabs: fix integer handling issue
...
Need to add ull suffix to constant when doing shift of constant
into 64-bit variables
Signed-off-by: Oded Gabbay <ogabbay@kernel.org >
2021-02-08 18:20:08 +02:00
Alexander Usyskin
369aea8459
mei: implement client dma setup.
...
Implement HBM message protocol to setup and tear down
DMA buffer on behalf of an client. On top there DMA
buffer allocation and its life time management.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com >
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com >
Link: https://lore.kernel.org/r/20210206144325.25682-5-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-06 15:48:11 +01:00
Alexander Usyskin
dfad8742a3
mei: hbm: add client dma hbm messages
...
Define structures for client DMA HBM protocol.
The protocol requires passing dma buffer address
and the buffer id.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com >
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com >
Link: https://lore.kernel.org/r/20210206144325.25682-4-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-06 15:48:11 +01:00
Alexander Usyskin
b7a4804129
mei: add support for client dma capability
...
Client DMA capability indicates whether the firmware supports setting up
a direct DMA channel between the host and me client.
The DMA capabilities are supported from firmware HBM version 2.2
and newer.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com >
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com >
Link: https://lore.kernel.org/r/20210206144325.25682-3-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-06 15:48:11 +01:00
Alexander Usyskin
36edb1407c
mei: allow clients on bus to communicate in remove callback
...
Introduce new intermediate state to allow the clients on the bus
to communicate with the firmware from the remove handler.
This is to enable to perform a clean shutdown.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com >
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com >
Link: https://lore.kernel.org/r/20210206144325.25682-2-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-06 15:48:11 +01:00
Greg Kroah-Hartman
37f1cda438
Merge tag 'mhi-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next
...
Manivannan writes:
MHI changes for v5.12
Loic improved the MHI PCI generic controller by adding support for DIAG channel,
PCI error handling, suspend/recovery/resume, and health check. Loic also added
support for resetting the MHI device as per the MHI specification. This includes
writing to a specific register for default cases and looking for controller
specific callback when provided.
Along with this Loic, also added a new API which gets the number for free TREs
(Transfer Ring Elements) from the MHI core. The client drivers can make use of
this API and the current consumer is the "mhi-net" driver. For taking both the
"mhi-net" driver change and the API change, we created "mhi-net-immutable"
branch for this patch and merged the same into net-next and mhi-next.
Carl added a patch which lets the controller driver to pass the custom IRQ
flags for BHI and MHI event interrupts to the MHI core. The current consumer of
this feature is the ath11k MHI controller driver. For taking both the changes,
we created "mhi-ath11k-immutable" branch for this patch and merged into
ath11k-next and mhi-next.
Finally, Loic cleaned up the MHI queue APIs and fixed the shared MSI vector
support.
* tag 'mhi-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
bus: mhi: pci_generic: Increase num of elements in hw event ring
mhi: pci_generic: Print warning in case of firmware crash
bus: mhi: core: Add helper API to return number of free TREs
mhi: core: Factorize mhi queuing
mhi: use irq_flags if controller driver configures it
mhi: pci_generic: Fix shared MSI vector support
mhi: unconstify mhi_event_config
bus: mhi: Ensure correct ring update ordering with memory barrier
mhi: pci_generic: Set irq moderation value to 1ms for hw channels
mhi: pci_generic: Add diag channels
mhi: pci_generic: Increase controller timeout value
mhi: pci_generic: Add health-check
mhi: pci_generic: Add PCI error handlers
mhi: pci_generic: Add suspend/resume/recovery procedure
mhi: pci_generic: Add support for reset
mhi: pci_generic: Enable burst mode for hardware channels
mhi: pci-generic: Increase number of hardware events
bus: mhi: core: Add device hardware reset support
2021-02-05 15:04:33 +01:00
Uwe Kleine-König
1609faa9e6
coresight: etm4x: Fix merge resolution for amba rework
...
This was non-trivial to get right because commits
c23bc382ef ("coresight: etm4x: Refactor probing routine") and
5214b56358 ("coresight: etm4x: Add support for sysreg only devices")
changed the code flow considerably. With this change the driver can be
built again.
Fixes: 0573d3fa48 ("Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next")
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org >
Link: https://lore.kernel.org/r/20210205130848.20009-1-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-05 15:02:48 +01:00
Loic Poulain
026c5b1ec2
bus: mhi: pci_generic: Increase num of elements in hw event ring
...
We met some sporadic modem crashes during high throughput testing, this
has been root caused to a lack of elements in the event ring. Indeed,
the modem is simply crashing when event ring becomes empty.
It appears that the total number event ring elements is too low given
the performances of the modem (IPA hardware accelerator). This change
increases the number of elements in the hardware event ring to 2048,
which is aligned with what is defined in downstream version:
https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/arch/arm64/boot/dts/qcom/sm8150-mhi.dtsi?h=msm-4.14#n482
With this change, modem coes not crash anymore.
Note: An event ring element is 16-Byte, so the total memory usage of
a hardware event ring is now 32KB.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/1612514195-8257-1-git-send-email-loic.poulain@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
2021-02-05 17:59:29 +05:30
Loic Poulain
1e2f29ba83
mhi: pci_generic: Print warning in case of firmware crash
...
Print warning when MHI detects sys error.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org >
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/1612370382-21643-1-git-send-email-loic.poulain@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
2021-02-05 17:58:49 +05:30
Subbaraman Narayanamurthy
e2057ee299
nvmem: qcom-spmi-sdam: Fix uninitialized pdev pointer
...
"sdam->pdev" is uninitialized and it is used to print error logs.
Fix it. Since device pointer can be used from sdam_config, use it
directly thereby removing pdev pointer.
Fixes: 40ce979879 ("nvmem: add QTI SDAM driver")
Cc: stable@vger.kernel.org
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210205100853.32372-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-05 11:25:52 +01:00
Nicolas Saenz Julienne
b31f1eb41c
nvmem: Kconfig: Correct typo in NVMEM_RMEM
...
s/drivers/driver/ as the configuration selects a single driver.
Suggested-by: Randy Dunlap <rdunlap@infradead.org >
Acked-by: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210205100853.32372-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-05 11:25:52 +01:00
Greg Kroah-Hartman
0573d3fa48
Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next
...
This merges from linux-arm at 860660fd82 ("ARM: 9055/1: mailbox:
arm_mhuv2: make remove callback return void") into char-misc-next to get
the amba fixes from Uwe.
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: Russell King <linux@armlinux.org.uk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-05 11:15:43 +01:00
Greg Kroah-Hartman
5157110888
Merge tag 'icc-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next
...
Georgi writes:
interconnect changes for 5.12
Here are the interconnect changes for the 5.12-rc1 merge window
consisting of driver updates.
Driver changes:
- Refactoring and consolidation of drivers.
- New driver for MSM8939 platforms.
- New driver for SDX55 platforms.
Signed-off-by: Georgi Djakov <djakov@kernel.org >
* tag 'icc-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
interconnect: qcom: Add SDX55 interconnect provider driver
dt-bindings: interconnect: Add Qualcomm SDX55 DT bindings
interconnect: qcom: Add MSM8939 interconnect provider driver
dt-bindings: interconnect: Add Qualcomm MSM8939 DT bindings
dt-bindings: interconnect: single yaml file for RPM interconnect drivers
interconnect: qcom: qcs404: use shared code
interconnect: qcom: Consolidate interconnect RPM support
2021-02-05 11:11:14 +01:00
Uwe Kleine-König
860660fd82
ARM: 9055/1: mailbox: arm_mhuv2: make remove callback return void
...
My build tests failed to catch that amba driver that would have needed
adaption in commit 3fd269e74f ("amba: Make the remove callback return
void"). Change the remove function to make the driver build again.
Link: https://lore.kernel.org/r/20210202194308.jm66vblqjwr5wo6v@pengutronix.de
Reported-by: kernel test robot <lkp@intel.com >
Fixes: 3fd269e74f ("amba: Make the remove callback return void")
Acked-by: Viresh Kumar <viresh.kumar@linaro.org >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk >
2021-02-04 21:51:51 +00:00
Ricky Wu
920fd8a706
misc: rtsx: init of rts522a add OCP power off when no card is present
...
Power down OCP for power consumption
when no SD/MMC card is present
Cc: stable@vger.kernel.org
Signed-off-by: Ricky Wu <ricky_wu@realtek.com >
Link: https://lore.kernel.org/r/20210204083115.9471-1-ricky_wu@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:09:32 +01:00
Samuel Thibault
1f7c14afd4
speakup: Make dectlk flush timeout configurable
...
In case the serial port or cable got faulty, we may not be getting
acknowledgements any more. The driver then currently waits for 4s to
avoid jamming the device. This makes this delay configurable.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org >
Link: https://lore.kernel.org/r/20210128180116.1848120-3-samuel.thibault@ens-lyon.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:05:48 +01:00
Samuel Thibault
49f259eff8
speakup ABI: Advertise synth parameters for all synths
...
The parameters were advertised for the "soft" synth, but they are
available for all synths.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org >
Link: https://lore.kernel.org/r/20210128180116.1848120-2-samuel.thibault@ens-lyon.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:05:47 +01:00
Ahmad Fatoum
0445efacec
nvmem: core: skip child nodes not matching binding
...
The nvmem cell binding applies to all eeprom child nodes matching
"^.*@[0-9a-f]+$" without taking a compatible into account.
Linux drivers, like at24, are even more extensive and assume
_all_ at24 eeprom child nodes to be nvmem cells since e888d445ac
("nvmem: resolve cells from DT at registration time").
Since df5f3b6f53 ("dt-bindings: nvmem: stm32: new property for
data access"), the additionalProperties: True means it's Ok to have
other properties as long as they don't match "^.*@[0-9a-f]+$".
The barebox bootloader extends the MTD partitions binding to
EEPROM and can fix up following device tree node:
&eeprom {
partitions {
compatible = "fixed-partitions";
};
};
This is allowed binding-wise, but drivers using nvmem_register()
like at24 will fail to parse because the function expects all child
nodes to have a reg property present. This results in the whole
EEPROM driver probe failing despite the device tree being correct.
Fix this by skipping nodes lacking a reg property instead of
returning an error. This effectively makes the drivers adhere
to the binding because all nodes with a unit address must have
a reg property and vice versa.
Fixes: e888d445ac ("nvmem: resolve cells from DT at registration time").
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210129171430.11328-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:04:19 +01:00
Nicolas Saenz Julienne
5a3fa75a4d
nvmem: Add driver to expose reserved memory as nvmem
...
Firmware/co-processors might use reserved memory areas in order to pass
data stemming from an nvmem device otherwise non accessible to Linux.
For example an EEPROM memory only physically accessible to firmware, or
data only accessible early at boot time.
In order to expose this data to other drivers and user-space, the driver
models the reserved memory area as an nvmem device.
Tested-by: Tim Gover <tim.gover@raspberrypi.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210129171430.11328-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:04:18 +01:00
Nicolas Saenz Julienne
f90714e56c
dt-bindings: nvmem: Add bindings for rmem driver
...
Firmware/co-processors might use reserved memory areas in order to pass
data stemming from an nvmem device otherwise non accessible to Linux.
For example an EEPROM memory only physically accessible to firmware, or
data only accessible early at boot time.
Introduce the dt-bindings to nvmem's rmem.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210129171430.11328-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:04:18 +01:00
Fabio Estevam
579db09c61
nvmem: imx-iim: Use of_device_get_match_data()
...
The retrieval of driver data via of_device_get_match_data() can make
the code simpler.
Use of_device_get_match_data() to simplify the code.
Signed-off-by: Fabio Estevam <festevam@gmail.com >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210129171430.11328-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:04:18 +01:00
Dan Carpenter
72e008ce30
nvmem: core: Fix a resource leak on error in nvmem_add_cells_from_of()
...
This doesn't call of_node_put() on the error path so it leads to a
memory leak.
Fixes: 0749aa25af ("nvmem: core: fix regression in of_nvmem_cell_get()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Link: https://lore.kernel.org/r/20210129171430.11328-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:04:18 +01:00
Yang Li
76ec1ec8fc
cxl: Simplify bool conversion
...
Fix the following coccicheck warning:
./drivers/misc/cxl/sysfs.c:181:48-53: WARNING: conversion to bool not
needed here
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com >
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com >
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com >
Link: https://lore.kernel.org/r/1611908705-98507-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:02:18 +01:00
Suzuki K Poulose
f728960633
coresight: etm4x: Handle accesses to TRCSTALLCTLR
...
TRCSTALLCTLR register is only implemented if
TRCIDR3.STALLCTL == 0b1
Make sure the driver touches the register only it is implemented.
Link: https://lore.kernel.org/r/20210127184617.3684379-1-suzuki.poulose@arm.com
Cc: stable@vger.kernel.org
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: Mike Leach <mike.leach@linaro.org >
Cc: Leo Yan <leo.yan@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-32-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Jonathan Zhou
e5d51fbe9b
coresight: Add support for v8.4 SelfHosted tracing
...
v8.4 tracing extensions added support for trace filtering controlled
by TRFCR_ELx. This must be programmed to allow tracing at EL1/EL2 and
EL0. The timestamp used is the virtual time. Also enable CONTEXIDR_EL2
tracing if we are running the kernel at EL2.
Link: https://lore.kernel.org/r/20210110224850.1880240-29-suzuki.poulose@arm.com
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Mike Leach <mike.leach@linaro.org >
Cc: Will Deacon <will@kernel.org >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Jonathan Zhou <jonathan.zhouwen@huawei.com >
[ Move the trace filtering setup etm_init_arch_data() and clean ups]
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-31-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Jonathan Zhou
4b6929f50d
arm64: Add TRFCR_ELx definitions
...
Add definitions for the Arm v8.4 SelfHosted trace extensions registers.
[ split the register definitions to separate patch
rename some of the symbols ]
Link: https://lore.kernel.org/r/20210110224850.1880240-28-suzuki.poulose@arm.com
Cc: Will Deacon <will@kernel.org >
Acked-by: Catalin Marinas <catalin.marinas@arm.com >
Signed-off-by: Jonathan Zhou <jonathan.zhouwen@huawei.com >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-30-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
61c68c68b8
dts: bindings: coresight: ETM system register access only units
...
Document the bindings for ETMs with system register accesses.
Link: https://lore.kernel.org/r/20210110224850.1880240-27-suzuki.poulose@arm.com
Cc: devicetree@vger.kernel.org
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: Mike Leach <mike.leach@linaro.org >
Acked-by: Rob Herring <robh@kernel.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-29-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
5214b56358
coresight: etm4x: Add support for sysreg only devices
...
Add support for devices with system instruction access only.
They don't have a memory mapped interface and thus are not
AMBA devices. System register access is not permitted to
TRCPDCR and thus skip access to them.
Link: https://lore.kernel.org/r/20210110224850.1880240-26-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-28-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
e97db2cf09
coresight: etm4x: Run arch feature detection on the CPU
...
As we are about to add support for system register based devices,
we don't get an AMBA pid. So, the detection code could check
the system registers running on the CPU to check for the architecture
specific features. Thus we move the arch feature detection to
run on the CPU. We cannot always read the PID from the HW, as the
PID could be overridden by DT for broken devices. So, use the
PID from AMBA layer if available.
Link: https://lore.kernel.org/r/20210110224850.1880240-25-suzuki.poulose@arm.com
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: Mike Leach <mike.leach@linaro.org >
Cc: liuqi115@huawei.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-27-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
c23bc382ef
coresight: etm4x: Refactor probing routine
...
CoreSight ETM with system register access may not have a
memory mapped i/o access. Refactor the ETM specific probing
into a common routine to allow reusing the code for such ETMs.
Link: https://lore.kernel.org/r/20210110224850.1880240-24-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-26-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
dc1747a716
coresight: etm4x: Detect system instructions support
...
ETM v4.4 onwards adds support for system instruction access
to the ETM. Detect the support on an ETM and switch to using the
mode when available.
Link: https://lore.kernel.org/r/20210110224850.1880240-23-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-25-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
1ab3bb9df5
coresight: etm4x: Add necessary synchronization for sysreg access
...
As per the specification any update to the TRCPRGCTLR must be synchronized
by a context synchronization event (in our case an explicist ISB) before
the TRCSTATR is checked.
Link: https://lore.kernel.org/r/20210110224850.1880240-22-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-24-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:34 +01:00
Suzuki K Poulose
4211bfce1e
coresight: etm4x: Expose trcdevarch via sysfs
...
Expose the TRCDEVARCH register via the sysfs for component
detection. Given that the TRCIDR1 may not completely identify
the ETM component and instead need to use TRCDEVARCH, expose
this via sysfs for tools to use it for identification.
Link: https://lore.kernel.org/r/20210110224850.1880240-21-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-23-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
8b94db1eda
coresight: etm4x: Use TRCDEVARCH for component discovery
...
We have been using TRCIDR1 for detecting the ETM version. This
is in preparation for the future IP support.
Link: https://lore.kernel.org/r/20210110224850.1880240-20-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-22-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
fd6e790500
coresight: etm4x: Detect access early on the target CPU
...
In preparation to detect the support for system instruction
support, move the detection of the device access to the target
CPU.
Link: https://lore.kernel.org/r/20210110224850.1880240-19-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-21-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
e49516e2df
coresight: etm4x: Handle ETM architecture version
...
We are about to rely on TRCDEVARCH for detecting the ETM
and its architecture version, falling back to TRCIDR1 if
the former is not implemented (in older broken implementations).
Also, we use the architecture version information to
make some decisions. Streamline the architecture version
handling by adding helpers.
Link: https://lore.kernel.org/r/20210110224850.1880240-18-suzuki.poulose@arm.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-20-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
4d1b1fd729
coresight: etm4x: Clean up exception level masks
...
etm4_get_access_type() calculates the exception level bits
for use in address comparator registers. This is also used
by the TRCVICTLR register by shifting to the required position.
This patch cleans up the logic to make etm4_get_access_type()
calculate a generic mask which can be used by all users by
shifting to their field.
No functional changes intended.
Link: https://lore.kernel.org/r/20210110224850.1880240-17-suzuki.poulose@arm.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-19-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
1d3eead7e9
coresight: etm4x: Cleanup secure exception level masks
...
We rely on the ETM architecture version to decide whether
Secure EL2 is available on the CPU for excluding the level
for address comparators and viewinst main control register.
We must instead use the TRCDIDR3.EXLEVEL_S field to detect
the supported levels.
Link: https://lore.kernel.org/r/20210110224850.1880240-16-suzuki.poulose@arm.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-18-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
33d5573a15
coresight: etm4x: Check for Software Lock
...
The Software lock is not implemented for system instructions
based accesses. So, skip the lock register access in such
cases.
Link: https://lore.kernel.org/r/20210110224850.1880240-15-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-17-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
d02dfac343
coresight: etm4x: Define DEVARCH register fields
...
Define the fields of the DEVARCH register for identifying
a component as an ETMv4.x unit. Going forward, we use the
DEVARCH register for the component identification, rather
than the TRCIDR3.
Link: https://lore.kernel.org/r/20210110224850.1880240-14-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-16-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
91b9f01854
coresight: etm4x: Hide sysfs attributes for unavailable registers
...
Some of the management registers in ETMv4.x are not accessible
via system register instructions. Thus we must hide the sysfs
files exposing them to the userspace, to prevent system crashes.
This patch adds an is_visible() routine to control the visibility
at runtime for the registers that may not be accessed.
Link: https://lore.kernel.org/r/20210110224850.1880240-13-suzuki.poulose@arm.com
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-15-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
03336d0f4d
coresight: etm4x: Add sysreg access helpers
...
ETM architecture defines the system instructions for accessing
via register accesses. Add basic support for accessing a given
register via system instructions.
We split the list of registers as :
1) Accessible only from memory mapped interface
2) Accessible from system register instructions.
All registers are accessible via the memory-mapped interface.
However, some registers are not accessible via the system
instructions. This list is then used to further filter out
the files we expose via sysfs.
Link: https://lore.kernel.org/r/20210110224850.1880240-12-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-14-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
4f2a67266a
coresight: etm4x: Add commentary on the registers
...
As we are about define a switch..case table for individual register
access by offset for implementing the system instruction support,
document the possible set of registers for each group to make
it easier to correlate.
Link: https://lore.kernel.org/r/20210110224850.1880240-11-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-13-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
c03ceec116
coresight: etm4x: Make offset available for sysfs attributes
...
Some of the ETM management registers are not accessible via
system instructions. Thus we need to filter accesses to these
registers depending on the access mechanism for the ETM at runtime.
The driver can cope with this for normal operation, by regular
checks. But the driver also exposes them via sysfs, which now
needs to be removed.
So far, we have used the generic coresight sysfs helper macros
to export a given device register, defining a "show" operation
per register. This is not helpful to filter the files at runtime,
based on the access.
In order to do this dynamically, we need to filter the attributes
by offsets and hard coded "show" functions doesn't make this easy.
Thus, switch to extended attributes, storing the offset in the scratch
space. This allows us to implement filtering based on the offset and
also saves us some text size. This will be later used for determining
a given attribute must be "visible" via sysfs.
Link: https://lore.kernel.org/r/20210110224850.1880240-10-suzuki.poulose@arm.com
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-12-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
f5bd523690
coresight: etm4x: Convert all register accesses
...
Convert all register accesses from etm4x driver to use a wrapper
to allow switching the access at runtime with little overhead.
co-developed by sed tool ;-), mostly equivalent to :
s/readl\(_relaxed\)\?(drvdata->base + \(.*\))/etm4x_\1_read32(csdev, \2)
s/writel\(_relaxed\)\?(\(.*\), drvdata->base + \(.*\))/etm4x_\1_write32(csdev, \2, \3)
We don't want to replace them with the csdev_access_* to
avoid a function call for every register access for system
register access. This is a prepartory step to add system
register access later where the support is available.
Link: https://lore.kernel.org/r/20210110224850.1880240-9-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-11-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:33 +01:00
Suzuki K Poulose
5e2acf9d5d
coresight: etm4x: Always read the registers on the host CPU
...
As we are about to add support for sysreg access to ETM4.4+ components,
make sure that we read the registers only on the host CPU.
Link: https://lore.kernel.org/r/20210110224850.1880240-8-suzuki.poulose@arm.com
Cc: Mike Leach <mike.leach@linaro.org >
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210201181351.1475223-10-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-04 17:00:32 +01:00