From: Michael Schmitz <schmitzmic@gmail.com>
To: linux-m68k@vger.kernel.org, geert@linux-m68k.org
Cc: schmitzmic@gmail.com, Miro Kropacek <miro.kropacek@gmail.com>
Subject: [PATCH 5/5] m68k: Add support for Svethlana
Date: Fri, 14 Aug 2026 15:17:45 +1200 [thread overview]
Message-ID: <20260814031745.17140-6-schmitzmic@gmail.com> (raw)
In-Reply-To: <20260814031745.17140-1-schmitzmic@gmail.com>
From: Miro Kropacek <miro.kropacek@gmail.com>
The SuperVidel FPGA contains an OpenCore ethernet package. Add
platform device data and other necessary definitions to support
this device on Atari.
The ethoc module must be enabled separately by the user.
Signed-off-by: Miro Kropacek <miro.kropacek@gmail.com>
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>
Link: https://lists.debian.org/debian-68k/2026/08/msg00000.html
---
arch/m68k/Kconfig.devices | 12 ++++++
arch/m68k/atari/config.c | 71 +++++++++++++++++++++++++++++++
arch/m68k/include/asm/atariints.h | 2 +-
arch/m68k/include/asm/irq.h | 6 +--
4 files changed, 87 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
index e6e3efac1840..48f964d1615e 100644
--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -67,6 +67,18 @@ config ATARI_ETHERNAT
To compile the actual ethernet driver, choose Y or M for the SMC91X
option in the network device section; the module will be called smc91x.
+config ATARI_SVETHLANA
+ bool "Atari SuperVidel SVEthlana Ethernet support"
+ depends on ATARI
+ help
+ Say Y to include support for the SVEthlana network adapter built
+ into the SuperVidel FPGA. SuperVidel firmware version 10 or newer
+ is required (older firmware lacks the Ethernet DMA).
+
+ To compile the actual ethernet driver, choose Y or M for the ETHOC
+ option in the network device section; the module will be called
+ ethoc.
+
config ATARI_ETHERNEC
bool "Atari EtherNEC Ethernet support"
depends on ATARI_ROM_ISA
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index ee2d061efb2a..86f07d0b85e0 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -34,6 +34,7 @@
#include <linux/platform_device.h>
#include <linux/usb/isp116x.h>
#include <linux/module.h>
+#include <net/ethoc.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo-atari.h>
@@ -748,6 +749,62 @@ static struct platform_device *atari_ethernat_devices[] __initdata = {
};
#endif /* CONFIG_ATARI_ETHERNAT */
+#ifdef CONFIG_ATARI_SVETHLANA
+/*
+ * SVEthlana: OpenCores 10/100 Mbps Ethernet MAC in the SuperVidel FPGA,
+ * handled by the ethoc driver. Requires SuperVidel firmware version 10
+ * or newer (Ethernet DMA).
+ *
+ * The MAC can only DMA within the SuperVidel DDR RAM, so the packet
+ * buffers are carved out of the top of the DDR; the framebuffer lives
+ * at the bottom.
+ */
+
+#define ATARI_SVETHLANA_PHYS_ADDR 0x80012000
+#define ATARI_SVETHLANA_IRQ 141 /* vector 0xc5 */
+
+#define ATARI_SV_VERSION_PHYS_ADDR 0x8001007c
+#define ATARI_SV_DDR_END 0xa8000000
+/* 128 packet buffers of 1536 bytes each, the maximum ethoc supports */
+#define SVETHLANA_BUF_SIZE (128 * 1536)
+
+static struct resource svethlana_resources[] = {
+ [0] = {
+ .name = "ethoc-regs",
+ .start = ATARI_SVETHLANA_PHYS_ADDR,
+ .end = ATARI_SVETHLANA_PHYS_ADDR + 0x7ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .name = "ethoc-buf",
+ .start = ATARI_SV_DDR_END - SVETHLANA_BUF_SIZE,
+ .end = ATARI_SV_DDR_END - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [2] = {
+ .name = "ethoc-irq",
+ .start = ATARI_SVETHLANA_IRQ,
+ .end = ATARI_SVETHLANA_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct ethoc_platform_data svethlana_platform_data = {
+ .phy_id = -1,
+ .big_endian = true,
+};
+
+static struct platform_device svethlana_device = {
+ .name = "ethoc",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(svethlana_resources),
+ .resource = svethlana_resources,
+ .dev = {
+ .platform_data = &svethlana_platform_data,
+ },
+};
+#endif /* CONFIG_ATARI_SVETHLANA */
+
#ifdef CONFIG_ATARI_ETHERNEC
/*
* EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset,
@@ -892,6 +949,20 @@ static int __init atari_platform_init(void)
}
#endif
+#ifdef CONFIG_ATARI_SVETHLANA
+ {
+ void __iomem *sv_version;
+
+ sv_version = ioremap(ATARI_SV_VERSION_PHYS_ADDR, 4);
+ if (sv_version) {
+ if (hwreg_present(sv_version) &&
+ (__raw_readl(sv_version) & 0x3ff) >= 10)
+ rv = platform_device_register(&svethlana_device);
+ iounmap(sv_version);
+ }
+ }
+#endif
+
#ifdef CONFIG_ATARI_ETHERNEC
{
int error;
diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h
index 6321c4495620..cb15361d14e9 100644
--- a/arch/m68k/include/asm/atariints.h
+++ b/arch/m68k/include/asm/atariints.h
@@ -32,7 +32,7 @@
#define VME_SOURCE_BASE 56
#define VME_MAX_SOURCES 16
-#define NUM_ATARI_SOURCES 141
+#define NUM_ATARI_SOURCES 142
/* convert vector number to int source number */
#define IRQ_VECTOR_TO_SOURCE(v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8)))
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 2263e92d418a..8bac43d0f49d 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -10,8 +10,8 @@
* different m68k hosts compiled into the kernel.
* Currently the Atari has 72 and the Amiga 24, but if both are
* supported in the kernel it is better to make room for 72.
- * With EtherNAT add-on card on Atari, the highest interrupt
- * number is 140 so NR_IRQS needs to be 141.
+ * With the SVEthlana adapter in the SuperVidel on Atari, the highest
+ * interrupt number is 141 so NR_IRQS needs to be 142.
*/
#if defined(CONFIG_COLDFIRE)
#define NR_IRQS 256
@@ -19,7 +19,7 @@
defined(CONFIG_SUN3X) || defined(CONFIG_VIRT)
#define NR_IRQS 200
#elif defined(CONFIG_ATARI)
-#define NR_IRQS 141
+#define NR_IRQS 142
#elif defined(CONFIG_MAC)
#define NR_IRQS 72
#elif defined(CONFIG_Q40)
--
2.17.1
next prev parent reply other threads:[~2026-08-14 3:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 3:17 [PATCH 0/5] m68k SuperVidel patches Michael Schmitz
2026-08-14 3:17 ` [PATCH 1/5] m68k: Fix atari mouse movement Michael Schmitz
2026-08-14 7:53 ` Geert Uytterhoeven
2026-08-14 3:17 ` [PATCH 2/5] fbdev: Give atafb proper parent Michael Schmitz
2026-08-14 7:50 ` Helge Deller
2026-08-14 3:17 ` [PATCH 3/5] fbdev: Add support for further video bit depths on atafb:external Michael Schmitz
2026-08-14 3:17 ` [PATCH 4/5] fbdev: Add support for SuperVidel's SuperBlitter Michael Schmitz
2026-08-14 3:17 ` Michael Schmitz [this message]
2026-08-14 8:07 ` [PATCH 5/5] m68k: Add support for Svethlana Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260814031745.17140-6-schmitzmic@gmail.com \
--to=schmitzmic@gmail.com \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=miro.kropacek@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox