Re: [PATCH 5/5] m68k: Add support for Svethlana

Michael Schmitz <[email protected]>
Newsgroups org.kernel.vger.linux-m68k
Message-ID <[email protected]>
Hi Geert,

thanks for your review!

Am 14.08.2026 um 20:07 schrieb Geert Uytterhoeven:
> Hi Michael,
>
> Thanks for your patch!
>
> On Fri, 14 Aug 2026 at 05:18, Michael Schmitz <[email protected]> wrote:
>> From: Miro Kropacek <[email protected]>
>>
>> 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 <[email protected]>
>> Reviewed-by: Michael Schmitz <[email protected]>
>> Link: https://lists.debian.org/debian-68k/2026/08/msg00000.html
>
> Since you're now in the path to upstream, you should add your SoB here

Will do ...

>
>> --- 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,
>
> Does SVEthlana contain a unique MAC address?  Without this, you probably
> get a different random MAC, and thus a different IP address from DHCP.
>
>> +};
>> +
>> +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);
>
> This unconditionally writes to rv, potentially overwriting an error
> code stored by a failed EtherNAT registration attempt.

OK, I'll respin, adding SoB's to the entire series. (Hope this won't 
cause trouble with the fbdev tree ...)

Cheers,

	Michael

>
>> +                       iounmap(sv_version);
>> +               }
>> +       }
>> +#endif
>> +
>>  #ifdef CONFIG_ATARI_ETHERNEC
>>         {
>>                 int error;
>
> The rest LGTM.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.