Commit Graph

1236026 Commits

Author SHA1 Message Date
Heinrich Toews 6be569be53 tools/examples: add /dev/mem physical memory access example
Add a new example utility that maps a physical MMIO address range using
/dev/mem and mmap, reads 32-bit register values, and dumps a
user-specified number of bytes in hexadecimal format.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-04-02 10:50:58 +02:00
Heinrich Toews ee6bbf0acb drivers: remoteproc: ti_k3_m4: use memremap for no-map reserved memory
Replace devm_ioremap_wc() with memremap(MEMREMAP_WB) for no-map
reserved-memory regions that have struct page backing.

Using ioremap_wc() on a region backed by struct pages violates
ARM64 memory aliasing rules by creating conflicting cached and
write-combining mappings of the same physical pages. This can
cause SIGBUS faults in unrelated userspace processes.

Add a devm cleanup action to call memunmap() on the mapped
region when the device is released.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-18 17:32:17 +01:00
Heinrich Toews fb6487598d arm64: dts: k3-am623-pfc-750-8xxx: add no-map and gap reservations for AM623 PFC
Add missing no-map property to ramoops region to prevent Linux
from managing it as regular memory.

Reserve gap regions adjacent to ioremap_wc-mapped M4 memory to
avoid ARM64 cache aliasing issues caused by Linux allocating
pages next to these regions.

Also reserve a gap between r5f-dma-memory and TF-A region to
prevent potential memory conflicts.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-18 17:29:27 +01:00
Heinrich Toews 84f6b6b2b4 dsa: microchip: ksz9477_sysfs: move to regmap
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews c6b83a8a18 arm64: dts: k3-am623-pfc-750-8xxx: fix padconf for SPI2_D1
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews 440b2636a6 arm64: dts: k3-am62x-pfc: add spidev definition
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews 8fbc497d02 driver: spi: kbus: fix: add contextualization to max_speed_hz validation
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews 364bafa89b arm64: dts: k3-am62x-pfc: tpm: fix: reference names should always be in lower case
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews 973133fb07 arm64: dts: k3-am623-pfc-750-84xx: ksz: enable single led mode
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:09 +01:00
Heinrich Toews e9a7a7db80 net: dsa: microchip: ksz_common: add single led mode support for ksz9477
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews f7bef5c22d arm64: configs: am6xxx: enable NET_DSA_MICROCHIP_KSZ9477_SYSFS
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews 07add97641 net: dsa: microchip: ksz9477: add sysfs reg access support
This commit adds sysfs support for ksz9477 register acccess in
userspace. Although access is possible through the use of regmap it
showed to be uncomfortable to work with whole register dumps and also
or security reasons write access is prohibited by deault.

Do a 16-bit read access:

    echo 16 0x040C > ksz_read

A 32-bit wirte access:

    echo 32 0x0120 0x0115  > ksz_write

Results will be logged in the kernel buffer.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews 008d7df4af arm64: configs: am6xxx: enable RPMSG configs
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews c4cf89b09f configs: am6xxx: enable REMOTEPROC and TI_K3_M4_REMOTEPROC
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews c037b08a85 arm64: dts: k3-am623-pfc-750-8xxx: add remoteproc mcu_m4fss nodes
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Hari Nagalla beb102e610 remoteproc: Introduce mailbox messages for graceful shutdown
Two mailbox messages are added to facilitate handshake between the
remote processors to ensure graceful stop of the remote processors.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2026-03-17 17:54:08 +01:00
Markus Schneider-Pargmann 750daf2748 remoteproc: k3-m4: Move suspend to suspend_late
The remote core has to be able to query the DM for the next system mode
in the suspend path. To support this, ti_sci.c has to send the
prepare_sleep command before the suspend message is sent to the remote
core. This patch moves the suspend to suspend_late to be executed after
ti_sci's suspend call.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
2026-03-17 17:54:08 +01:00
Hari Nagalla 1f4ef45bc2 remoteproc: k3-m4: Introduce PM suspend/resume handlers
Introduce suspend/resume handling to m4 remoteproc driver. The driver
registers for pm notifications. And on SUSPEND_PREPARE event a i
RP_MBOX_SUSPEND_SYSTEM mailbox message is sent to the remote core.
a) If the remote core does n't respond to the SUSPEND message, the
driver sets a device on constraint and returns.
b) If the remote core responds with 'RP_MBOX_SUSPEND_ACK', the driver
initiates a stop of the remote core and returns from the suspend
handler.
c) On the other hand, if the remote core responds with
RP_MBOX_SUSPEND_AUTO or RP_MBOX_SUSPEND_CANCEL, the driver simply
returns.

