Compare commits

...

10 Commits

Author SHA1 Message Date
Heinrich Toews
3f96c98631 dirty
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-11-06 08:52:22 +01:00
Heinrich Toews
b911ee989b dts: 750-84xx: wosm: move uio_mram to fss node
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-11-03 14:23:42 +01:00
Heinrich Toews
7a999a818a net: dsa: microchip: ksz9477: setup single-led mode (dirty)
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-11-03 14:21:20 +01:00
Heinrich Toews
3c892fb041 configs: am6xxx: enable RPMSG
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-11-03 14:20:16 +01:00
Heinrich Toews
0bd2c98b18 arm64: dts: k3-am623-pfc-750-8xxx: fix: mux SPI2_D1 as output
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-10-27 13:43:22 +01:00
Heinrich Toews
4d0cde8401 pfc-750-84xx: testing M4 test leds access
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-10-10 15:00:35 +02:00
Heinrich Toews
8dd8da6f3e configs: am6xxx: enable REMOTEPROC and TI_K3_M4_REMOTEPROC
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-10-10 07:24:53 +02:00
Heinrich Toews
2d7ff83b90 arm64: dts: k3-am623-pfc-750-8xxx: add remoteproc mcu_m4fss nodes
Signed-off-by: Heinrich Toews <ht@twx-software.de>
2025-10-10 07:23:26 +02:00
Hari Nagalla
419cbe263d 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>
2025-10-09 15:27:57 +02:00
Markus Schneider-Pargmann
dc062ea3a8 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>
2025-10-09 15:21:54 +02:00
13 changed files with 206 additions and 24 deletions

@ -171,4 +171,17 @@ mcu_mcan1: can@4e18000 {
bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
status = "disabled";
};
mcu_m4fss: m4fss@5000000 {
compatible = "ti,am64-m4fss";
reg = <0x00 0x5000000 0x00 0x30000>,
<0x00 0x5040000 0x00 0x10000>;
reg-names = "iram", "dram";
resets = <&k3_reset 9 1>;
firmware-name = "am62-mcu-m4f0_0-fw";
ti,sci = <&dmsc>;
ti,sci-dev-id = <9>;
ti,sci-proc-ids = <0x18 0xff>;
status = "disabled";
};
};

@ -15,3 +15,20 @@ &wsysinit {
status = "okay";
board,variant = "pfc400";
};
&mcu_pmx0 {
mcu_gpio0_pins: mcu-gpio-test-pin {
pinctrl-single,pins = <
AM64X_MCU_IOPAD(0x001C, PIN_OUTPUT, 7) /* (A6) nRST-EM3 -> nRST-EM2 0x0408401C MCU_UART0_CTSn.MCU_GPIO0_7 (PIN twisted) */
AM64X_MCU_IOPAD(0x0020, PIN_OUTPUT, 7) /* (B6) nRST-EM2 -> nRST-EM3 0x04084020 MCU_UART0_RTSn.MCU_GPIO0_8 (PIN twisted) */
AM64X_MCU_IOPAD(0x003C, PIN_OUTPUT, 7) /* (E5) nRST-EM1 0x0408403C MCU_MCAN1_TX.MCU_GPIO0_15 */
>;
};
};
&mcu_gpio0 {
pinctrl-0 = <&mcu_gpio0_pins>;
pinctrl-names = "default";
status = "reserved";
/* status = "okay"; */
};

