Close

Linux driver progress

A project log for T030

MC68030 based single board computer

tobias-rathjeTobias Rathje 09/11/2016 at 19:230 Comments

A working serial driver for the UART in the 68901 MFP is now a reality:

This presentation provided a lot of valuable clues:

http://free-electrons.com/doc/serial-drivers.pdf

At it's present state my serial driver only implements the most basic functionality. The mctrl and set_termios calls are not implemented and the driver relies upon the ROM BIOS to initialize the UART.

And now we have a shell:

But Linux is not much fun without storage and networking, is it? So I have also managed to create a rudimentary SPI master driver for the TP3465 MID chip.

And with the SPI bus initialized as follows:

/*
 * SD card SPI node
 */
static struct spi_board_info mmc_spi_info[] = {
    {
      .modalias         = "mmc_spi",
      .mode             = SPI_MODE_0,
      .max_speed_hz     = 3125000,
      .chip_select      = 0,
    },
};

/*
 * Ethernet SPI node
 */
static struct spi_board_info enc28j60_spi_info[] = {
    {
      .modalias         = "enc28j60",
      .mode             = SPI_MODE_0,
      .irq              = IRQ_USER + 15,
      .max_speed_hz     = 3125000,
      .chip_select      = 1,
    },
};

we have the TP3465 driver talking to both the SD card and the ethernet module:

Root filesystem on SD card:

Ethernet is working, and we can reach stuff on the internet:

Notice the very round ping times, I believe they are caused by the MFP timer driving the scheduler only having 8 bit resolution.

I have configured two GPIO lines on the MFP as interrupt inputs, one for the ENC28J60 and one for the TP3465. Ethernet interrupts are working fine, but I have not yet managed to get interrupt based SPI transfers to work even though it is supported by my SPI master driver. Right now I am unsure if it's a hardware related problem or if there's a bug in the driver.

Naturally the SPI transfer speed is very limited, and that shows particularly with the SD card device:

Ughh, painfully slow!

Trying to boot using the standard Debian based root filesystem proved a bad idea, so in order to make a somewhat usable system, I have created a very simple startup script using the busybox-based init. The script creates a tmpfs-based ramdisk at /rbin and installs a static busybox binary onto that. /rbin is then prepended to $PATH when a user logs in which results in the simple busybox versions of ls, cat etc being used.

Output from the startup script:

I have also installed the Dropbear lightweight SSH server. Once a SSH session has been established it runs fine with no noticeable lag, but the initial key exchange takes a good three minutes. Retrocomputing demands patience... :-)

And of course the lynx web browser is working with the retro-site:

Discussions