[PATCH v1 7/7] zorro: warp mfd: expose the Kickstart slot selection
From: Paolo Pisati
Date: Wed Nov 11 2026 - 11:47:06 EST
The board keeps several Kickstart images and the ARM boots the 68k from
the selected one.
Writing kickslot makes the ARM reset the machine on the spot. That is
how the board works, not a crash.
Signed-off-by: Paolo Pisati <p.pisati@xxxxxxxxx>
---
.../ABI/testing/sysfs-driver-warp-mfd | 11 +++++
drivers/zorro/warp-mfd.c | 49 +++++++++++++++++++
drivers/zorro/warp-mfd.h | 7 +++
3 files changed, 67 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-driver-warp-mfd b/Documentation/ABI/testing/sysfs-driver-warp-mfd
index a8213affb153..8cb7df076e15 100644
--- a/Documentation/ABI/testing/sysfs-driver-warp-mfd
+++ b/Documentation/ABI/testing/sysfs-driver-warp-mfd
@@ -40,3 +40,14 @@ KernelVersion: 7.5
Contact: Paolo Pisati <p.pisati@xxxxxxxxx>
Description:
(RO) Fan drive, as a percentage.
+
+What: /sys/bus/zorro/devices/zorro<N>/kickslot
+Date: November 2026
+KernelVersion: 7.5
+Contact: Paolo Pisati <p.pisati@xxxxxxxxx>
+Description:
+ (RW) Kickstart slot the ARM boots the 68k from. The board keeps
+ several Kickstart images.
+
+ Writing a slot number selects it and makes the ARM reset the
+ machine at once: that is how the board works, not a crash.
diff --git a/drivers/zorro/warp-mfd.c b/drivers/zorro/warp-mfd.c
index a438faeaa232..637ff4eccca3 100644
--- a/drivers/zorro/warp-mfd.c
+++ b/drivers/zorro/warp-mfd.c
@@ -23,6 +23,7 @@
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/jiffies.h>
+#include <linux/kstrtox.h>
#include <linux/limits.h>
#include <linux/module.h>
#include <linux/mutex.h>
@@ -302,6 +303,52 @@ out: \
} \
static DEVICE_ATTR_RO(name)
+static ssize_t kickslot_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ int ret;
+ struct warp_mfd *warp = dev_get_drvdata(dev);
+ union warp_reply *rpl;
+
+ rpl = kmalloc_obj(*rpl);
+ if (!rpl)
+ return -ENOMEM;
+ ret = warp_get_status(warp, rpl);
+ if (ret)
+ goto out;
+ ret = sysfs_emit(buf, "%u\n", rpl->diag.kickstart_nr);
+out:
+ kfree(rpl);
+ return ret;
+}
+
+/*
+ * WARNING:
+ * changing softkick slot will initiate a forced reboot - your Amiga is not
+ * crashing, it's the ARM MCU that is abruptly pulling the plug
+ */
+static ssize_t kickslot_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct warp_mfd *warp = dev_get_drvdata(dev);
+ union warp_cmd *cmd;
+ int ret;
+
+ cmd = kzalloc_obj(*cmd);
+ if (!cmd)
+ return -ENOMEM;
+ cmd->hdr.cmd = WARP_CMD_SELECT_KICK;
+ ret = kstrtou8(buf, 10, &cmd->select_kick.kick_nr);
+ if (ret)
+ goto done;
+ ret = warp_exec_cmd(warp, cmd, NULL);
+done:
+ kfree(cmd);
+ return ret ? ret : count;
+}
+static DEVICE_ATTR_RW(kickslot);
+
warp_config_string_attr(boardname, board_name);
warp_config_uint_attr(fanspeedpercent, fan_percent, "%u");
warp_config_uint_attr(fmwver, fmw_ver, "%04X");
@@ -324,6 +371,8 @@ static struct attribute *warp_attrs[] = {
&dev_attr_tarm.attr,
&dev_attr_vbatt.attr,
&dev_attr_vcc5v.attr,
+ /* RW attr */
+ &dev_attr_kickslot.attr,
NULL
};
diff --git a/drivers/zorro/warp-mfd.h b/drivers/zorro/warp-mfd.h
index 4fa09fa972d4..6bc7b38b5e4b 100644
--- a/drivers/zorro/warp-mfd.h
+++ b/drivers/zorro/warp-mfd.h
@@ -59,6 +59,7 @@
/* Command opcodes. Only the ones this driver issues are listed. */
enum warp_cmd_id {
+ WARP_CMD_SELECT_KICK = 5,
WARP_CMD_GET_DIAG = 6,
};
@@ -72,8 +73,14 @@ struct warp_cmd_hdr {
u32 cmd; /* enum warp_cmd_id */
};
+struct warp_cmd_select_kick {
+ struct warp_cmd_hdr hdr;
+ u8 kick_nr;
+};
+
union warp_cmd {
struct warp_cmd_hdr hdr;
+ struct warp_cmd_select_kick select_kick;
};
struct warp_rpl_hdr {
--
2.43.0