@ -6,6 +6,28 @@
* Copyright (C) 2025 WAGO GmbH & Co. KG - https://www.wago.com/
*/
&leds_gpio {
led-1 {
label = "pfc400:nrst-em2";
gpios = <&mcu_gpio0 7 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
led-2 {
label = "pfc400:nrst-em3";
gpios = <&mcu_gpio0 8 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
led-3 {
label = "pfc400:nrst-em1";
gpios = <&mcu_gpio0 15 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
function = LED_FUNCTION_HEARTBEAT;
default-state = "on";
};
};
&main_pmx0 {
main_ksz9477_pins: main-ksz9477-pins {
pinctrl-single,pins = <

@ -39,19 +39,18 @@ oms_reset_all: reset_all {
debounce-interval = <1>;
};
};
};
leds {
compatible = "gpio-leds";
&leds_gpio {
led-0 {
pinctrl-0 = <&sd_activity_led_pin>;
pinctrl-names = "default";
led-0 {
function = LED_FUNCTION_SD;
color = <LED_COLOR_ID_ORANGE>;
gpios = <&main_gpio0 31 GPIO_ACTIVE_LOW>;
linux,default-trigger = "mmc0";
default-state = "on";
};
label = "pfc400:sd:mmc0";
function = LED_FUNCTION_SD;
color = <LED_COLOR_ID_ORANGE>;
gpios = <&main_gpio0 31 GPIO_ACTIVE_LOW>;
linux,default-trigger = "mmc0";
default-state = "on";
};
};

@ -54,8 +54,15 @@ vcc_1v8_sys: regulator-4 {
regulator-boot-on;
};
uio_nvram: UIO_NVRAM@1000000 {
leds_gpio: leds {
compatible = "gpio-leds";
};
};
&fss {
uio_mram: uio@500000000 {
compatible = "uio_pdrv_genirq";
linux,uio-name = "UIO_OSPI_MRAM";
/*
* FSS Memory Region: External Memory Space (Region 3)

@ -96,6 +96,18 @@ wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9db00000 {
reg = <0x00 0x9db00000 0x00 0xc00000>;
no-map;
};
mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
compatible = "shared-dma-pool";
reg = <0x00 0x9cb00000 0x00 0x100000>;
no-map;
};
mcu_m4fss_memory_region: m4f-memory@9cc00000 {
compatible = "shared-dma-pool";
reg = <0x00 0x9cc00000 0x00 0xe00000>;
no-map;
};
};
vmain_pd: regulator-0 {
@ -224,7 +236,7 @@ main_spi2_pins_default: main-spi2-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01b0, PIN_OUTPUT, 1) /* (A20) MCASP0_ACLKR.SPI2_CLK */
AM62X_IOPAD(0x0194, PIN_INPUT, 1) /* (B19) MCASP0_AXR3.SPI2_D0 */
AM62X_IOPAD(0x0198, PIN_INPUT, 1) /* (A19) MCASP0_AXR2.SPI2_D1 */
AM62X_IOPAD(0x0198, PIN_OUTPUT, 1) /* (A19) MCASP0_AXR2.SPI2_D1 */
AM62X_IOPAD(0x01ac, PIN_OUTPUT, 1) /* (E19) MCASP0_AFSR.SPI2_CS0 */
>;
};
@ -357,3 +369,10 @@ &usb0 {
status = "okay";
dr_mode = "peripheral";
};
&mcu_m4fss {
mboxes = <&mailbox0_cluster0 &mbox_m4_0>;
memory-region = <&mcu_m4fss_dma_memory_region>,
<&mcu_m4fss_memory_region>;
status = "okay";
};

@ -150,7 +150,6 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_GATE=m
CONFIG_NET_SWITCHDEV=y
CONFIG_CGROUP_NET_PRIO=y
# CONFIG_WIRELESS is not set
CONFIG_PAGE_POOL_STATS=y
@ -258,6 +257,7 @@ CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SERIAL_OMAP_MODBUS is not set
CONFIG_RPMSG_TTY=y
CONFIG_HW_RANDOM=y
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
@ -371,6 +371,14 @@ CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y
CONFIG_IOMMU_IO_PGTABLE_DART=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_CDEV=y
CONFIG_TI_K3_DSP_REMOTEPROC=y
CONFIG_TI_K3_M4_REMOTEPROC=y
CONFIG_TI_K3_R5_REMOTEPROC=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_SOC_BRCMSTB=y
CONFIG_TI_SCI_PM_DOMAINS=y
CONFIG_PM_DEVFREQ=y
@ -402,7 +410,6 @@ CONFIG_NTFS3_FS=m
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_CONFIGFS_FS=y
CONFIG_SQUASHFS=y
CONFIG_PSTORE=y
CONFIG_PSTORE_CONSOLE=y
@ -451,8 +458,6 @@ CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_PACKING=y
CONFIG_INDIRECT_PIO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC64_ROCKSOFT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC7=y
CONFIG_CRC8=y
@ -465,4 +470,6 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_SAMPLES=y
CONFIG_SAMPLE_RPMSG_CLIENT=m
CONFIG_MEMTEST=y

@ -174,6 +174,7 @@ int ksz9477_reset_switch(struct ksz_device *dev)
SPI_AUTO_EDGE_DETECTION, 0);
/* default configuration */
/* TWx: REG_SW_LUE_CTRL_1 = Switch Lookup Engine Control 1 Register */
ksz_write8(dev, REG_SW_LUE_CTRL_1,
SW_AGING_ENABLE | SW_LINK_AUTO_AGING | SW_SRC_ADDR_FILTER);
@ -195,6 +196,62 @@ int ksz9477_reset_switch(struct ksz_device *dev)
data8 = SW_ENABLE_REFCLKO | SW_REFCLKO_IS_125MHZ;
ksz_write8(dev, REG_SW_GLOBAL_OUTPUT_CTRL__1, data8);
{
u16 data16;
/* REGS
*
* Write MMD - Device Address 2h, Register 00h = 0010h to enable single-LED mode.
*
* REG_PORT_PHY_MMD_SETUP - Write the PHY MMD Setup Register with 0002h
* REG_PORT_PHY_MMD_INDEX_DATA - Write the PHY MMD Data Register with 0000h
* - Write the PHY MMD Setup Register with 4002h
* - Write the PHY MMD Data Register with 0010h
*
*
*/
/* WRITE */
for (int i = 1; i <= 5; i++) {
/* skip EM port 3(4) */
if (i == 4)
continue;
/* Read <MMD LED Mode Register> for Port i */
ksz_write16(dev, REG_PORT_PHY_MMD_SETUP |
(i << 12), 0x0002);
ksz_write16(dev, REG_PORT_PHY_MMD_INDEX_DATA |
(i << 12), 0x0000);
ksz_write16(dev, REG_PORT_PHY_MMD_SETUP |
(i << 12), 0x4002);
ksz_write16(dev, REG_PORT_PHY_MMD_INDEX_DATA |
(i << 12), 0x0011);
/* Due to Errata Module 19 this workaround is needed to
* enable single-led mode. It has also to be a 32bit
* write.
*/
ksz_write32(dev, REG_PORT_PHY_DIGITAL_DEBUG_3 |
(i << 12), 0xfa000300);
pr_info("TWx %s:%d - Port %d: Wrote MMD LED Mode Register: 0x%x\n.",
__func__, __LINE__, i, 0x0011);
}
/* READ */
for (int i = 1; i <= 5; i++) {
/* Read <MMD LED Mode Register> for Port i */
ksz_write16(dev, REG_PORT_PHY_MMD_SETUP | (i << 12), 0x0002);
ksz_write16(dev, REG_PORT_PHY_MMD_INDEX_DATA | (i << 12), 0x0000);
ksz_write16(dev, REG_PORT_PHY_MMD_SETUP | (i << 12), 0x4002);
ksz_read16(dev, REG_PORT_PHY_MMD_INDEX_DATA | (i << 12), &data16);
pr_info("TWx %s:%d - Port %d: MMD LED Mode Register: 0x%x\n.",
__func__, __LINE__, i, data16);
}
}
return 0;
}

@ -59,7 +59,9 @@ enum omap_rp_mbox_messages {
RP_MBOX_SUSPEND_SYSTEM = 0xFFFFFF11,
RP_MBOX_SUSPEND_ACK = 0xFFFFFF12,
RP_MBOX_SUSPEND_CANCEL = 0xFFFFFF13,
RP_MBOX_END_MSG = 0xFFFFFF14,
RP_MBOX_SHUTDOWN = 0xFFFFFF14,
RP_MBOX_SHUTDOWN_ACK = 0xFFFFFF15,
RP_MBOX_END_MSG = 0xFFFFFF16,
};
#endif /* _OMAP_RPMSG_H */

@ -819,7 +819,7 @@ static int m4_pm_notifier_call(struct notifier_block *bl, unsigned long state, v
case PM_HIBERNATION_PREPARE:
case PM_RESTORE_PREPARE:
case PM_SUSPEND_PREPARE:
return k3_m4_suspend(rproc);
break;
case PM_POST_HIBERNATION:
case PM_POST_RESTORE:
@ -831,6 +831,20 @@ static int m4_pm_notifier_call(struct notifier_block *bl, unsigned long state, v
return 0;
}
static int k3_m4_suspend_late(struct device *dev)
{
struct rproc *rproc = dev_get_drvdata(dev);
struct k3_m4_rproc *kproc = rproc->priv;
/* Check if pm notifier call is set. if it is, suspend/resume is
* supported
*/
if (!kproc->pm_notifier.notifier_call)
return 0;
return k3_m4_suspend(rproc);
}
static const struct rproc_ops k3_m4_rproc_ops = {
.start = k3_m4_rproc_start,
.stop = k3_m4_rproc_stop,
@ -952,6 +966,8 @@ static int k3_m4_rproc_probe(struct platform_device *pdev)
}
}
dev_set_drvdata(dev, rproc);
ret = devm_rproc_add(dev, rproc);
if (ret)
return dev_err_probe(dev, ret,
@ -977,10 +993,15 @@ static const struct of_device_id k3_m4_of_match[] = {
};
MODULE_DEVICE_TABLE(of, k3_m4_of_match);
static const struct dev_pm_ops k3_m4_pm_ops = {
LATE_SYSTEM_SLEEP_PM_OPS(k3_m4_suspend_late, NULL)
};
static struct platform_driver k3_m4_rproc_driver = {
.probe = k3_m4_rproc_probe,
.driver = {
.name = "k3-m4-rproc",
.pm = &k3_m4_pm_ops,
.of_match_table = k3_m4_of_match,
},
};

@ -1277,6 +1277,10 @@ static ssize_t cqspi_write(struct cqspi_flash_pdata *f_pdata,
*/
if (!op->cmd.dtr && cqspi->use_direct_mode &&
cqspi->use_direct_mode_wr && ((to + len) <= cqspi->ahb_size)) {
pr_info("TWx: %s:%d - Writing <%lu> bytes with offset <%lld> to ahb_base <%p>\n",
__func__, __LINE__, len, to, cqspi->ahb_base + to);
print_hex_dump(KERN_INFO, "TWx write buf:", DUMP_PREFIX_OFFSET,
16, 1, buf, len, true);
memcpy_toio(cqspi->ahb_base + to, buf, len);
return cqspi_wait_idle(cqspi);
}
@ -1702,7 +1706,10 @@ static int cqspi_probe(struct platform_device *pdev)
struct cqspi_st *cqspi;
int ret;
int irq;
const u_char *test_buf = "THIS IS TWx.";
const u_char *test_buf = "TWX-111-000";
loff_t to;
pr_info("TWx: %s:%d.\n", __func__, __LINE__);
host = devm_spi_alloc_host(&pdev->dev, sizeof(*cqspi));
if (!host) {
@ -1897,18 +1904,20 @@ static int cqspi_probe(struct platform_device *pdev)
__func__, __LINE__,
cqspi->use_direct_mode_wr ? "enabled" : "disabled");
pr_info("TWx: %s:%d - Writing %s, size %lu to ahb_base 0x0\n",
to = 5;
pr_info("TWx: %s:%d - Writing %s, size %lu to ahb_base %lld\n",
__func__, __LINE__,
test_buf, strlen(test_buf));
memcpy_toio(cqspi->ahb_base, test_buf, strlen(test_buf));
test_buf, strlen(test_buf), to);
memcpy_toio(cqspi->ahb_base + to, test_buf, strlen(test_buf));
cqspi_wait_idle(cqspi);
print_hex_dump(KERN_INFO, "TWx ahb_base:", DUMP_PREFIX_OFFSET,
16, 1, cqspi->ahb_base, 64, true);
return 0;
probe_setup_failed:
cqspi_controller_enable(cqspi, 0);
probe_reset_failed:

@ -730,19 +730,25 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
int mi = uio_find_mem_index(vma);
struct uio_mem *mem;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (mi < 0)
return -EINVAL;
mem = idev->info->mem + mi;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (mem->addr & ~PAGE_MASK)
return -ENODEV;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (vma->vm_end - vma->vm_start > mem->size)
return -EINVAL;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
vma->vm_ops = &uio_physical_vm_ops;
if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pr_info("TWx: %s:%d\n", __func__, __LINE__);
/*
* We cannot use the vm_iomap_memory() helper here,
* because vma->vm_pgoff is the map index we looked
@ -800,10 +806,13 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
switch (idev->info->mem[mi].memtype) {
case UIO_MEM_IOVA:
case UIO_MEM_PHYS:
pr_info("TWx: %s:%d\n", __func__, __LINE__);
ret = uio_mmap_physical(vma);
pr_info("TWx: %s:%d ret = %d\n",__func__, __LINE__, ret);
break;
case UIO_MEM_LOGICAL:
case UIO_MEM_VIRTUAL:
pr_info("TWx: %s:%d\n", __func__, __LINE__);
ret = uio_mmap_logical(vma);
break;
default:

@ -1 +1 @@
Subproject commit 284f50148360c4dbd8e243a42b2534a0e0b66804
Subproject commit 705c63ebb290e1da8f8de0cc4d5ef5547e4528f0