On the Resume path, driver queries DM to determine the state of the
remote core and if it is Off, turns on the remote core.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
2026-03-17 17:54:08 +01:00
Hari Nagalla 0436682951 remoteproc: k3-m4: support for graceful shutdown of remote cores
Upon a stop request, K3-M4 remote proc driver sends a RP_MBOX_SHUTDOWN
mailbox message to the remote R5 core.

The remote core is expected to:
- relinquish all the resources acquired through Device Manager (DM)
- disable its interrupts
- send back a mailbox acknowledgment RP_MBOX_SHUDOWN_ACK
- enter WFI state.

Meanwhile, the K3-M4 remote proc driver does:
- wait for the RP_MBOX_SHUTDOWN_ACK from the remote core
- wait for the remote proc to enter WFI state
- reset the remote core through device manager

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2026-03-17 17:54:08 +01:00
Martyn Welch 8811cb9cf5 remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem
The AM62x and AM64x SoCs of the TI K3 family has a Cortex M4F core in
the MCU domain. This core is typically used for safety applications in a
stand alone mode. However, some application (non safety related) may
want to use the M4F core as a generic remote processor with IPC to the
host processor. The M4F core has internal IRAM and DRAM memories and are
exposed to the system bus for code and data loading.

A remote processor driver is added to support this subsystem, including
being able to load and boot the M4F core. Loading includes to M4F
internal memories and predefined external code/data memories. The
carve outs for external contiguous memory is defined in the M4F device
node and should match with the external memory declarations in the M4F
image binary. The M4F subsystem has two resets. One reset is for the
entire subsystem i.e including the internal memories and the other, a
local reset is only for the M4F processing core. When loading the image,
the driver first releases the subsystem reset, loads the firmware image
and then releases the local reset to let the M4F processing core run.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2026-03-17 17:54:08 +01:00
Hari Nagalla 4535aed8be dt-bindings: remoteproc: k3-m4f: Add K3 AM64x SoCs
K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain.
The remote processor's life cycle management and IPC mechanisms are
similar across the R5F and M4F cores from remote processor driver
point of view. However, there are subtle differences in image loading
and starting the M4F subsystems.

The YAML binding document provides the various node properties to be
configured by the consumers of the M4F subsystem.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2026-03-17 17:54:08 +01:00
Heinrich Toews 45a6f8a5b2 arm64: configs: am6xxx: enable NFC_TAG_ST25DV
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Heinrich Toews 835d1cd4c5 nfc: tag: add NFC tag device st25dvxxk
This driver is actually an external kernel module that was imported
into the kernel tree.

You can find the original driver of Boban Loïc at

https://github.com/2pecshy/eeprom-ST25DV-linux-driver.git

Changes done by Fa. WAGO:

- refactor the probe and detect functions to align with
  modern Linux kernel best practices:

- Switch to Managed Resources: Replaced standard kmalloc/kzalloc with
  devm_kmalloc/devm_kzalloc for all data structures and buffers.
  This simplifies the probe function and eliminates the need for
  most memory-related goto labels and manual kfree calls.
- Automatic Device Management: Integrated devm_add_action_or_reset
  to handle the automatic unregistering of the dummy I2C client,
  ensuring safer resource release during error paths and removal.
- Modernized Logging: Replaced generic pr_warn/pr_info calls with
  device-specific dev_err, dev_info, and dev_dbg for better
  traceability in systems with multiple I2C devices.
- Improved String Handling: Replaced the deprecated strlcpy with
  the safer strscpy in the detection phase.
- Enhanced Status Reporting: Added detailed dev_info upon successful
  probe, including the specific chip model name and detected memory
  capacity.
- Coding Style Fixes: Standardized indentation, removed unnecessary
  braces for single-statement blocks, and structured area-specific
  initializations to improve readability and maintainability.

The driver was tested and seems to be working fine.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-03-17 17:54:08 +01:00
Sergej WIEBE 4f6af6494f Merge pull request #425 from BU-Automation/topic/sw/add_initramfs_support
arm: configs: am3xxx_pfc_generic: enable initramfs support
2026-03-16 17:12:43 +01:00
Sergej Wiebe b1cdb250c5 arm: configs: am3xxx_pfc_generic: enable initramfs support
Enable CONFIG_BLK_DEV_INITRD to allow booting an external initramfs
passed by the bootloader via the Android boot image format.

Without this option the kernel ignores any ramdisk provided through
ATAGs or the devicetree linux,initrd-start/end properties and hangs
indefinitely at:

  Waiting for root device /dev/ram0...

