zorro: add a CS-Lab Warp 1260 MFD
Subsystems (3)
cover zorro: add a CS-Lab Warp 1260 MFD
The CS-Lab Warp 1260 is an A1200 trapdoor multifunction accelerator: it contains a 68060, an FPGA, an ARM co-processor and several sub-devices hanging off them. The 68k drives the IDE interface and the RTG display controller directly, through the FPGA; the ARM owns most of the rest - USB, SD card, WiFi, audio, the Kickstart slots, the CPU clock, fan control and the board telemetry - and the 68k reaches it through a dual-port RAM mailbox.
pata_cswarp, merged in 7.4-rc1, binds the board's Zorro device for the IDE window alone. This series puts an mfd parent on the device instead, hands the IDE window to pata_cswarp as a cell, and uses the mailbox for a first set of board functions, exposed as sysfs attributes on the Zorro device:
1-3 the mfd parent, pata_cswarp as its first cell, defconfig 4 the dual-port RAM command channel and the board identity 5-7 voltages and temperatures, fan duty cycle, Kickstart slot
selection
The layout - an mfd parent in drivers/zorro/ handing cells to the function drivers - is modelled on Geert's Zorro MFD experiments [1], which were the inspiration for this series.
The RFC [2] got no replies, so its questions still stand:
- Geert, does this fit where you wanted to take the Zorro MFD work? Should the parent stay in drivers/zorro/, as in your experiments, or move to drivers/mfd/? Lee, I have Cc'd you for this one.
- Would you rather see the voltages, temperatures and fan in hwmon than as plain sysfs attributes?
- Writing kickslot makes the ARM reset the machine on the spot. Is a sysfs attribute acceptable for that?
Changes since the RFC:
- Rebased on v7.4-rc2, which has pata_cswarp and its defconfig patch.
- Dropped the WiFi configuration patch. The board commits the SSID and the passphrase together when the passphrase arrives, so writing the passphrase alone clears the SSID: two independent attributes cannot express that.
- Documented the attributes in Documentation/ABI/testing/sysfs-driver-warp-mfd and added a MAINTAINERS entry.
- Created the attributes through .driver.dev_groups.
- pata_cswarp: mapped the cell with devm_ioremap_resource().
- The store callback takes a size_t count, the driver includes what it uses, and the probe banner prints the board window with %pR.
Tested on a Warp 1260 (firmware 20.27) on top of v7.4-rc2. Every patch builds warp-mfd and pata_cswarp with W=1 for m68k.
I wrote the original version of this driver myself, by hand. An LLM coding assistant came in later: it was used to review that code against CS-Lab's AmigaOS sources, to write several of the fixes folded into these patches and the ABI documentation, to split the work into this series and to draft the commit messages. I reviewed every change and tested the result on my Warp 1260.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/log/?h=zorro-mfd
[2] https://lore.kernel.org/r/[email protected]
Paolo Pisati (7):
zorro: warp mfd: add the CS-Lab Warp multifunction parent
ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro
device
m68k: defconfig: enable WARP_MFD
zorro: warp mfd: add the dual-port RAM command channel and expose the
board identity
zorro: warp mfd: expose the voltage and temperature sensors
zorro: warp mfd: expose the fan duty cycle
zorro: warp mfd: expose the Kickstart slot selection
.../ABI/testing/sysfs-driver-warp-mfd | 53 ++ MAINTAINERS | 8 + arch/m68k/configs/amiga_defconfig | 1 + arch/m68k/configs/multi_defconfig | 1 + drivers/ata/Kconfig | 2 +- drivers/ata/pata_cswarp.c | 48 +- drivers/zorro/Kconfig | 30 ++ drivers/zorro/Makefile | 2 + drivers/zorro/warp-mfd.c | 473 ++++++++++++++++++ drivers/zorro/warp-mfd.h | 148 ++++++ 10 files changed, 734 insertions(+), 32 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-warp-mfd create mode 100644 drivers/zorro/warp-mfd.c create mode 100644 drivers/zorro/warp-mfd.h
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
Signature · 1 line
2.43.0
PATCH 1/7 zorro: warp mfd: add the CS-Lab Warp multifunction parent
The Warp 1260 is an A1200 trapdoor accelerator whose single Zorro device fronts several functions: an ARM co-processor reached through a dual-port RAM window, and an IDE interface and an RTG display controller that the 68k drives directly.pata_cswarp claims the whole device for the IDE window alone, which leaves no way for anything else on the board to get a driver.
Add a parent that owns the Zorro device and describes the functions as mfd cells, starting with the IDE window as a "warp-pata" cell.
Only the window layout is described here; the dual-port RAM protocol arrives with its first user.pata_cswarp is converted in the next patch.
--- MAINTAINERS | 7 ++++ drivers/zorro/Kconfig | 30 ++++++++++++++ drivers/zorro/Makefile | 2 + drivers/zorro/warp-mfd.c | 89 ++++++++++++++++++++++++++++++++++++++++ drivers/zorro/warp-mfd.h | 19 +++++++++ 5 files changed, 147 insertions(+) create mode 100644 drivers/zorro/warp-mfd.c create mode 100644 drivers/zorro/warp-mfd.h
MAINTAINERS +7 -0
@@ -7173,6 +7173,13 @@ L: [email protected] S: Maintained F: tools/crypto/tcrypt/tcrypt_speed_compare.py +CS-LAB WARP MULTIFUNCTION DRIVER +M: Paolo Pisati <[email protected]> +L: [email protected] +S: Maintained +F: drivers/zorro/warp-mfd.c +F: drivers/zorro/warp-mfd.h + CS3308 MEDIA DRIVER M: Hans Verkuil <[email protected]> L: [email protected]
drivers/zorro/Kconfig +30 -0
@@ -17,3 +17,33 @@ config ZORRO_NAMES When in doubt, say Y. +# Zorro multifunction drivers + +config WARP_MFD + tristate "CS-Lab Warp multifunction driver" + depends on ZORRO + select MFD_CORE + help + The CS-Lab Warp 1260 is an A1200 trapdoor accelerator. Besides the + 68060 it carries an FPGA and an ARM co-processor; its control + registers, the dual-port RAM and the IDE interface share one Zorro + device, which this driver binds to. + + The 68k drives these through the FPGA: the on-board IDE interface and + an RTG display controller. + + The co-processor owns the rest, reached over the dual-port RAM: two + USB host ports, an SD card slot, an ESP32 WiFi bridge, + an audio mixer, the Kickstart slot selection, the CPU clock and turbo + levels, thermal regulation of the fan, and the board telemetry. + + This driver hands the IDE window to pata_cswarp - which needs + idemode=native set in Warp Configuration to be of any use - and + exposes the configuration and telemetry reachable over the dual-port + RAM in sysfs: voltages, temperatures, fan, firmware version and + Kickstart slot. Nothing else on the list has a driver yet. + + If you have a CS-Lab Warp 1260 board, say Y. Otherwise, say N. + + To compile this driver as a module, choose M here: the module + will be called warp-mfd.
drivers/zorro/Makefile +2 -0
@@ -7,6 +7,8 @@ obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_ZORRO_NAMES) += names.o +obj-$(CONFIG_WARP_MFD) += warp-mfd.o + hostprogs := gen-devlist # Files generated that shall be removed upon make clean
drivers/zorro/warp-mfd.c new file +89 -0
89 lines not on this page · raw message
drivers/zorro/warp-mfd.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* CS-Lab Warp - board window layout +* +* Copyright 2026 Paolo Pisati <[email protected]> +*/ + +#ifndef _WARP_MFD_H +#define _WARP_MFD_H + +/* Offsets from the start of the board's Zorro window. */ +#define WARP_OFFSET_DPREG_CR 0x1000/* dual-port interrupt control reg */ +#define WARP_OFFSET_DPRAM 0x2000/* dual-port RAM */ +#define WARP_OFFSET_ATA 0x6000/* on-board IDE interface */ + +#define WARP_DPRAM_SIZE 0x2000 +#define WARP_ATA_SIZE 0x1800 + +#endif /* _WARP_MFD_H */
Signature · 1 line
2.43.0
PATCH 2/7 ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro device
In reply to Paolo PisatiNow that warp-mfd owns the device and hands the window out as the "warp-pata" cell, take it from there.
PATA_CSWARP depends on WARP_MFD from here on.
--- drivers/ata/Kconfig | 2 +- drivers/ata/pata_cswarp.c | 48 ++++++++++++++------------------------- 2 files changed, 18 insertions(+), 32 deletions(-)
drivers/ata/Kconfig +1 -1
@@ -1035,7 +1035,7 @@ config PATA_GAYLE config PATA_CSWARP tristate "Amiga CS Warp PATA support" - depends on M68K && AMIGA && ZORRO + depends on WARP_MFD help This option enables support for the on-board IDE interface on CS-Lab Warp Expansion Card (NOTE that idemode=native has to be
drivers/ata/pata_cswarp.c +17 -31
109 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 3/7 m68k: defconfig: enable WARP_MFD
In reply to Paolo PisatiEnable the CS-Lab Warp multifunction driver in the Amiga and multi defconfigs, which pata_cswarp now depends on.
--- arch/m68k/configs/amiga_defconfig | 1 + arch/m68k/configs/multi_defconfig | 1 + 2 files changed, 2 insertions(+)
arch/m68k/configs/amiga_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_AMIGA=y CONFIG_ZORRO=y CONFIG_AMIGA_PCMCIA=y CONFIG_ZORRO_NAMES=y +CONFIG_WARP_MFD=y CONFIG_HEARTBEAT=y CONFIG_PROC_HARDWARE=y CONFIG_AMIGA_BUILTIN_SERIAL=y
arch/m68k/configs/multi_defconfig +1 -0
@@ -31,6 +31,7 @@ CONFIG_ZORRO=y CONFIG_AMIGA_PCMCIA=y CONFIG_ATARI_ROM_ISA=y CONFIG_ZORRO_NAMES=y +CONFIG_WARP_MFD=y CONFIG_HEARTBEAT=y CONFIG_PROC_HARDWARE=y CONFIG_NATFEAT=y
Signature · 1 line
2.43.0
PATCH 4/7 zorro: warp mfd: add the dual-port RAM command channel and expose the board identity
In reply to Paolo PisatiThe ARM co-processor is reached through a dual-port RAM window and an interrupt control register: the 68k writes a command frame, rings the ARM, and the ARM acknowledges and then answers in the same buffer, raising a flag for each on the shared IRQ_AMIGA_PORTS line.
The protocol header describes only what the driver uses: the control bits, GetDiag and its reply frame, laid out as the 68k sees it, with static_assert()s pinning the offsets - the firmware decides them, not the compiler.
Use it for the first attributes: boardname, hwver and fmwver, read from a fresh diagnostic frame on every access.
--- .../ABI/testing/sysfs-driver-warp-mfd | 16 ++ MAINTAINERS | 1 + drivers/zorro/warp-mfd.c | 259 +++++++++++++++++- drivers/zorro/warp-mfd.h | 120 +++++++- 4 files changed, 392 insertions(+), 4 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-warp-mfd
Documentation/ABI/testing/sysfs-driver-warp-mfd new file +16 -0
@@ -0,0 +1,16 @@ +What: /sys/bus/zorro/devices/zorro<N>/boardname +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +Description: + (RO) Name of the CS-Lab Warp board, as reported by its ARM + co-processor. + +What: /sys/bus/zorro/devices/zorro<N>/fmwver +What: /sys/bus/zorro/devices/zorro<N>/hwver +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +Description: + (RO) Firmware and hardware version, as four hexadecimal digits: + an fmwver of 2027 is firmware release 20.27.
MAINTAINERS +1 -0
@@ -7177,6 +7177,7 @@ CS-LAB WARP MULTIFUNCTION DRIVER M: Paolo Pisati <[email protected]> L: [email protected] S: Maintained +F: Documentation/ABI/testing/sysfs-driver-warp-mfd F: drivers/zorro/warp-mfd.c F: drivers/zorro/warp-mfd.h
drivers/zorro/warp-mfd.c +256 -3
298 lines not on this page · raw message
drivers/zorro/warp-mfd.h +119 -1
136 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/7 zorro: warp mfd: expose the voltage and temperature sensors
In reply to Paolo PisatiThe diagnostic frame carries the 5 V rail, the backup battery and three temperatures - the 68060, its NTC and the ARM - as IEEE-754 binary32.
Decode the bit pattern with integer arithmetic into milli-units.
--- .../ABI/testing/sysfs-driver-warp-mfd | 19 +++++ drivers/zorro/warp-mfd.c | 80 +++++++++++++++++++ drivers/zorro/warp-mfd.h | 4 + 3 files changed, 103 insertions(+)
Documentation/ABI/testing/sysfs-driver-warp-mfd +19 -0
@@ -14,3 +14,22 @@ Contact: Paolo Pisati <[email protected]> Description: (RO) Firmware and hardware version, as four hexadecimal digits: an fmwver of 2027 is firmware release 20.27. + +What: /sys/bus/zorro/devices/zorro<N>/t60int +What: /sys/bus/zorro/devices/zorro<N>/t60ext +What: /sys/bus/zorro/devices/zorro<N>/tarm +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +Description: + (RO) Temperatures in degrees Celsius, with one decimal: t60int + is the 68060, t60ext its NTC, tarm the ARM co-processor. + +What: /sys/bus/zorro/devices/zorro<N>/vbatt +What: /sys/bus/zorro/devices/zorro<N>/vcc5v +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +Description: + (RO) Voltages in volts, with two decimals: vbatt is the backup + battery, vcc5v the 5 V rail.
drivers/zorro/warp-mfd.c +80 -0
110 lines not on this page · raw message
drivers/zorro/warp-mfd.h +4 -0
@@ -84,6 +84,10 @@ struct warp_rpl_hdr {* Reply to WARP_CMD_GET_DIAG. Fields this driver does not expose are kept * so the ones after them land at the right offset. * +* The board reports its sensors as IEEE-754 binary32. They are kept as raw +* bit patterns because the kernel cannot use the FPU; warp_f32_to_milli() +* decodes them with integer arithmetic. +* * turbo_level and tz_corr_secs are reported by the firmware but no longer * maintained by it; treat their contents as stale. */
Signature · 1 line
2.43.0
PATCH 6/7 zorro: warp mfd: expose the fan duty cycle
In reply to Paolo PisatiThe diagnostic frame also reports the fan drive as a percentage. Expose it as fanspeedpercent.
--- Documentation/ABI/testing/sysfs-driver-warp-mfd | 7 +++++++ drivers/zorro/warp-mfd.c | 2 ++ 2 files changed, 9 insertions(+)
Documentation/ABI/testing/sysfs-driver-warp-mfd +7 -0
@@ -33,3 +33,10 @@ Contact: Paolo Pisati <[email protected]> Description: (RO) Voltages in volts, with two decimals: vbatt is the backup battery, vcc5v the 5 V rail. + +What: /sys/bus/zorro/devices/zorro<N>/fanspeedpercent +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +Description: + (RO) Fan drive, as a percentage.
drivers/zorro/warp-mfd.c +2 -0
@@ -303,6 +303,7 @@ out: \static DEVICE_ATTR_RO (name)warp_config_string_attr (boardname, board_name); +warp_config_uint_attr (fanspeedpercent, fan_percent,"%u" );warp_config_uint_attr (fmwver, fmw_ver,"%04X" );warp_config_uint_attr (hwver, hw_ver,"%04X" );/* board sensors: volts to 2 decimals, temperatures to 1, as WarpDiag shows them */
@@ -315,6 +316,7 @@ warp_config_sensor_attr(vcc5v, vcc5v, 2);static struct attribute *warp_attrs[] = {/* RO attr */ &dev_attr_boardname.attr, + &dev_attr_fanspeedpercent.attr, &dev_attr_fmwver.attr, &dev_attr_hwver.attr, &dev_attr_t60int.attr,
Signature · 1 line
2.43.0
PATCH 7/7 zorro: warp mfd: expose the Kickstart slot selection
In reply to Paolo PisatiThe 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.
--- .../ABI/testing/sysfs-driver-warp-mfd | 11 +++++ drivers/zorro/warp-mfd.c | 49 +++++++++++++++++++ drivers/zorro/warp-mfd.h | 7 +++ 3 files changed, 67 insertions(+)
Documentation/ABI/testing/sysfs-driver-warp-mfd +11 -0
@@ -40,3 +40,14 @@ KernelVersion: 7.5 Contact: Paolo Pisati <[email protected]> Description: (RO) Fan drive, as a percentage. + +What: /sys/bus/zorro/devices/zorro<N>/kickslot +Date: November 2026 +KernelVersion: 7.5 +Contact: Paolo Pisati <[email protected]> +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.
drivers/zorro/warp-mfd.c +49 -0
67 lines not on this page · raw message
drivers/zorro/warp-mfd.h +7 -0
@@ -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 {
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v1 1/7] zorro: warp mfd: add the CS-Lab Warp multifunction parent
In reply to Paolo PisatiThank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Low] mfd: warp_mfd_probe() places new MFD core driver in drivers/zorro/ - [Low] mfd: warp_mfd_driver…
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Low] mfd: warp_mfd_probe() places new MFD core driver in drivers/zorro/
- [Low] mfd: warp_mfd_driver hard-codes mfd in names and uses wrong subject prefix
- [Low] mfd: warp_mfd_cells registers only a single child cell and Kconfig mismatches code
- [Low] mfd: warp_mfd_probe() passes z->dev.id instead of PLATFORM_DEVID_AUTO
--
commit 9af1a8469b32d3686430ab985b8dd9f3f752e76e
Author: Paolo Pisati <[email protected]>
zorro: warp mfd: add the CS-Lab Warp multifunction parent
This commit adds a Zorro parent driver for the CS-Lab Warp 1260 board that registers the on-board IDE window as an mfd cell for pata_cswarp.
Quoted 14 lines
drivers/zorro/Kconfig +6
-0@@ -17,3 +17,33 @@ config ZORRO_NAMES When in doubt, say Y. +# Zorro multifunction drivers + +config WARP_MFD + tristate "CS-Lab Warp multifunction driver" + depends on ZORRO + select MFD_CORE
[ ... ]
Quoted 5 lines
drivers/zorro/Kconfig +5
-0+ This driver hands the IDE window to pata_cswarp - which needs + idemode=native set in Warp Configuration to be of any use - and + exposes the configuration and telemetry reachable over the dual-port + RAM in sysfs: voltages, temperatures, fan, firmware version and + Kickstart slot. Nothing else on the list has a driver yet.
[ ... ]
drivers/zorro/Makefile obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o · line 10
Quoted 9 lines
drivers/zorro/Makefile +1
-0@@ -7,6 +7,8 @@ obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_ZORRO_NAMES) += names.o +obj-$(CONFIG_WARP_MFD) += warp-mfd.o
[Severity: Low]
Should this driver and its local header live under drivers/mfd/ instead of drivers/zorro/? Per the mfd subsystem guidelines, new core mfd drivers that call mfd_add_devices() or devm_mfd_add_devices(), along with headers shared only between the parent and its children, belong in drivers/mfd/.
Quoted 5 lines
drivers/zorro/warp-mfd.c new file +0
-0
[ ... ]
drivers/zorro/warp-mfd.c line 37
Quoted 10 lines
drivers/zorro/warp-mfd.c new file +10
-0+static const struct mfd_cell warp_mfd_cells[] = { + { + .name ="warp-pata" , + .num_resources =1 , + .resources = (const struct resource []) { +DEFINE_RES_MEM_NAMED (WARP_OFFSET_ATA ,WARP_ATA_SIZE , +"pata" ), + } + } +};
[Severity: Low]
Is an mfd driver appropriate when warp_mfd_cells[] only registers a single child device? The mfd subsystem guidelines require mfd to be used only for devices registering multiple children across different subsystems.
In addition, the Kconfig help text states that this driver exposes dual-port RAM configuration and telemetry in sysfs (voltages, temperatures, fan, firmware version, and Kickstart slot), none of which is present in this commit, and drivers/zorro/warp-mfd.h defines dual-port RAM offsets and sizes that have no users here. Even later in the series, telemetry is added as custom sysfs attributes on the parent Zorro device rather than as a child device in the appropriate subsystem such as hwmon.
Quoted 11 lines
drivers/zorro/warp-mfd.c new file +11
-0+static int warp_mfd_probe (struct zorro_dev *z, +const struct zorro_device_id *ent) +{ +int error; + +dev_info (&z->dev,"Warp at %pR\n" , &z->resource); + + error =mfd_add_devices (&z->dev, z->dev.id, warp_mfd_cells, +ARRAY_SIZE (warp_mfd_cells), &z->resource, +0 ,NULL ); +if (error) {
drivers/zorro/warp-mfd.c line 59
Quoted 10 lines
drivers/zorro/warp-mfd.c new file +10
-0+dev_err (&z->dev,"mfd_add_devices() failed %d\n" , error); +return error; + } +return 0 ; +} + +static void warp_mfd_remove (struct zorro_dev *z) +{ +mfd_remove_devices (&z->dev); +}
[Severity: Low]
This isn't a bug, but mfd guidelines prefer automatic platform device IDs over passing z->dev.id to mfd_add_devices() when subdevices do not require explicit numbering. Using devm_mfd_add_devices() would also drop warp_mfd_remove() and keep child teardown ordered with devres resources added later in the series.
Similarly, warp_mfd_cells[] could use the standard mfd cell resource helper macro instead of open-coding .num_resources and a compound literal, and warp_mfd_init() / warp_mfd_exit() could use module_driver().
[ ... ]
drivers/zorro/warp-mfd.c line 72
Quoted 6 lines
drivers/zorro/warp-mfd.c new file +6
-0+static struct zorro_driver warp_mfd_driver = { + .name ="warp-mfd" , + .id_table = warp_mfd_ids, + .probe = warp_mfd_probe, + .remove = warp_mfd_remove +};
[Severity: Low]
This isn't a bug, but mfd subsystem conventions avoid hard-coding "mfd" in driver, symbol, Kconfig, and file names (such as "warp-mfd", warp_mfd_driver, and warp-mfd.c), and expect commit subjects in the form "mfd: <driver>: <Capitalized description>".
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewRe: [PATCH v1 2/7] ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro device
In reply to Paolo PisatiThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ata: pata_cswarp: duplicate ata_platform_remove_one() and module_platform_driver() --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] ata: pata_cswarp: duplicate ata_platform_remove_one() and module_platform_driver()
--
commit 0358845c5d4b9568f67a2b55aedc3acc1ebbdef0
Author: Paolo Pisati <[email protected]>
ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro device
This commit converts pata_cswarp from a Zorro driver into a platform driver that binds to the "warp-pata" MFD cell provided by warp-mfd.
Quoted 4 lines
drivers/ata/pata_cswarp.c +0
-0
[ ... ]
Quoted 31 lines
drivers/ata/pata_cswarp.c +6
-11@@ -145,34 +135,29 @@ static int pata_cswarp_probe(struct zorro_dev *z, IRQF_SHARED, &pata_cswarp_sht); } -static void pata_cswarp_remove (struct zorro_dev *z) +static void pata_cswarp_remove (struct platform_device *pdev) { -struct ata_host *host =dev_get_drvdata (&z->dev); +struct ata_host *host =dev_get_drvdata (&pdev->dev);ata_host_detach (host); } -static const struct zorro_device_id pata_cswarp_zorro_tbl[] = { - { .id =ZORRO_PROD_CSLAB_WARP_1260 }, - { } -}; -MODULE_DEVICE_TABLE (zorro, pata_cswarp_zorro_tbl); - -static struct zorro_driver pata_cswarp_driver = { - .name ="pata_cswarp" , - .id_table = pata_cswarp_zorro_tbl, +static struct platform_driver pata_cswarp_driver = { + .driver = { + .name ="warp-pata" , + }, .probe = pata_cswarp_probe, .remove = pata_cswarp_remove, };static int __init pata_cswarp_init (void )
drivers/ata/pata_cswarp.c static int pata_cswarp_probe(struct zorro_dev *z, · line 161
Quoted 10 lines
drivers/ata/pata_cswarp.c +2
-2{ -return zorro_register_driver (&pata_cswarp_driver); +return platform_driver_register (&pata_cswarp_driver); } static void __exit pata_cswarp_unregister(void) { -zorro_unregister_driver (&pata_cswarp_driver); +platform_driver_unregister (&pata_cswarp_driver); }
[Severity: Low]
Now that pata_cswarp is a platform_driver, could pata_cswarp_remove() be replaced with libata's ata_platform_remove_one(), and pata_cswarp_init() / pata_cswarp_unregister() with module_platform_driver(pata_cswarp_driver)?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewRe: [PATCH v1 3/7] m68k: defconfig: enable WARP_MFD
In reply to Paolo PisatiSashiko has reviewed this patch and found no issues.
Quoted 4 lines
Enable the CS-Lab Warp multifunction driver in the Amiga and multi defconfigs, which
pata_cswarpnow depends on.Signed-off-by Paolo Pisati <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
[email protected]
AI reviewRe: [PATCH v1 4/7] zorro: warp mfd: add the dual-port RAM command channel and expose the board identity
In reply to Paolo PisatiThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] zorro: warp-mfd: stale reg_cr irq flags not cleared in warp_send_msg() --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] zorro: warp-mfd: stale reg_cr irq flags not cleared in warp_send_msg()
--
commit 4b5b6213bfa8c6be415c4e81b0b8ac501eb8e890
Author: Paolo Pisati <[email protected]>
zorro: warp mfd: add the dual-port RAM command channel and expose the board identity
This commit adds the dual-port RAM command channel and interrupt handling to communicate with the ARM co-processor, exposing boardname, fmwver, and hwver in sysfs.
Quoted 4 lines
drivers/zorro/warp-mfd.c +0
-0
[ ... ]
Quoted 11 lines
drivers/zorro/warp-mfd.c +11
-0+/* send a message to the ARM coprocessor, optionally waiting for a reply */ +static int warp_send_msg (struct warp_mfd *warp,bool wait_reply) +{ +struct completion *done = wait_reply ? &warp->reply : &warp->recv; +long ret; + +/* a previous exchange may have timed out and completed late */ +reinit_completion (done); + +/* enable 68k & ARM interrupts */ +z_writel (DPREG_CR_SET |DPREG_CR_IE_68K |DPREG_CR_IE_ARM , warp->reg_cr);
drivers/zorro/warp-mfd.c static const struct mfd_cell warp_mfd_cells[] = { · line 133
Quoted 10 lines
drivers/zorro/warp-mfd.c +10
-0+ +/* send irq to ARM */ +z_writel (DPREG_CR_SET |DPREG_CR_MP_ARM , warp->reg_cr); + +/* wait for a reply, or just wait for a receiver ack */ + ret =wait_for_completion_interruptible_timeout (done, +WARP_MSG_TIMEOUT ); + +/* disable ARM & 68k interrupts */ +z_writel (DPREG_CR_CLR |DPREG_CR_IE_68K |DPREG_CR_IE_ARM , warp->reg_cr);
[Severity: Medium]
Can an interrupted or timed-out wait leave DPREG_CR_MR_ARM and DPREG_CR_MP_68K latched in warp->reg_cr?
When wait_for_completion_interruptible_timeout() returns early (such as on a signal during a sysfs read), warp_send_msg() clears DPREG_CR_IE_68K while the ARM is still processing the command. When the ARM finishes, its status flags stay latched in warp->reg_cr because the interrupt is disabled. On the next command, enabling DPREG_CR_IE_68K after reinit_completion(done) immediately triggers warp_irq() from the stale flags before the ARM processes the new request, so warp_exec_cmd() reads back the command opcode still in warp->dpram and warp_get_status() fails with -EIO.
Clearing DPREG_CR_MR_ARM and DPREG_CR_MP_68K before reinit_completion() and enabling DPREG_CR_IE_68K would avoid completing on a stale flag.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[email protected]
AI reviewRe: [PATCH v1 5/7] zorro: warp mfd: expose the voltage and temperature sensors
In reply to Paolo PisatiSashiko has reviewed this patch and found no issues.
Quoted 6 lines
The diagnostic frame carries the 5 V rail, the backup battery and three temperatures - the 68060, its NTC and the ARM - as IEEE-754 binary32.
Decode the bit pattern with integer arithmetic into milli-units.
Signed-off-by Paolo Pisati <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
[email protected]
AI reviewRe: [PATCH v1 6/7] zorro: warp mfd: expose the fan duty cycle
In reply to Paolo PisatiSashiko has reviewed this patch and found no issues.
Quoted 4 lines
The diagnostic frame also reports the fan drive as a percentage. Expose it as fanspeedpercent.
Signed-off-by Paolo Pisati <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
[email protected]
AI reviewRe: [PATCH v1 7/7] zorro: warp mfd: expose the Kickstart slot selection
In reply to Paolo PisatiSashiko has reviewed this patch and found no issues.
Quoted 7 lines
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 <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
Lee Jones
maintainerRe: [PATCH v1 1/7] zorro: warp mfd: add the CS-Lab Warp multifunction parent
In reply to [email protected]Quoted 10 lines · On Wed, 11 Nov 2026, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Low] mfd:warp_mfd_probe()places new MFD core driver indrivers/zorro/
- [Low] mfd:warp_mfd_driverhard-codes mfd in names and uses wrong subject prefix
- [Low] mfd:warp_mfd_cellsregisters only a single child cell andKconfigmismatches code
- [Low] mfd:warp_mfd_probe()passesz->dev.idinstead ofPLATFORM_DEVID_AUTO
All of these are hard blockers.
Why are you adding a whole new subsystem for your device?
This clearly lives in drivers/mfd.
Quoted 127 lines
--
commit
9af1a8469b32d3686430ab985b8dd9f3f752e76e
Author: Paolo Pisati <[email protected]>zorro: warp mfd: add the CS-Lab Warp multifunction parent
This commit adds a Zorro parent driver for the CS-Lab Warp 1260 board that registers the on-board IDE window as an mfd cell for
pata_cswarp.Quoted 14 lines
drivers/zorro/Kconfig +6
-0@@ -17,3 +17,33 @@ config ZORRO_NAMES When in doubt, say Y. +# Zorro multifunction drivers + +config WARP_MFD + tristate "CS-Lab Warp multifunction driver" + depends on ZORRO + select MFD_CORE[ ... ]
Quoted 5 lines
drivers/zorro/Kconfig +5
-0+ This driver hands the IDE window to pata_cswarp - which needs + idemode=native set in Warp Configuration to be of any use - and + exposes the configuration and telemetry reachable over the dual-port + RAM in sysfs: voltages, temperatures, fan, firmware version and + Kickstart slot. Nothing else on the list has a driver yet.[ ... ]
drivers/zorro/Makefile obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o · line 10
Quoted 9 lines
drivers/zorro/Makefile +1
-0@@ -7,6 +7,8 @@ obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_ZORRO_NAMES) += names.o +obj-$(CONFIG_WARP_MFD) += warp-mfd.o[Severity: Low]
Should this driver and its local header live underdrivers/mfd/instead ofdrivers/zorro/? Per the mfd subsystem guidelines, new core mfd drivers that callmfd_add_devices()ordevm_mfd_add_devices(), along with headers shared only between the parent and its children, belong indrivers/mfd/.Quoted 5 lines
drivers/zorro/warp-mfd.c new file +0
-0[ ... ]
drivers/zorro/warp-mfd.c line 37
Quoted 10 lines
drivers/zorro/warp-mfd.c new file +10
-0+static const struct mfd_cell warp_mfd_cells[] = { + { + .name ="warp-pata" , + .num_resources =1 , + .resources = (const struct resource []) { +DEFINE_RES_MEM_NAMED (WARP_OFFSET_ATA ,WARP_ATA_SIZE , +"pata" ), + } + } +};[Severity: Low]
Is an mfd driver appropriate when warp_mfd_cells[] only registers a single child device? The mfd subsystem guidelines require mfd to be used only for devices registering multiple children across different subsystems.In addition, the
Kconfighelp text states that this driver exposes dual-port RAM configuration and telemetry in sysfs (voltages, temperatures, fan, firmware version, and Kickstart slot), none of which is present in this commit, anddrivers/zorro/warp-mfd.hdefines dual-port RAM offsets and sizes that have no users here. Even later in the series, telemetry is added as custom sysfs attributes on the parent Zorro device rather than as a child device in the appropriate subsystem such as hwmon.Quoted 11 lines
drivers/zorro/warp-mfd.c new file +11
-0+static int warp_mfd_probe (struct zorro_dev *z, +const struct zorro_device_id *ent) +{ +int error; + +dev_info (&z->dev,"Warp at %pR\n" , &z->resource); + + error =mfd_add_devices (&z->dev, z->dev.id, warp_mfd_cells, +ARRAY_SIZE (warp_mfd_cells), &z->resource, +0 ,NULL ); +if (error) {drivers/zorro/warp-mfd.c line 59
Quoted 10 lines
drivers/zorro/warp-mfd.c new file +10
-0+dev_err (&z->dev,"mfd_add_devices() failed %d\n" , error); +return error; + } +return 0 ; +} + +static void warp_mfd_remove (struct zorro_dev *z) +{ +mfd_remove_devices (&z->dev); +}[Severity: Low]
This isn't a bug, but mfd guidelines prefer automatic platform device IDs over passingz->dev.idtomfd_add_devices()when subdevices do not require explicit numbering. Usingdevm_mfd_add_devices()would also dropwarp_mfd_remove()and keep child teardown ordered with devres resources added later in the series.Similarly, warp_mfd_cells[] could use the standard mfd cell resource helper macro instead of open-coding .num_resources and a compound literal, and
warp_mfd_init()/warp_mfd_exit()could usemodule_driver().[ ... ]
drivers/zorro/warp-mfd.c line 72
Quoted 6 lines
drivers/zorro/warp-mfd.c new file +6
-0+static struct zorro_driver warp_mfd_driver = { + .name ="warp-mfd" , + .id_table = warp_mfd_ids, + .probe = warp_mfd_probe, + .remove = warp_mfd_remove +};[Severity: Low]
This isn't a bug, but mfd subsystem conventions avoid hard-coding "mfd" in driver, symbol,Kconfig, and file names (such as "warp-mfd",warp_mfd_driver, andwarp-mfd.c), and expect commit subjects in the form "mfd: <driver>: <Capitalized description>".Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Signature · 1 line
Lee Jones
Re: [PATCH v1 1/7] zorro: warp mfd: add the CS-Lab Warp multifunction parent
Quoted 13 lines · Lee Jones
Quoted 10 lines · On Wed, 11 Nov 2026, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Low] mfd:warp_mfd_probe()places new MFD core driver indrivers/zorro/
- [Low] mfd:warp_mfd_driverhard-codes mfd in names and uses wrong subject prefix
- [Low] mfd:warp_mfd_cellsregisters only a single child cell andKconfigmismatches code
- [Low] mfd:warp_mfd_probe()passesz->dev.idinstead ofPLATFORM_DEVID_AUTO
Quoted 3 lines
All of these are hard blockers.
Why are you adding a whole new subsystem for your device?
No hard reason: I took inspiration from Geert's Zorro MFD experiments[1], hence the weird location.
Quoted 2 lines
This clearly lives in
drivers/mfd.
Ack, I'll address Sashiko's comments and i'll resubmit.
Signature · 2 lines
bye, p.
Hi Paolo
Quoted 8 lines · Paolo Pisati
The CS-Lab Warp 1260 is an A1200 trapdoor multifunction accelerator: it contains a 68060, an FPGA, an ARM co-processor and several sub-devices hanging off them. The 68k drives the IDE interface and the RTG display controller directly, through the FPGA; the ARM owns most of the rest - USB, SD card, WiFi, audio, the Kickstart slots, the CPU clock, fan control and the board telemetry - and the 68k reaches it through a dual-port RAM mailbox.
I can't test your patches (I wish I could but I only have a 060 + G3 + Radeon hd 2400 A4000 ;)).
But since you have an 060 could you maybe test these for me:
https://lore.kernel.org/linux-m68k/[email protected]/T/#m42ec8c1fe97b64b22f9cfc8d7ce753937bdbab1a
I also have a fix for a small performance issue in 060 only kernels which I'll send next if someone else can test.
Thanks,
Daniel