• pcmcia ethernet card support for m68k?

    From John Paul Adrian Glaubitz@21:1/5 to Stan Johnson on Tue Aug 11 00:10:01 2020
    On 8/10/20 11:52 PM, Stan Johnson wrote:
    I have a PowerBook 190cs that is running Debian SID. I would like to be
    able to connect this PowerBook to an Ethernet network using an MPC-10 Ethernet PCMCIA card (I've confirmed that the card works in Mac OS 8.1).
    It looks like there used to be some PCMCIA tools for 2.4 and 2.6
    kernels, but it's not clear what to use for 4.x and 5.x kernels, or
    whether PCMCIA support exists for m68k.

    PCMCIA works on m68k, I already used it on my Amiga 1200. Not sure about
    68k Macs though.

    One particular thing is that not all PCMCIA cards supported by the kernel
    will also work with the PCMCIA stack on Linux/Amiga [1]. So I had to be
    careful buying the right networking card.

    You might have better luck with your Mac.

    Adrian

    [1] http://www.g-mb.de/pcmcia_e.html

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Johnson@21:1/5 to All on Tue Aug 11 00:00:01 2020
    Hello,

    I have a PowerBook 190cs that is running Debian SID. I would like to be
    able to connect this PowerBook to an Ethernet network using an MPC-10
    Ethernet PCMCIA card (I've confirmed that the card works in Mac OS 8.1).
    It looks like there used to be some PCMCIA tools for 2.4 and 2.6
    kernels, but it's not clear what to use for 4.x and 5.x kernels, or
    whether PCMCIA support exists for m68k.

    thanks for any suggestions

    -Stan Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to John Paul Adrian Glaubitz on Tue Aug 11 01:50:01 2020
    On Tue, Aug 11, 2020 at 12:04:04AM +0200, John Paul Adrian Glaubitz wrote:
    On 8/10/20 11:52 PM, Stan Johnson wrote:
    I have a PowerBook 190cs that is running Debian SID. I would like to be able to connect this PowerBook to an Ethernet network using an MPC-10 Ethernet PCMCIA card (I've confirmed that the card works in Mac OS 8.1).
    It looks like there used to be some PCMCIA tools for 2.4 and 2.6
    kernels, but it's not clear what to use for 4.x and 5.x kernels, or
    whether PCMCIA support exists for m68k.

    PCMCIA works on m68k, I already used it on my Amiga 1200. Not sure about
    68k Macs though.

    One particular thing is that not all PCMCIA cards supported by the kernel will also work with the PCMCIA stack on Linux/Amiga [1]. So I had to be careful buying the right networking card.

    You might have better luck with your Mac.

    There was a discussion of the driver for PCMCIA support on the PB190
    back in November 2009, but I don't believe anything was ever completed.
    There's old code that worked for some cards back then, but it would
    need to be updated to a current kernel, and even then probably needs
    some work to get accepted.

    Here's part of the thread to give you somewhere to start if you're
    curious about it:

    https://lists.debian.org/debian-68k/2009/11/msg00018.html

    The socket driver is named trex, and was ported from the nubus-pmac
    tree since the same hardware is present on the PB5300 and PB1400.

    Later PowerBooks have cardbus slots (since they are PCI based) and
    don't need this specific driver.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Tue Aug 11 04:20:02 2020
    On Mon, 10 Aug 2020, Brad Boyer wrote:


    There was a discussion of the driver for PCMCIA support on the PB190
    back in November 2009, but I don't believe anything was ever completed.

    At the time, Diego Cousinet sent me an unfinished trex patch for the
    2.6.31 kernel but we never got it working with my Farallon card. I think
    he did some more work on this in 2011 but I've not kept in touch.

    There's old code that worked for some cards back then, but it would need
    to be updated to a current kernel, and even then probably needs some
    work to get accepted.


    Right.

    ISTR the 190 and 5300 did have an optional infrared port. Unfortunately
    the IRDA stack got removed from Linux in v4.17.

    I've been working on other issues because the Powerbook 190 is limited to
    40 MB of RAM (and that upgrade is probably unobtainable/unaffordable now).

    Another limitation of the 190 is the missing FPU, which means the CPU has
    to emulate those instructions which is slow. The FPU emulation in Linux is incomplete and the end result is that you can't run 'fio' for example.

    The way I see it, implementing Localtalk support, better FPU emulation or
    any of a dozen other issues would be more rewarding because that might
    help with lots of Mac models (particularly those with more RAM).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Johnson@21:1/5 to Finn Thain on Tue Aug 11 06:30:02 2020
    On 8/10/20 8:03 PM, Finn Thain wrote:
    ...

    ISTR the 190 and 5300 did have an optional infrared port. Unfortunately
    the IRDA stack got removed from Linux in v4.17.

    The PB 190 has infrared, which only supports Apple???s IRtalk in Mac OS.
    But it doesn't matter for Linux since IRDA support has been removed.


    I've been working on other issues because the Powerbook 190 is limited to
    40 MB of RAM (and that upgrade is probably unobtainable/unaffordable now).

    Another limitation of the 190 is the missing FPU, which means the CPU has
    to emulate those instructions which is slow. The FPU emulation in Linux is incomplete and the end result is that you can't run 'fio' for example.

    The way I see it, implementing Localtalk support, better FPU emulation or
    any of a dozen other issues would be more rewarding because that might
    help with lots of Mac models (particularly those with more RAM).


    Supporting LocalTalk in Linux would be great for communicating with
    older Macs (and even better if you're talking about TCP/IP over
    LocalTalk, which would potentially allow Internet access via some LocalTalk/Ethernet bridges).

    On the 190, I can use a PCMCIA network card in Mac OS, which along with
    the FTP server in NCSA Telnet 2.7b4 can be used to move files reliably
    to and from any HFS volume. It sounds like there may not be enough PB
    190 users to justify spending any more effort in getting PCMCIA working
    in Linux.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geert Uytterhoeven@21:1/5 to userm57@yahoo.com on Tue Aug 11 09:20:01 2020
    On Tue, Aug 11, 2020 at 6:29 AM Stan Johnson <userm57@yahoo.com> wrote:
    On 8/10/20 8:03 PM, Finn Thain wrote:
    ...

    ISTR the 190 and 5300 did have an optional infrared port. Unfortunately
    the IRDA stack got removed from Linux in v4.17.

    The PB 190 has infrared, which only supports Apple???s IRtalk in Mac OS.
    But it doesn't matter for Linux since IRDA support has been removed.

    commit d64c2a76123f0300b08d0557ad56e9d599872a36
    Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Date: Wed Mar 14 13:12:26 2018 +0100

    staging: irda: remove the irda network stack and drivers

    No one has publicly stepped up to maintain this broken codebase for
    devices that no one uses anymore, so let's just drop the whole thing.

    If someone really wants/needs it, we can revert this and they can fix
    the code up to work properly.

    Cc: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Stan Johnson on Tue Aug 11 10:40:02 2020
    On Mon, Aug 10, 2020 at 10:29:07PM -0600, Stan Johnson wrote:
    On 8/10/20 8:03 PM, Finn Thain wrote:

    The way I see it, implementing Localtalk support, better FPU emulation or any of a dozen other issues would be more rewarding because that might
    help with lots of Mac models (particularly those with more RAM).


    Supporting LocalTalk in Linux would be great for communicating with
    older Macs (and even better if you're talking about TCP/IP over
    LocalTalk, which would potentially allow Internet access via some LocalTalk/Ethernet bridges).

    Do we have enough CPU time to implement LocalTalk fully in software
    without causing other issues? I believe it's a synchronous protocol,
    and unless you're talking about one of the models with IOPs (IIfx,
    Q900, Q950) or real DMA (Q660, Q840) the CPU will need to be
    involved on a very fixed schedule. Is it possible to do that level
    of real-time scheduling with a standard Linux kernel? If I'm
    interpreting the docs correctly, we will have to talk to the serial
    controller around 8000 times per second (230kbit/s and 4 bytes at a
    time from the ESCC) with very tight tolerances. Will it cause
    problems to have the serial controller sending interrupts that
    often? I suspect Apple just hogged the CPU during data transfer.

    If we did have real LocalTalk support, we could use the ipddp module
    to use a Linux box as the bridge. It has both modes according to the
    code. I've never tried it myself, but it should work.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Stan Johnson on Wed Aug 12 02:00:01 2020
    On Mon, 10 Aug 2020, Stan Johnson wrote:


    It sounds like there may not be enough PB 190 users to justify spending
    any more effort in getting PCMCIA working in Linux.


    If you fixed the trex driver, that model might go from few to many users.
    Who knows?

    Once again, the other limitations of that model are relevant.

    But interest is hard to guage, short of a pledge. Some work on GCC was
    recently crowd-funded. https://lists.debian.org/debian-68k/2019/12/msg00000.html

    Since the trex driver originated with the nubus-pmac project, that may be another forum to seek interested users/developers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Schmitz@21:1/5 to Brad Boyer on Wed Aug 12 01:50:01 2020
    Brad,

    On 11/08/20 8:29 PM, Brad Boyer wrote:
    On Mon, Aug 10, 2020 at 10:29:07PM -0600, Stan Johnson wrote:
    On 8/10/20 8:03 PM, Finn Thain wrote:
    The way I see it, implementing Localtalk support, better FPU emulation or >>> any of a dozen other issues would be more rewarding because that might
    help with lots of Mac models (particularly those with more RAM).

    Supporting LocalTalk in Linux would be great for communicating with
    older Macs (and even better if you're talking about TCP/IP over
    LocalTalk, which would potentially allow Internet access via some
    LocalTalk/Ethernet bridges).
    Do we have enough CPU time to implement LocalTalk fully in software
    without causing other issues? I believe it's a synchronous protocol,
    and unless you're talking about one of the models with IOPs (IIfx,
    Q900, Q950) or real DMA (Q660, Q840) the CPU will need to be
    involved on a very fixed schedule. Is it possible to do that level
    of real-time scheduling with a standard Linux kernel? If I'm

    Depends on the interrupt priority levels - if the SCC can preempt other interrupt handlers, and you do nothing but acknowledge the interrupt and
    copy bytes to a buffer, this might be worth a try. Protocol handling and
    moving buffer data to network buffers would be left to a task queue, to
    run when a packet has been fully received.

    Today's kernels are a lot smarter with locks than 20 years ago when this
    would have been impossible.

    How large are the data packets involved? Is there a pseudo-DMA address
    window for the SCC data port to used optimized access (moveml)? Does SCC
    access force a bus delay, or can the SCC be accessed at full rate?

    interpreting the docs correctly, we will have to talk to the serial controller around 8000 times per second (230kbit/s and 4 bytes at a
    time from the ESCC) with very tight tolerances. Will it cause
    problems to have the serial controller sending interrupts that
    often? I suspect Apple just hogged the CPU during data transfer.

    It definitely felt like that :-)

    Haven't tried 8000 Hz interrupt rates on a 16 MHz clocked m68k (200 with handling ne8390 interrupts is fine), but that ought to be
    straightforward enough to test with a little module.

    Cheers,

        Michael



    If we did have real LocalTalk support, we could use the ipddp module
    to use a Linux box as the bridge. It has both modes according to the
    code. I've never tried it myself, but it should work.

    Brad Boyer
    flar@allandria.com


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Michael Schmitz on Wed Aug 12 02:50:01 2020
    On Wed, 12 Aug 2020, Michael Schmitz wrote:


    Depends on the interrupt priority levels - if the SCC can preempt other interrupt handlers, and you do nothing but acknowledge the interrupt and
    copy bytes to a buffer, this might be worth a try.

    Is there overhead in monitoring packets for node addresses? If so, any
    node on the network would consume CPU of every other node whenever it transmits... if true, it begs for IOP offload (or DMA).

    Protocol handling and moving buffer data to network buffers would be
    left to a task queue, to run when a packet has been fully received.

    Today's kernels are a lot smarter with locks than 20 years ago when this would have been impossible.

    How large are the data packets involved? Is there a pseudo-DMA address
    window for the SCC data port to used optimized access (moveml)? Does SCC access force a bus delay, or can the SCC be accessed at full rate?


    Good questions. But I'm not going to dive into leaked source code or disassembled drivers to find answers. I might dig out the relevant books
    and tech notes though.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Wed Aug 12 02:40:01 2020
    On Tue, 11 Aug 2020, Brad Boyer wrote:

    Do we have enough CPU time to implement LocalTalk fully in software
    without causing other issues?

    It would cause issues if drivers (especially the VIA clocksource) were
    badly starved of CPU, such that interrupts were handled too late. We
    already have a system clock drift problem on many models (though not all) because of that.

    I believe it's a synchronous protocol, and unless you're talking about
    one of the models with IOPs (IIfx, Q900, Q950) or real DMA (Q660, Q840)
    the CPU will need to be involved on a very fixed schedule.

    I agree, the IOP machines would be good candidates. The PSC machines too,
    now that the NetBSD developers have figured out a lot more about the DMA controller.

    Is it possible to do that level of real-time scheduling with a standard
    Linux kernel?

    Well, high efficiency I/O and real time processing are important to the upstream kernel, because some big customers want those things.

    If I'm interpreting the docs correctly, we will have to talk to the
    serial controller around 8000 times per second (230kbit/s and 4 bytes at
    a time from the ESCC)

    I think 8000 is an over-estimate. 230kbit/s is a baud rate not a bit rate, right?

    with very tight tolerances.

    Slack tolerances probably lead to high packet loss. But there may be a
    happy medium.

    Will it cause problems to have the serial controller sending interrupts
    that often?

    I would like to know how many interrupts per second can be serviced on a Powerbook 190 (assuming that the ISR does nothing except acknowledge the interrupt) without consuming more than say, 50% CPU. It might be possible
    to run a test like this using the timer interrupt, just by reducing VIA_TIMER_CYCLES.

    I suspect Apple just hogged the CPU during data transfer.


    Me too. IIRC the mouse pointer moved jerkily during Localtalk I/O (and
    also during floppy disk initialization).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Schmitz@21:1/5 to Finn Thain on Wed Aug 12 03:30:01 2020
    Hi Finn,

    On 12/08/20 12:45 PM, Finn Thain wrote:
    On Wed, 12 Aug 2020, Michael Schmitz wrote:

    Depends on the interrupt priority levels - if the SCC can preempt other
    interrupt handlers, and you do nothing but acknowledge the interrupt and
    copy bytes to a buffer, this might be worth a try.
    Is there overhead in monitoring packets for node addresses? If so, any
    node on the network would consume CPU of every other node whenever it transmits... if true, it begs for IOP offload (or DMA).

    As far as I recall, the SCC can be programmed to only respond to a
    specific node address in synchronous mode. Packets destined to other
    nodes are just passed through.

    But it's over 20 years since I last looked at the SCC databook, so I may
    be mistaken. My comments were based on that above assumption.


    Protocol handling and moving buffer data to network buffers would be
    left to a task queue, to run when a packet has been fully received.

    Today's kernels are a lot smarter with locks than 20 years ago when this
    would have been impossible.

    How large are the data packets involved? Is there a pseudo-DMA address
    window for the SCC data port to used optimized access (moveml)? Does SCC
    access force a bus delay, or can the SCC be accessed at full rate?

    Good questions. But I'm not going to dive into leaked source code or disassembled drivers to find answers. I might dig out the relevant books
    and tech notes though.

    I didn't expect you to trawl through disassembly or leaked code - I just thought someone might remember.

    The bit about bus delay should be possible to figure out from timing
    access to the SCC data port and compare to RAM access. That might
    already decide the issue.

    (and no, not suggesting you do that, either ... Just in case someone
    feels like a little kernel hacking for fun, if not profit)

    Cheers,

        Michael

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Finn Thain on Wed Aug 12 04:20:01 2020
    On Wed, Aug 12, 2020 at 10:33:53AM +1000, Finn Thain wrote:
    On Tue, 11 Aug 2020, Brad Boyer wrote:
    If I'm interpreting the docs correctly, we will have to talk to the
    serial controller around 8000 times per second (230kbit/s and 4 bytes at
    a time from the ESCC)

    I think 8000 is an over-estimate. 230kbit/s is a baud rate not a bit rate, right?

    Maybe? What information I do have is a little limited, and not very
    detailed on that sort of thing.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Michael Schmitz on Wed Aug 12 04:20:01 2020
    On Wed, Aug 12, 2020 at 01:25:16PM +1200, Michael Schmitz wrote:
    On 12/08/20 12:45 PM, Finn Thain wrote:
    On Wed, 12 Aug 2020, Michael Schmitz wrote:

    Depends on the interrupt priority levels - if the SCC can preempt other >>interrupt handlers, and you do nothing but acknowledge the interrupt and >>copy bytes to a buffer, this might be worth a try.
    Is there overhead in monitoring packets for node addresses? If so, any
    node on the network would consume CPU of every other node whenever it >transmits... if true, it begs for IOP offload (or DMA).

    As far as I recall, the SCC can be programmed to only respond to a specific node address in synchronous mode. Packets destined to other nodes are just passed through.

    But it's over 20 years since I last looked at the SCC databook, so I may be mistaken. My comments were based on that above assumption.

    Yes, I just looked at the SCC/ESCC manual and there is definitely an
    address search function in SDLC mode. It seems like it should work. I
    have to imagine Apple made sure it did. I've seen too many large node
    count LocalTalk networks to believe anything else.


    Protocol handling and moving buffer data to network buffers would be
    left to a task queue, to run when a packet has been fully received.

    Today's kernels are a lot smarter with locks than 20 years ago when this >>would have been impossible.

    How large are the data packets involved? Is there a pseudo-DMA address >>window for the SCC data port to used optimized access (moveml)? Does SCC >>access force a bus delay, or can the SCC be accessed at full rate?

    Good questions. But I'm not going to dive into leaked source code or >disassembled drivers to find answers. I might dig out the relevant books >and tech notes though.

    I didn't expect you to trawl through disassembly or leaked code - I just thought someone might remember.

    The bit about bus delay should be possible to figure out from timing access to the SCC data port and compare to RAM access. That might already decide
    the issue.

    (and no, not suggesting you do that, either ... Just in case someone feels like a little kernel hacking for fun, if not profit)

    I think that sort of logic was restricted to special PDMA windows or
    interfaces explicitly put into PDMA mode (like SCSI DMA on the IIfx).
    It would still have to be tested to be sure.

    We've certainly disassembled other parts of the code to do stuff. I
    remember spending hours in MacsBug disassembling ROM code years ago.
    That's how we confirmed some details on the IIfx hardware.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Schmitz@21:1/5 to All on Wed Aug 12 08:00:01 2020
    Hi Brad,

    Finn is right - that's a baud rate, not bit rate. I'm a little hazy on
    whether SDLC uses start and stop bits at all - I'm guessing it does not,
    making baud rate almost equal to bit rate (not considering node address
    and prefix). Still close to 7.2 kHz interrupt rate.

    Cheers,

    Michael

    Am 12.08.2020 um 14:12 schrieb Brad Boyer:
    On Wed, Aug 12, 2020 at 10:33:53AM +1000, Finn Thain wrote:
    On Tue, 11 Aug 2020, Brad Boyer wrote:
    If I'm interpreting the docs correctly, we will have to talk to the
    serial controller around 8000 times per second (230kbit/s and 4 bytes at >>> a time from the ESCC)

    I think 8000 is an over-estimate. 230kbit/s is a baud rate not a bit rate, >> right?

    Maybe? What information I do have is a little limited, and not very
    detailed on that sort of thing.

    Brad Boyer
    flar@allandria.com


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Michael Schmitz on Wed Aug 12 10:10:02 2020
    On Wed, Aug 12, 2020 at 05:54:29PM +1200, Michael Schmitz wrote:
    Finn is right - that's a baud rate, not bit rate. I'm a little hazy on whether SDLC uses start and stop bits at all - I'm guessing it does not, making baud rate almost equal to bit rate (not considering node address and prefix). Still close to 7.2 kHz interrupt rate.

    OK. That makes sense. And I do believe you are right that there are
    no start or stop bits. The charts I saw seem to indicate that there
    is a start and stop tag for each end of the whole frame rather than
    a bit on each data byte. The SCC docs also clearly indicate that
    the address byte is just the first byte of data as well.

    That interrupt rate still sounds like it could be hard to handle.
    Perhaps it won't be quite as bad on some of the later models that
    are running the CPU at higher clock speeds. At least we don't
    support any of the 8MHz models. It might be more practical on some
    of the PCI PowerMacs that are both running much faster CPUs and
    have real DMA as well.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Michael Schmitz on Thu Aug 13 03:00:01 2020
    On Wed, 12 Aug 2020, Michael Schmitz wrote:


    The bit about bus delay should be possible to figure out from timing
    access to the SCC data port and compare to RAM access. That might
    already decide the issue.


    The Guide to Macintosh Family Hardware says that SCC accesses are paced by
    the GLUE logic.

    "The SCC requires 2.2 uS between accesses for its intemal lines to
    stabilize; in the case of back-to-back accesses to the SCC, the GLUE
    holds off the second access for that amount of time."

    That's 454545 accesses per second (peak).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Thu Aug 13 04:00:01 2020
    On Tue, 11 Aug 2020, Brad Boyer wrote:

    I suspect Apple just hogged the CPU during data transfer.


    Your suspicion is confirmed by Apple's literature. Inside Macintosh:
    Devices, p. 7-10, says appletalk "is not interrupt-driven" and "The Guide
    to Macintosh Family Hardware", ch. 10, says,

    "AppleTalk operates at a nominal data transmission rate of 230.4
    Kbaud. This higher rate is possible because AppleTalk communications
    are not interrupt driven; during AppleTalk communications, the
    AppleTalk Driver has complete control of the computer. Although
    AppleTalk uses a synchronous communication protocol, the AppleTalk
    Driver runs the SCC chip in asynchronous mode, timed by the 3.672 MHz
    clock.

    "The maximum possible transmission rate for serial data ranges from
    approximately 500 Kbaud on the Macintosh Plus and Macintosh SE to 900
    Kbaud on the Macintosh II family. To achieve such data transmission
    rates, the SCC would have to be operated in synchronous mode timed by
    an external clock, and the serial driver would have to have complete,
    uninterrupted control of the computer."

    Tech note HW 545 has more.

    "If the period of time interrupts are not serviced becomes too great,
    the 3-byte receive buffer in the serial chip overflows with incoming
    data and characters are lost. This is known as a hardware overrun.
    AppleTalk works a little differently. When a packet comes across the
    network, an interrupt alerts the processor to that event. AppleTalk
    code then disables interrupts and polls in the entire packet without
    multiple successive interrupts. This is necessary because of the high
    speed at which data is received: 230.4 kilobaud. The overhead of
    processing an interrupt for each byte of data would be prohibitive. A
    'worst case' situation is that a 603-byte packet (the largest possible
    AppleTalk packet) sent to the LocalTalk port takes approximately 26
    milliseconds to receive."

    This 26 ms interval will cause missed timer interrupts and system clock
    drift, unless the timer interrupt was polled too. (We could probably poll
    all of the VIA 1 interrupt sources for the duration of the packet, but not
    with Egret hardware because of delays in that interrupt handler.)

    Another consideration is raised in tech note TB 570. It says, "system
    services like AppleTalk require that interrupts not be disabled for much
    more than 1/1000th of a second usually. This means if you are doing
    something large during your interrupt routine (when all interrupts may be turned off), you could delay the AppleTalk interrupt so long that data
    gets lost."

    I think this is quite feasible for the majority of systems. A minority
    might drop some packets depending on hardware configuration, etc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Finn Thain on Thu Aug 13 08:20:01 2020
    On Thu, Aug 13, 2020 at 11:51:57AM +1000, Finn Thain wrote:
    This 26 ms interval will cause missed timer interrupts and system clock drift, unless the timer interrupt was polled too. (We could probably poll
    all of the VIA 1 interrupt sources for the duration of the packet, but not with Egret hardware because of delays in that interrupt handler.)

    That will make for a really messy driver, but it could be done with some careful thought. It could also be made conditional on m68k so that a
    ppc based system wouldn't need it, since it can figure out how much
    real time passed between timer interrupts with the timebase.

    Another consideration is raised in tech note TB 570. It says, "system services like AppleTalk require that interrupts not be disabled for much
    more than 1/1000th of a second usually. This means if you are doing
    something large during your interrupt routine (when all interrupts may be turned off), you could delay the AppleTalk interrupt so long that data
    gets lost."

    I think this is quite feasible for the majority of systems. A minority
    might drop some packets depending on hardware configuration, etc.

    It sounds like the first step might be to audit all the other common
    drivers to see which ones are disabling interrupts too long. I know
    we do quite a bit of that.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Schmitz@21:1/5 to All on Thu Aug 13 10:20:02 2020
    Hi Finn,

    Am 13.08.2020 um 12:58 schrieb Finn Thain:
    On Wed, 12 Aug 2020, Michael Schmitz wrote:


    The bit about bus delay should be possible to figure out from timing
    access to the SCC data port and compare to RAM access. That might
    already decide the issue.


    The Guide to Macintosh Family Hardware says that SCC accesses are paced by the GLUE logic.

    "The SCC requires 2.2 uS between accesses for its intemal lines to
    stabilize; in the case of back-to-back accesses to the SCC, the GLUE
    holds off the second access for that amount of time."

    Right, it now comes back to me at last - this is what we had used on the
    Atari and VME SCC serial drivers (no need for that with glue logic though):

    #define scc_reg_delay() \
    do { \
    if (MACH_IS_MVME16x || MACH_IS_BVME6000 || MACH_IS_MVME147) \
    __asm__ __volatile__ ( " nop; nop"); \
    else if (MACH_IS_ATARI) \
    __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) :
    "cc" );\
    } while (0)


    The tstb takes around 600 ns. Is the Mac SCC clocked slower than the
    Atari one (8 MHz)?



    That's 454545 accesses per second (peak).


    Many SCC operations need two accesses ... can the data register be read directly on the Mac SCC, or does it need a control register write first?

    Polling for the entire packet might really be the only way.

    Cheers,

    Michael

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Fri Aug 14 00:50:01 2020
    On Wed, 12 Aug 2020, Brad Boyer wrote:

    On Thu, Aug 13, 2020 at 11:51:57AM +1000, Finn Thain wrote:
    This 26 ms interval will cause missed timer interrupts and system
    clock drift, unless the timer interrupt was polled too. (We could
    probably poll all of the VIA 1 interrupt sources for the duration of
    the packet, but not with Egret hardware because of delays in that
    interrupt handler.)

    That will make for a really messy driver, but it could be done with some careful thought. It could also be made conditional on m68k so that a ppc based system wouldn't need it, since it can figure out how much real
    time passed between timer interrupts with the timebase.


    I would imagine that this 26 ms would be spent in interrupt context in the pmac_zilog driver. This may or may not impact the timekeeping on
    powermacs. I don't know how interrupt priorities work on those platforms.

    Another consideration is raised in tech note TB 570. It says, "system services like AppleTalk require that interrupts not be disabled for
    much more than 1/1000th of a second usually. This means if you are
    doing something large during your interrupt routine (when all
    interrupts may be turned off), you could delay the AppleTalk interrupt
    so long that data gets lost."

    I think this is quite feasible for the majority of systems. A minority might drop some packets depending on hardware configuration, etc.

    It sounds like the first step might be to audit all the other common
    drivers to see which ones are disabling interrupts too long. I know we
    do quite a bit of that.


    SCSI transfers happen either at IPL 2 or IPL 7. These days we use PDMA everywhere except for PSC machines (which should be using DMA but Linux
    drivers don't support it) and certain rare SCSI targets which can't keep
    up. Limiting scatter/gather segments to 1024 B should meet the timing constraint.

    It's possible that the floppy driver disables interrupts for too long. But apart from that, 1 ms seems quite feasible (at least until multiple
    controllers become busy).

    BTW, feasibility is one thing but actually implementing Localtalk support
    is another. DMA support for PSC machines and framebuffer acceleration are probably more important features than Localtalk. And I see debugging as
    more important than adding features. So more volunteers are needed (as
    always).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Michael Schmitz on Fri Aug 14 06:10:01 2020
    On Thu, 13 Aug 2020, Michael Schmitz wrote:

    Am 13.08.2020 um 12:58 schrieb Finn Thain:
    On Wed, 12 Aug 2020, Michael Schmitz wrote:


    The bit about bus delay should be possible to figure out from timing access to the SCC data port and compare to RAM access. That might
    already decide the issue.


    The Guide to Macintosh Family Hardware says that SCC accesses are
    paced by the GLUE logic.

    "The SCC requires 2.2 uS between accesses for its intemal lines to
    stabilize; in the case of back-to-back accesses to the SCC, the
    GLUE holds off the second access for that amount of time."

    Right, it now comes back to me at last - this is what we had used on the Atari and VME SCC serial drivers (no need for that with glue logic
    though):

    #define scc_reg_delay() \
    do { \
    if (MACH_IS_MVME16x || MACH_IS_BVME6000 || MACH_IS_MVME147) \
    __asm__ __volatile__ ( " nop; nop"); \
    else if (MACH_IS_ATARI) \
    __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );\
    } while (0)


    The tstb takes around 600 ns. Is the Mac SCC clocked slower than the
    Atari one (8 MHz)?


    PCLK runs at 3.6864 MHz which means a cycle takes 271 ns. The SCC Users
    Manual says, "recovery time is four PCLK cycles (AC Spec #49), measured
    from the falling edge of /RD or /WR in the case of a read or write of any register." That's 1.1 us. I don't know why Apple says 2.2 us but it's
    probably academic.



    That's 454545 accesses per second (peak).


    Many SCC operations need two accesses ... can the data register be read directly on the Mac SCC, or does it need a control register write first?


    To read the same register again and again, surely you wouldn't have to
    write to the register pointer more than once.

    Polling for the entire packet might really be the only way.


    The data rate is fixed at 230 kB/s so there are only a hundred or so
    processor cycles between bytes. Even if there are a few bytes in the
    buffer then you probably only have 500 cycles on a fast machine.

    If polling is too inefficient then we need to use the DMA controller or
    the SCC IOP (on machines that have them).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Finn Thain on Fri Aug 14 10:40:02 2020
    On Fri, Aug 14, 2020 at 08:43:00AM +1000, Finn Thain wrote:
    On Wed, 12 Aug 2020, Brad Boyer wrote:

    That will make for a really messy driver, but it could be done with some careful thought. It could also be made conditional on m68k so that a ppc based system wouldn't need it, since it can figure out how much real
    time passed between timer interrupts with the timebase.


    I would imagine that this 26 ms would be spent in interrupt context in the pmac_zilog driver. This may or may not impact the timekeeping on
    powermacs. I don't know how interrupt priorities work on those platforms.

    I think most if not all of the PowerMac models have real DMA engines
    anyway. That might avoid the problem entirely. There's already some
    code for DBDMA on PCI PowerMacs in pmac_zilog, but it is apparently
    unfinished. At least some of the NuBus PowerMacs have a DMA engine,
    but with less capability.

    It sounds like the first step might be to audit all the other common drivers to see which ones are disabling interrupts too long. I know we
    do quite a bit of that.


    SCSI transfers happen either at IPL 2 or IPL 7. These days we use PDMA everywhere except for PSC machines (which should be using DMA but Linux drivers don't support it) and certain rare SCSI targets which can't keep
    up. Limiting scatter/gather segments to 1024 B should meet the timing constraint.

    It's possible that the floppy driver disables interrupts for too long. But apart from that, 1 ms seems quite feasible (at least until multiple controllers become busy).

    It's worth looking, but Apple must have had a way around that.

    BTW, feasibility is one thing but actually implementing Localtalk support
    is another. DMA support for PSC machines and framebuffer acceleration are probably more important features than Localtalk. And I see debugging as
    more important than adding features. So more volunteers are needed (as always).

    That's probably true. We have so much on the list already. I know there
    were several other things I wanted to check out first. I have a wide
    variety of video cards with various accelerator capabilities, plus a
    couple NuBus DMA cards that should allow doing accelerated video even
    on the early video cards without any extra logic beyond the basics. I
    had hoped to work on the ADB drivers as well. It would be great to get
    full ADB support working on the iMate which could potentially be used
    to have real ADB support on anything with a USB port. The company that
    made it has given hardware information for some of their other
    peripherals, but I haven't tried asking for iMate documentation.

    I was also hoping to get some enhancements for the IOP core to fully re-initialize the IOP kernel which should allow us to manage the
    bypass mode directly. However, that also means finding the resources
    in the ROM that contain the kernel and device drivers for the IOP. I
    don't fancy writing a new IOP kernel from scratch. I was working on
    updating the swim_iop driver, but I still haven't finished fixing it
    for the new block device layer.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Sat Aug 15 03:00:01 2020
    On Fri, 14 Aug 2020, Brad Boyer wrote:

    BTW, feasibility is one thing but actually implementing Localtalk
    support is another. DMA support for PSC machines and framebuffer acceleration are probably more important features than Localtalk. And
    I see debugging as more important than adding features. So more
    volunteers are needed (as always).

    That's probably true. We have so much on the list already. I know there
    were several other things I wanted to check out first. I have a wide
    variety of video cards with various accelerator capabilities, plus a
    couple NuBus DMA cards that should allow doing accelerated video even on
    the early video cards without any extra logic beyond the basics.

    I suspect that the on-board video hardware is under-performing in Linux, especially on some Quadras. And Linux/mac68k also lacks multiple display support.

    Reverse engineering NuBus cards is another story. ISTR that NetBSD made
    some progress there. But it's not high on my list of priorities because
    there's any number of different cards and no way of knowing which ones are still around.

    I had hoped to work on the ADB drivers as well. It would be great to get
    full ADB support working on the iMate which could potentially be used to
    have real ADB support on anything with a USB port. The company that made
    it has given hardware information for some of their other peripherals,
    but I haven't tried asking for iMate documentation.


    That seems out-of-scope for the Linux/mac68k project (?)

    I was also hoping to get some enhancements for the IOP core to fully re-initialize the IOP kernel which should allow us to manage the bypass
    mode directly.

    I think SCC IOP bypass is enabled in PRAM, which means we can just leave
    the ROM to manage that (or MacOS, if the user wants MacOS to boot before Linux). And if you succeed in reviving the swim_iop driver, there would be
    no need to manage the SWIM/ADB IOP bypass either, right?

    However, that also means finding the resources in the ROM that contain
    the kernel and device drivers for the IOP.

    That could be useful if MacOS carries firmware updates to fix bugs in the
    IOP kernels and drivers stored in the ROM. End users could extract those resources from MacOS for use with the Linux firmware loader. I wonder
    whether such bugs exist (?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Finn Thain on Sat Aug 15 04:40:02 2020
    On Sat, Aug 15, 2020 at 10:52:08AM +1000, Finn Thain wrote:
    On Fri, 14 Aug 2020, Brad Boyer wrote:

    That's probably true. We have so much on the list already. I know there were several other things I wanted to check out first. I have a wide variety of video cards with various accelerator capabilities, plus a
    couple NuBus DMA cards that should allow doing accelerated video even on the early video cards without any extra logic beyond the basics.

    I suspect that the on-board video hardware is under-performing in Linux, especially on some Quadras. And Linux/mac68k also lacks multiple display support.

    Multiple display support shouldn't be too difficult, but I think we
    should do that by having real video drivers rather than just using
    macfb. It would be similar to the way offb works for PCI PowerMacs,
    where there is both a generic driver and individual drivers for
    each of the onboard chips as well as the various common PCI cards.

    Reverse engineering NuBus cards is another story. ISTR that NetBSD made
    some progress there. But it's not high on my list of priorities because there's any number of different cards and no way of knowing which ones are still around.

    It's worth writing drivers for the official Apple cards if nothing else. However, they're all pretty lacking in capability. But it would make it
    easy to throw in two or three Toby cards and have multiple displays.

    I had hoped to work on the ADB drivers as well. It would be great to get full ADB support working on the iMate which could potentially be used to have real ADB support on anything with a USB port. The company that made
    it has given hardware information for some of their other peripherals,
    but I haven't tried asking for iMate documentation.


    That seems out-of-scope for the Linux/mac68k project (?)

    True, but I was still planning on looking into it. I have tons of
    ADB input devices (keyboards, mice, trackballs, joysticks, gamepads,
    drawing tablets, and even a barcode scanner). I was hoping to get some
    of them beyond the basic keyboard and mouse support working. Having
    them on a regular PC would be amusing.

    I was also hoping to get some enhancements for the IOP core to fully re-initialize the IOP kernel which should allow us to manage the bypass mode directly.

    I think SCC IOP bypass is enabled in PRAM, which means we can just leave
    the ROM to manage that (or MacOS, if the user wants MacOS to boot before Linux). And if you succeed in reviving the swim_iop driver, there would be
    no need to manage the SWIM/ADB IOP bypass either, right?

    Yes, but that's just because it's the ROM that loads the initial kernel
    and drivers to be able to check for keyboard input during boot or to be
    able to boot from a floppy. I suppose we can just tell people to manage
    the serial switch setting in MacOS, but that seems clumsy. I'm pretty
    sure the MacOS reloads it all during boot.

    However, that also means finding the resources in the ROM that contain
    the kernel and device drivers for the IOP.

    That could be useful if MacOS carries firmware updates to fix bugs in the
    IOP kernels and drivers stored in the ROM. End users could extract those resources from MacOS for use with the Linux firmware loader. I wonder
    whether such bugs exist (?)

    I wouldn't be surprised. It's also quite likely that the Q900/Q950 ROM
    has a newer version of them than the IIfx. I haven't checked. It might
    be easier to find them in the system software than in the ROM. I know
    where they should be and how to look for them there. There's a unique
    resource type for them, according to the information I have.

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Sat Aug 15 05:30:01 2020
    On Fri, 14 Aug 2020, Brad Boyer wrote:


    Multiple display support shouldn't be too difficult, but I think we
    should do that by having real video drivers rather than just using
    macfb. It would be similar to the way offb works for PCI PowerMacs,
    where there is both a generic driver and individual drivers for each of
    the onboard chips as well as the various common PCI cards.


    I think macfb could be replaced entirely by simplefb and some nubus
    drivers, now that nubus has actual drivers under the Linux driver model
    (as of Linux v4.16).

    I suppose we can just tell people to manage the serial switch setting in MacOS, but that seems clumsy.

    No need for MacOS. As of Linux v5.1 you can configure SCC IOP bypass using /dev/nvram on 68k Macs. (I wonder whether PRAM reset would enable or
    disable bypass...)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to All on Thu Aug 20 03:20:01 2020
    On Sat, 15 Aug 2020, I wrote, incorrectly:


    I think macfb could be replaced entirely by simplefb and some nubus
    drivers, now that nubus has actual drivers under the Linux driver model
    (as of Linux v4.16).


    I was forgetting about palette operations. So macfb is actually required
    for on-board video hardware.

    As of Linux v5.1 you can configure SCC IOP bypass using /dev/nvram on
    68k Macs. (I wonder whether PRAM reset would enable or disable
    bypass...)


    /dev/nvram functionality works on IIfx but not Quadra 900/950 models
    because there's no Caboose driver yet. RTC and soft power control
    functionality are also missing on Quadra 900/950 for the same reason.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Boyer@21:1/5 to Finn Thain on Thu Aug 20 07:20:01 2020
    On Thu, Aug 20, 2020 at 11:15:28AM +1000, Finn Thain wrote:
    On Sat, 15 Aug 2020, I wrote, incorrectly:

    I think macfb could be replaced entirely by simplefb and some nubus drivers, now that nubus has actual drivers under the Linux driver model
    (as of Linux v4.16).


    I was forgetting about palette operations. So macfb is actually required
    for on-board video hardware.

    That's fine, although at least Valkyrie already has a separate driver
    as it is also used in some PowerPC models. Would separating them out
    like they are there make the code simpler? I know there is also a
    separate driver for Control, which is the video chip on the various
    PowerMac 7x00 models.

    As of Linux v5.1 you can configure SCC IOP bypass using /dev/nvram on
    68k Macs. (I wonder whether PRAM reset would enable or disable
    bypass...)


    /dev/nvram functionality works on IIfx but not Quadra 900/950 models
    because there's no Caboose driver yet. RTC and soft power control functionality are also missing on Quadra 900/950 for the same reason.

    That might be a tough one. I've never heard of anyone finding good documentation on Caboose. This may be one thing that has to be
    completely reverse engineered by disassembling the ROM code. Even
    on the various IIfx craziness, we still managed to find some basic
    information to give us a head start.

    The official board diagram for the Q900 shows Caboose connected to
    VIA1 instead of directly to the CPU. The MESS hardware information
    claims it is a 68HC05 just like Egret and Cuda. Perhaps we should
    try the via-cuda driver with ADB disabled and see what happens?

    Brad Boyer
    flar@allandria.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to Brad Boyer on Thu Aug 20 08:30:01 2020
    On Wed, 19 Aug 2020, Brad Boyer wrote:

    On Thu, Aug 20, 2020 at 11:15:28AM +1000, Finn Thain wrote:
    On Sat, 15 Aug 2020, I wrote, incorrectly:

    I think macfb could be replaced entirely by simplefb and some nubus drivers, now that nubus has actual drivers under the Linux driver
    model (as of Linux v4.16).


    I was forgetting about palette operations. So macfb is actually
    required for on-board video hardware.

    That's fine, although at least Valkyrie already has a separate driver as
    it is also used in some PowerPC models. Would separating them out like
    they are there make the code simpler?

    Optimistically, that driver could become so comprehensive as to acquire a complexity problem in need of a solution like that. I don't think we've
    reached that goal yet.

    But I can see some value in splitting off the nubus card support into a separate driver (e.g. macfb-nubus) in the course of supporting multiple displays. The on-board driver (e.g. macfb) will probably never need to instantiate multiple devices.

    I know there is also a separate driver for Control, which is the video
    chip on the various PowerMac 7x00 models.

    As of Linux v5.1 you can configure SCC IOP bypass using /dev/nvram
    on 68k Macs. (I wonder whether PRAM reset would enable or disable bypass...)


    /dev/nvram functionality works on IIfx but not Quadra 900/950 models because there's no Caboose driver yet. RTC and soft power control functionality are also missing on Quadra 900/950 for the same reason.

    That might be a tough one. I've never heard of anyone finding good documentation on Caboose. This may be one thing that has to be
    completely reverse engineered by disassembling the ROM code. Even on the various IIfx craziness, we still managed to find some basic information
    to give us a head start.

    The official board diagram for the Q900 shows Caboose connected to VIA1 instead of directly to the CPU. The MESS hardware information claims it
    is a 68HC05 just like Egret and Cuda.

    I would not be surprised if the Caboose chip was a forerunner of the Egret
    chip (which was itself the forerunner of the Cuda).

    AFAIK, all of three designs are or were publicly undocumented up until
    mkLinux gave us an open source Cuda driver.

    Perhaps we should try the via-cuda driver with ADB disabled and see what happens?


    Yes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)