Signed-off-by: Sergej Wiebe <sergej.wiebe@wago.com>
2026-03-16 11:52:21 +01:00
Andrej UNRAU d20b58cb7c Merge pull request #424 from BU-Automation/fix/dts-rename-eb-led-to-em
arm64: dts: ti: k3-am623-pfc-750-84xx: fix LED name 'eb' to 'em'
2026-03-10 15:57:18 +01:00
Andrej Unrau 1f75fdeac0 arm64: dts: ti: k3-am623-pfc-750-84xx: fix LED name 'eb' to 'em'
The LED on the PFC400 interaction board was incorrectly named 'eb'.
Rename all occurrences (node names, labels, and multicolor group) to the
correct name 'em'.

Signed-off-by: Andrej Unrau <andrej.unrau@wago.com>
2026-03-10 14:55:14 +01:00
Oliver SCHILDAN b661f3fdcc Merge pull request #423 from BU-Automation/topic/osch/release_w05.11.08
add new version release_w05.11.08
2026-02-27 14:56:39 +01:00
Oliver Schildan d14d5d186e add new version release_w05.11.08 2026-02-27 12:49:22 +01:00
Tobias BIEHL 0e6597e783 Merge pull request #422 from BU-Automation/topic/tbi/kbus-spi-waitqueue-issue
drivers: spi: kbus: remove re-initialization of workqueue in renesas_isr
2026-02-27 11:13:11 +01:00
Tobias Biehl 238366a634 drivers: spi: kbus: remove re-initialization of workqueue in renesas_isr
The init_workqueue_head() call during usage leads to hanging ioctl()
calls in userspace. There is no need to re-init the workqueue, so remove
it.

Signed-off-by: Tobias Biehl <tobias.biehl@wago.com>
2026-02-27 10:30:09 +01:00
Oleg Karfich 7d25e1159b add new version release_w05.11.07
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
2026-02-26 16:08:16 +01:00
Heinrich Toews 1dde1a6b0f arm: dts: pfc-750-84xx-wosm: mram: optimize timings
set cdns,tsd2d-ns to 30 ~ D_NSS_FLD   (Bit 31:24)
set cdns,tshsl-ns to 30 ~ D_BTWN_FLD  (Bit 23:16)
set cdns,tchsh-ns to 10 ~ D_AFTER_FLD (Bit 15:8)
set cdns,tslch-ns to 10 ~ D_INIT_FLD  (Bit 7:0)

OSPI0_DEV_DELAY_REG Register in AM62xx TRM.

Calculation with Ref-Clk (400 MHz): 2.5ns * FLD-value.

Can be accessed through devmem:

    devmem 0xfc4000c 32
    0x0C0C0404

Tested with mram-test3.sh:

root@PFC400-DEV-R3:~ ./mram_test3.sh --timeout 600 --debug
Starting Stress Test on /dev/mtd0 (1024 KB Range, Duration: 600s)
[00:03:57] [Iter 5670] Pos:  748 / 1024 KB | Offset: 0x000bb200^[[A
[00:09:59] [Iter 14383] Pos:  217 / 1024 KB | Offset: 0x00036700

========================================
         MRAM TEST RESULTS
========================================
 Final Status:     PASSED
 Total Runtime:    00:10:00
 Total Iterations: 14383
 Total Data Moved: 57532 KB
 Config Timeout:   600s
========================================

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-26 16:08:16 +01:00
Heinrich Toews 58bbb53e99 arm: dts: pfc-750-84xx-wosm: mram: remove cdns,phy-mode
The device-tree bindnig cdns,phy-mode does not exist in mainline
kernels.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-26 16:08:16 +01:00
Oleg KARFICH eeaa1fa415 Merge pull request #419 from BU-Automation/topic/ht/pfc400/mram-em008lxo-rebase
Add full MRAM STR (8s-8s-8s) Support with 200 Mhz Clock Speed
2026-02-25 15:21:40 +01:00
Heinrich Toews 4e58c348b2 spi: cadence-qspi: add logging for clk configuration changes
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-25 10:00:36 +01:00
Heinrich Toews f3d8580745 mtd: spi-nor: everspin: implement 200MHz Octal-STR mode for EM008LX
This patch enables high-speed Octal-STR (8s-8s-8s) operation at 200MHz
for the Everspin EM008LX MRAM series.

To maintain reliable boot-up, the device is identified at a safe
frequency. Upon successful JEDEC ID verification, the driver escalates
the clock frequency to 200MHz and synchronizes the dummy cycles.

Key Improvements:
- Added frequency escalation in params->setup() hook to 200MHz.
- Implemented Octal register access (0x85/0x81) for configuration.
- Synchronized dummy cycles to 20, as required for 200MHz operation.
- Validated with Cadence OSPI controller using a 400MHz reference clock
  and a read-capture delay of 3-5 cycles.

The resulting configuration achieves the maximum specified throughput
of the Everspin MRAM while maintaining data integrity.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-25 10:00:08 +01:00
Heinrich Toews 1d2ed385ff arm: dts: pfc-750-84xx-wosm: mram: change total capacity to 1MB
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-24 11:23:02 +01:00
Heinrich Toews 7587fa5670 arm: dts: pfc-750-84xx-wosm: mram: adjust timings for 80 Mhz 8s-8s-8s mode
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-24 11:23:02 +01:00
Heinrich Toews 0918552295 mtd: spi-nor: core: add blind octal reset fix for Everspin MRAM
Everspin Octal-STR MRAMs (like EM008LXO) stay in Octal mode after a
warm reboot if the hardware reset pin is not toggled (e.g., when
connected to nPORZ-MCU). This causes the subsequent JEDEC ID read
to fail, as the controller restarts in Single-SPI mode while the
device still expects Octal-STR commands.

This patch introduces spi_nor_everspin_reboot_fix(), which is called
within spi_nor_hw_reset() as a fallback if no dedicated reset GPIO
is defined in the Device Tree.

The fix sends a "blind" Software Reset sequence (0x66 -> 0x99) using
8-8-8 protocol. If the device is in Octal-STR mode, it will recover to
Single-SPI. If it is already in Single-SPI mode, the 8-lane command is
ignored by the device, making this a safe recovery path for warm
reboots.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-24 11:23:02 +01:00
Heinrich Toews 133e49bfc4 mtd: spi-nor: everspin: refactor initialization and enable Octal STR mode
Refactor the Everspin MRAM initialization sequence to support transition
into Octal STR (8s-0-8s) mode.

The following changes are implemented:
- Add everspin_mram_software_reset() to ensure the device is in a known
  state (Single-SPI) before configuration.
- Update register addresses and opcodes to align with the datasheet and
  legacy driver requirements (e.g., using 0x81 for WRAR).
- Refactor everspin_mram_write_reg() to use SNOR_PROTO_1_1_1 for initial
  configuration and ensure Write Enable (WREN) is issued.
- Implement Octal STR mode activation by configuring CFR1V (Dummy Cycles)
  and CFR0V (Mode).
- Add verification steps by reading the Status Register and ID in
  SNOR_PROTO_8_8_8 mode with appropriate dummy cycles.

This ensures the MRAM is correctly detected and switched to high-speed
octal operation during the probe phase.

Signed-off-by: Heinrich Toews <ht@twx-software.de>
2026-02-24 11:23:02 +01:00
Oleg KARFICH 2b10a5afd4 Merge pull request #416 from BU-Automation/topic/ok/pfc400/redesign-2
Topic/ok/pfc400/redesign 2
2026-02-20 07:55:54 +01:00
Oleg Karfich 4ae31418d2 add new version release_w05.11.06
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
2026-02-19 15:49:56 +01:00
Oleg Karfich 6441f580b5 arm64: dts: k3-am623-pfc-750-84xx-baseboard: move KSZ9477 reset pin to MCU GPIO
Move the reset GPIO pin for the KSZ9477 Ethernet switch from main_gpio1
pin 10 to mcu_gpio0 pin 11 to match the actual hardware configuration.

This change:
- Removes the reset pin definition from main_pmx0 pinctrl group
- Adds a new mcu_pmx0 pinctrl group for the MCU GPIO configuration
- Updates the ksz9477 device node to reference both pinctrl groups
- Changes reset-gpios from main_gpio1 10 to mcu_gpio0 11

Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
2026-02-19 15:16:31 +01:00
Oleg Karfich 9e6fd10aa1 add new version release_w05.11.05
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
2026-02-18 10:34:56 +01:00
Oleg KARFICH d3d097fd35 Merge pull request #417 from BU-Automation/topic/rg/cc100_can
arm: dts: cc100 dali change PTN5150 configuration
2026-02-18 08:42:20 +01:00
Ralf Gliese 2c0c1870ce arm: dts: EC300: change PTN5150 configuration
add new hardware Version AHX(instead HHX) of PTN5150 with different I2C address

Signed-off-by: Ralf Gliese <ralf.gliese@elrest.de>
2026-02-17 10:58:29 +01:00
Ralf Gliese 6f8cbb8517 arm: dts: cc100 dali change PTN5150 configuration
add new hardware Version AHX (old HX) of PTN5150 with diffrent I2C address

Signed-off-by: Ralf Gliese <ralf.gliese@elrest.de>
2026-02-17 07:50:59 +01:00
Oleg KARFICH 5a06c5102f Merge pull request #414 from BU-Automation/topic/rg/cc100_can
dts: CC100_CAN: change adc configuration
2026-02-13 15:30:23 +01:00
Oleg KARFICH f44b178c4f Merge branch 'master' into topic/rg/cc100_can 2026-02-13 08:51:58 +01:00